megareviewer 0.2.15 → 0.2.17
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/README.md +1 -1
- package/dist/THIRD_PARTY_LICENSES.txt +202 -0
- package/dist/server.js +1605 -847
- package/dist/web/assets/{core-a5EcSd0Y.js → core-bY0eVDTo.js} +1 -1
- package/dist/web/assets/index-WOoCnsMr.js +88 -0
- package/dist/web/assets/index-sirb8dNl.css +1 -0
- package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/web/index.html +2 -2
- package/package.json +3 -1
- package/dist/web/assets/index-Bywy_-XQ.css +0 -1
- package/dist/web/assets/index-DI578zZj.js +0 -86
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/c-Cz4nF6n_.js","assets/c-SSSlmE39.js","assets/cpp-DzjeI0uH.js","assets/cpp-Cts1PyIS.js","assets/css-DgaLhXQH.js","assets/css-BGIxQoYs.js","assets/graphql-BHtseKAV.js","assets/graphql-f69H1Mm0.js","assets/javascript-BzbQS41l.js","assets/typescript-j_1H8WHN.js","assets/jsx-D3KKoC5L.js","assets/tsx-BOvsFOI6.js","assets/html-BWDvXlHg.js","assets/html-BMn1ogTm.js","assets/java-_ATy9zCa.js","assets/java-BtIQNnN0.js","assets/javascript-CpIGwZ_Y.js","assets/json-C3WlssX3.js","assets/json-B88Oqtu5.js","assets/jsx-C4yDKi0A.js","assets/php-CUj1wjLQ.js","assets/xml-WY0zc4PG.js","assets/sql-CNu3Or2W.js","assets/ruby-DAHFNlv9.js","assets/shellscript-CqHdAlCp.js","assets/yaml-DijMHRDA.js","assets/scss-8bKmll0B.js","assets/shellscript-CVTB3cr6.js","assets/sql-CfM2IJm3.js","assets/svelte-DAcAPYhA.js","assets/tsx-CGosfAUg.js","assets/typescript-Bb1J8qyy.js","assets/vue-DfeOw4hL.js","assets/xml-DuKfbPI6.js","assets/yaml-DDA_XMNu.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
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,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(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},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=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.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(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 P(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,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(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 F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=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)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ee(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(ee.bind(null,e))}var z={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=z,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ee,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=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.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 D(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)E.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 D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=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,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){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&&E());){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&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(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,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();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`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(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.browser=function(e){return{$$typeof:o,_reason:e}},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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.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=u(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=u(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=u(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=u(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),h=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=m()})),g=o((e=>{var t=p(),n=d(),r=h();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){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e: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 f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),z=Symbol.for(`react.lazy`),B=Symbol.for(`react.activity`),V=Symbol.for(`react.legacy_hidden`),te=Symbol.for(`react.memo_cache_sentinel`),H=Symbol.for(`react.view_transition`),U=Symbol.for(`react.recoverable`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case B:return`Activity`;case H:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case z:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,W=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function pe(e,t){ue++,le[ue]=e.current,e.current=t}var me=de(null),he=de(null),ge=de(null),_e=de(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?hp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=hp(t),e=gp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function be(e){var t=e.memoizedState;t!==null&&(dh._currentValue=t.memoizedState,pe(_e,e)),t=me.current;var n=gp(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function xe(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),dh._currentValue=ce)}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(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);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=`
|
|
7
|
+
`+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`);case 30:return we(`ViewTransition`);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`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,G=t.unstable_setDisableYieldValue,He=null,Ue=null;function We(e){if(typeof Ve==`function`&&G(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&-e;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){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ge(n),i=1<<r;t|=e[r],n&=~i}return t}function nt(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 rt(){var e=Ze;return Ze<<=1,!(Ze&62914560)&&(Ze=4194304),e}function it(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function at(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(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&&st(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function st(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 ct(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 lt(e,t){var n=t&-t;return n=n&42?1:ut(n),(n&(e.suspendedLanes|t))===0?n:0}function ut(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 dt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ft(){var e=se.p;return e===0?(e=window.event,e===void 0?32:Dh(e.type)):e}function pt(e,t){var n=se.p;try{return se.p=e,t()}finally{se.p=n}}var mt=Math.random().toString(36).slice(2),ht=`__reactFiber$`+mt,gt=`__reactProps$`+mt,_t=`__reactContainer$`+mt,vt=`__reactEvents$`+mt,yt=`__reactListeners$`+mt,bt=`__reactHandles$`+mt,xt=`__reactResources$`+mt,St=`__reactMarker$`+mt,Ct=`__reactLoad$`+mt;function wt(e){delete e[ht],delete e[gt],delete e[yt],delete e[bt]}function Tt(e){var t;if(t=e[ht])return t;for(var n=e.parentNode;n;){if(t=n[_t]||n[ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gm(e);e!==null;){if(n=e[ht])return n;e=gm(e)}return t}e=n,n=e.parentNode}return null}function Et(e){if(e=e[ht]||e[_t]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ot(e){var t=e[xt];return t||=e[xt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function kt(e){e[St]=!0}function At(e){e[Ct]=void 0}var jt=new Set,Mt={};function Nt(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Mt[e]=t,e=0;e<t.length;e++)jt.add(t[e])}var Ft=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]*$`),It={},Lt={};function Rt(e){return ke.call(Lt,e)?!0:ke.call(It,e)?!1:Ft.test(e)?Lt[e]=!0:(It[e]=!0,!1)}var zt=!1;function Bt(){var e=zt;return zt=!1,e}function Vt(e,t,n){if(Rt(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 Ht(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 Ut(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 Wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Gt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Kt(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 qt(e){if(!e._valueTracker){var t=Gt(e)?`checked`:`value`;e._valueTracker=Kt(e,t,``+e[t])}}function Jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Gt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Yt=/[\n"\\]/g;function Xt(e){return e.replace(Yt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Zt(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=``+Wt(t)):e.value!==``+Wt(t)&&(e.value=``+Wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):$t(e,Wt(n)):o===`number`&&e.value==t?$t(e,Wt(e.value)):$t(e,Wt(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=``+Wt(s):e.removeAttribute(`name`)}function Qt(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)){qt(e);return}n=n==null?``:``+Wt(n),t=t==null?n:``+Wt(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),qt(e)}function $t(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function en(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=``+Wt(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 tn(e,t,n){t!=null&&(t=``+Wt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Wt(n)}function nn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),qt(e)}function rn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var an=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 on(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||an.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function sn(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]=``,zt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(on(e,a,r),zt=!0)}else for(var o in t)t.hasOwnProperty(o)&&on(e,o,t[o])}function cn(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 ln=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`],[`maskType`,`mask-type`],[`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`]]),un=/^[\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 dn(e){return un.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function fn(){}var pn=null;function mn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hn=null,gn=null;function _n(e){var t=Et(e);if(t&&(e=t.stateNode)){var n=e[gt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Zt(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="`+Xt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[gt]||null;if(!a)throw Error(i(90));Zt(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&&Jt(r)}break a;case`textarea`:tn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&en(e,!!n.multiple,t,!1)}}}var vn=!1;function yn(e,t,n){if(vn)return e(t,n);vn=!0;try{return e(t)}finally{if(vn=!1,(hn!==null||gn!==null)&&(Vd(),hn&&(t=hn,e=gn,gn=hn=null,_n(t),e)))for(t=0;t<e.length;t++)_n(e[t])}}function bn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[gt]||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 xn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Sn=!1;if(xn)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Sn=!0}}),window.addEventListener(`test`,Cn,Cn),window.removeEventListener(`test`,Cn,Cn)}catch{Sn=!1}var wn=null,Tn=null,En=null;function Dn(){if(En)return En;var e,t=Tn,n=t.length,r,i=`value`in wn?wn.value:wn.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 En=i.slice(e,1<r?1-r:void 0)}function On(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 kn(){return!0}function An(){return!1}function jn(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)?kn:An,this.isPropagationStopped=An,this}return D(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=kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=kn)},persist:function(){},isPersistent:kn}),t}var Mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nn=jn(Mn),Pn=D({},Mn,{view:0,detail:0}),Fn=jn(Pn),In,Ln,Rn,zn=D({},Pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xn,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!==Rn&&(Rn&&e.type===`mousemove`?(In=e.screenX-Rn.screenX,Ln=e.screenY-Rn.screenY):Ln=In=0,Rn=e),In)},movementY:function(e){return`movementY`in e?e.movementY:Ln}}),Bn=jn(zn),Vn=jn(D({},zn,{dataTransfer:0})),Hn=jn(D({},Pn,{relatedTarget:0})),Un=jn(D({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0})),Wn=jn(D({},Mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Gn=jn(D({},Mn,{data:0})),Kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},qn={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`},Jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jn[e])?!!t[e]:!1}function Xn(){return Yn}var Zn=jn(D({},Pn,{key:function(e){if(e.key){var t=Kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=On(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?qn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xn,charCode:function(e){return e.type===`keypress`?On(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?On(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Qn=jn(D({},zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),$n=jn(D({},Mn,{submitter:0})),er=jn(D({},Pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xn})),tr=jn(D({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),nr=jn(D({},zn,{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})),rr=jn(D({},Mn,{newState:0,oldState:0,source:0})),ir=[9,13,27,32],ar=xn&&`CompositionEvent`in window,or=null;xn&&`documentMode`in document&&(or=document.documentMode);var sr=xn&&`TextEvent`in window&&!or,cr=xn&&(!ar||or&&8<or&&11>=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function mr(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function hr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=Dn(),En=Tn=wn=null,pr=!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 cr&&t.locale!==`ko`?null:t.data;default:return null}}var gr={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 _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!gr[e.type]:t===`textarea`}function vr(e,t,n,r){hn?gn?gn.push(r):gn=[r]:hn=r,t=Qf(t,`onChange`),0<t.length&&(n=new Nn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var yr=null,br=null;function xr(e){Wf(e,0)}function Sr(e){if(Jt(Dt(e)))return e}function Cr(e,t){if(e===`change`)return t}var wr=!1;if(xn){var Tr;if(xn){var Er=`oninput`in document;if(!Er){var Dr=document.createElement(`div`);Dr.setAttribute(`oninput`,`return;`),Er=typeof Dr.oninput==`function`}Tr=Er}else Tr=!1;wr=Tr&&(!document.documentMode||9<document.documentMode)}function Or(){yr&&(yr.detachEvent(`onpropertychange`,kr),br=yr=null)}function kr(e){if(e.propertyName===`value`&&Sr(br)){var t=[];vr(t,br,e,mn(e)),yn(xr,t)}}function Ar(e,t,n){e===`focusin`?(Or(),yr=t,br=n,yr.attachEvent(`onpropertychange`,kr)):e===`focusout`&&Or()}function jr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Sr(br)}function Mr(e,t){if(e===`click`)return Sr(t)}function Nr(e,t){if(e===`input`||e===`change`)return Sr(t)}function Pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Fr=typeof Object.is==`function`?Object.is:Pr;function Ir(e,t){if(Fr(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)||!Fr(e[i],t[i]))return!1}return!0}function Lr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=Rr(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=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lr(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=Lr(e.document)}return t}function Hr(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 Ur=xn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==Lr(r)||(r=Wr,`selectionStart`in r&&Hr(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}),Kr&&Ir(Kr,r)||(Kr=r,r=Qf(Gr,`onSelect`),0<r.length&&(t=new Nn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Xr={animationend:Yr(`Animation`,`AnimationEnd`),animationiteration:Yr(`Animation`,`AnimationIteration`),animationstart:Yr(`Animation`,`AnimationStart`),transitionrun:Yr(`Transition`,`TransitionRun`),transitionstart:Yr(`Transition`,`TransitionStart`),transitioncancel:Yr(`Transition`,`TransitionCancel`),transitionend:Yr(`Transition`,`TransitionEnd`)},Zr={},Qr={};xn&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),`TransitionEvent`in window||delete Xr.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t=Xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionrun`),ii=$r(`transitionstart`),ai=$r(`transitioncancel`),oi=$r(`transitionend`),si=new Map,ci=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ci.push(`scrollEnd`);function li(e,t){si.set(e,t),Nt(t,[e])}var ui=0;function di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Sd.identifierPrefix;var n=ui++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function fi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ad;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function pi(e,t){return e=fi(e),t=fi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var mi=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)},hi=[],gi=0,_i=0;function vi(){for(var e=gi,t=_i=gi=0;t<e;){var n=hi[t];hi[t++]=null;var r=hi[t];hi[t++]=null;var i=hi[t];hi[t++]=null;var a=hi[t];if(hi[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 yi(e,t,n,r){hi[gi++]=e,hi[gi++]=t,hi[gi++]=n,hi[gi++]=r,_i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bi(e,t,n,r){return yi(e,t,n,r),Ci(e)}function xi(e,t){return yi(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<jd)throw jd=0,Md=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wi={};function Ti(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 Ei(e,t,n,r){return new Ti(e,t,n,r)}function Di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return n===null?(n=Ei(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&1206910976,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 ki(e,t){e.flags&=1206910978;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 Ai(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Di(r)&&(s=1);else if(typeof r==`string`)s=Zm(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case B:return e=Ei(31,n,t,a),e.elementType=B,e.lanes=o,e;case j:return ji(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Ei(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Ei(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Ei(19,n,t,a),e.elementType=R,e.lanes=o,e;case V:case H:return e=a|32,e=Ei(30,n,t,e),e.elementType=H,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case ee:s=14;break a;case z:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ji(e,t,n,r){return e=Ei(7,e,r,t),e.lanes=n,e}function Mi(e,t,n){return e=Ei(6,e,null,t),e.lanes=n,e}function Ni(e){var t=Ei(18,null,null,0);return t.stateNode=e,t}function Pi(e,t,n){return t=Ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fi=new WeakMap;function Ii(e,t){if(typeof e==`object`&&e){var n=Fi.get(e);return n===void 0?(t={value:e,source:t,stack:Oe(t)},Fi.set(e,t),t):n}return{value:e,source:t,stack:Oe(t)}}var Li=[],Ri=0,zi=null,Bi=0,Vi=[],Hi=0,Ui=null,Wi=1,Gi=``;function Ki(e,t){Li[Ri++]=Bi,Li[Ri++]=zi,zi=e,Bi=t}function qi(e,t,n){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Ui=e;var r=Wi;e=Gi;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,Wi=1<<32-Ge(t)+i|n<<i|r,Gi=a+e}else Wi=1<<a|n<<i|r,Gi=e}function Ji(e){e.return!==null&&(Ki(e,1),qi(e,1,0))}function Yi(e){for(;e===zi;)zi=Li[--Ri],Li[Ri]=null,Bi=Li[--Ri],Li[Ri]=null;for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Gi=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null}function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Wi=t.id,Gi=t.overflow,Ui=e}var Zi=null,Qi=null,$i=!1,ea=null,ta=!1,na=Error(i(519));function ra(e){throw la(Ii(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),na}function ia(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ht]=e,t[gt]=r,n){case`dialog`:Gf(`cancel`,t),Gf(`close`,t);break;case`iframe`:case`object`:case`embed`:Gf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Hf.length;n++)Gf(Hf[n],t);break;case`source`:Gf(`error`,t);break;case`img`:case`image`:case`link`:Gf(`error`,t),Gf(`load`,t);break;case`details`:Gf(`toggle`,t);break;case`input`:Gf(`invalid`,t),Qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Gf(`invalid`,t);break;case`textarea`:Gf(`invalid`,t),nn(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||ip(t.textContent,n)?(r.popover!=null&&(Gf(`beforetoggle`,t),Gf(`toggle`,t)),r.onScroll!=null&&Gf(`scroll`,t),r.onScrollEnd!=null&&Gf(`scrollend`,t),r.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||ra(e,!0)}function aa(e){for(Zi=e.return;Zi;)switch(Zi.tag){case 5:case 31:case 13:ta=!1;return;case 27:case 3:ta=!0;return;default:Zi=Zi.return}}function oa(e){if(e!==Zi)return!1;if(!$i)return aa(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`||vp(e.type,e.memoizedProps)),n=!n),n&&Qi&&ra(e),aa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Qi=hm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Qi=hm(e)}else t===27?(t=Qi,Dp(e.type)?(e=mm,mm=null,Qi=e):Qi=t):Qi=Zi?pm(e.stateNode.nextSibling):null;return!0}function sa(){Qi=Zi=null,$i=!1}function ca(){var e=ea;return e!==null&&(md===null?md=e:md.push.apply(md,e),ea=null),e}function la(e){ea===null?ea=[e]:ea.push(e)}var ua=de(null),da=null,fa=null;function pa(e,t,n){pe(ua,t._currentValue),t._currentValue=n}function ma(e){e._currentValue=ua.current,fe(ua)}function ha(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 ga(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),ha(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),ha(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ha(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 _a(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;Fr(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=[dh]:e.push(dh))}a=a.return}return e!==null&&ga(t,e,n,r),t.flags|=262144,e!==null}function va(e){for(e=e.firstContext;e!==null;){if(!Fr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ya(e){da=e,fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ba(e){return Sa(da,e)}function xa(e,t){return da===null&&ya(e),Sa(e,t)}function Sa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fa===null){if(e===null)throw Error(i(308));fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fa=fa.next=t;return n}var Ca=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()})}},wa=t.unstable_scheduleCallback,Ta=t.unstable_NormalPriority,Ea={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Da(){return{controller:new Ca,data:new Map,refCount:0}}function Oa(e){e.refCount--,e.refCount===0&&wa(Ta,function(){e.controller.abort()})}function ka(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Aa=null;function ja(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ma=null,Na=0,Pa=0,Fa=null;function Ia(e,t){if(Ma===null){var n=Ma=[];Na=0,Pa=Lf(),Fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Na++,t.then(La,La),t}function La(){if(--Na===0&&(Aa=null,Ma!==null)){Fa!==null&&(Fa.status=`fulfilled`);var e=Ma;Ma=null,Pa=0,Fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ra(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 za=W.S;W.S=function(e,t){if(_d=Pe(),typeof t==`object`&&t&&typeof t.then==`function`&&Ia(e,t),Aa!==null)for(var n=Cf;n!==null;)ka(n,Aa),n=n.next;if(n=e.types,n!==null){for(var r=Cf;r!==null;)ka(r,n),r=r.next;if(Pa!==0){r=Aa,r===null&&(r=Aa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}za!==null&&za(e,t)};var Ba=de(null);function Va(){var e=Ba.current;return e===null?Qu.pooledCache:e}function Ha(e,t){t===null?pe(Ba,Ba.current):pe(Ba,t.pool)}function Ua(){var e=Va();return e===null?null:{parent:Ea._currentValue,pool:e}}var Wa=Error(i(460)),Ga=Error(i(474)),Ka=Error(i(542)),qa={then:function(){}};function Ja(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(fn,fn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,$a(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(fn,fn);else{if(e=Qu,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,$a(e),e}throw Za=t,Wa}}function Xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Za=e,Wa):e}}var Za=null;function Qa(){if(Za===null)throw Error(i(459));var e=Za;return Za=null,e}function $a(e){if(e===Wa||e===Ka)throw Error(i(483))}var eo=null,to=0;function no(e){var t=to;return to+=1,eo===null&&(eo=[]),Ya(eo,e,t)}function ro(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function io(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ao(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=Oi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Mi(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===j?(e=d(e,t,n.props.children,r,n.key),ro(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===z&&Xa(i)===t.type)?(t=a(t,n.props),ro(t,n),t.return=e,t):(t=Ai(n.type,n.key,n.props,null,e.mode,r),ro(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=Pi(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=ji(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=Mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ai(t.type,t.key,t.props,null,e.mode,n),ro(n,t),n.return=e,n;case A:return t=Pi(t,e.mode,n),t.return=e,t;case z:return t=Xa(t),f(e,t,n)}if(oe(t)||re(t))return t=ji(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,no(t),n);if(t.$$typeof===F)return f(e,xa(e,t),n);io(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case z:return n=Xa(n),p(e,t,n,r)}if(oe(n)||re(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,no(n),r);if(n.$$typeof===F)return p(e,t,xa(e,n),r);io(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case z:return r=Xa(r),m(e,t,n,r,i)}if(oe(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,no(r),i);if(r.$$typeof===F)return m(e,t,n,xa(t,r),i);io(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&&Ki(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&&Ki(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(_.key===null?h:_.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&&Ki(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&&Ki(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&&Ki(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(_.key===null?g:_.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&&Ki(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),ro(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===z&&Xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ro(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=ji(o.props.children,e.mode,c,o.key),ro(c,o),c.return=e,e=c):(c=Ai(o.type,o.key,o.props,null,e.mode,c),ro(c,o),c.return=e,e=c)}return s(e);case A: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}n(e,r);break}t(e,r),r=r.sibling}c=Pi(o,e.mode,c),c.return=e,e=c}return s(e);case z:return o=Xa(o),_(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(re(o)){if(l=re(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,no(o),c);if(o.$$typeof===F)return _(e,r,xa(e,o),c);io(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=Mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{to=0;var i=_(e,t,n,r);return eo=null,i}catch(t){if(t===Wa||t===Ka)throw t;var a=Ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var oo=ao(!0),so=ao(!1),co=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uo(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 fo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Zu&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 yi(e,r,t,n),Ci(e)}function mo(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,ct(e,n)}}function ho(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var go=!1;function _o(){if(go){var e=Fa;if(e!==null)throw e}}function vo(e,t,n,r){go=!1;var i=e.updateQueue;co=!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,p=f!==s.lane;if(p?(ed&f)===f:(r&f)===f){f!==0&&f===Pa&&(go=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:co=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,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),cd|=o,e.lanes=o,e.memoizedState=d}}function yo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function bo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yo(n[e],t)}var xo=de(null),So=de(0);function Co(e,t){e=od,pe(So,e),pe(xo,t),od=e|t.baseLanes}function wo(){pe(So,od),pe(xo,xo.current)}function To(){od=So.current,fe(xo),fe(So)}var Eo=de(null),Do=null;function Oo(e){var t=e.alternate;pe(No,No.current&1),pe(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){pe(No,No.current),pe(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(pe(No,No.current),pe(Eo,e),Do===null&&(Do=e)):jo()}function jo(){pe(No,No.current),pe(Eo,Eo.current)}function Mo(e){fe(Eo),Do===e&&(Do=null),fe(No)}var No=de(0);function Po(e,t){pe(Eo,Eo.current),pe(No,t)}function Fo(e){fe(No),fe(Eo),Do===e&&(Do=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||um(n)||dm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Lo=0,Ro=null,zo=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(i(321))}function Yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Xo(e,t,n,r,i,a){return Lo=a,Ro=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?dc:fc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Zo(t,n,r,i)),K(e),a}function K(e){W.H=uc;var t=zo!==null&&zo.next!==null;if(Lo=0,Bo=zo=Ro=null,Vo=!1,Go=0,Ko=null,t)throw Error(i(300));e===null||Oc||(e=e.dependencies,e!==null&&va(e)&&(Oc=!0))}function Zo(e,t,n,r){Ro=e;var a=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=a)throw Error(i(301));if(a+=1,Bo=zo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}W.H=pc,o=t(n,r)}while(Ho);return o}function Qo(){var e=W.H,t=e.useState()[0];return t=typeof t.then==`function`?as(t):t,e=e.useState()[0],(zo===null?null:zo.memoizedState)!==e&&(Ro.flags|=1024),t}function $o(){var e=Wo!==0;return Wo=0,e}function es(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ts(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}Lo=0,Bo=zo=Ro=null,Ho=!1,Go=Wo=0,Ko=null}function ns(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?Ro.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function rs(){if(zo===null){var e=Ro.alternate;e=e===null?null:e.memoizedState}else e=zo.next;var t=Bo===null?Ro.memoizedState:Bo.next;if(t!==null)Bo=t,zo=e;else{if(e===null)throw Ro.alternate===null?Error(i(467)):Error(i(310));zo=e,e={memoizedState:zo.memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},Bo===null?Ro.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function as(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Ya(Ko,e,t),t=Ro,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?dc:fc),e}function os(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return as(e);if(e.$$typeof===U)return;if(e.$$typeof===F)return ba(e)}throw Error(i(438,String(e)))}function ss(e){var t=null,n=Ro.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ro.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=is(),Ro.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]=te;return t.index++,n}function cs(e,t){return typeof t==`function`?t(e):t}function ls(e){return us(rs(),zo,e)}function us(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?(Lo&f)===f:(ed&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===Pa&&(d=!0);else if((Lo&p)===p){u=u.next,p===Pa&&(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,Ro.lanes|=p,cd|=p;f=u.action,Uo&&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,Ro.lanes|=f,cd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Fr(o,e.memoizedState)&&(Oc=!0,d&&(n=Fa,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 ds(e){var t=rs(),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);Fr(o,t.memoizedState)||(Oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function fs(e,t,n){var r=Ro,a=rs(),o=$i;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Fr((zo||a).memoizedState,n);if(s&&(a.memoizedState=n,Oc=!0),a=a.queue,Is(hs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Bo!==null&&!!(Bo.memoizedState.tag&1),Ms(e?9:8,{destroy:void 0},ms.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Qu===null)throw Error(i(349));o||Lo&127||ps(r,t,n)}return n}function ps(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ro.updateQueue,t===null?(t=is(),Ro.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ms(e,t,n,r){t.value=n,t.getSnapshot=r,gs(t)&&_s(e)}function hs(e,t,n){return n(function(){gs(t)&&_s(e)})}function gs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function _s(e){var t=xi(e,2);t!==null&&Id(t,e,2)}function vs(e){var t=ns();if(typeof e==`function`){var n=e;if(e=n(),Uo){We(!0);try{n()}finally{We(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function ys(e,t,n,r){return e.baseState=n,us(e,zo,typeof r==`function`?r:cs)}function bs(e,t,n,r,a){if(sc(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)}};W.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,xs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function xs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=W.T,o={};o.types=a===null?null:a.types,W.T=o;try{var s=n(i,r),c=W.S;c!==null&&c(o,s),Ss(e,t,s)}catch(n){ws(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),W.T=a}}else try{a=n(i,r),Ss(e,t,a)}catch(n){ws(e,t,n)}}function Ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Cs(e,t,n)},function(n){return ws(e,t,n)}):Cs(e,t,n)}function Cs(e,t,n){t.status=`fulfilled`,t.value=n,Ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xs(e,n)))}function ws(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ts(t),t=t.next;while(t!==r)}e.action=null}function Ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Es(e,t){return t}function Ds(e,t){if($i){var n=Qu.formState;if(n!==null){a:{var r=Ro;if($i){if(Qi){b:{for(var i=Qi,a=ta;i.nodeType!==8;)if(!a||(i=pm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Qi=pm(i.nextSibling),r=i.data===`F!`;break a}}ra(r)}r=!1}r&&(t=n[0])}}return n=ns(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:t},n.queue=r,n=ic.bind(null,Ro,r),r.dispatch=n,r=vs(!1),a=oc.bind(null,Ro,!1,r.queue),r=ns(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=bs.bind(null,Ro,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Os(e){return ks(rs(),zo,e)}function ks(e,t,n){if(t=us(e,t,Es)[0],e=ls(cs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=as(t)}catch(e){throw e===Wa?Ka:e}else r=t;t=rs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Ro.flags|=2048,Ms(9,{destroy:void 0},As.bind(null,i,n),null)),[r,a,e]}function As(e,t){e.action=t}function js(e){var t=rs(),n=zo;if(n!==null)return ks(t,n,e);rs(),t=t.memoizedState,n=rs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ro.updateQueue,t===null&&(t=is(),Ro.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 Ns(){return rs().memoizedState}function Ps(e,t,n,r){var i=ns();Ro.flags|=e,i.memoizedState=Ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function Fs(e,t,n,r){var i=rs();r=r===void 0?null:r;var a=i.memoizedState.inst;zo!==null&&r!==null&&Yo(r,zo.memoizedState.deps)?i.memoizedState=Ms(t,a,n,r):(Ro.flags|=e,i.memoizedState=Ms(1|t,a,n,r))}function q(e,t){Ps(8390656,8,e,t)}function Is(e,t){Fs(2048,8,e,t)}function Ls(e){Ro.flags|=4;var t=Ro.updateQueue;if(t===null)t=is(),Ro.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Rs(e){var t=rs().memoizedState;return Ls({ref:t,nextImpl:e}),function(){if(Zu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function zs(e,t){return Fs(4,2,e,t)}function Bs(e,t){return Fs(4,4,e,t)}function Vs(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 Hs(e,t,n){n=n==null?null:n.concat([e]),Fs(4,4,Vs.bind(null,t,e),n)}function Us(){}function Ws(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gs(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r}function Ks(e,t,n){return n===void 0||Lo&1073741824&&!(ed&261930)?e.memoizedState=t:(e.memoizedState=n,e=Pd(),Ro.lanes|=e,cd|=e,n)}function qs(e,t,n,r){return Fr(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(ed&261930)?(Oc=!0,e.memoizedState=n):(e=Pd(),Ro.lanes|=e,cd|=e,t):(e=Ks(e,n,r),Fr(e,t)||(Oc=!0),e)}function Js(e,t,n,r,i){var a=se.p;se.p=a!==0&&8>a?a:8;var o=W.T,s={};s.types=o===null?null:o.types,W.T=s,oc(e,!1,t,n);try{var c=i(),l=W.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ac(e,t,Ra(c,r),Nd(e)):ac(e,t,r,Nd(e))}catch(n){ac(e,t,{then:function(){},status:`rejected`,reason:n},Nd())}finally{se.p=a,o!==null&&s.types!==null&&(o.types=s.types),W.T=o}}function Ys(){}function Xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Zs(e).queue;Js(e,a,t,ce,n===null?Ys:function(){return Qs(e),n(r)})}function Zs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qs(e){var t=Zs(e);t.next===null&&(t=e.alternate.memoizedState),ac(e,t.next.queue,{},Nd())}function $s(){return ba(dh)}function ec(){return rs().memoizedState}function tc(){return rs().memoizedState}function nc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Nd();e=fo(n);var r=po(t,e,n);r!==null&&(Id(r,t,n),mo(r,t,n)),t={cache:Da()},e.payload=t;return}t=t.return}}function rc(e,t,n){var r=Nd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sc(e)?cc(t,n):(n=bi(e,t,n,r),n!==null&&(Id(n,e,r),lc(n,t,r)))}function ic(e,t,n){ac(e,t,n,Nd())}function ac(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sc(e))cc(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,Fr(s,o))return yi(e,t,i,0),Qu===null&&vi(),!1}catch{}if(n=bi(e,t,i,r),n!==null)return Id(n,e,r),lc(n,t,r),!0}return!1}function oc(e,t,n,r){if(r={lane:2,revertLane:Lf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sc(e)){if(t)throw Error(i(479))}else t=bi(e,n,r,2),t!==null&&Id(t,e,2)}function sc(e){var t=e.alternate;return e===Ro||t!==null&&t===Ro}function cc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var uc={readContext:ba,use:os,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},dc={readContext:ba,use:os,useCallback:function(e,t){return ns().memoizedState=[e,t===void 0?null:t],e},useContext:ba,useEffect:q,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ps(4194308,4,Vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var n=ns();t=t===void 0?null:t;var r=e();if(Uo){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ns();if(n!==void 0){var i=n(t);if(Uo){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=rc.bind(null,Ro,e),[r.memoizedState,e]},useRef:function(e){var t=ns();return e={current:e},t.memoizedState=e},useState:function(e){e=vs(e);var t=e.queue,n=ic.bind(null,Ro,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Us,useDeferredValue:function(e,t){return Ks(ns(),e,t)},useTransition:function(){var e=vs(!1);return e=Js.bind(null,Ro,e.queue,!0,!1),ns().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ro,a=ns();if($i){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Qu===null)throw Error(i(349));ed&127||ps(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,q(hs.bind(null,r,o,e),[e]),r.flags|=2048,Ms(9,{destroy:void 0},ms.bind(null,r,o,n,t),null),n},useId:function(){var e=ns(),t=Qu.identifierPrefix;if($i){var n=Gi,r=Wi;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:$s,useFormState:Ds,useActionState:Ds,useOptimistic:function(e){var t=ns();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=oc.bind(null,Ro,!0,n),n.dispatch=t,[e,t]},useMemoCache:ss,useCacheRefresh:function(){return ns().memoizedState=nc.bind(null,Ro)},useEffectEvent:function(e){var t=ns(),n={impl:e};return t.memoizedState=n,function(){if(Zu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},fc={readContext:ba,use:os,useCallback:Ws,useContext:ba,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:ls,useRef:Ns,useState:function(){return ls(cs)},useDebugValue:Us,useDeferredValue:function(e,t){return qs(rs(),zo.memoizedState,e,t)},useTransition:function(){var e=ls(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:ec,useHostTransitionStatus:$s,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){return ys(rs(),zo,e,t)},useMemoCache:ss,useCacheRefresh:tc,useEffectEvent:Rs},pc={readContext:ba,use:os,useCallback:Ws,useContext:ba,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:ds,useRef:Ns,useState:function(){return ds(cs)},useDebugValue:Us,useDeferredValue:function(e,t){var n=rs();return zo===null?Ks(n,e,t):qs(n,zo.memoizedState,e,t)},useTransition:function(){var e=ds(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:ec,useHostTransitionStatus:$s,useFormState:js,useActionState:js,useOptimistic:function(e,t){var n=rs();return zo===null?(n.baseState=e,[e,n.queue.dispatch]):ys(n,zo,e,t)},useMemoCache:ss,useCacheRefresh:tc,useEffectEvent:Rs};function mc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Nd(),i=fo(r);i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Id(t,e,r),mo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Nd(),i=fo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Id(t,e,r),mo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Nd(),r=fo(n);r.tag=2,t!=null&&(r.callback=t),t=po(e,r,n),t!==null&&(Id(t,e,n),mo(t,e,n))}};function gc(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?!Ir(n,r)||!Ir(i,a):!0}function _c(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&&hc.enqueueReplaceState(t,t.state,null)}function vc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function yc(e){mi(e)}function J(e){console.error(e)}function bc(e){mi(e)}function xc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Sc(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 Cc(e,t,n){return n=fo(n),n.tag=3,n.payload={element:null},n.callback=function(){xc(e,t)},n}function wc(e){return e=fo(e),e.tag=3,e}function Tc(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(){Sc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Sc(t,n,r),typeof i!=`function`&&(bd===null?bd=new Set([this]):bd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&_a(t,n,a,!0),n=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?Jd():n.alternate===null&&sd===0&&(sd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),_f(e,r,a)),!1;case 22:return n.flags|=65536,r===qa?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)),_f(e,r,a)),!1}throw Error(i(435,n.tag))}return _f(e,r,a),Jd(),!1}if($i)return t=Eo.current,t===null?(r!==na&&(t=Error(i(423),{cause:r}),la(Ii(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ii(r,n),a=Cc(e.stateNode,r,a),ho(e,a),sd!==4&&(sd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==na&&(e=Error(i(422),{cause:r}),la(Ii(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ii(o,n),pd===null?pd=[o]:pd.push(o),sd!==4&&(sd=2),t===null)return!0;r=Ii(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Cc(n.stateNode,r,e),ho(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`&&(bd===null||!bd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=wc(a),Tc(a,e,n,r),ho(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Dc=Error(i(461)),Oc=!1;function kc(e,t,n,r){t.child=e===null?so(t,null,n,r):oo(t,e.child,n,r)}function Ac(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 ya(t),r=Xo(e,t,n,o,a,i),s=$o(),e!==null&&!Oc?(es(e,t,i),il(e,t,i)):($i&&s&&Ji(t),t.flags|=1,kc(e,t,r,i),t.child)}function jc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Mc(e,t,a,r,i)):(e=Ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!al(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ir:n,n(o,r)&&e.ref===t.ref)return il(e,t,i)}return t.flags|=1,e=Oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ir(a,r)&&e.ref===t.ref){if(Oc=!1,t.pendingProps=r=a,al(e,i))e.flags&131072&&(Oc=!0);else return t.lanes=e.lanes,il(e,t,i)}}return Bc(e,t,n,r,i)}function Nc(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 Fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ha(t,a===null?null:a.cachePool),a===null?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ha(t,null),wo(),jo()):(Ha(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return kc(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 Fc(e,t,n,r,i){var a=Va();return a=a===null?null:{parent:Ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ha(t,null),wo(),Ao(t),e!==null&&_a(e,t,r,!0),t.childLanes=i,null}function Ic(e,t){return t=Yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Lc(e,t,n){return oo(t,e.child,null,n),e=Ic(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function Rc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if($i){if(r.mode===`hidden`)return e=Ic(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Pc(null,e);if(ko(t),(e=Qi)?(e=lm(e,ta),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw ra(t);return t.lanes=536870912,null}return Ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ko(t),a){if(t.flags&256)t.flags&=-257,t=Lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Oc||_a(e,t,n,!1),a=(n&e.childLanes)!==0,Oc||a){if(xo.current===null){if(r=Qu,r!==null&&(s=lt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,xi(e,s),Id(r,e,s),Dc;Jd()}t=Lc(e,t,n)}else e=o.treeContext,Qi=pm(s.nextSibling),Zi=t,$i=!0,ea=null,ta=!1,e!==null&&Xi(t,e),t=Ic(t,r),t.flags|=134221824;return t}return e=Oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zc(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 Bc(e,t,n,r,i){return ya(t),n=Xo(e,t,n,r,void 0,i),r=$o(),e!==null&&!Oc?(es(e,t,i),il(e,t,i)):($i&&r&&Ji(t),t.flags|=1,kc(e,t,n,i),t.child)}function Vc(e,t,n,r,i,a){return ya(t),t.updateQueue=null,n=Zo(t,r,n,i),K(e),r=$o(),e!==null&&!Oc?(es(e,t,a),il(e,t,a)):($i&&r&&Ji(t),t.flags|=1,kc(e,t,n,a),t.child)}function Hc(e,t,n,r,i){if(ya(t),t.stateNode===null){var a=wi,o=n.contextType;typeof o==`object`&&o&&(a=ba(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},lo(t),o=n.contextType,a.context=typeof o==`object`&&o?ba(o):wi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(mc(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&&hc.enqueueReplaceState(a,a.state,null),vo(t,r,a,i),_o(),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=vc(n,s);a.props=c;var l=a.context,u=n.contextType;o=wi,typeof u==`object`&&u&&(o=ba(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)&&_c(t,a,r,o),co=!1;var f=t.memoizedState;a.state=f,vo(t,r,a,i),_o(),l=t.memoizedState,s||f!==l||co?(typeof d==`function`&&(mc(t,n,d,r),l=t.memoizedState),(c=co||gc(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,uo(e,t),o=t.memoizedProps,u=vc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=wi,typeof l==`object`&&l&&(c=ba(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)&&_c(t,a,r,c),co=!1,f=t.memoizedState,a.state=f,vo(t,r,a,i),_o();var p=t.memoizedState;o!==d||f!==p||co||e!==null&&e.dependencies!==null&&va(e.dependencies)?(typeof s==`function`&&(mc(t,n,s,r),p=t.memoizedState),(u=co||gc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&va(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,zc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=oo(t,e.child,null,i),t.child=oo(t,null,n,i)):kc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=il(e,t,i),e}function Uc(e,t,n,r){return sa(),t.flags|=256,kc(e,t,n,r),t.child}var Wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gc(e){return{baseLanes:e,cachePool:Ua()}}function Kc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=dd),e}function qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if($i){if(i?Oo(t):jo(),(e=Qi)?(e=lm(e,ta),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw ra(t);return t.lanes=dm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(jo(),i=t.mode,a=Yc({mode:`hidden`,children:a},i),r=ji(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Gc(n),r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(null,r)):(Oo(t),Jc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Zc(e,t,a,o,r,c,s,n)}return i?(jo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Oi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ji(i,a,n,null),i.flags|=2):i=Oi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Pc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Gc(n):(a=i.cachePool,a===null?a=Ua():(s=Ea._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(e.child,r)):(Oo(t),n=e.child,e=n.sibling,n=Oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Jc(e,t){return t=Yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Yc(e,t){return e=Ei(22,e,null,t),e.lanes=0,e}function Xc(e,t,n){return oo(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,Xc(e,t,c)):t.memoizedState===null?(jo(),o=a.fallback,s=t.mode,a=Yc({mode:`visible`,children:a.children},s),o=ji(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,oo(t,e.child,null,c),a=t.child,a.memoizedState=Gc(c),a.childLanes=Kc(e,r,c),t.memoizedState=Wc,Pc(null,a)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(t),dm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,la({value:a,source:null,stack:null})),Xc(e,t,c)}if(Oc||_a(e,t,c,!1),r=(c&e.childLanes)!==0,Oc||r){if(xo.current!==null)return Xc(e,t,c);if(r=Qu,r!==null&&(a=lt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,xi(e,a),Id(r,e,a),Dc;return um(o)||Jd(),Xc(e,t,c)}return um(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Qi=pm(o.nextSibling),Zi=t,$i=!0,ea=null,ta=!1,e!==null&&Xi(t,e),t=Jc(t,a.children),t.flags|=134221824,t)}function Qc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ha(e.return,t,n)}function $c(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function el(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 tl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function nl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(tl(e),kc(e,t,r,n),tl(e)):kc(e,t,r,n),r=$i?Bi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qc(e,n,t);else if(e.tag===19)Qc(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`backwards`:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,tl(t)),el(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}el(t,!0,n,null,a,r);break;case`together`:el(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),el(t,!1,i,n,a,r)}return t.child}function rl(e,t,n){var r=t.pendingProps;return pa(t,t.type,r.value),kc(e,t,r.children,n),t.child}function il(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(_a(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=Oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function al(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&va(e)))}function ol(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),pa(t,Ea,e.memoizedState.cache),sa();break;case 27:case 5:be(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=_a(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?qc(e,t,n):(Oo(t),e=il(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return nl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(_a(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return nl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Nc(e,t,n,t.pendingProps);case 24:pa(t,Ea,e.memoizedState.cache)}return il(e,t,n)}function sl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Oc=!0;else{if(!al(e,n)&&!(t.flags&128))return Oc=!1,ol(e,t,n);Oc=!!(e.flags&131072)}}else Oc=!1,$i&&t.flags&1048576&&qi(t,Bi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Xa(t.elementType),t.type=e,typeof e==`function`)Di(e)?(r=vc(e,r),t.tag=1,t=Hc(null,t,e,r,n)):(t.tag=0,t=Bc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Ac(null,t,e,r,n);break a}if(a===ee){t.tag=14,t=jc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=rl(null,t,n);break a}}throw t=ae(e)||e,Error(i(306,t,``))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=vc(r,t.pendingProps),Hc(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,uo(e,t),vo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,pa(t,Ea,r),r!==o.cache&&ga(t,[Ea],n,!0),_o(),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=Uc(e,t,r,n);break a}if(r!==a){a=Ii(Error(i(424)),t),la(a),t=Uc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Qi=pm(e.firstChild),Zi=t,$i=!0,ea=null,ta=!0,n=so(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(sa(),r===a){t=il(e,t,n);break a}kc(e,t,r,n)}t=t.child}return t;case 26:return zc(e,t),e===null?(n=Lm(t.type,null,t.pendingProps,null))?t.memoizedState=n:$i||(t.stateNode=_p(t.type,t.pendingProps,ge.current,t)):t.memoizedState=Lm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&$i&&(r=t.stateNode=ym(t.type,t.pendingProps,ge.current),Zi=t,ta=!0,a=Qi,Dp(t.type)?(mm=a,Qi=pm(r.firstChild)):Qi=a),kc(e,t,t.pendingProps.children,n),zc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&$i&&((a=r=Qi)&&(r=sm(r,t.type,t.pendingProps,ta),r===null?a=!1:(t.stateNode=r,Zi=t,Qi=pm(r.firstChild),ta=!1,a=!0)),a||ra(t)),be(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,vp(a,o)?r=null:s!==null&&vp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Xo(e,t,Qo,null,null,n),dh._currentValue=a),zc(e,t),kc(e,t,r,n),t.child;case 6:return e===null&&$i&&((e=n=Qi)&&(n=cm(n,t.pendingProps,ta),n===null?e=!1:(t.stateNode=n,Zi=t,Qi=null,e=!0)),e||ra(t)),null;case 13:return qc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oo(t,null,r,n):kc(e,t,r,n),t.child;case 11:return Ac(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,zc(e,t),kc(e,t,r,n),t.child;case 8:return kc(e,t,t.pendingProps.children,n),t.child;case 12:return kc(e,t,t.pendingProps.children,n),t.child;case 10:return rl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ya(t),a=ba(a),r=r(a),t.flags|=1,kc(e,t,r,n),t.child;case 14:return jc(e,t,t.type,t.pendingProps,n);case 15:return Mc(e,t,t.type,t.pendingProps,n);case 19:return nl(e,t,n);case 31:return Rc(e,t,n);case 22:return Nc(e,t,n,t.pendingProps);case 24:return ya(t),r=ba(Ea),e===null?(a=Va(),a===null&&(a=Qu,o=Da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},lo(t),pa(t,Ea,a)):((e.lanes&n)!==0&&(uo(e,t),vo(t,null,null,n),_o()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,pa(t,Ea,r),r!==a.cache&&ga(t,[Ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),pa(t,Ea,r))),kc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:$i&&Ji(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:zc(e,t),kc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function cl(e){e.flags|=4}function ll(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Qm(t,r):Qm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Gd())e.flags|=8192;else throw Za=qa,Ga}}else e.flags&=-16777217}function ul(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$m(t)){if(Gd())e.flags|=8192;else throw Za=qa,Ga}}function dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:rt(),e.lanes|=t,fd|=t)}function fl(e,t){if(!$i)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function pl(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&1206910976,r|=i.flags&1206910976,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 ml(e,t,n){var r=t.pendingProps;switch(Yi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pl(t),null;case 1:return pl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ma(Ea),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(oa(t)?cl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ca())),pl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(cl(t),o===null?(pl(t),ll(t,a,null,r,n)):(pl(t),ul(t,o))):o?o===e.memoizedState?(pl(t),t.flags&=-16777217):(cl(t),pl(t),ul(t,o)):(e=e.memoizedProps,e!==r&&cl(t),pl(t),ll(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&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}e=me.current,oa(t)?ia(t,e):(e=ym(a,r,n),t.stateNode=e,cl(t))}return pl(t),t.subtreeFlags&=-33554433,null;case 5:if(xe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}if(o=me.current,oa(t))ia(t,o);else{var s=mp(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[ht]=t,o[gt]=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(sp(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&&cl(t)}}return pl(t),t.subtreeFlags&=-33554433,ll(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,oa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Zi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ip(e.nodeValue,n)),e||ra(t,!0)}else e=mp(e).createTextNode(r),e[ht]=t,t.stateNode=e}return pl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=oa(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[ht]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),e=!1}else n=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(i(558))}return pl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=oa(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[ht]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),a=!1}else a=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(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),dl(t,t.updateQueue),pl(t),null);case 4:return ye(),e===null&&Jf(t.stateNode.containerInfo),t.flags|=67108864,pl(t),null;case 10:return ma(t.type),pl(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return pl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)fl(r,!1);else{if(sd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Io(e),o!==null){for(t.flags|=128,fl(r,!1),e=o.updateQueue,t.updateQueue=e,dl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ki(n,e),n=n.sibling;return Po(t,No.current&1|2),$i&&Ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>vd&&(t.flags|=128,a=!0,fl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,dl(t,e),fl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!$i)return pl(t),null}else 2*Pe()-r.renderingStartTime>vd&&n!==536870912&&(t.flags|=128,a=!0,fl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,o=No.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||$i?Po(t,o):(n=o,pe(Eo,t),pe(No,n),Do===null&&(Do=t)),$i&&Ki(t,r.treeForkCount),e}return pl(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(pl(t),t.subtreeFlags&6&&(t.flags|=8192)):pl(t),n=t.updateQueue,n!==null&&dl(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&&fe(Ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ma(Ea),pl(t),null;case 25:return null;case 30:return t.flags|=33554432,pl(t),null}throw Error(i(156,t.tag))}function hl(e,t){switch(Yi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ma(Ea),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(Mo(t),t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ye(),null;case 10:return ma(t.type),null;case 22:case 23:return Mo(t),To(),e!==null&&fe(Ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ma(Ea),null;case 25:return null;default:return null}}function gl(e,t){switch(Yi(t),t.tag){case 3:ma(Ea),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:ma(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&fe(Ba);break;case 24:ma(Ea)}}function _l(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){gf(t,t.return,e)}}function vl(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){gf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){gf(t,t.return,e)}}function yl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bo(t,n)}catch(t){gf(e,e.return,t)}}}function bl(e,t,n){n.props=vc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){gf(e,t,n)}}function xl(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:var i=e.stateNode,a=di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=zp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Bp(e);m(e.child,!1,nm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){gf(e,t,n)}}function Sl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){gf(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){gf(e,t,n)}else n.current=null}}function Cl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)im(e.stateNode,t[n])}function wl(e){for(var t=e.return;t!==null&&(Dl(t)&&im(e.stateNode,t.stateNode),!El(t));)t=t.return}function Tl(e){for(var t=e.return;t!==null&&(Dl(t)&&am(e.stateNode,t.stateNode),!El(t));)t=t.return}function El(e){return e.tag===5||e.tag===3||e.tag===27}function Dl(e){return e&&e.tag===7&&e.stateNode!==null}function Ol(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){gf(e,e.return,t)}}function kl(e,t,n){try{var r=e.stateNode;lp(r,e.type,n,t),r[gt]=t}catch(t){gf(e,e.return,t)}}function Al(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dp(e.type)||e.tag===4}function jl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Al(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&&Dp(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 Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fn)),Cl(e,r),zt=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Dp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Cl(e,r),zt=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Dp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);sp(t,r,n),t[ht]=e,t[gt]=n}catch(t){gf(e,e.return,t)}}var Fl=!1,Il=null;function Ll(e){(e.tag===30||e.subtreeFlags&33554432)&&(Fl=!0)}var Rl=null;function zl(){var e=Rl;return Rl=null,e}var Bl=0;function Vl(e,t,n,r,i){return Bl=0,Hl(e.child,t,n,r,i)}function Hl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Np(o);r.push(s),s.view&&(a=!0)}else a||Np(o).view&&(a=!0);Fl=!0,Ap(o,Bl===0?t:t+`_`+Bl,n),Bl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Hl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Ul(e,t){for(;e!==null;)e.tag===5?jp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ul(e.child,t)),e=e.sibling}function Wl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Wl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=pi(t.default,t.share),t!==`none`&&(Vl(e,n,t,null,!1)||Ul(e.child,!1))}e=e.sibling}}function Gl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=di(r,n),a=pi(r.default,n.paired?r.share:r.enter);a===`none`?Wl(e):Vl(e,i,a,null,!1)?(Wl(e),n.paired||t||Fd(e,r.onEnter)):Ul(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e,t),e=e.sibling;else Wl(e)}function Kl(e){if(Il!==null&&Il.size!==0){var t=Il;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=pi(n.default,n.share);if(a!==`none`&&(Vl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Fd(e,n.onShare)):Ul(e.child,!1)),t.delete(r),t.size===0)break}}}Kl(e)}e=e.sibling}}}function ql(e){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode),r=Il===null?void 0:Il.get(n),i=pi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Vl(e,n,i,null,!1)?r===void 0?Fd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Il.delete(n),Fd(e,t.onShare)):Ul(e.child,!1)),Il!==null&&Kl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Il!==null&&Kl(e)}function Jl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode);t=pi(t.default,t.update),e.flags&=-5,t!==`none`&&Vl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Jl(e);e=e.sibling}}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ul(e.child,!1))}Yl(e)}e=e.sibling}}function Xl(e){if(e.tag===30)e.stateNode.paired=null,Ul(e.child,!1),Yl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else Yl(e)}function Zl(e){for(e=e.child;e!==null;)e.tag===30?Ul(e.child,!1):e.subtreeFlags&33554432&&Zl(e),e=e.sibling}function Ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Bl<a.length){var l=a[Bl],u=Np(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Ap(c,Bl===0?n:n+`_`+Bl,i),s&&e.flags&4||(Rl===null&&(Rl=[]),Rl.push(c,Bl===0?r:r+`_`+Bl,t.memoizedProps)),Bl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function $l(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=di(n,r),a=pi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Pp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Bl=0,i=Ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Fd(e,n.onUpdate))}else e.subtreeFlags&33554432&&$l(e,t);e=e.sibling}}var eu=!1,tu=!1,nu=!1,ru=!1,iu=typeof WeakSet==`function`?WeakSet:Set,au=null,ou=!1,su=!1,cu=!1,lu=!1;function uu(e,t,n){if(e=e.containerInfo,fp=bh,e=Vr(e),Hr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(pp={focusedElem:e,selectionRange:r},bh=!1,n=(n&335544064)===n,au=t,t=n?9270:1024;au!==null;){if(e=au,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Ll(e),du(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ql(r),du(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ll(e),du(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,au=r):(n&&Jl(e),du(n))}}Il=null}function du(e){for(;au!==null;){var t=au,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=vc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){gf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)om(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:om(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=di(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=pi(a.default,a.update),a!==`none`&&Vl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,au=r;break}au=t.return}}function fu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Mu(e,n),r&4&&_l(5,n);break;case 1:if(Mu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){gf(n,n.return,e)}else{var i=vc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){gf(n,n.return,e)}}}r&64&&yl(n),r&512&&xl(n,n.return);break;case 3:if(Mu(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{bo(e,t)}catch(e){gf(n,n.return,e)}}break;case 27:t===null&&r&4&&Pl(n);case 26:case 5:Mu(e,n),t===null&&r&4&&Ol(n),r&512&&xl(n,n.return);break;case 12:Mu(e,n);break;case 31:Mu(e,n),r&4&&xu(e,n);break;case 13:Mu(e,n),r&4&&Su(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=bf.bind(null,n),fm(e,n))));break;case 22:if(r=n.memoizedState!==null||eu,!r){var a=t!==null&&t.memoizedState!==null||tu;t=eu,i=tu,eu=r,(tu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Pu(e,n,r)):Mu(e,n),eu=t,tu=i}break;case 30:Mu(e,n),r&512&&xl(n,n.return);break;case 7:r&512&&xl(n,n.return);default:Mu(e,n)}}function pu(e,t){for(e=e.child;e!==null;)mu(e,t),e=e.sibling}function mu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){gf(e,e.return,t)}hu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,zt=!0}catch(t){gf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?kp(s,!0):kp(e.stateNode,!1)}catch(t){gf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&pu(e,t);break;default:pu(e,t)}}function hu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:mu(n,r);break a;case 22:n.memoizedState===null&&hu(n,r);break a;default:hu(n,r)}}e=e.sibling}}function gu(e){var t=e.alternate;t!==null&&(e.alternate=null,gu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wt(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 _u=null,vu=!1;function yu(e,t,n){for(n=n.child;n!==null;)bu(e,t,n),n=n.sibling}function bu(e,t,n){if(Ue&&typeof Ue.onCommitFiberUnmount==`function`)try{Ue.onCommitFiberUnmount(He,n)}catch{}switch(n.tag){case 26:tu||Sl(n,t),yu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!tu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tu||Sl(n,t),Tl(n);var r=_u,i=vu;Dp(n.type)&&(_u=n.stateNode,vu=!1),yu(e,t,n),bm(n.stateNode,n.type,n.memoizedProps),_u=r,vu=i;break;case 5:tu||Sl(n,t),Tl(n);case 6:if(n.tag===6&&Tl(n),r=_u,i=vu,_u=null,yu(e,t,n),_u=r,vu=i,_u!==null){if(vu)try{(_u.nodeType===9?_u.body:_u.nodeName===`HTML`?_u.ownerDocument.body:_u).removeChild(n.stateNode),zt=!0}catch(e){gf(n,t,e)}else try{_u.removeChild(n.stateNode),zt=!0}catch(e){gf(n,t,e)}}break;case 18:_u!==null&&(vu?(e=_u,Op(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gh(e)):Op(_u,n.stateNode));break;case 4:r=_u,i=vu,_u=n.stateNode.containerInfo,vu=!0,yu(e,t,n),_u=r,vu=i;break;case 0:case 11:case 14:case 15:vl(2,n,t),tu||vl(4,n,t),yu(e,t,n);break;case 1:tu||(Sl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&bl(n,t,r)),yu(e,t,n);break;case 21:yu(e,t,n);break;case 22:tu=(r=tu)||n.memoizedState!==null,yu(e,t,n),tu=r;break;case 30:Sl(n,t),yu(e,t,n);break;case 7:tu||Sl(n,t),yu(e,t,n);break;default:yu(e,t,n)}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gh(e)}catch(e){gf(t,t.return,e)}}}function Su(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gh(e)}catch(e){gf(t,t.return,e)}}function Cu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new iu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new iu),t;default:throw Error(i(435,e.tag))}}function wu(e,t){var n=Cu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=xf.bind(null,e,t);t.then(r,r)}})}function Tu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Dp(l.type)){_u=l.stateNode,vu=!1;break a}break;case 5:_u=l.stateNode,vu=!1;break a;case 3:case 4:_u=l.stateNode.containerInfo,vu=!0;break a}l=l.return}if(_u===null)throw Error(i(160));bu(s,c,o),_u=null,vu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Du(t,e,n),t=t.sibling}var Eu=null;function Du(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Tu(t,e,n),Ou(e),a&4&&(vl(3,e,e.return),_l(3,e),vl(5,e,e.return));break;case 1:Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),a&64&&eu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Eu,Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(eu)e.stateNode=_p(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[St]||r[ht]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),sp(r,t,n),r[ht]=e,kt(r),t=r;break a;case`link`:if(o=Ym(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),sp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Ym(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),sp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[ht]=e,kt(r),t=r}e.stateNode=t}}else eu||Xm(o,e.type,e.stateNode)}else e.stateNode=Wm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&kl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||tu||t.parentNode.removeChild(t)):a.count--,n===null?eu||Xm(o,e.type,e.stateNode):Wm(o,n,e.memoizedProps))}break;case 27:Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),r!==null&&a&4&&kl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=nu,nu=!1,Tu(t,e,n),nu=o,Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),e.flags&32){t=e.stateNode;try{rn(t,``),zt=!0}catch(t){gf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,kl(e,t,r===null?t:r.memoizedProps)),a&1024&&(ru=!0);break;case 6:if(Tu(t,e,n),Ou(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,zt=!0}catch(t){gf(e,e.return,t)}}break;case 3:if(zt=!1,Jm=null,o=Eu,Eu=wm(t.containerInfo),Tu(t,e,n),Eu=o,Ou(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Gh(t.containerInfo)}catch(t){gf(e,e.return,t)}ru&&(ru=!1,ku(e)),zt=!1;break;case 4:a=nu,nu=eu,r=Bt(),o=Eu,Eu=wm(e.stateNode.containerInfo),Tu(t,e,n),Ou(e),Eu=o,zt&&su&&(cu=!0),zt=r,nu=a;break;case 12:Tu(t,e,n),Ou(e);break;case 31:Tu(t,e,n),Ou(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 13:Tu(t,e,n),Ou(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(gd=Pe()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=eu,l=tu,u=nu;eu=c||o,nu=u||o,tu=l||s,Tu(t,e,n),tu=l,nu=u,eu=c,Ou(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||eu||tu||(t=s||tu,n=eu,r=tu,eu=o||eu,tu=t,Nu(e,2),eu=n,tu=r),!o&&nu||pu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,wu(e,n))));break;case 19:Tu(t,e,n),Ou(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 30:a&512&&(tu||r===null||Sl(r,r.return)),a=Bt(),o=su,s=(n&335544064)===n,c=e.memoizedProps,su=s&&pi(c.default,c.update)!==`none`,Tu(t,e,n),Ou(e),s&&r!==null&&zt&&(e.flags|=4),su=o,zt=a;break;case 21:break;case 7:a&512&&(tu||r===null||Sl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Tu(t,e,n),Ou(e)}}function Ou(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Al(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Dl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(El(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Nl(e,jl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(rn(l,``),n.flags&=-33),Nl(e,jl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ml(e,jl(e),u,s);break;default:throw Error(i(161))}}catch(t){gf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ku(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ku(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,bh=!0,t.reset(),bh=!1),e=e.sibling}}function Au(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ju(t,e),t=t.sibling;else $l(t,!1)}function ju(e,t){var n=e.alternate;if(n===null)Gl(e,!1);else switch(e.tag){case 3:if(lu=ou=!1,zl(),Au(t,e),!ou&&!cu){if(e=Rl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];jp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),lu=!0}Rl=null;break;case 5:Au(t,e);break;case 4:r=ou,ou=!1,Au(t,e),ou&&(cu=!0),ou=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Au(t,e):Gl(e,!1));break;case 30:r=ou,i=zl(),ou=!1,Au(t,e),ou&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=di(a,o),o=di(n.memoizedProps,o);var s=pi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Bl=0,t=Ql(e,n,t,o,s,a,!0),Bl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Fd(e,e.memoizedProps.onUpdate),Rl=i):i!==null&&(i.push.apply(i,Rl),Rl=i),ou=e.flags&32?!0:r;break;default:Au(t,e)}}function Mu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fu(e,t.alternate,t),t=t.sibling}function Nu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:vl(4,n,n.return),Nu(n,r);break;case 1:Sl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&bl(n,n.return,i),Nu(n,r);break;case 27:r&2&&bm(n.stateNode,n.type,n.memoizedProps);case 5:Sl(n,n.return),n.tag!==5&&n.tag!==27||Tl(n),Nu(n,r);break;case 6:Tl(n);break;case 26:Sl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||tu||i.parentNode.removeChild(i),Nu(n,r);break;case 22:n.memoizedState===null&&Nu(n,r);break;case 30:Sl(n,n.return),Nu(n,r);break;case 7:Sl(n,n.return);default:Nu(n,r)}e=e.sibling}}function Pu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Pu(i,a,n),_l(4,a);break;case 1:if(Pu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){gf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)yo(l[i],c)}catch(e){gf(r,r.return,e)}}s&&o&64&&yl(a),xl(a,a.return);break;case 27:n&2&&Pl(a);case 5:a.tag!==5&&a.tag!==27||wl(a),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 6:wl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||eu||Xm(wm(c.ownerDocument),a.type,c),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 12:Pu(i,a,n);break;case 31:Pu(i,a,n),s&&o&4&&xu(i,a);break;case 13:Pu(i,a,n),s&&o&4&&Su(i,a);break;case 22:a.memoizedState===null&&Pu(i,a,n),xl(a,a.return);break;case 30:Pu(i,a,n),xl(a,a.return);break;case 7:xl(a,a.return);default:Pu(i,a,n)}t=t.sibling}}function Fu(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&&Oa(n))}function Iu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Oa(e))}function Lu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ru(e,t,n,r),t=t.sibling;else i&&Zl(t)}function Ru(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Xl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Lu(e,t,n,r),a&2048&&_l(9,t);break;case 1:Lu(e,t,n,r);break;case 3:Lu(e,t,n,r),i&&lu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Oa(a)));break;case 12:if(a&2048){Lu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){gf(t,t.return,e)}}else Lu(e,t,n,r);break;case 31:Lu(e,t,n,r);break;case 13:Lu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Xl(t),o._visibility&2?Lu(e,t,n,r):(o._visibility|=2,zu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Xl(s),o._visibility&2?Lu(e,t,n,r):Bu(e,t)),a&2048&&Fu(s,t);break;case 24:Lu(e,t,n,r),a&2048&&Iu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ul(a.child,!0),Ul(t.child,!0))),Lu(e,t,n,r);break;default:Lu(e,t,n,r)}}function zu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!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:zu(a,o,s,c,i),_l(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,zu(a,o,s,c,i)):u._visibility&2?zu(a,o,s,c,i):Bu(a,o),i&&l&2048&&Fu(o.alternate,o);break;case 24:zu(a,o,s,c,i),i&&l&2048&&Iu(o.alternate,o);break;default:zu(a,o,s,c,i)}t=t.sibling}}function Bu(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:Bu(n,r),i&2048&&Fu(r.alternate,r);break;case 24:Bu(n,r),i&2048&&Iu(r.alternate,r);break;default:Bu(n,r)}t=t.sibling}}var Vu=8192;function Hu(e,t,n){if(e.subtreeFlags&Vu)for(e=e.child;e!==null;)Uu(e,t,n),e=e.sibling}function Uu(e,t,n){switch(e.tag){case 26:Hu(e,t,n),e.flags&Vu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&th(n,e)):nh(n,Eu,e.memoizedState,e.memoizedProps));break;case 5:Hu(e,t,n),e.flags&Vu&&(e=e.stateNode,(t&335544128)===t&&th(n,e));break;case 3:case 4:var r=Eu;Eu=wm(e.stateNode.containerInfo),Hu(e,t,n),Eu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Vu,Vu=16777216,Hu(e,t,n),Vu=r):Hu(e,t,n));break;case 30:if((e.flags&Vu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Il===null&&(Il=new Map),Il.set(r,i)}Hu(e,t,n);break;default:Hu(e,t,n)}}function Wu(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 Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,Ju(r,e)}Wu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ku(e),e=e.sibling}function Ku(e){switch(e.tag){case 0:case 11:case 15:Gu(e),e.flags&2048&&vl(9,e,e.return);break;case 3:Gu(e);break;case 12:Gu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qu(e)):Gu(e);break;default:Gu(e)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,Ju(r,e)}Wu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vl(8,t,t.return),qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,qu(t));break;default:qu(t)}e=e.sibling}}function Ju(e,t){for(;au!==null;){var n=au;switch(n.tag){case 0:case 11:case 15:vl(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:Oa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,au=r;else a:for(n=e;au!==null;){r=au;var i=r.sibling,a=r.return;if(gu(r),r===n){au=null;break a}if(i!==null){i.return=a,au=i;break a}au=a}}}var Yu={getCacheForType:function(e){var t=ba(Ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ba(Ea).controller.signal}},Xu=typeof WeakMap==`function`?WeakMap:Map,Zu=0,Qu=null,$u=null,ed=0,td=0,nd=null,rd=!1,id=!1,ad=!1,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=0,pd=null,md=null,hd=!1,gd=0,_d=0,vd=1/0,yd=null,bd=null,xd=0,Sd=null,Cd=null,wd=0,Td=0,Ed=null,Dd=null,Od=null,kd=null,Ad=null,jd=0,Md=null;function Nd(){return Zu&2&&ed!==0?ed&-ed:W.T===null?ft():Lf()}function Pd(){if(dd===0){if(!(ed&536870912)||$i){var e=Xe;Xe<<=1,!(Xe&3932160)&&(Xe=262144),dd=e}else dd=536870912}return e=Eo.current,e!==null&&(e.flags|=32),dd}function Fd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=zp(di(e.memoizedProps,n))),kd===null&&(kd=[]),kd.push(t.bind(null,r))}}function Id(e,t,n){(e===Qu&&(td===2||td===9)||e.cancelPendingCommit!==null)&&(Ud(e,0),Bd(e,ed,dd,!1)),at(e,n),(!(Zu&2)||e!==Qu)&&(e===Qu&&(!(Zu&2)&&(ld|=n),sd===4&&Bd(e,ed,dd,!1)),kf(e))}function Ld(e,t,n){if(Zu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||et(e,t),a=r?Zd(e,t):Yd(e,t,!0),o=r;do{if(a===0){id&&!r&&Bd(e,t,0,!1);break}if(n=e.current.alternate,o&&!zd(n))a=Yd(e,t,!1),o=!1;else{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=pd;var l=c.current.memoizedState.isDehydrated;if(l&&(Ud(c,s).flags|=256),s=Yd(c,s,!1),s!==2&&s!==6){if(ad&&!l){c.errorRecoveryDisabledLanes|=o,ld|=o,a=4;break a}o=md,md=a,o!==null&&(md===null?md=o:md.push.apply(md,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Ud(e,0),Bd(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&&(t&62914560)!==t)break;case 6:Bd(r,t,dd,!rd);break a;case 2:md=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=gd+300-Pe(),10<a)){if(Bd(r,t,dd,!rd),$e(r,0,!0)!==0)break a;wd=t,r.timeoutHandle=xp(Rd.bind(null,r,n,md,yd,hd,t,dd,ld,fd,rd,o,`Throttled`,-0,0),a);break a}Rd(r,n,md,yd,hd,t,dd,ld,fd,rd,o,null,-0,0)}break}}while(1);kf(e)}function Rd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fn},Il=null,Uu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=oh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?gd-Pe():(a&4194048)===a?_d-Pe():0,m=ih(d,m),m!==null)?(wd=a,e.cancelPendingCommit=m(af.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Bd(e,a,o,!l)):af(e,t,a,n,r,i,o,s,c,l,u,d)}function zd(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(!Fr(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 Bd(e,t,n,r){t=tt(e,t),t&=~ud,t&=~ld,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&&st(e,n,t)}function Vd(){return Zu&6?!0:(Af(0,!1),!1)}function Hd(){if($u!==null){if(td===0)var e=$u.return;else e=$u,fa=da=null,ts(e),eo=null,to=0,e=$u;for(;e!==null;)gl(e.alternate,e),e=e.return;$u=null}}function Ud(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Sp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),wd=0,Hd(),Qu=e,$u=n=Oi(e.current,null),ed=t,td=0,nd=null,rd=!1,id=et(e,t),ad=!1,fd=dd=ud=ld=cd=sd=0,md=pd=null,hd=!1,od=tt(e,t),vi(),n}function Wd(e,t){Ro=null,W.H=uc,t===Wa||t===Ka?(t=Qa(),td=3):t===Ga?(t=Qa(),td=4):td=t===Dc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,nd=t,$u===null&&(sd=1,xc(e,Ii(t,e.current)))}function Gd(){var e=Eo.current;return e===null?!0:(ed&4194048)===ed?Do===null:(ed&62914560)===ed||ed&536870912?e===Do:!1}function Kd(){var e=W.H;return W.H=uc,e===null?uc:e}function qd(){var e=W.A;return W.A=Yu,e}function Jd(){sd=4,rd||(ed&4194048)!==ed&&Eo.current!==null||(id=!0),!(cd&134217727)&&!(ld&134217727)||Qu===null||Bd(Qu,ed,dd,!1)}function Yd(e,t,n){var r=Zu;Zu|=2;var i=Kd(),a=qd();(Qu!==e||ed!==t)&&(yd=null,Ud(e,t)),t=!1;var o=sd;a:do try{if(td!==0&&$u!==null){var s=$u,c=nd;switch(td){case 8:Hd(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=td;if(td=0,nd=null,tf(e,s,c,l),n&&id){o=0;break a}break;default:l=td,td=0,nd=null,tf(e,s,c,l)}}Xd(),o=sd;break}catch(t){Wd(e,t)}while(1);return t&&e.shellSuspendCounter++,fa=da=null,Zu=r,W.H=i,W.A=a,$u===null&&(Qu=null,ed=0,vi()),o}function Xd(){for(;$u!==null;)$d($u)}function Zd(e,t){var n=Zu;Zu|=2;var r=Kd(),a=qd();Qu!==e||ed!==t?(yd=null,vd=Pe()+500,Ud(e,t)):id=et(e,t);a:do try{if(td!==0&&$u!==null){t=$u;var o=nd;b:switch(td){case 1:td=0,nd=null,tf(e,t,o,1);break;case 2:case 9:if(Ja(o)){td=0,nd=null,ef(t);break}t=function(){td!==2&&td!==9||Qu!==e||(td=7),kf(e)},o.then(t,t);break a;case 3:td=7;break a;case 4:td=5;break a;case 7:Ja(o)?(td=0,nd=null,ef(t)):(td=0,nd=null,tf(e,t,o,7));break;case 5:var s=null;switch($u.tag){case 26:s=$u.memoizedState;case 5:case 27:var c=$u;if(s?$m(s):c.stateNode.complete){td=0,nd=null;var l=c.sibling;if(l!==null)$u=l;else{var u=c.return;u===null?$u=null:($u=u,nf(u))}break b}}td=0,nd=null,tf(e,t,o,5);break;case 6:td=0,nd=null,tf(e,t,o,6);break;case 8:Hd(),sd=6;break a;default:throw Error(i(462))}}Qd();break}catch(t){Wd(e,t)}while(1);return fa=da=null,W.H=r,W.A=a,Zu=n,$u===null?(Qu=null,ed=0,vi(),sd):0}function Qd(){for(;$u!==null&&!Me();)$d($u)}function $d(e){var t=sl(e.alternate,e,od);e.memoizedProps=e.pendingProps,t===null?nf(e):$u=t}function ef(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vc(n,t,t.pendingProps,t.type,void 0,ed);break;case 11:t=Vc(n,t,t.pendingProps,t.type.render,t.ref,ed);break;case 5:ts(t);var r=t;r===Zi&&($i?(aa(r),r.tag===5&&r.stateNode!=null&&(Qi=r.stateNode)):(aa(r),$i=!0));default:gl(n,t),t=$u=ki(t,od),t=sl(n,t,od)}e.memoizedProps=e.pendingProps,t===null?nf(e):$u=t}function tf(e,t,n,r){fa=da=null,ts(t),eo=null,to=0;var i=t.return;try{if(Ec(e,i,t,n,ed)){sd=1,xc(e,Ii(n,e.current)),$u=null;return}}catch(t){if(i!==null)throw $u=i,t;sd=1,xc(e,Ii(n,e.current)),$u=null;return}t.flags&32768?($i||r===1?e=!0:id||ed&536870912?e=!1:(rd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),rf(t,e)):nf(t)}function nf(e){var t=e;do{if(t.flags&32768){rf(t,rd);return}e=t.return;var n=ml(t.alternate,t,od);if(n!==null){$u=n;return}if(t=t.sibling,t!==null){$u=t;return}$u=t=e}while(t!==null);sd===0&&(sd=5)}function rf(e,t){do{var n=hl(e.alternate,e);if(n!==null){n.flags&=32767,$u=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){$u=e;return}$u=e=n}while(e!==null);sd=6,$u=null}function af(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do pf();while(xd!==0);if(Zu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Qu&&($u=Qu=null,ed=0),Cd=t,Sd=e,wd=n,Ed=a,Dd=r,of(e,t,n,s,c,l,f)}}function of(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Td=s,s|=_i,ot(e,n,s,r,i,a),kd=null,(n&335544064)===n?(Ad=ja(e),r=10262):(Ad=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Sf(Re,function(){return mf(),null})):(e.callbackNode=null,e.callbackPriority=0),Fl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=W.T,W.T=null,i=se.p,se.p=2,a=Zu,Zu|=4;try{uu(e,t,n)}finally{Zu=a,se.p=i,W.T=r}}xd=1,Fl?Od=Lp(o,e.containerInfo,Ad,lf,uf,cf,df,mf,sf,null,null):(lf(),uf(),df())}function sf(e){if(xd!==0){var t=Sd.onRecoverableError;t(e,{componentStack:null})}}function cf(){xd===3&&(xd=0,ju(Cd,Sd),xd=4)}function lf(){if(xd===1){xd=0;var e=Sd,t=Cd,n=wd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=W.T,W.T=null;var i=se.p;se.p=2;var a=Zu;Zu|=4;try{su=cu=!1,Du(t,e,n),n=pp;var o=Vr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Br(s.ownerDocument.documentElement,s)){if(c!==null&&Hr(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 _=zr(s,h),v=zr(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}}bh=!!fp,pp=fp=null}finally{Zu=a,se.p=i,W.T=r}}e.current=t,xd=2}}function uf(){if(xd===2){xd=0;var e=Sd,t=Cd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=W.T,W.T=null;var r=se.p;se.p=2;var i=Zu;Zu|=4;try{fu(e,t.alternate,t)}finally{Zu=i,se.p=r,W.T=n}}xd=3}}function df(){if(xd===4||xd===3){xd=0;var e=Od;Od=null,Ne();var t=Sd,n=Cd,r=wd,i=Dd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?xd=5:(xd=0,Cd=Sd=null,ff(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(bd=null),dt(r),n=n.stateNode,Ue&&typeof Ue.onCommitFiberRoot==`function`)try{Ue.onCommitFiberRoot(He,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=W.T,a=se.p,se.p=2,W.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{W.T=n,se.p=a}}if(i=kd,o=Ad,Ad=null,i!==null&&(kd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);wd&3&&pf(),kf(t),a=t.pendingLanes,r&261930&&a&42?t===Md?jd++:(jd=0,Md=t):(jd=0,Md=null),Af(0,!1)}}function ff(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Oa(t)))}function pf(){return Od!==null&&(Od.skipTransition(),Od=null),lf(),uf(),df(),mf()}function mf(){if(xd!==5)return!1;var e=Sd,t=Td;Td=0;var n=dt(wd),r=W.T,a=se.p;try{se.p=32>n?32:n,W.T=null,n=Ed,Ed=null;var o=Sd,s=wd;if(xd=0,Cd=Sd=null,wd=0,Zu&6)throw Error(i(331));var c=Zu;if(Zu|=4,Ku(o.current),Ru(o,o.current,s,n),Zu=c,Af(0,!1),Ue&&typeof Ue.onPostCommitFiberRoot==`function`)try{Ue.onPostCommitFiberRoot(He,o)}catch{}return!0}finally{se.p=a,W.T=r,ff(e,t)}}function hf(e,t,n){t=Ii(n,t),t=Cc(e.stateNode,t,2),e=po(e,t,2),e!==null&&(at(e,2),kf(e))}function gf(e,t,n){if(e.tag===3)hf(e,e,n);else for(;t!==null;){if(t.tag===3){hf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(bd===null||!bd.has(r))){e=Ii(n,e),n=wc(2),r=po(t,n,2),r!==null&&(Tc(n,r,t,e),at(r,2),kf(r));break}}t=t.return}}function _f(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Xu;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)||(ad=!0,i.add(n),e=vf.bind(null,e,t,n),t.then(e,e))}function vf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Qu===e&&(ed&n)===n&&(sd===4||sd===3&&(ed&62914560)===ed&&300>Pe()-gd?Zu&2?ud|=n:Ud(e,0):ud|=n,fd===ed&&(fd=0)),kf(e)}function yf(e,t){t===0&&(t=rt()),e=xi(e,t),e!==null&&(at(e,t),kf(e))}function bf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yf(e,n)}function xf(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),yf(e,n)}function Sf(e,t){return Ae(e,t)}var Cf=null,wf=null,Tf=!1,Ef=!1,Df=!1,Of=0;function kf(e){e!==wf&&e.next===null&&(wf===null?Cf=wf=e:wf=wf.next=e),Ef=!0,Tf||(Tf=!0,If())}function Af(e,t){if(!Df&&Ef){Df=!0;do for(var n=!1,r=Cf;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,Ff(r,a))}else a=ed,a=$e(r,r===Qu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||et(r,a)||(n=!0,Ff(r,a))}r=r.next}while(n);Df=!1}}function jf(){Mf()}function Mf(){Ef=Tf=!1;var e=0;Of!==0&&bp()&&(e=Of);for(var t=Pe(),n=null,r=Cf;r!==null;){var i=r.next,a=Nf(r,t);a===0?(r.next=null,n===null?Cf=i:n.next=i,i===null&&(wf=n)):(n=r,(e!==0||a&3)&&(Ef=!0)),r=i}xd!==0&&xd!==5||Af(e,!1),Of!==0&&(Of=0)}function Nf(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]=nt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Qu,n=ed,n=$e(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(td===2||td===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),dt(n)){case 2:case 8:n=Le;break;case 32:n=Re;break;case 268435456:n=Be;break;default:n=Re}return r=Pf.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 Pf(e,t){if(xd!==0&&xd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(pf()&&e.callbackNode!==n)return null;var r=ed;return r=$e(e,e===Qu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ld(e,r,t),Nf(e,Pe()),e.callbackNode!=null&&e.callbackNode===n?Pf.bind(null,e):null)}function Ff(e,t){if(pf())return null;Ld(e,t,!0)}function If(){Tp(function(){Zu&6?Ae(Ie,jf):Mf()})}function Lf(){if(Of===0){var e=Pa;e===0&&(e=Ye,Ye<<=1,!(Ye&261888)&&(Ye=256)),Of=e}return Of}function Rf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:dn(e)}function zf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Rf((i[gt]||null).action),o=r.submitter;o&&(t=(t=o[gt]||null)?Rf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Nn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Of!==0){var e=new FormData(i,o);Xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Bf=0;Bf<ci.length;Bf++){var Vf=ci[Bf];li(Vf.toLowerCase(),`on`+(Vf[0].toUpperCase()+Vf.slice(1)))}li(ei,`onAnimationEnd`),li(ti,`onAnimationIteration`),li(ni,`onAnimationStart`),li(`dblclick`,`onDoubleClick`),li(`focusin`,`onFocus`),li(`focusout`,`onBlur`),li(ri,`onTransitionRun`),li(ii,`onTransitionStart`),li(ai,`onTransitionCancel`),li(oi,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),Nt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Nt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Nt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Nt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Hf=`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(` `),Uf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Hf));function Wf(e,t){t=!!(t&4);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){mi(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){mi(e)}i.currentTarget=null,a=c}}}}function Gf(e,t){var n=t[vt];n===void 0&&(n=t[vt]=new Set);var r=e+`__bubble`;n.has(r)||(Yf(t,e,2,!1),n.add(r))}function Kf(e,t,n){var r=0;t&&(r|=4),Yf(n,e,r,t)}var qf=`_reactListening`+Math.random().toString(36).slice(2);function Jf(e){if(!e[qf]){e[qf]=!0,jt.forEach(function(t){t!==`selectionchange`&&(Uf.has(t)||Kf(t,!1,e),Kf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qf]||(t[qf]=!0,Kf(`selectionchange`,!1,t))}}function Yf(e,t,n,r){switch(Dh(t)){case 2:var i=xh;break;case 8:i=Sh;break;default:i=Ch}n=i.bind(null,t,n,e),i=void 0,!Sn||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 Xf(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=Tt(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}yn(function(){var r=a,i=mn(n),s=[];a:{var c=si.get(e);if(c!==void 0){var l=Nn,u=e;switch(e){case`keypress`:if(On(n)===0)break a;case`keydown`:case`keyup`:l=Zn;break;case`focusin`:u=`focus`,l=Hn;break;case`focusout`:u=`blur`,l=Hn;break;case`beforeblur`:case`afterblur`:l=Hn;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=Bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Vn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=er;break;case ei:case ti:case ni:l=Un;break;case oi:l=tr;break;case`scroll`:case`scrollend`:l=Fn;break;case`wheel`:l=nr;break;case`copy`:case`cut`:case`paste`:l=Wn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Qn;break;case`submit`:l=$n;break;case`toggle`:case`beforetoggle`:l=rr}var d=!!(t&4),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=bn(m,p),g!=null&&d.push(Zf(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==pn&&(u=n.relatedTarget||n.fromElement)&&(Tt(u)||u[_t]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Tt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Bn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Qn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Dt(c),h=l==null?u:Dt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Tt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,$f):null,c!==null&&ep(s,u,c,d,!1),l!==null&&f!==null&&ep(s,f,l,d,!0)))}a:{if(c=r?Dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Cr;else if(_r(c)){if(wr)_=Nr;else{_=jr;var v=Ar}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&cn(r.elementType)&&(_=Cr):_=Mr;if(_&&=_(e,r)){vr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Dt(r):window,e){case`focusin`:(_r(v)||v.contentEditable===`true`)&&(Wr=v,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(s,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(s,n,i)}var y;if(ar)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else pr?dr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(cr&&n.locale!==`ko`&&(pr||b!==`onCompositionStart`?b===`onCompositionEnd`&&pr&&(y=Dn()):(wn=i,Tn=`value`in wn?wn.value:wn.textContent,pr=!0)),v=Qf(r,b),0<v.length&&(b=new Gn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=fr(n),y!==null&&(b.data=y)))),(y=sr?mr(e,n):hr(e,n))&&(b=Qf(r,`onBeforeInput`),0<b.length&&(v=new Gn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),zf(s,e,r,n,i)}Wf(s,t)})}function Zf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Qf(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=bn(e,n),i!=null&&r.unshift(Zf(e,i,a)),i=bn(e,t),i!=null&&r.push(Zf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function $f(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ep(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=bn(n,a),l!=null&&o.unshift(Zf(n,l,c))):i||(l=bn(n,a),l!=null&&o.push(Zf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var tp=/\r\n?/g,np=/\u0000|\uFFFD/g;function rp(e){return(typeof e==`string`?e:``+e).replace(tp,`
|
|
10
|
+
`).replace(np,``)}function ip(e,t){return t=rp(t),rp(e)===t}function ap(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&rn(e,``+r);else return;break;case`className`:Ht(e,`class`,r);break;case`tabIndex`:Ht(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ht(e,n,r);break;case`style`:sn(e,r,o);return;case`data`:if(t!==`object`){Ht(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ap(e,t,`name`,a.name,a,null),ap(e,t,`formEncType`,a.formEncType,a,null),ap(e,t,`formMethod`,a.formMethod,a,null),ap(e,t,`formTarget`,a.formTarget,a,null)):(ap(e,t,`encType`,a.encType,a,null),ap(e,t,`method`,a.method,a,null),ap(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=fn);return;case`onScroll`:r!=null&&Gf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Gf(`scrollend`,e);return;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));o?.__html!==n&&(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=dn(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`credentialless`: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`:Gf(`beforetoggle`,e),Gf(`toggle`,e),Vt(e,`popover`,r);break;case`xlinkActuate`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Vt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=ln.get(n)||n,Vt(e,n,r);else return}zt=!0}function op(e,t,n,r,a,o){switch(n){case`style`:sn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)rn(e,``+r);else return;break;case`onScroll`:r!=null&&Gf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Gf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=fn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[gt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}zt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Vt(e,n,r)}return}zt=!0}function sp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Gf(`error`,e),Gf(`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:ap(e,t,o,s,n,null)}}a&&ap(e,t,`srcSet`,n.srcSet,n,null),r&&ap(e,t,`src`,n.src,n,null);return;case`input`:Gf(`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:ap(e,t,r,d,n,null)}}Qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Gf(`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:ap(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&en(e,!!r,n,!0):en(e,!!r,t,!1);return;case`textarea`:for(s in Gf(`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:ap(e,t,s,c,n,null)}nn(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:ap(e,t,l,r,n,null)}return;case`dialog`:Gf(`beforetoggle`,e),Gf(`toggle`,e),Gf(`cancel`,e),Gf(`close`,e);break;case`iframe`:case`object`:Gf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Hf.length;r++)Gf(Hf[r],e);break;case`image`:Gf(`error`,e),Gf(`load`,e);break;case`details`:Gf(`toggle`,e);break;case`embed`:case`source`:case`link`:Gf(`error`,e),Gf(`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:ap(e,t,u,r,n,null)}return;default:if(cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&op(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ap(e,t,c,r,n,null))}var cp={};function lp(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)||ap(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`:m!==f&&(zt=!0),o=m;break;case`name`:m!==f&&(zt=!0),a=m;break;case`checked`:m!==f&&(zt=!0),u=m;break;case`defaultChecked`:m!==f&&(zt=!0),d=m;break;case`value`:m!==f&&(zt=!0),s=m;break;case`defaultValue`:m!==f&&(zt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ap(e,t,p,m,r,f)}}Zt(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)||ap(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`:o!==l&&(zt=!0),p=o;break;case`defaultValue`:o!==l&&(zt=!0),c=o;break;case`multiple`:o!==l&&(zt=!0),s=o;default:o!==l&&ap(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?en(e,!!n,n?[]:``,!1):en(e,!!n,t,!0)):en(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:ap(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`:a!==o&&(zt=!0),p=a;break;case`defaultValue`:a!==o&&(zt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ap(e,t,s,a,r,o)}tn(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:ap(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`:p!==m&&(zt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ap(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)&&ap(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:ap(e,t,u,p,r,m)}return;default:if(cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&op(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||op(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ap(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||ap(e,t,f,p,r,m)}function up(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function dp(){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&&up(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&&up(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 fp=null,pp=null;function mp(e){return e.nodeType===9?e:e.ownerDocument}function hp(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 gp(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 _p(e,t,n,r){return n=mp(n).createElement(e),n[ht]=r,n[gt]=t,sp(n,e,t),kt(n),n}function vp(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 yp=null;function bp(){var e=window.event;return e&&e.type===`popstate`?e!==yp&&(yp=e,!0):(yp=null,!1)}var xp=typeof setTimeout==`function`?setTimeout:void 0,Sp=typeof clearTimeout==`function`?clearTimeout:void 0,Cp=typeof Promise==`function`?Promise:void 0,wp=typeof requestAnimationFrame==`function`?requestAnimationFrame:xp,Tp=typeof queueMicrotask==`function`?queueMicrotask:Cp===void 0?xp:function(e){return Cp.resolve(null).then(e).catch(Ep)};function Ep(e){setTimeout(function(){throw e})}function Dp(e){return e===`head`}function Op(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),Gh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)xm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[St]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xm(e.ownerDocument.body)}n=i}while(n);Gh(t)}function kp(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 Ap(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function jp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Mp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Np(e){return Mp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Pp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Mp(t,n,e)}function Fp(e){return e.documentElement.clientHeight}function Ip(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Lp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Fp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=eh(f),u>rh){s.length=o;break}f=new Promise(Ip.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Rp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Rp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Rp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Rp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function zp(e){return{name:e,group:new Rp(`group`,e),imagePair:new Rp(`image-pair`,e),old:new Rp(`old`,e),new:new Rp(`new`,e)}}function Bp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Bp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Gp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Up(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Vp,e,s,r)}this._eventListeners=a}};function Vp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Bp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Gp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Up(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Hp,e,n,i),r.splice(t,1),a!==null&&a()}};function Hp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Up(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Wp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Gp(e,t,n,r){if(e.length===0)return-1;r=Wp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Wp(a.optionsOrUseCapture)===r)return i}return-1}Bp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Up(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Up(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Bp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag!==6&&(e=b(e),_m(e,t))}Bp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Y,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Kp(t[n],e);n--);};function Y(e,t){return t.push(e),!1}Bp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=mp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,qp,e,void 0,void 0))};function qp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Bp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Bp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0);for(var n=t=0;n<Xp.length;n++){var r=Xp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Xp[t++]=r}Xp.length=t}};function Yp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Xp=[],Zp=!1;function Qp(e,t,n){Xp.push({fragmentInstance:e,observer:t,instance:n}),Zp||(Zp=!0,vm(function(){Zp=!1;var e=Xp;Xp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Bp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,$p,e,void 0,void 0),e};function $p(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Bp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Bp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Y,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||em(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function em(e,t,n,r,i){var a=Tt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function tm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Bp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Y,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),tm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),tm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function nm(e,t){return e=b(e),rm(e,t),!1}function rm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function im(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Up(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Xp.length;i++){var a=Xp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Xp[r++]=a)}Xp.length=r,n.observe(e)}),rm(e,t))}function am(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Up(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Qp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function om(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`:om(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sm(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[St])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=pm(e.nextSibling),e===null)break}return null}function cm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pm(e.nextSibling),e===null))return null;return e}function lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pm(e.nextSibling),e===null))return null;return e}function um(e){return e.data===`$?`||e.data===`$~`}function dm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function fm(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 pm(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 mm=null;function hm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gm(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 _m(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function vm(e){wp(function(){wp(function(t){return e(t)})})}function ym(e,t,n){switch(t=mp(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 bm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ap(e,t,r,null,cp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===fn&&(e.onclick=null),wt(e)}function xm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var Sm=new Map,Cm=new Set;function wm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Tm=se.d;se.d={f:Em,r:Dm,D:Am,C:jm,L:Mm,m:Nm,X:Fm,S:Pm,M:Im};function Em(){var e=Tm.f(),t=Vd();return e||t}function Dm(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?Qs(t):Tm.r(e)}var Om=typeof document>`u`?null:document;function km(e,t,n){var r=Om;if(r&&typeof t==`string`&&t){var i=Xt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cm.has(i)||(Cm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),sp(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Am(e){Tm.D(e),km(`dns-prefetch`,e,null)}function jm(e,t){Tm.C(e,t),km(`preconnect`,e,t)}function Mm(e,t,n){Tm.L(e,t,n);var r=Om;if(r&&e&&t){var i=`link[rel="preload"][as="`+Xt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Xt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Xt(n.imageSizes)+`"]`)):i+=`[href="`+Xt(e)+`"]`;var a=i;switch(t){case`style`:a=Rm(e);break;case`script`:a=Hm(e)}if(!(Sm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zm(a))||t===`script`&&r.querySelector(Um(a))))){var o=r.createElement(`link`);sp(o,`link`,e),t===`style`&&(o[Ct]=!0,o.onload=o.onerror=function(){At(o)}),kt(o),r.head.appendChild(o)}}}function Nm(e,t){Tm.m(e,t);var n=Om;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Xt(r)+`"][href="`+Xt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hm(e)}if(!Sm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Sm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Um(a)))return}r=n.createElement(`link`),sp(r,`link`,e),kt(r),n.head.appendChild(r)}}}function Pm(e,t,n){Tm.S(e,t,n);var r=Om;if(r&&e){var i=Ot(r).hoistableStyles,a=Rm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sm.get(a))&&Km(e,n);var c=o=r.createElement(`link`);kt(c),sp(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,Gm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Fm(e,t){Tm.X(e,t);var n=Om;if(n&&e){var r=Ot(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),kt(a),sp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Im(e,t){Tm.M(e,t);var n=Om;if(n&&e){var r=Ot(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),kt(a),sp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t,n,r){var a=(a=ge.current)?wm(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`?(n=Rm(n.href),t=Ot(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Rm(n.href);var o=Ot(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(zm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Sm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sm.set(e,o)),Vm(a,e,o,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`?(n=Hm(n),t=Ot(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Rm(e){return`href="`+Xt(e)+`"`}function zm(e){return`link[rel="stylesheet"][`+e+`]`}function Bm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Vm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ct]){r.loading=1;return}}else t=e.createElement(`link`),t[Ct]=!0,t.onload=t.onerror=At.bind(null,t),sp(t,`link`,n),kt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Hm(e){return`[src="`+Xt(e)+`"]`}function Um(e){return`script[async]`+e}function Wm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Xt(n.href)+`"]`);if(r)return t.instance=r,kt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),kt(r),sp(r,`style`,a),Gm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Rm(n.href);var o=e.querySelector(zm(a));if(o)return t.state.loading|=4,t.instance=o,kt(o),o;r=Bm(n),(a=Sm.get(a))&&Km(r,a),o=(e.ownerDocument||e).createElement(`link`),kt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),sp(o,`link`,r),t.state.loading|=4,Gm(o,n.precedence,e),t.instance=o;case`script`:return o=Hm(n.src),(a=e.querySelector(Um(o)))?(t.instance=a,kt(a),a):(r=n,(a=Sm.get(o))&&(r=D({},n),qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),kt(a),sp(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,Gm(r,n.precedence,e));return t.instance}function Gm(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 Km(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jm=null;function Ym(e,t,n){if(Jm===null){var r=new Map,i=Jm=new Map;i.set(n,r)}else i=Jm,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[St]||a[ht]||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 Xm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zm(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 Qm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function $m(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function eh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function th(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=eh(t),e.suspenseyImages.push(t)),e=sh.bind(e),t.decode().then(e,e))}function nh(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=Rm(r.href),a=t.querySelector(zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=oh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,kt(a);return}a=t.ownerDocument||t,r=Bm(r),(i=Sm.get(i))&&Km(r,i),a=a.createElement(`link`),kt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),sp(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=oh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rh=0;function ih(e,t){return e.stylesheets&&e.count===0&&lh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rh===0&&(rh=62500*dp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ah(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function oh(){this.count--,ah(this)}function sh(){this.imgCount--,ah(this)}var ch=null;function lh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ch=new Map,t.forEach(uh,e),ch=null,oh.call(e))}function uh(e,t){if(!(t.state.loading&4)){var n=ch.get(e);if(n)var r=n.get(null);else{n=new Map,ch.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=oh.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 dh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function fh(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=it(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=it(0),this.hiddenUpdates=it(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function ph(e,t,n,r,i,a,o,s,c,l,u,d){return e=new fh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ei(3,null,null,t),e.current=a,a.stateNode=e,t=Da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},lo(a),e}function mh(e){return e?(e=wi,e):wi}function hh(e,t,n,r,i,a){i=mh(i),r.context===null?r.context=i:r.pendingContext=i,r=fo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=po(e,r,t),n!==null&&(Id(n,e,t),mo(n,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _h(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function vh(e){if(e.tag===13||e.tag===31){var t=xi(e,67108864);t!==null&&Id(t,e,67108864),_h(e,67108864)}}function yh(e){if(e.tag===13||e.tag===31){var t=Nd();t=ut(t);var n=xi(e,t);n!==null&&Id(n,e,t),_h(e,t)}}var bh=!0;function xh(e,t,n,r){var i=W.T;W.T=null;var a=se.p;try{se.p=2,Ch(e,t,n,r)}finally{se.p=a,W.T=i}}function Sh(e,t,n,r){var i=W.T;W.T=null;var a=se.p;try{se.p=8,Ch(e,t,n,r)}finally{se.p=a,W.T=i}}function Ch(e,t,n,r){if(bh){var i=wh(r);if(i===null)Xf(e,t,r,Th,n),Fh(e,r);else if(Lh(i,e,t,n,r))r.stopPropagation();else if(Fh(e,r),t&4&&-1<Ph.indexOf(e)){for(;i!==null;){var a=Et(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}kf(a),!(Zu&6)&&(vd=Pe()+500,Af(0,!1))}}break;case 31:case 13:s=xi(a,2),s!==null&&Id(s,a,2),Vd(),_h(a,2)}if(a=wh(r),a===null&&Xf(e,t,r,Th,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Xf(e,t,r,null,n)}}function wh(e){return e=mn(e),Eh(e)}var Th=null;function Eh(e){if(Th=null,e=Tt(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 Th=e,null}function Dh(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Fe()){case Ie:return 2;case Le:return 8;case Re:case ze:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Oh=!1,kh=null,Ah=null,jh=null,Mh=new Map,Nh=new Map,X=[],Ph=`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 Fh(e,t){switch(e){case`focusin`:case`focusout`:kh=null;break;case`dragenter`:case`dragleave`:Ah=null;break;case`mouseover`:case`mouseout`:jh=null;break;case`pointerover`:case`pointerout`:Mh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Nh.delete(t.pointerId)}}function Ih(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=Et(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lh(e,t,n,r,i){switch(t){case`focusin`:return kh=Ih(kh,e,t,n,r,i),!0;case`dragenter`:return Ah=Ih(Ah,e,t,n,r,i),!0;case`mouseover`:return jh=Ih(jh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Mh.set(a,Ih(Mh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Nh.set(a,Ih(Nh.get(a)||null,e,t,n,r,i)),!0}return!1}function Rh(e){var t=Tt(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,pt(e.priority,function(){yh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,pt(e.priority,function(){yh(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 zh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pn=r,n.target.dispatchEvent(r),pn=null}else return t=Et(n),t!==null&&vh(t),e.blockedOn=n,!1;t.shift()}return!0}function Bh(e,t,n){zh(e)&&n.delete(t)}function Vh(){Oh=!1,kh!==null&&zh(kh)&&(kh=null),Ah!==null&&zh(Ah)&&(Ah=null),jh!==null&&zh(jh)&&(jh=null),Mh.forEach(Bh),Nh.forEach(Bh)}function Hh(e,n){e.blockedOn===n&&(e.blockedOn=null,Oh||(Oh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vh)))}var Uh=null;function Wh(e){Uh!==e&&(Uh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Uh===e&&(Uh=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(Eh(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,Xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gh(e){function t(t){return Hh(t,e)}kh!==null&&Hh(kh,e),Ah!==null&&Hh(Ah,e),jh!==null&&Hh(jh,e),Mh.forEach(t),Nh.forEach(t);for(var n=0;n<X.length;n++){var r=X[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<X.length&&(n=X[0],n.blockedOn===null);)Rh(n),n.blockedOn===null&&X.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[gt]||null;if(typeof a==`function`)o||Wh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[gt]||null)s=o.formAction;else if(Eh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wh(n)}}}function Kh(){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 qh(e){this._internalRoot=e}Jh.prototype.render=qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;hh(n,Nd(),e,t,null,null)},Jh.prototype.unmount=qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hh(e.current,2,null,e,null,null),Vd(),t[_t]=null}};function Jh(e){this._internalRoot=e}Jh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ft();e={blockedOn:null,target:e,priority:t};for(var n=0;n<X.length&&t!==0&&t<X[n].priority;n++);X.splice(n,0,e),n===0&&Rh(e)}};var Yh=n.version;if(Yh!==`19.3.1`)throw Error(i(527,Yh,`19.3.1`));se.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:f(e),e=e===null?null:e.stateNode,e};var Xh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:W,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zh.isDisabled&&Zh.supportsFiber)try{He=Zh.inject(Xh),Ue=Zh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=yc,s=J,c=bc;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=ph(e,1,!1,null,null,n,r,null,o,s,c,Kh),e[_t]=t.current,Jf(e),new qh(t)}})),_=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=g()}));function v(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 y(e,t=`|`){return e.map(e=>U(e)).join(t)}function b(e,t){return typeof t==`bigint`?t.toString():t}var x=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function S(e){return new x(e)}function C(e){return e==null}function w(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function T(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function E(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function D(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function O(e){return D(e._zod.def)??e._zod.def.shape}function k(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return E(this,t,e),e},enumerable:!0,configurable:!0})}function A(e,t,n){t in e?E(e,t,n):e[t]=n}function j(e,t,n,r){let i=O(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?k(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):A(e,a,r?r(n.value,a):n.value))}}function M(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?k(e,n,()=>t[n]):A(e,n,r.value))}}function N(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function P(e){return JSON.stringify(e)}function F(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var I=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function L(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var R=S(()=>{if(We.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ee(e){if(L(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return L(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function z(e){return ee(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var B=new Set([`string`,`number`,`symbol`]);function V(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function te(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function H(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 U(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ne(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var re={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ie={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ae(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`);let i={};return j(i,e,oe(e,t)),te(e,N(n,{shape:i,checks:[]}))}function oe(e,t){let n=O(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function W(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`);let i=new Set(oe(e,t)),a={};return j(a,e,Reflect.ownKeys(O(e)).filter(e=>!i.has(e))),te(e,N(n,{shape:a,checks:[]}))}function se(e,t){if(!ee(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=O(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return te(e,N(e._zod.def,{shape:ce(e,t)}))}function ce(e,t){let n={};return j(n,e,Reflect.ownKeys(O(e))),M(n,t),n}function le(e,t){if(!ee(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return te(e,N(e._zod.def,{shape:ce(e,t)}))}function ue(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return j(n,e,Reflect.ownKeys(O(e))),j(n,t,Reflect.ownKeys(O(t))),te(e,N(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function de(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(oe(t,n)):void 0,o={};return j(o,t,Reflect.ownKeys(O(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),te(t,N(t._zod.def,{shape:o,checks:[]}))}function fe(e,t,n){let r=n?new Set(oe(t,n)):void 0,i={};return j(i,t,Reflect.ownKeys(O(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),te(t,N(t._zod.def,{shape:i}))}function pe(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 me(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 he(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ge(e){return typeof e==`string`?e:e?.message}function _e(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function ve(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ye(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:ge(e.inst?._zod.def?.error?.(e))??ge(a?.(e))??ge(t?.error?.(e))??ge(n.customError?.(e))??ge(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var be=/[\uD800-\uDBFF]/;function xe(e){let t=e.length;if(!be.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Se(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ce(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function we(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Te(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ke(e,n,r.value)}}function Ee(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function De(e,t,n){return Ee(e,t,n,!1)}function Oe(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ee(this,n,r(this))},set(e){Ee(this,n,e)}})}return t}function ke(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ee(this,t,n.bind(this))},set(e){Ee(this,t,e)}})}function Ae(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var je,Me=!1,Ne={configurable:!0,get(){Me=!0}};function Pe(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&je!==e._zod?je=void 0:(je=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Ne);let e=Me;Me=!1;try{let r=n(this);return Me?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Me||=e,r}catch(n){throw delete this[t],Me||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Fe(e,t,n,r){let i=Ae(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Ie=`~constantCatch`;function Le(e){let t=()=>e;return t[Ie]=!0,t}var Re,ze={value:void 0,enumerable:!1},Be=`captureStackTrace`in Error?Error:null;function Ve(e){let t=Be;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Be=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function G(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){ze.value=new a(r);try{Object.defineProperty(n,"_zod",ze)}finally{ze.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Te(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ve(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var He=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ue=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Re=globalThis).__zod_globalConfig??(Re.__zod_globalConfig={});var We=globalThis.__zod_globalConfig;function Ge(e){return e&&Object.assign(We,e),We}function Ke(){let e=this._zod;return e.message??=JSON.stringify(e.def,b,2),e.message}function qe(e){this._zod.message=e}var Je={get:Ke,set:qe,enumerable:!0,configurable:!0},Ye={value:void 0,enumerable:!1},Xe=new WeakSet([Object.prototype,Error.prototype]),Ze=G(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Ye.value=t,Object.defineProperty(e,"issues",Ye),Ye.value=void 0,Object.defineProperty(e,"message",Je);let n=Object.getPrototypeOf(e);Xe.has(n)||(Xe.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Qe(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function $e(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Qe(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function et(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],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function tt(e,t){return{callee:t?.callee??e,Err:t?.Err}}var nt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new He;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ye(e,o,Ge())));throw I(n,a?.callee??t),n}return s.value};return t},rt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ye(e,o,Ge())));throw I(n,a?.callee??t),n}return s.value};return t},it=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 He;return a.issues.length?at(e,a.issues,i):{success:!0,data:a.value}};function at(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>ye(e,n,Ge()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var ot=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?at(e,a.issues,i):{success:!0,data:a.value}},st=Symbol.for(`zod.compile.invalid`),ct=Symbol.for(`zod.compile.fallback`),lt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==st)return!0;if(r.definite===!0&&n===void 0)return!1}return ut(e,t,n)});function ut(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[ct]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new He;return a.issues.length===0}var dt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ft=e=>{let t=nt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,tt(n,a))};return n},pt=e=>{let t=nt(e),n=(e,r,i,a)=>t(e,r,i,tt(n,a));return n},mt=e=>{let t=rt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,tt(n,a))};return n},ht=e=>{let t=rt(e),n=async(e,r,i,a)=>await t(e,r,i,tt(n,a));return n},gt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return it(e)(t,n,i)},_t=e=>(t,n,r)=>it(e)(t,n,r),vt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ot(e)(t,n,i)},yt=e=>async(t,n,r)=>ot(e)(t,n,r),bt=/^[cC][0-9a-z]{6,}$/,xt=/^[0-9a-z]+$/,St=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ct=/^[0-9a-vA-V]{20}$/,wt=/^[A-Za-z0-9]{27}$/,Tt=/^[a-zA-Z0-9_-]{21}$/;function Et(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Dt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ot=/^([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})$/,kt=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)$/,At=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,jt=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Mt(){return new RegExp(jt,`u`)}var Nt=/^(?:(?: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])$/,Pt=/^(([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}|:))$/,Ft=/^((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])$/,It=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,zt=/^https?$/,Bt=/^\+[1-9]\d{6,14}$/,Vt=`(?:(?:\\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])))`;function Ht(e){return RegExp(`^${e}$`)}var Ut=Ht(Vt);function Wt(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Gt(e){return RegExp(`^${Wt(e)}$`)}function Kt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Wt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Wt({precision:e.precision})}`:n;return RegExp(`^${Vt}T(?:${r})$`)}var qt=/^[\s\S]{0,}$/,Jt=/^-?\d+$/,Yt=/^-?\d+(?:\.\d+)?$/,Xt=/^(?:true|false)$/i,Zt=/^[^A-Z]*$/,Qt=/^[^a-z]*$/,$t=G(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),en=e=>{let t=e.value;return!C(t)&&t.length!==void 0},tn={number:`number`,bigint:`bigint`,object:`date`},nn=G(`$ZodCheckLessThan`,(e,t)=>{$t.init(e,t);let n=tn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:tn[typeof r.value]??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})}}),rn=G(`$ZodCheckGreaterThan`,(e,t)=>{$t.init(e,t);let n=tn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:tn[typeof r.value]??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})}}),an=G(`$ZodCheckMultipleOf`,(e,t)=>{$t.init(e,t),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`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):T(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})}}),on=G(`$ZodCheckNumberFormat`,(e,t)=>{$t.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=re[t.format];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})}}),sn=G(`$ZodCheckMaxLength`,(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=en),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?xe(r):i)<=t.maximum)return;let a=Se(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cn=G(`$ZodCheckMinLength`,(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=en),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?xe(r):i)>=t.minimum)return;let a=Se(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ln=G(`$ZodCheckLengthEquals`,(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=en),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?xe(r):i;if(a===t.length)return;let o=Se(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),un=G(`$ZodCheckStringFormat`,(e,t)=>{var n,r;$t.init(e,t),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=()=>{})}),dn=G(`$ZodCheckRegex`,(e,t)=>{un.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})}}),fn=G(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Zt,un.init(e,t)}),pn=G(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Qt,un.init(e,t)}),mn=G(`$ZodCheckIncludes`,(e,t)=>{$t.init(e,t);let n=V(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),hn=G(`$ZodCheckStartsWith`,(e,t)=>{$t.init(e,t);let n=RegExp(`^${V(t.prefix)}.*`);t.pattern??=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})}}),gn=G(`$ZodCheckEndsWith`,(e,t)=>{$t.init(e,t);let n=RegExp(`.*${V(t.suffix)}$`);t.pattern??=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})}}),_n=G(`$ZodCheckOverwrite`,(e,t)=>{$t.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),vn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
11
|
+
`).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?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
12
|
+
`)}\n};`)(...Object.values(this.closed))}},yn={major:4,minor:6,patch:7},bn=G(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=pe(t),a;for(let o of n){if(o._zod.def.when){if(me(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new He;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(ve(t.issues,n,e),i||=pe(t,n))});else{if(t.issues.length===n)continue;ve(t.issues,n,e),i||=pe(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(pe(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new He;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new He;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return De(this,`~standard`,Cn(this))},set"~standard"(e){Ee(this,`~standard`,e)}}),xn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ye(e,t,Ge()))}:{value:e.value};async function Sn(e,t){let n={async:!0};return xn(await e._zod.run({value:t,issues:[]},n),n)}function Cn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return xn(r,n)}catch{}return Sn(e,t)},vendor:`zod`,version:1}}var wn=G(`$ZodString`,(e,t)=>{bn.init(e,t),e._zod.pattern=t.pattern??qt,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}}),Tn=G(`$ZodStringFormat`,(e,t)=>{un.init(e,t),wn.init(e,t)}),En=G(`$ZodGUID`,(e,t)=>{t.pattern??=Ot,Tn.init(e,t)}),Dn=G(`$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??=kt(e)}else t.pattern??=kt();Tn.init(e,t)}),On=G(`$ZodEmail`,(e,t)=>{t.pattern??=At,Tn.init(e,t)});function kn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function An(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?kn(e)||2:jn(e,t)}function jn(e,t){if(!t.normalize&&t.protocol?.source===zt.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Mn=/[\t\n\r]/g;function Nn(e){return e.replace(Mn,``)}function Pn(e,t){return t.lastIndex=0,t.test(e.hostname)}function Fn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var In=G(`$ZodURL`,(e,t)=>{Tn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=An(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Nn(r);return}t.hostname&&!Pn(i,t.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&&!Fn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Nn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ln=G(`$ZodEmoji`,(e,t)=>{t.pattern??=Mt(),Tn.init(e,t)}),Rn=G(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Tt:Et(t.length),Tn.init(e,t)}),zn=G(`$ZodCUID`,(e,t)=>{t.pattern??=bt,Tn.init(e,t)}),Bn=G(`$ZodCUID2`,(e,t)=>{t.pattern??=xt,Tn.init(e,t)}),Vn=G(`$ZodULID`,(e,t)=>{t.pattern??=St,Tn.init(e,t)}),Hn=G(`$ZodXID`,(e,t)=>{t.pattern??=Ct,Tn.init(e,t)}),Un=G(`$ZodKSUID`,(e,t)=>{t.pattern??=wt,Tn.init(e,t)}),Wn=G(`$ZodISODateTime`,(e,t)=>{t.pattern??=Kt(t),Tn.init(e,t)}),Gn=G(`$ZodISODate`,(e,t)=>{t.pattern??=Ut,Tn.init(e,t)}),Kn=G(`$ZodISOTime`,(e,t)=>{t.pattern??=Gt(t),Tn.init(e,t)}),qn=G(`$ZodISODuration`,(e,t)=>{t.pattern??=Dt,Tn.init(e,t)}),Jn=G(`$ZodIPv4`,(e,t)=>{t.pattern??=Nt,Tn.init(e,t)}),Yn=/^[0-9a-fA-F:.]+$/;function Xn(e){return Yn.test(e)?kn(`http://[${e}]`):!1}var Zn=G(`$ZodIPv6`,(e,t)=>{t.pattern??=Pt,Tn.init(e,t),e._zod.check=n=>{Xn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Qn=G(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ft,Tn.init(e,t)});function $n(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Xn(n)}var er=G(`$ZodCIDRv6`,(e,t)=>{t.pattern??=It,Tn.init(e,t),e._zod.check=n=>{$n(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function tr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var nr=/^[0-9a-zA-Z+/]*={0,2}$/,rr=G(`$ZodBase64`,(e,t)=>{t.pattern??=nr,Tn.init(e,t),e._zod.check=n=>{tr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),ir=/^[A-Za-z0-9_-]*$/;function ar(e){if(!ir.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return tr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var or=G(`$ZodBase64URL`,(e,t)=>{t.pattern??=ir,Tn.init(e,t),e._zod.check=n=>{ar(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),sr=G(`$ZodE164`,(e,t)=>{t.pattern??=Bt,Tn.init(e,t)});function cr(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 lr=G(`$ZodJWT`,(e,t)=>{Tn.init(e,t),e._zod.check=n=>{cr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ur=G(`$ZodNumber`,(e,t)=>{bn.init(e,t),e._zod.pattern=Yt,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:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),dr=G(`$ZodNumberFormat`,(e,t)=>{on.init(e,t),ur.init(e,t)}),fr=G(`$ZodBoolean`,(e,t)=>{bn.init(e,t),e._zod.pattern=Xt,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}}),pr=G(`$ZodUnknown`,(e,t)=>{bn.init(e,t),e._zod.parse=e=>e}),mr=G(`$ZodNever`,(e,t)=>{bn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function hr(e,t){let n=_e(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of _e(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,ve(n.issues,t,e),n}}return i(n,a)}}var gr=e=>Array.isArray(e)?e.length:-1;function _r(e,t,n){e.issues.length&&t.issues.push(...he(n,e.issues)),t.value[n]=e.value}var vr=G(`$ZodArray`,(e,t)=>{bn.init(e,t);let n=We.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>_r(t,r,e)));else if(_r(c,r,e),s&&c.issues.length!==0&&pe(c))break}return o.length?Promise.all(o).then(()=>r):r},hr(e,gr)});function yr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...he(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var br=[];function xr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:br,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ne(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Sr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(pe(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>yr(e,n,i,t,d,f))):yr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Cr=G(`$ZodObject`,(e,t)=>{bn.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=S(()=>xr(t));Pe(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||E(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=L,o=t.catchall,s,c=We.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(pe(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>yr(n,t,e,r,a,o))):yr(s,t,e,r,a,o)}return o?Sr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),wr=G(`$ZodObjectJIT`,(e,t)=>{Cr.init(e,t);let n=e._zod.parse,r=S(()=>xr(t)),i=We.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new vn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
13
|
+
let ${e}_ab = false;
|
|
14
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
15
|
+
const iss = ${e}.issues[i];
|
|
16
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
17
|
+
payload.issues.push(iss);
|
|
18
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
19
|
+
}
|
|
20
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
21
|
+
payload.value = newResult;
|
|
22
|
+
return payload;
|
|
23
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:P(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
24
|
+
const ${n}_present = ${i};
|
|
25
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
26
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (${e}) {
|
|
30
|
+
newResult[${r}] = ${n}.value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
`)}else f?(o.write(`
|
|
35
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
36
|
+
}
|
|
37
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
38
|
+
if (${n}.value !== undefined || ${i}) {
|
|
39
|
+
newResult[${r}] = ${n}.value;
|
|
40
|
+
}
|
|
41
|
+
`)):o.write(`
|
|
42
|
+
const ${n}_present = ${i};
|
|
43
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
44
|
+
}
|
|
45
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
46
|
+
payload.issues.push({
|
|
47
|
+
code: "invalid_type",
|
|
48
|
+
expected: "nonoptional",
|
|
49
|
+
input: undefined,
|
|
50
|
+
path: [${r}]
|
|
51
|
+
});
|
|
52
|
+
if (ctx && ctx.abortEarly) {
|
|
53
|
+
payload.value = newResult;
|
|
54
|
+
return payload;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (${n}_present) {
|
|
59
|
+
newResult[${r}] = ${n}.value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=L,c=!We.jitless,l=c&&R.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Sr([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Tr(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=>!pe(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=>ye(e,r,Ge())))}),t)}var Er=G(`$ZodUnion`,(e,t)=>{bn.init(e,t),Pe(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Pe(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Pe(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Pe(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>w(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=>Tr(t,r,e,i)):Tr(o,r,e,i)}});function Dr(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Or=G(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Er.init(e,t);let n=e._zod.parse;Pe(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||E(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=D(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=S(()=>Dr(t));e._zod.parse=(i,a)=>{let o=i.value;if(!L(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._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()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),kr=G(`$ZodIntersection`,(e,t)=>{bn.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])=>jr(e,t,n)):jr(e,i,a)}});function Ar(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ee(e)&&ee(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Ar(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=Ar(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 jr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Ar(t.value,n.value);if(!c.valid){if(pe(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Mr=G(`$ZodRecord`,(e,t)=>{bn.init(e,t);let n=We.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!ee(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ye(e,i,Ge())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...he(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...he(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Yt.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>ye(e,i,Ge())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...he(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...he(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Nr=G(`$ZodEnum`,(e,t)=>{bn.init(e,t);let n=v(t.entries),r=new Set(n);e._zod.values=r,Pe(e,`pattern`,e=>{let t=v(e.def.entries).filter(e=>B.has(typeof e));return RegExp(t.length?`^(${t.map(e=>V(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),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}}),Pr=G(`$ZodLiteral`,(e,t)=>{bn.init(e,t);let n=new Set(t.values);e._zod.values=n,Pe(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?V(e):e?V(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),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}}),Fr=G(`$ZodTransform`,(e,t)=>{bn.init(e,t),e._zod.optin=`optional`,We.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ue(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));if(i instanceof Promise)throw new He;return n.value=i,n}});function Ir(e,t){return e.value=t.issues.length?void 0:t.value,e}var Lr=G(`$ZodOptional`,(e,t)=>{bn.init(e,t),Pe(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Pe(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Pe(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${w(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ir(e,t)):Ir(e,r)}return t.innerType._zod.run(e,n)}}),Rr=G(`$ZodExactOptional`,(e,t)=>{Lr.init(e,t),Pe(e,`values`,e=>e.def.innerType._zod.values),Pe(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),zr=G(`$ZodNullable`,(e,t)=>{bn.init(e,t),Pe(e,`optin`,e=>e.def.innerType._zod.optin),Pe(e,`optout`,e=>e.def.innerType._zod.optout),Pe(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${w(t.source)}|null)$`):void 0}),Pe(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Br=G(`$ZodDefault`,(e,t)=>{bn.init(e,t),e._zod.optin=`defaulted`,Pe(e,`values`,e=>e.def.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=>Vr(e,t)):Vr(r,t)}});function Vr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Hr=G(`$ZodPrefault`,(e,t)=>{bn.init(e,t),e._zod.optin=`defaulted`,Pe(e,`values`,e=>e.def.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))}),Ur=G(`$ZodNonOptional`,(e,t)=>{bn.init(e,t),Pe(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].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=>Wr(t,e)):Wr(i,e)}});function Wr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Gr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ye(e,r,Ge()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Kr=G(`$ZodCatch`,(e,t)=>{bn.init(e,t),Pe(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Pe(e,`optout`,e=>e.def.innerType._zod.optout),Pe(e,`values`,e=>e.def.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({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Gr(e,r,t,n)):Gr(e,r,t,n)}}),qr=G(`$ZodPipe`,(e,t)=>{bn.init(e,t),Pe(e,`values`,e=>e.def.in._zod.values),Pe(e,`optin`,e=>e.def.in._zod.optin),Pe(e,`optout`,e=>e.def.out._zod.optout),Pe(e,`propValues`,e=>e.def.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=>Jr(e,t.in,n)):Jr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Jr(e,t.out,n)):Jr(r,t.out,n)}});function Jr(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Yr=G(`$ZodPreprocess`,(e,t)=>{qr.init(e,t)}),Xr=G(`$ZodReadonly`,(e,t)=>{bn.init(e,t),Pe(e,`propValues`,e=>e.def.innerType._zod.propValues),Pe(e,`values`,e=>e.def.innerType._zod.values),Pe(e,`optin`,e=>e.def.innerType?._zod?.optin),Pe(e,`optout`,e=>e.def.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(Zr):Zr(r)}});function Zr(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Qr=G(`$ZodCustom`,(e,t)=>{$t.init(e,t),bn.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=>$r(t,n,r,e));$r(i,n,r,e)}});function $r(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(we(e))}}var ei=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},ti=`~memo`,ni=[];function ri(e){return typeof e==`object`&&!!e}function ii(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var ai=new WeakMap,oi=0,si=1,ci=2;function li(e,t,n){let r=ai.get(e);if(r!==void 0)return r?ci:oi;if(t.has(e))return ci;t.add(e);let i=oi,a=e=>{if(i!==ci&&e?._zod){let r=li(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=oi;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?si:o.value?._zod?li(o.value,t,n):oi;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=D(c);s(e?o(e,!0):si),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?li(r,t,!1):si);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),ui(e,i)}function ui(e,t){return t!==si&&ai.set(e,t===ci),t}function di(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var fi,pi=[],mi={alloc(e,t,n){let r=fi;if(!r)return n;fi=void 0;let i={value:n,issues:null};return r.set(t.value,i),pi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&gi(n,e.value))throw new ei;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=li(e,new Set,!1);if(i===oi)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===ci||r?n=!0:r=!0}let l=s.value;if(!ri(l))return t(s,c);let u=c[ti];u||(u={buckets:new WeakMap,backEdges:void 0},c[ti]=u);let d;i===c?d=a:(d=di(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...ii(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;fi=d;let p=pi.length,m=t(s,c);fi=void 0;let h=pi.length>p?pi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ii(e.issues):ni),e)):(h&&(h.issues=m.issues.length?ii(m.issues):ni),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function hi(){return mi}function gi(e,t){let n=e[ti]?.backEdges;return n!==void 0&&ri(t)&&n.has(t)}var _i=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ce(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${U(e.values[0])}`:`Invalid option: expected one of ${y(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${y(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function vi(){return{localeError:_i()}}var yi,bi=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 xi(){return new bi}(yi=globalThis).__zod_globalRegistry??(yi.__zod_globalRegistry=xi());var Si=globalThis.__zod_globalRegistry;function Ci(e){return e.checks&&=[...e.checks],e}function wi(e,t){return new e(Ci({type:`string`,...H(t)}))}function Ti(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...H(t)})}function Ei(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...H(t)})}function Di(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...H(t)})}function Oi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...H(t)})}function ki(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...H(t)})}function Ai(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...H(t)})}function ji(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...H(t)})}function Mi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...H(t)})}function Ni(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...H(t)})}function Pi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...H(t)})}function Fi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...H(t)})}function Ii(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...H(t)})}function Li(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...H(t)})}function Ri(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...H(t)})}function zi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...H(t)})}function Bi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...H(t)})}function Vi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...H(t)})}function Hi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...H(t)})}function Ui(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...H(t)})}function Wi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...H(t)})}function Gi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...H(t)})}function Ki(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...H(t)})}function qi(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...H(t)})}function Ji(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...H(t)})}function Yi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...H(t)})}function Xi(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...H(t)})}function Zi(e,t){return new e(Ci({type:`number`,checks:[],...H(t)}))}function Qi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...H(t)})}function $i(e,t){return new e({type:`boolean`,...H(t)})}function ea(e){return new e({type:`unknown`})}function ta(e,t){return new e({type:`never`,...H(t)})}function na(e,t){return new nn({check:`less_than`,...H(t),value:e,inclusive:!1})}function ra(e,t){return new nn({check:`less_than`,...H(t),value:e,inclusive:!0})}function ia(e,t){return new rn({check:`greater_than`,...H(t),value:e,inclusive:!1})}function aa(e,t){return new rn({check:`greater_than`,...H(t),value:e,inclusive:!0})}function oa(e,t){return new an({check:`multiple_of`,...H(t),value:e})}function sa(e,t){return new sn({check:`max_length`,...H(t),maximum:e})}function ca(e,t){return new cn({check:`min_length`,...H(t),minimum:e})}function la(e,t){return new ln({check:`length_equals`,...H(t),length:e})}function ua(e,t){return new dn({check:`string_format`,format:`regex`,...H(t),pattern:e})}function da(e){return new fn({check:`string_format`,format:`lowercase`,...H(e)})}function fa(e){return new pn({check:`string_format`,format:`uppercase`,...H(e)})}function pa(e,t){return new mn({check:`string_format`,format:`includes`,...H(t),includes:e})}function ma(e,t){return new hn({check:`string_format`,format:`starts_with`,...H(t),prefix:e})}function ha(e,t){return new gn({check:`string_format`,format:`ends_with`,...H(t),suffix:e})}function ga(e){return new _n({check:`overwrite`,tx:e})}function _a(e){return ga(t=>t.normalize(e))}function va(){return ga(e=>e.trim())}function ya(){return ga(e=>e.toLowerCase())}function ba(){return ga(e=>e.toUpperCase())}function xa(){return ga(e=>F(e))}function Sa(e,t,n){return new e({type:`array`,element:t,...H(n)})}function Ca(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...H(n)})}function wa(e,t){let n=Ta(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(we(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(we(r))}},e(t.value,t)),t);return n}function Ta(e,t){let n=new $t({check:`custom`,...H(t)});return n._zod.check=e,n}function Ea(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&E(e,t,n[t]);return e}function Da(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??Si,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Oa(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function ka(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),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;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,ka(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ea(o.schema,c),t.io===`input`&&za(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 Aa(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ja(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;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}/${Aa(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Aa(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>
|
|
63
|
+
|
|
64
|
+
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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ma(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ma(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Na=new Set([`type`,`properties`,`required`,`additionalProperties`]),Pa=[`oneOf`,`anyOf`];function Fa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ia(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Na.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Fa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}E(n,r,e.length===1?e[0]:Ia(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Fa(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function La(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Na)if(t in e)return;let n=t.filter(e=>Pa.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ia(t);else{let e=n[0],i=Pa.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ia([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ea(e,r))}function Ra(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)):Ea(i,s),Ea(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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ma(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])La(e)}}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)}Ea(i,n.defId?n.schema: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??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,E(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),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:Va(t,`input`,e.processors),output:Va(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function za(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 za(r.element,n);if(r.type===`set`)return za(r.valueType,n);if(r.type===`lazy`)return za(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`||r.type===`catch`)return za(r.innerType,n);if(r.type===`intersection`)return za(r.left,n)||za(r.right,n);if(r.type===`record`||r.type===`map`)return za(r.keyType,n)||za(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:za(r.in,n)||za(r.out,n);if(r.type===`object`){for(let e in r.shape)if(za(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(za(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(za(e,n))return!0;return!!(r.rest&&za(r.rest,n))}return!1}var Ba=(e,t={})=>n=>{let r=Da({...n,processors:t});return ka(e,r),ja(r,e),Ra(r,e)},Va=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Da({...i??{},target:a,io:t,processors:n});return ka(e,o),ja(o,e),Ra(o,e)},Ha=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ua=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Wa=(e,t)=>{Ha(e,`minimum`,t),Ua(e,`maximum`,t)},Ga=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ka=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},qa=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Ja=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Ya=(e,t)=>Ha(e,`minimum`,t.minimum),Xa=(e,t)=>Ua(e,`maximum`,t.maximum),Za=e=>(t,n)=>{Ja(t,n.format);let[r,i]=e[n.format];Ha(t,`minimum`,r),Ua(t,`maximum`,i)},Qa={greater_than:(e,t)=>Ha(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ua(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ga(e,t.value),number_format:Za(re),bigint_format:Za(ie),min_length:Ya,max_length:Xa,length_equals:(e,t)=>Wa(e,t.length),min_size:Ya,max_size:Xa,size_equals:(e,t)=>Wa(e,t.size),string_format:(e,t)=>{Ja(e,t.format),t.pattern&&Ka(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>qa(e,t.mime)};function $a(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Qa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Ha(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Ha(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ua(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ua(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ga(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&qa(t,i.mime);for(let e of i.patterns??[])Ka(t,e);return t}var eo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},to=new Map([[nr,Lt],[ir,Rt]]),no=e=>to.get(e)??e,ro=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=$a(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=eo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(no);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}))])}},io=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=$a(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Oa(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},ao=(e,t,n,r)=>{n.type=`boolean`},oo=(e,t,n,r)=>{n.not={}},so=(e,t,n,r)=>{let i=e._zod.def,a=v(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},co=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Oa(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Oa(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);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}},lo=(e,t,n,r)=>{Oa(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},uo=(e,t,n,r)=>{Oa(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},fo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=$a(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ka(a.element,t,{...r,path:[...r.path,`items`]})};function po(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?po(t.out):t.type===`catch`?po(t.innerType):e._zod.optin}var mo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Oa(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)E(i.properties,e,ka(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?po(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ka(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ho=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ka(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},go=(e,t,n,r)=>{let i=e._zod.def,a=ka(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ka(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function _o(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=_o(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>_o(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Yt:Jt).source)),p}var vo=new WeakMap;function yo(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of vo.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=_o(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var bo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=$a(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=ka(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)E(i.patternProperties,no(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=ka(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=vo.get(t);n||(n=[],vo.set(t,n),t.deferred.push(()=>yo(t))),n.push(e)}i.additionalProperties=ka(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&po(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},xo=(e,t,n,r)=>{let i=e._zod.def,a=ka(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`}]},So=(e,t,n,r)=>{let i=e._zod.def;ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Co=Symbol();function wo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Oa(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Co):JSON.parse(o)}var To=(e,t,n,r)=>{let i=e._zod.def;ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=wo(i.defaultValue,e,t,n,r);o!==Co&&(n.default=o)},Eo=(e,t,n,r)=>{let i=e._zod.def;ka(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=wo(i.defaultValue,e,t,n,r);o!==Co&&(n._prefault=o)},Do=(e,t,n,r)=>{let i=e._zod.def;ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Oa(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Oo=(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;ka(o,t,r);let s=t.seen.get(e);s.ref=o},ko=(e,t,n,r)=>{let i=e._zod.def;ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ao=(e,t,n,r)=>{let i=e._zod.def;ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},jo=new WeakSet([Object.prototype,Error.prototype]);function Mo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var No=G(`ZodError`,(e,t)=>{Ze.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);jo.has(n)||(jo.add(n),Mo(n,`format`,e=>t=>et(e,t)),Mo(n,`flatten`,e=>t=>$e(e,t)),Mo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,b,2)}),Mo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,b,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Po=nt(No),Fo=rt(No),Io=it(No),Lo=ot(No),Ro=ft(No),zo=pt(No),Bo=mt(No),Vo=ht(No),Ho=gt(No),Uo=_t(No),Wo=vt(No),Go=yt(No);function Ko(){We.localeError||Ge(vi())}function qo(){We.memoizer||Ge({memoizer:hi()})}var Jo=G(`ZodType`,(e,t)=>(Ko(),bn.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(N(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 te(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(gc(e,t))},superRefine(e,t){return this.check(_c(e,t))},overwrite(e){return this.check(ga(e))},optional(){return Zs(this)},exactOptional(){return $s(this)},nullable(){return tc(this)},nullish(){return Zs(tc(this))},nonoptional(e){return sc(this,e)},array(){return Ps(this)},or(e){return Ls([this,e])},and(e){return Vs(this,e)},transform(e){return dc(this,Ys(e))},default(e){return rc(this,e)},prefault(e){return ac(this,e)},catch(e){return lc(this,e)},pipe(e){return dc(this,e)},readonly(){return mc(this)},describe(e){let t=this.clone();return Si.add(t,{description:e}),t},meta(...e){if(e.length===0)return Si.get(this);let t=this.clone();return Si.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return De(this,`~standard`,{...Cn(this),jsonSchema:{input:Va(this,`input`),output:Va(this,`output`)}})},set"~standard"(e){Ee(this,`~standard`,e)},parse:function e(t,n){return Po(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Fo(this,t,n,{callee:e})},safeParse(e,t){return Io(this,e,t)},async safeParseAsync(e,t){return Lo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ee(this,`spa`,e)},validate(e,t){return lt(this,e,t)},validateAsync(e,t){return dt(this,e,t)},encode:function e(t,n){return Ro(this,t,n,{callee:e})},decode:function e(t,n){return zo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Bo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Vo(this,t,n,{callee:e})},safeEncode(e,t){return Ho(this,e,t)},safeDecode(e,t){return Uo(this,e,t)},async safeEncodeAsync(e,t){return Wo(this,e,t)},async safeDecodeAsync(e,t){return Go(this,e,t)},toJSONSchema(e){return Ba(this,{})(e)},get description(){return Si.get(this)?.description},get _def(){return this._zod.def}}),Yo=G(`_ZodString`,(e,t)=>{wn.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r)},Oe({format:e=>$a(e).format??null,minLength:e=>$a(e).minimum??null,maxLength:e=>$a(e).maximum??null},{regex(...e){return this.check(ua(...e))},includes(...e){return this.check(pa(...e))},startsWith(...e){return this.check(ma(...e))},endsWith(...e){return this.check(ha(...e))},min(...e){return this.check(ca(...e))},max(...e){return this.check(sa(...e))},length(...e){return this.check(la(...e))},nonempty(...e){return this.check(ca(1,...e))},lowercase(e){return this.check(da(e))},uppercase(e){return this.check(fa(e))},trim(){return this.check(va())},normalize(...e){return this.check(_a(...e))},toLowerCase(){return this.check(ya())},toUpperCase(){return this.check(ba())},slugify(){return this.check(xa())}})),Xo=G(`ZodString`,(e,t)=>{wn.init(e,t),Yo.init(e,t)},{email(e){return this.check(Ti(ns,e))},url(e){return this.check(ji(os,e))},jwt(e){return this.check(Ki(Ss,e))},emoji(e){return this.check(Mi(cs,e))},guid(e){return this.check(Ei(rs,e))},uuid(e){return this.check(Di(is,e))},uuidv4(e){return this.check(Oi(is,e))},uuidv6(e){return this.check(ki(is,e))},uuidv7(e){return this.check(Ai(is,e))},nanoid(e){return this.check(Ni(ls,e))},cuid(e){return this.check(Pi(us,e))},cuid2(e){return this.check(Fi(ds,e))},ulid(e){return this.check(Ii(fs,e))},base64(e){return this.check(Ui(ys,e))},base64url(e){return this.check(Wi(bs,e))},xid(e){return this.check(Li(ps,e))},ksuid(e){return this.check(Ri(ms,e))},ipv4(e){return this.check(zi(hs,e))},ipv6(e){return this.check(Bi(gs,e))},cidrv4(e){return this.check(Vi(_s,e))},cidrv6(e){return this.check(Hi(vs,e))},e164(e){return this.check(Gi(xs,e))},datetime(e){return this.check(qi(Qo,e))},date(e){return this.check(Ji($o,e))},time(e){return this.check(Yi(es,e))},duration(e){return this.check(Xi(ts,e))}});function K(e){return wi(Xo,e)}var Zo=G(`ZodStringFormat`,(e,t)=>{Tn.init(e,t),Yo.init(e,t)}),Qo=G(`ZodISODateTime`,(e,t)=>{Wn.init(e,t),Zo.init(e,t)}),$o=G(`ZodISODate`,(e,t)=>{Gn.init(e,t),Zo.init(e,t)}),es=G(`ZodISOTime`,(e,t)=>{Kn.init(e,t),Zo.init(e,t)}),ts=G(`ZodISODuration`,(e,t)=>{qn.init(e,t),Zo.init(e,t)}),ns=G(`ZodEmail`,(e,t)=>{On.init(e,t),Zo.init(e,t)}),rs=G(`ZodGUID`,(e,t)=>{En.init(e,t),Zo.init(e,t)}),is=G(`ZodUUID`,(e,t)=>{Dn.init(e,t),Zo.init(e,t)});function as(e){return Di(is,e)}var os=G(`ZodURL`,(e,t)=>{In.init(e,t),Zo.init(e,t)});function ss(e){return ji(os,e)}var cs=G(`ZodEmoji`,(e,t)=>{Ln.init(e,t),Zo.init(e,t)}),ls=G(`ZodNanoID`,(e,t)=>{Rn.init(e,t),Zo.init(e,t)}),us=G(`ZodCUID`,(e,t)=>{zn.init(e,t),Zo.init(e,t)}),ds=G(`ZodCUID2`,(e,t)=>{Bn.init(e,t),Zo.init(e,t)}),fs=G(`ZodULID`,(e,t)=>{Vn.init(e,t),Zo.init(e,t)}),ps=G(`ZodXID`,(e,t)=>{Hn.init(e,t),Zo.init(e,t)}),ms=G(`ZodKSUID`,(e,t)=>{Un.init(e,t),Zo.init(e,t)}),hs=G(`ZodIPv4`,(e,t)=>{Jn.init(e,t),Zo.init(e,t)}),gs=G(`ZodIPv6`,(e,t)=>{Zn.init(e,t),Zo.init(e,t)}),_s=G(`ZodCIDRv4`,(e,t)=>{Qn.init(e,t),Zo.init(e,t)}),vs=G(`ZodCIDRv6`,(e,t)=>{er.init(e,t),Zo.init(e,t)}),ys=G(`ZodBase64`,(e,t)=>{rr.init(e,t),Zo.init(e,t)}),bs=G(`ZodBase64URL`,(e,t)=>{or.init(e,t),Zo.init(e,t)}),xs=G(`ZodE164`,(e,t)=>{sr.init(e,t),Zo.init(e,t)}),Ss=G(`ZodJWT`,(e,t)=>{lr.init(e,t),Zo.init(e,t)}),Cs=G(`ZodNumber`,(e,t)=>{ur.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e.isFinite=!0},Oe({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=$a(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=$a(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=$a(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>$a(e).format??null},{gt(e,t){return this.check(ia(e,t))},gte(e,t){return this.check(aa(e,t))},min(e,t){return this.check(aa(e,t))},lt(e,t){return this.check(na(e,t))},lte(e,t){return this.check(ra(e,t))},max(e,t){return this.check(ra(e,t))},int(e){return this.check(Es(e))},safe(e){return this.check(Es(e))},positive(e){return this.check(ia(0,e))},nonnegative(e){return this.check(aa(0,e))},negative(e){return this.check(na(0,e))},nonpositive(e){return this.check(ra(0,e))},multipleOf(e,t){return this.check(oa(e,t))},step(e,t){return this.check(oa(e,t))},finite(){return this}}));function ws(e){return Zi(Cs,e)}var Ts=G(`ZodNumberFormat`,(e,t)=>{dr.init(e,t),Cs.init(e,t)});function Es(e){return Qi(Ts,e)}var Ds=G(`ZodBoolean`,(e,t)=>{fr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r)});function Os(e){return $i(Ds,e)}var ks=G(`ZodUnknown`,(e,t)=>{pr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function As(){return ea(ks)}var js=G(`ZodNever`,(e,t)=>{mr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r)});function Ms(e){return ta(js,e)}var Ns=G(`ZodArray`,(e,t)=>{qo(),vr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ca(e,t))},nonempty(e){return this.check(ca(1,e))},max(e,t){return this.check(sa(e,t))},length(e,t){return this.check(la(e,t))},unwrap(){return this.element}});function Ps(e,t){return Sa(Ns,e,t)}var Fs=G(`ZodObject`,(e,t)=>{qo(),wr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),Fe(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Gs(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(N(this._zod.def,{catchall:e}))},passthrough(){return this.clone(N(this._zod.def,{catchall:As()}))},loose(){return this.clone(N(this._zod.def,{catchall:As()}))},strict(){return this.clone(N(this._zod.def,{catchall:Ms()}))},strip(){return this.clone(N(this._zod.def,{catchall:void 0}))},extend(e){return se(this,e)},safeExtend(e){return le(this,e)},merge(e){return ue(this,e)},pick(e){return ae(this,e)},omit(e){return W(this,e)},partial(...e){return de(Xs,this,e[0])},exactPartial(...e){return de(Qs,this,e[0],`exactPartial`)},required(...e){return fe(oc,this,e[0])}});function q(e,t){return new Fs({type:`object`,shape:e??{},...H(t)})}var Is=G(`ZodUnion`,(e,t)=>{Er.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.options=t.options});function Ls(e,t){return new Is({type:`union`,options:e,...H(t)})}var Rs=G(`ZodDiscriminatedUnion`,(e,t)=>{Is.init(e,t),Or.init(e,t)});function zs(e,t,n){return new Rs({type:`union`,options:t,discriminator:e,...H(n)})}var Bs=G(`ZodIntersection`,(e,t)=>{kr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r)});function Vs(e,t){return new Bs({type:`intersection`,left:e,right:t})}var Hs=G(`ZodRecord`,(e,t)=>{qo(),Mr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Us(e,t,n){return!t||!t._zod?new Hs({type:`record`,keyType:K(),valueType:e,...H(t)}):new Hs({type:`record`,keyType:e,valueType:t,...H(n)})}var Ws=G(`ZodEnum`,(e,t)=>{Nr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 Ws({...t,checks:[],...H(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 Ws({...t,checks:[],...H(r),entries:i})}});function Gs(e,t){return new Ws({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...H(t)})}var Ks=G(`ZodLiteral`,(e,t)=>{Pr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(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 qs(e,t){return new Ks({type:`literal`,values:Array.isArray(e)?e:[e],...H(t)})}var Js=G(`ZodTransform`,(e,t)=>{qo(),Fr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ue(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(we(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(we(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ys(e){return new Js({type:`transform`,transform:e})}var Xs=G(`ZodOptional`,(e,t)=>{Lr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zs(e){return new Xs({type:`optional`,innerType:e})}var Qs=G(`ZodExactOptional`,(e,t)=>{Rr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $s(e){return new Qs({type:`optional`,innerType:e})}var ec=G(`ZodNullable`,(e,t)=>{zr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tc(e){return new ec({type:`nullable`,innerType:e})}var nc=G(`ZodDefault`,(e,t)=>{Br.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function rc(e,t){return new nc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():z(t)}})}var ic=G(`ZodPrefault`,(e,t)=>{Hr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ac(e,t){return new ic({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():z(t)}})}var oc=G(`ZodNonOptional`,(e,t)=>{Ur.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sc(e,t){return new oc({type:`nonoptional`,innerType:e,...H(t)})}var cc=G(`ZodCatch`,(e,t)=>{Kr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lc(e,t){return new cc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Le(t)})}var uc=G(`ZodPipe`,(e,t)=>{qr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.in=t.in,e.out=t.out});function dc(e,t){return new uc({type:`pipe`,in:e,out:t})}var fc=G(`ZodPreprocess`,(e,t)=>{uc.init(e,t),Yr.init(e,t)}),pc=G(`ZodReadonly`,(e,t)=>{Xr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new pc({type:`readonly`,innerType:e})}var hc=G(`ZodCustom`,(e,t)=>{Qr.init(e,t),Jo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r)});function gc(e,t={}){return Ca(hc,e,t)}function _c(e,t){return wa(e,t)}function vc(e,t){return new fc({type:`pipe`,in:Ys(e),out:t})}function yc(e){return qi(Qo,e)}var J=l(d(),1),bc=_(),xc=yc(),Sc=K().regex(/^[0-9a-f]{40}$/),Cc=ss({protocol:/^https?$/}),wc=Gs([`github`,`bitbucket`]),Tc=q({host:wc,owner:K().min(1),repo:K().min(1)}).readonly(),Ec=q({repo:Tc,number:ws().int().positive()}).readonly(),Dc=q({id:K().min(1),name:K()}).readonly(),Oc=q({sha:Sc,message:K(),author:K()}).readonly(),kc=q({ref:Ec,url:Cc,title:K(),description:K(),author:Dc,sourceBranch:K().min(1),targetBranch:K().min(1),baseSha:Sc,headSha:Sc,commits:Ps(Oc).readonly(),diff:K(),createdAt:xc,updatedAt:xc}).readonly(),Ac=q({ref:Ec,url:Cc,title:K(),author:Dc,updatedAt:xc,role:Gs([`reviewer`,`author`])}).readonly(),jc=q({reviews:Ps(q({at:xc,pullRequest:Ec}).readonly()).readonly(),comments:Ps(xc).readonly()}).readonly();K().regex(/^\d{4}-\d{2}-\d{2}$/);var Mc=864e5,Nc=e=>Date.parse(`${e}T00:00:00Z`),Pc=e=>new Date(e).toISOString().slice(0,10),Fc=e=>new Date(Nc(e)).getUTCDay(),Ic=(e,t)=>Pc(Nc(e)+t*Mc),Lc=({repo:e,number:t})=>`${e.host}/${e.owner}/${e.repo}#${t}`,Rc=(e,t)=>{let{today:n,weeks:r,dayOf:i}=t,a=Ic(n,-Fc(n)-7*(Math.max(1,r)-1)),o=new Map;for(let{at:t,pullRequest:n}of e.reviews){let e=i(t),r=o.get(e)??new Set;r.add(Lc(n)),o.set(e,r)}let s=new Map;for(let t of e.comments){let e=i(t);s.set(e,(s.get(e)??0)+1)}let c=[];for(let e=a;e<=n;e=Ic(e,1))c.push({date:e,pullRequests:o.get(e)?.size??0,comments:s.get(e)??0});return c},zc=e=>e<=0?0:e===1?1:e===2?2:e<=4?3:4,Bc=e=>{let t=e.at(-1),n=t===void 0?null:Ic(t.date,-Fc(t.date)),r=null;for(let t of e)t.pullRequests>0&&(r===null||t.pullRequests>=r.pullRequests)&&(r=t);return{pullRequests:e.reduce((e,t)=>e+t.pullRequests,0),comments:e.reduce((e,t)=>e+t.comments,0),daysWithReviews:e.filter(e=>e.pullRequests>0).length,thisWeek:e.filter(e=>n!==null&&e.date>=n).reduce((e,t)=>e+t.pullRequests,0),busiest:r}},Vc=K().regex(/^h_[0-9a-f]{16}(-[2-9]|-[1-9][0-9]+)?$/).brand(),Hc=Ls([Vc,K().regex(/^h_[0-9a-f]{16}(-[2-9]|-[1-9][0-9]+)?\.[1-9][0-9]*$/).brand()]),Uc=Gs([`added`,`deleted`,`modified`,`renamed`]),Wc=ws().int().positive(),Gc=q({kind:Gs([`context`,`add`,`del`]),oldLine:Wc.nullable(),newLine:Wc.nullable(),text:K(),noNewlineAtEnd:Os()}).readonly(),Kc=ws().int().nonnegative(),qc=q({id:Vc,path:K().min(1),oldStart:Kc,oldLines:Kc,newStart:Kc,newLines:Kc,sectionHeading:K().nullable(),lines:Ps(Gc).readonly()}).readonly(),Jc=q({path:K().min(1),oldPath:K().min(1).nullable(),status:Uc,binary:Os(),oldMode:K().nullable(),newMode:K().nullable(),language:K().nullable(),hunks:Ps(qc).readonly(),additions:Kc,deletions:Kc}).readonly(),Yc=Gs([`generated`,`whitespace`,`rename`,`move`,`formatting`]),Xc=q({path:K().min(1),hunkId:Vc.nullable(),kind:Yc,detail:K().min(1)}).readonly(),Zc=q({id:Hc,hunkId:Vc,start:ws().int().nonnegative(),end:ws().int().positive(),definitions:Ps(K()).readonly()}).readonly(),Qc=q({fromPartId:Hc,toPartId:Hc,symbol:K().min(1),line:ws().int().positive(),use:Gs([`call`,`type`,`request`])}).readonly(),$c=q({partId:Hc,path:K().min(1),line:ws().int().positive(),column:ws().int().nonnegative(),length:ws().int().positive(),symbol:K().min(1),toPartIds:Ps(Hc).min(1).readonly()}).readonly(),el=q({path:K().min(1),line:Wc,use:Gs([`call`,`type`]),excerpt:q({start:Wc,lines:Ps(K()).max(5).readonly()}).readonly()}).readonly(),tl=q({partId:Hc,symbol:K().min(1),uses:Ps(el).max(50).readonly(),more:ws().int().nonnegative()}).readonly(),nl=e=>Vc.parse(e.replace(/\.[0-9]+$/,``)),rl=(e,t)=>{let n=e.lines.slice(0,t.start),r=e.lines.slice(t.start,t.end),i=(e,t)=>e.filter(e=>e.kind!==t).length,a=i(r,`add`),o=i(r,`del`),s=(e,t,n,r)=>Math.max(e+ +(t===0)+n-+(r===0),0);return{...e,oldStart:s(e.oldStart,e.oldLines,i(n,`add`),a),oldLines:a,newStart:s(e.newStart,e.newLines,i(n,`del`),o),newLines:o,lines:r}},il=e=>{let t=new Map;for(let n of e)t.set(n.hunkId,[...t.get(n.hunkId)??[],n]);return t},al=(e,t)=>e.hunks.flatMap(e=>{let n=t.get(e.id);return n===void 0?[{id:e.id,hunk:e}]:n.map(t=>({id:t.id,hunk:rl(e,t)}))}),ol=e=>e.slice(e.lastIndexOf(`/`)+1),sl=e=>e.split(`/`).slice(0,-1),cl=new Set([`__tests__`,`test`,`tests`,`spec`]),ll=e=>{let t=ol(e);return/\.(test|spec)\.[^.]+$/i.test(t)||/_(test|spec)\.[^.]+$/i.test(t)||/^test_.*\.py$/i.test(t)||/Tests?\.(java|kt)$/.test(t)||sl(e).some(e=>cl.has(e.toLowerCase()))},ul=`get|post|put|patch|delete|head|options|all`,dl=String.raw`(?:app|router|server|mux|r|e|g|fastify|\w*(?:Router|router|App))`,fl=String.raw`["'\`](\/[^"'\`]*)["'\`]`,pl=[e=>[...e.matchAll(new RegExp(String.raw`@[\w.]+\.(${ul})\(\s*${fl}`,`gi`))].map(([,e=``,t=``])=>({method:e.toUpperCase(),path:t})),e=>{let t=new RegExp(String.raw`@[\w.]+\.route\(\s*${fl}(.*)`).exec(e);if(t===null)return[];let[,n=``,r=``]=t,i=[...(/methods\s*=\s*[[(]([^\])]*)/.exec(r)?.[1]??``).matchAll(/["'](\w+)["']/g)].map(([,e=``])=>e.toUpperCase());return(i.length>0?i:[`GET`]).map(e=>({method:e,path:n}))},e=>[...e.matchAll(new RegExp(String.raw`(?<![\w@.])${dl}\.(${ul})\(\s*${fl}`,`gi`))].map(([,e=``,t=``])=>({method:e.toUpperCase(),path:t})),e=>{let t=new RegExp(String.raw`@(Get|Post|Put|Patch|Delete|Request)Mapping\(\s*(?:(?:value|path)\s*=\s*)?${fl}`).exec(e);if(t===null)return[];let[,n=``,r=``]=t;return[{method:n===`Request`?`ALL`:n.toUpperCase(),path:r}]},e=>{let t=/\bHandle(?:Func)?\(\s*"(?:([A-Z]+) )?(\/[^"]*)"/.exec(e);if(t===null)return[];let[,n=`ALL`,r=``]=t;return[{method:n,path:r}]}],ml=e=>pl.flatMap(t=>t(e));String.raw`(?<![\w])(?:[fFrRuU]{1,2})?(?<quote>["'\`])(?:\$\{[^}]*\})?(?<path>\/[^"'\`]*)\k<quote>`;var hl=q({from:K().min(1),to:K().min(1)}).readonly();new TextEncoder;var gl=e=>({ok:!0,value:e}),_l=e=>({ok:!1,error:e}),vl=(e,t,n)=>e.lines.some(e=>t===`new`?e.kind!==`del`&&e.newLine===n:e.kind!==`add`&&e.oldLine===n);new TextEncoder,new TextDecoder;var yl=q({hunkId:Vc,side:Gs([`new`,`old`]),startLine:ws().int().positive(),line:ws().int().positive()}).readonly().refine(e=>e.startLine<=e.line,{message:`startLine must not come after line`}),bl=K().regex(/^d[1-9][0-9]*$/).brand(),xl=Gs([`api`,`data`,`dependency`,`security`,`error-handling`,`performance`,`concurrency`,`configuration`,`behavior`,`other`]),Sl=q({id:bl,title:K().min(1),category:xl,whyItMatters:K(),hunkIds:Ps(Vc).readonly(),lines:yl.nullable().default(null)}).readonly();q({kind:Gs([`not-found`,`unauthorized`,`forbidden`,`rate-limited`,`too-large`,`rejected`,`network`,`invalid-response`,`unexpected`]),message:K(),retryAfterSeconds:ws().nonnegative().nullable()}).readonly(),q({kind:Gs([`not-configured`,`unauthorized`,`network`,`invalid-response`,`unexpected`]),message:K()}).readonly();var Cl=q({kind:Gs([`refusal`,`max-tokens`,`invalid-output`,`too-large`,`rate-limited`,`overloaded`,`unauthorized`,`network`,`unexpected`]),message:K()}).readonly(),wl=q({title:K().min(1),partIds:Ps(Hc).readonly(),kind:Gs([`flow`,`supporting`]),entries:Ps(Hc).readonly()}).readonly(),Tl=e=>typeof e==`object`&&!!e&&!Array.isArray(e),El=e=>{let t=Tl(e)?e.steps:e;return Array.isArray(t)?t.map(e=>Tl(e)&&typeof e.codeTitle==`string`&&e.codeTitle!==``?{...e,title:e.codeTitle}:e):t},Dl=q({key:K().min(1),url:Cc,summary:K(),description:K(),type:K(),status:K()}).readonly(),Ol=Gs([`description`,`ticket`,`commits`,`branch`]),kl=q({summary:K(),sources:Ps(q({kind:Ol,ref:K().nullable()}).readonly()).readonly()}).readonly(),Al=q({summary:K(),shape:K().default(``),behaviorChanges:Ps(K()).readonly(),watch:Ps(K()).readonly().default([])}).readonly(),jl=Gs([`unrequested`,`missing`,`contradicts`]),Ml=q({kind:jl,description:K(),hunkIds:Ps(Vc).readonly()}).readonly(),Nl=q({stated:kl.nullable(),inferred:Al,mismatches:Ps(Ml).readonly()}).readonly(),Pl=Gs([`claude-code`,`anthropic-api`,`codex`,`opencode`]),Fl={"claude-code":`Claude`,"anthropic-api":null,codex:`ChatGPT`,opencode:null},Il=e=>(e===null?null:Fl[e.provider])??`Claude`,Ll=K().regex(/^[a-z0-9-]+\/[A-Za-z0-9._:/-]+$/),Rl=q({provider:Pl,providerName:K().min(1),model:K().min(1),modelName:K().min(1),family:K().min(1)}).readonly(),zl=q({options:Ps(Rl.unwrap().extend({id:Ll,via:K().min(1),measured:Os(),available:Os(),reason:K().nullable()}).readonly()).readonly(),defaultId:Ll.nullable()}).readonly(),Bl=e=>e?.family??`Claude`,Vl=Gs([`biome`,`eslint`,`typescript`,`ruff`,`golangci-lint`,`rubocop`,`checkstyle`,`pmd`]),Hl=K().regex(/^[A-Za-z0-9@/_.:-]{1,80}$/),Ul=Gs([`lint-rule`,`type-option`,`formatter`,`pattern-rule`,`architecture-rule`,`ci-check`]),Wl=K().regex(/^[A-Za-z0-9 .+#_-]{1,40}$/),Gl=K().transform(e=>e.replace(/\s+/g,` `).trim()).pipe(K().min(1).max(160)),Kl=zs(`is`,[q({is:qs(`rule`),tool:Vl,rule:Hl,configPath:K().min(1)}),q({is:qs(`suggested`),kind:Ul,engine:Wl,does:Gl})]).readonly(),ql=Kl.optional().catch(void 0),Jl=q({tool:Vl.nullable(),path:K(),bytes:ws().int().nonnegative()}).readonly();Vl.options,new TextEncoder;var Yl={biome:`Biome`,eslint:`ESLint`,typescript:`TypeScript`,ruff:`Ruff`,"golangci-lint":`golangci-lint`,rubocop:`RuboCop`,checkstyle:`Checkstyle`,pmd:`PMD`},Xl={"lint-rule":`lint rule`,"type-option":`type-checker option`,formatter:`formatter setting`,"pattern-rule":`pattern rule`,"architecture-rule":`architecture rule`,"ci-check":`CI check`},Zl=Gs([`finding`,`risk`,`decision`]),Ql=K().regex(/^pref_[0-9a-f]{16}$/).brand(),$l=K().regex(/^prop_[0-9a-f]{16}$/).brand(),eu=Gs([`look-for`,`dont-flag`]),tu=zs(`kind`,[q({kind:qs(`global`)}),q({kind:qs(`repo`),repo:Tc})]).readonly(),nu=Gs([`written`,`learned`,`imported`]),ru=K().trim().min(1).max(300),iu=q({id:Ql,kind:eu,text:ru,scope:tu,source:nu,enabled:Os(),createdAt:xc,updatedAt:xc}).readonly(),au=q({id:$l,kind:eu,text:K().trim().min(1),scope:tu,source:Gs([`learned`,`imported`]),evidence:Ps(K()).max(5).readonly(),status:Gs([`pending`,`accepted`,`rejected`]),createdAt:xc}).readonly();q({kind:Gs([`dismissed`,`raised`,`comment`]),at:xc,pullRequest:Ec,pointKind:Zl.nullable(),title:K(),text:K(),path:K().nullable()}).readonly(),K().min(1).brand(),q({pullRequest:Ec,path:K().nullable(),body:K(),at:xc}).readonly();var ou=[`REVIEW.md`,`AGENTS.md`,`CLAUDE.md`,`CONTRIBUTING.md`,`.github/copilot-instructions.md`],su=Gs(ou),cu=32768,lu=q({path:su,bytes:ws().int().nonnegative(),enabled:Os(),tooLarge:Os()}).readonly(),uu=K().regex(/^[pg][1-9][0-9]*$/),du=q({preferences:Ps(q({ref:uu,id:Ql,kind:eu,text:K(),scope:tu}).readonly()).readonly(),guidelines:Ps(q({ref:uu,path:K(),bytes:ws().int().nonnegative()}).readonly()).readonly(),checks:Ps(Jl).readonly().default([])}).readonly(),fu=Gs([`raised`,`left-out`]),pu=q({ref:uu,effect:fu}).readonly(),mu=e=>e.kind===`global`?`global`:`${e.repo.host}/${e.repo.owner}/${e.repo.repo}`,hu=(e,t)=>e.host===t.host&&e.owner===t.owner&&e.repo===t.repo,gu=(e,t)=>mu(e)===mu(t);new TextEncoder;var _u=(e,t)=>{if(e===null||t===null)return null;let n=t.guidelines.find(t=>t.ref===e.ref);if(n!==void 0)return{effect:e.effect,label:n.path,preferenceId:null};let r=t.preferences.find(t=>t.ref===e.ref);if(r===void 0)return null;let i=r.kind===`look-for`?`raised`:`left-out`;return e.effect===i?{effect:i,label:r.text,preferenceId:r.id}:null},vu=K().regex(/^f[1-9][0-9]*$/).brand(),yu=K().regex(/^m[1-9][0-9]*$/).brand(),bu=Gs([`minor`,`major`,`blocking`]),xu=q({id:vu,title:K().min(1),explanation:K(),lines:yl,severity:bu.default(`major`),suggestion:Ps(K()).readonly().nullable().default(null),mismatch:yu.nullable().default(null),guidance:pu.nullable().default(null),guardrail:ql}).readonly(),Su=K().regex(/^([fmd][1-9][0-9]*|r:h_[0-9a-f]{16}(-[2-9]|-[1-9][0-9]+)?)$/).brand();q({id:Su,kind:Zl,title:K().min(1),explanation:K(),path:K().nullable(),lines:yl.nullable(),hunkIds:Ps(Vc).readonly(),severity:bu.nullable(),suggestion:Ps(K()).readonly().nullable(),mismatch:q({kind:jl,description:K()}).readonly().nullable(),checkedBy:q({test:K(),checks:K(),lines:yl,path:K()}).readonly().optional(),guidance:q({effect:fu,label:K(),preferenceId:Ql.nullable()}).readonly().optional(),guardrail:Kl.optional()}).readonly();var Cu=Gs([`open`,`raised`,`dismissed`]),wu=q({pointId:Su,state:Cu,updatedAt:xc}).readonly(),Tu={missing:`Asked for, not done.`,unrequested:`Done, not asked for.`,contradicts:`Contradicts what was asked.`},Eu=e=>{let t=e.lines.flatMap(e=>e.kind===`add`?e.newLine??[]:[]),n=e.lines.flatMap(e=>e.kind===`del`?e.oldLine??[]:[]),[r,i]=t.length>0?[`new`,t]:[`old`,n],a=i[0],o=i.at(-1);return a===void 0||o===void 0?null:{hunkId:e.id,side:r,startLine:a,line:o}},Du=e=>{let t=new Map(e.files.flatMap(e=>e.hunks.map(e=>[e.id,e]))),n=e=>{let n=e.filter(e=>t.has(e)),r=n[0],i=r===void 0?void 0:t.get(r),a=i===void 0?null:Eu(i);return{hunkIds:n,lines:a,path:a===null?null:i?.path??null}},r=t=>{let n=_u(t,e.guidance??null);return n===null?{}:{guidance:n}},i=e.intent?.mismatches??[],a=e=>{let t=e===null?NaN:Number(e.slice(1))-1,n=i[t];return n===void 0?null:{kind:n.kind,description:n.description}},o=new Set,s=e.findings.flatMap(e=>{let n=t.get(e.lines.hunkId);if(n===void 0)return[];let i=a(e.mismatch);return i!==null&&e.mismatch!==null&&o.add(e.mismatch),[{id:Su.parse(e.id),kind:`finding`,title:e.title,explanation:e.explanation,path:n.path,lines:e.lines,hunkIds:[n.id],severity:e.severity,suggestion:e.lines.side===`new`?e.suggestion:null,mismatch:i,...r(e.guidance),...e.guardrail===void 0?{}:{guardrail:e.guardrail}}]}),c={severity:null,suggestion:null,mismatch:null},l=i.flatMap((e,t)=>{let r=`m${t+1}`;return o.has(r)?[]:[{id:Su.parse(r),kind:`finding`,title:e.description,explanation:Tu[e.kind],...n(e.hunkIds),...c}]}),u=e.risk.flatMap(e=>{if(e.source!==`model`||e.riskClass!==`contract`)return[];let i=n([e.hunkId]);if(i.lines===null)return[];let a=e.lines,o=a!==null&&Ou([e.hunkId],a,t),s=e.checkedBy,l=s===void 0?void 0:t.get(s.lines.hunkId);return[{id:Su.parse(`r:${e.hunkId}`),kind:`risk`,title:e.reason,explanation:``,...i,...o?{lines:a}:{},...c,...s===void 0||l===void 0?{}:{checkedBy:{...s,path:l.path}},...r(e.guidance),...e.guardrail===void 0?{}:{guardrail:e.guardrail}}]}),d=e.decisions.map(e=>{let r=n(e.hunkIds),i=e.lines,a=i===null?void 0:t.get(i.hunkId),o=i!==null&&a!==void 0&&Ou(e.hunkIds,i,t);return{id:Su.parse(e.id),kind:`decision`,title:e.title,explanation:e.whyItMatters,...r,...o?{lines:i,path:a.path,hunkIds:[i.hunkId,...r.hunkIds.filter(e=>e!==i.hunkId)]}:{},...c}});return[...s,...l,...u,...d]},Ou=(e,t,n)=>{let r=n.get(t.hunkId);return r!==void 0&&e.includes(t.hunkId)&&vl(r,t.side,t.startLine)&&vl(r,t.side,t.line)},ku=q({test:K().min(1),lines:yl,checks:K()}).readonly(),Au=q({hunkId:Vc,riskClass:Gs([`mechanical`,`logic`,`contract`]),reason:K(),source:Gs([`proof`,`rule`,`model`,`fallback`]),lines:yl.nullable().default(null),checkedBy:ku.optional(),guidance:pu.nullable().default(null),guardrail:ql}).readonly(),ju=q({id:K().regex(/^t[1-9][0-9]*$/).brand(),sentence:K().min(1),excerpts:Ps(yl).min(1).max(2).readonly()}).readonly();ju.unwrap().omit({id:!0}).readonly();var Mu=Gs([`collect`,`prep`,`intent`,`findings`,`risk`,`decisions`,`steps`]),Nu=Gs([`pending`,`running`,`done`,`failed`,`skipped`]),Pu=K().regex(/^a_[0-9a-f]{16}$/).brand(),Fu=q({ref:Ec,headSha:Sc,pipelineVersion:K().min(1)}).readonly(),Iu=Gs([...Gs([`intent`,`findings`,`risk`,`decisions`,`steps`]).options,`guardrails`]),Lu=Gs([`running`,`done`,`failed`]),Ru=ws().int().nonnegative(),zu=Gs([`api`,`plan`]),Bu=q({pass:Iu,inputTokens:Ru,cacheReadTokens:Ru,cacheWriteTokens:Ru,outputTokens:Ru,costUsd:ws().nonnegative().nullable(),billing:zu.default(`api`),startedAt:xc.optional(),durationMs:ws().int().nonnegative().optional()}).readonly(),Vu=Gs([`ok`,`problems`,`failed`]),Hu=q({pass:Iu,attempt:ws().int().positive(),startedAt:xc,durationMs:ws().int().nonnegative(),outcome:Vu,problems:Ps(K()).readonly(),error:Cl.nullable()}).readonly(),Uu=q({stage:Mu,code:K().min(1),message:K()}).readonly(),Wu=e=>Array.isArray(e)?e.filter(e=>typeof e!=`object`||!e||!(`pass`in e)||e.pass!==`tour`):e,Gu=e=>typeof e!=`object`||!e?e:Object.fromEntries(Object.entries({findings:`skipped`,steps:`skipped`,...e}).filter(([e])=>e!==`tour`)),Ku=Gs([`running`,`complete`,`failed`]),qu=q({done:ws().int().nonnegative(),total:ws().int().nonnegative()}).readonly(),Ju=Gs([`read`,`none`,`missing-commit`]),Yu=q({risk:Ps(Au).readonly(),warnings:Ps(K()).readonly()}).readonly(),Xu=vc(e=>typeof e==`object`&&e&&`tour`in e&&!(`flows`in e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e===`tour`?`flows`:e,t])):e,q({id:Pu,key:Fu,status:Ku,stages:vc(Gu,Us(Mu,Nu)).readonly(),filesFetched:qu.nullable().default(null),pullRequest:kc.nullable(),files:Ps(Jc).readonly(),tickets:Ps(Dl).readonly(),missingTicketKeys:Ps(K()).readonly(),proofs:Ps(Xc).readonly(),parts:Ps(Zc).readonly(),callGraph:Ps(Qc).readonly(),callSites:Ps($c).readonly().default([]),fileLinks:Ps(hl).readonly(),generated:Ps(K()).readonly(),checkout:Ju,unchangedCallers:Ps(tl).readonly(),intent:Nl.nullable(),findings:Ps(xu).readonly().default([]),risk:Ps(Au).readonly(),decisions:Ps(Sl).readonly(),flows:vc(El,Ps(wl).readonly().nullable()),steps:Ps(ju).readonly().nullable().default(null),stepsError:Uu.nullable().default(null),warnings:Ps(K()).readonly(),usage:vc(Wu,Ps(Bu)).readonly(),modelCalls:vc(Wu,Ps(Hu)).readonly().default([]),error:Uu.nullable(),modelError:Uu.nullable().default(null),modelOption:Rl.nullable().default(null),guidance:du.nullable().default(null),beforeModel:Yu.nullable().default(null),guardrails:Lu.nullable().default(null),createdAt:xc,updatedAt:xc}).readonly()),Zu=[`intent`,`findings`,`risk`,`decisions`],Qu=`steps`,$u=[...Zu,Qu],ed=e=>e.stages.steps===`skipped`?Zu:$u,td=e=>e.status===`running`||e.status===`complete`&&$u.some(t=>e.stages[t]===`running`||e.stages[t]===`pending`),nd=e=>td(e)||e.guardrails===`running`,rd=e=>e.status===`complete`&&!td(e)&&!Zu.every(t=>e.stages[t]===`done`),id=e=>Zu.some(t=>e.stages[t]!==`skipped`)||e.usage.length>0||e.modelError!==null,ad=e=>{let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`||t.username!==``||t.port!==``)return null;let{hostname:n,pathname:r}=t;return n===`github.com`&&/^\/user-attachments\/assets\/[0-9a-f-]+$/i.test(r)||(n===`user-images.githubusercontent.com`||n===`private-user-images.githubusercontent.com`)&&r.length>1?`github`:n===`bitbucket.org`&&/^\/[^/]+\/[^/]+\/(images\/[^/]+|raw\/[^/]+\/.*[^/])$/.test(r)?`bitbucket`:null},od=new Set([`routes`,`pages`,`app`,`screens`,`views`]),sd=e=>/\.(tsx|jsx)$/.test(e)&&e.split(`/`).slice(0,-1).some(e=>od.has(e)),cd=(e,t,n)=>{let r=t.lines.flatMap(e=>e.kind===`add`?[e.text]:[]),i=r.flatMap(ml);if(i.length>0)return{kind:`route`,routes:ld(i)};let a=n.filter(e=>/^[A-Z]/.test(e));return sd(e.path)&&a.length>0?{kind:`page`,names:a}:n.includes(`main`)||r.some(e=>/^\s*if\s+__name__\s*==\s*["']__main__["']/.test(e))?{kind:`command`,name:`main`,path:e.path}:null},ld=e=>{let t=new Set;return e.filter(e=>{let n=`${e.method} ${e.path}`;return!t.has(n)&&(t.add(n),!0)})},ud=8,dd=500,fd=/^[!-/:-@[-`{-~]$/,pd=/^\s$/,md=/^[\p{L}\p{N}]$/u,hd=e=>e===void 0||pd.test(e),gd=e=>e!==void 0&&md.test(e),_d=(e,t,n)=>{let r=t;for(;e[r]===n;)r+=1;return r-t},vd=/&(?:#(\d{1,7})|#[xX]([0-9a-fA-F]{1,6})|(amp|lt|gt|quot|apos|nbsp));/y,yd={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,nbsp:`\xA0`},bd=e=>e===0||e>1114111||e>=55296&&e<=57343?`�`:String.fromCodePoint(e),xd=e=>e.replace(/\\([!-/:-@[-`{-~])/g,`$1`).replace(/&(?:#(\d{1,7})|#[xX]([0-9a-fA-F]{1,6})|(amp|lt|gt|quot|apos|nbsp));/g,(e,t,n,r)=>r===void 0?bd(t===void 0?Number.parseInt(n,16):Number(t)):yd[r]??``),Sd=/\balt\s*=\s*(?:"([^"]*)"|'([^']*)')/i,Cd=/\bsrc\s*=\s*(?:"([^"]*)"|'([^']*)')/i,wd=/\bwidth\s*=\s*["']?(\d{1,5})["']?/i,Td=/\bheight\s*=\s*["']?(\d{1,5})["']?/i,Ed=/<img\b[^>]*>/iy,Dd=/<(https?:\/\/[^\s<>]*)>/iy,Od=/https?:\/\/[^\s<]+/iy,kd=/\{:[^}\n]*\}/y,Ad=/^https:\/\/github\.com\/user-attachments\/assets\/[0-9a-f-]+$/i,jd=e=>{let t=Number(wd.exec(e)?.[1]??0),n=Number(Td.exec(e)?.[1]??0);return t>0&&n>0?{width:t,height:n}:void 0},Md=(e,t)=>e.exec(t)?.slice(1).find(e=>e!==void 0),Nd=(e,t,n)=>({kind:e,text:t.trim(),url:n!==void 0&&ad(n)!==null?n:null}),Pd=e=>{if(!/^https?:\/\//i.test(e))return null;try{return new URL(e).href}catch{return null}},Fd=e=>{let t=e.length;for(;;){let n=e[t-1];if(n!==void 0&&`?!.,:;*_~'"`.includes(n))--t;else if(n===`)`){let n=e.slice(0,t);if((n.match(/\(/g)?.length??0)<(n.match(/\)/g)?.length??0))--t;else break}else break}return e.slice(0,t)},Id=(e,t)=>{if(e[t]!==`(`)return null;let n=t+1;for(;e[n]===` `||e[n]===` `;)n+=1;let r=``;if(e[n]===`<`){let t=e.indexOf(`>`,n);if(t===-1||e.slice(n,t).includes(`
|
|
65
|
+
`))return null;r=e.slice(n+1,t),n=t+1}else{let t=n,i=0;for(;n<e.length;){let t=e[n]??``;if(t===`\\`&&fd.test(e[n+1]??``))n+=2;else if(pd.test(t))break;else if(t===`(`)i+=1,n+=1;else if(t===`)`){if(i===0)break;--i,n+=1}else n+=1}r=e.slice(t,n)}for(;e[n]===` `||e[n]===` `;)n+=1;let i=e[n];if(i===`"`||i===`'`||i===`(`&&r!==``){let t=i===`(`?`)`:i,r=e.indexOf(t,n+1);if(r===-1)return null;for(n=r+1;e[n]===` `||e[n]===` `;)n+=1}return e[n]===`)`?{url:xd(r),end:n+1}:null},Ld=class e{noCode=new Map;noCloser=new Map;spans=[];plain=``;text;depth;inLink;constructor(e,t,n){this.text=e,this.depth=t,this.inLink=n}read(){let{text:e}=this,t=0;for(;t<e.length;)t=this.step(t);return this.flush(),this.spans}flush(){this.plain!==``&&this.spans.push({kind:`text`,text:this.plain}),this.plain=``}push(e){this.flush(),this.spans.push(e)}nested(t,n=this.inLink){return new e(t,this.depth+1,n).read()}step(e){let{text:t}=this,n=t[e]??``;if(n===`\\`){let n=t[e+1];if(n===`
|
|
66
|
+
`||n!==void 0&&fd.test(n))return this.plain+=n,e+2}if(n==="`"){let n=this.codeAt(e);if(n!==null)return this.push({kind:`code`,text:n.text}),n.end;let r=_d(t,e,"`");return this.plain+="`".repeat(r),e+r}if(n===`&`){vd.lastIndex=e;let n=vd.exec(t);if(n!==null){let[t,r,i,a]=n;return this.plain+=a===void 0?bd(r===void 0?Number.parseInt(i??`0`,16):Number(r)):yd[a]??``,e+t.length}}if(n===`<`){let t=this.angleAt(e);if(t!==null)return t}if(n===`!`&&t[e+1]===`[`){let t=this.linkAt(e+1,!0);if(t!==null)return t}if(n===`[`&&!this.inLink){let t=this.linkAt(e,!1);if(t!==null)return t}if((n===`h`||n===`H`)&&!this.inLink){let t=this.bareUrlAt(e);if(t!==null)return t}if((n===`*`||n===`_`||n===`~`)&&this.depth<ud){let r=this.emphasisAt(e,n);if(r!==null)return r;let i=_d(t,e,n);return this.plain+=n.repeat(i),e+i}return this.plain+=n,e+1}codeAt(e){let{text:t}=this,n=_d(t,e,"`"),r=e+n;if(r>=(this.noCode.get(n)??1/0))return null;let i=r;for(;;){let e=t.indexOf("`",i);if(e===-1)return this.noCode.set(n,r),null;let a=_d(t,e,"`");if(a===n){let i=t.slice(r,e),a=i.length>2&&i.startsWith(` `)&&i.endsWith(` `);return{end:e+n,text:a?i.slice(1,-1):i}}i=e+a}}angleAt(e){let{text:t}=this;Ed.lastIndex=e;let n=Ed.exec(t)?.[0];if(n!==void 0){let t=Nd(`image`,Md(Sd,n)??``,Md(Cd,n)),r=jd(n);return this.push(r===void 0?t:{...t,size:r}),e+n.length}if(this.inLink)return null;Dd.lastIndex=e;let r=Dd.exec(t);if(r===null)return null;let[i,a=``]=r;return this.push({kind:`link`,url:Pd(a),spans:[{kind:`text`,text:a}]}),e+i.length}linkAt(e,t){let{text:n}=this,r=0,i=e,a=Math.min(n.length,e+dd),o=-1;for(;i<a;){let e=n[i];if(e===`\\`)i+=2;else if(e==="`"){let e=this.codeAt(i);i=e===null?i+_d(n,i,"`"):e.end}else{if(e===`[`)r+=1;else if(e===`]`&&(--r,r===0)){o=i;break}i+=1}}if(o===-1)return null;let s=Id(n,o+1);if(s===null)return null;let c=n.slice(e+1,o),l=s.end;kd.lastIndex=l;let u=kd.exec(n);return u!==null&&(l+=u[0].length),t?this.push(Nd(`image`,xd(c),s.url)):this.push({kind:`link`,url:Pd(s.url),spans:this.depth<ud?this.nested(c,!0):[{kind:`text`,text:c}]}),l}bareUrlAt(e){let{text:t}=this,n=t[e-1];if(n!==void 0&&!/[\s(*_~]/.test(n))return null;Od.lastIndex=e;let r=Od.exec(t)?.[0];if(r===void 0)return null;let i=Fd(r);if(!/^https?:\/\/[^/]/i.test(i))return null;let a=e+i.length,o=t.lastIndexOf(`
|
|
67
|
+
`,e-1)+1,s=t.indexOf(`
|
|
68
|
+
`,a);return t.slice(o,e).trim()===``&&t.slice(a,s===-1?t.length:s).trim()===``&&Ad.test(i)?this.push(Nd(`video`,``,i)):this.push({kind:`link`,url:Pd(i),spans:[{kind:`text`,text:i}]}),a}emphasisAt(e,t){let{text:n}=this,r=_d(n,e,t);if(r>(t===`~`?2:3)||hd(n[e+r])||t===`_`&&gd(n[e-1]))return null;let i=e+r,a=`${t}${r}`;if(i>=(this.noCloser.get(a)??1/0))return null;let o=i,s=-1;for(;o<n.length;){let e=n[o];if(e===`\\`)o+=2;else if(e==="`"){let e=this.codeAt(o);o=e===null?o+_d(n,o,"`"):e.end}else if(e===t){let e=_d(n,o,t);if(e===r&&o>i&&!hd(n[o-1])&&!(t===`_`&&gd(n[o+e]))){s=o;break}o+=e}else o+=1}if(s===-1)return this.noCloser.set(a,i),null;let c=this.nested(n.slice(i,s));return t===`~`?this.push({kind:`strike`,spans:c}):r===1?this.push({kind:`emphasis`,spans:c}):r===2?this.push({kind:`strong`,spans:c}):this.push({kind:`strong`,spans:[{kind:`emphasis`,spans:c}]}),s+r}},Rd=e=>new Ld(e,0,!1).read(),zd=e=>e.map(e=>`spans`in e?zd(e.spans):e.text).join(``),Bd=e=>{switch(e.kind){case`paragraph`:case`heading`:return zd(e.spans);case`code`:return e.text;case`suggestion`:return`Suggested change`;case`quote`:return e.blocks.map(Bd).find(e=>e.trim()!==``)??``;case`list`:return e.items[0]?.blocks.map(Bd).find(e=>e.trim()!==``)??``;case`table`:return e.head.map(zd).join(` | `);case`rule`:return``}},Vd=e=>{for(let t of nf(e)){let e=Bd(t).split(`
|
|
69
|
+
`)[0]?.trim()??``;if(e!==``)return e}return``},Hd=e=>/^[\s-]*$/.test(e),Ud=e=>/^ */.exec(e)?.[0].length??0,Wd=/^( {0,3})(`{3,})([^`]*)$/,Gd=/^ {0,3}(#{1,6})(?:[ \t]+(.*))?$/,Kd=/^ {0,3}(?:(?:\*[ \t]*){3,}|(?:-[ \t]*){3,}|(?:_[ \t]*){3,})$/,qd=/^ {0,3}> ?(.*)$/,Jd=/^( {0,3})([-*+]|\d{1,9}[.)])(?:([ \t]+)(.*))?$/,Yd=/^\[([ xX])\](?:[ \t]+|$)/,Xd=/^:?-+:?$/,Zd=e=>{let t=Jd.exec(e);if(t===null)return null;let[,n=``,r=``,i=``,a=``]=t,o=/\d/.test(r),s=i.length>4?1:i.length;return{ordered:o,delimiter:o?r.slice(-1):r,number:o?Number(r.slice(0,-1)):1,contentIndent:n.length+r.length+Math.max(s,1),content:i.length>4?`${i.slice(1)}${a}`:a}},Qd=(e,t)=>e.ordered===t.ordered&&e.delimiter===t.delimiter,$d=e=>{let t=e.trim();t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&!t.endsWith(`\\|`)&&(t=t.slice(0,-1));let n=[],r=``;for(let e=0;e<t.length;e+=1){let i=t[e]??``;i===`\\`&&t[e+1]===`|`?(r+=`\\|`,e+=1):i===`|`?(n.push(r.trim()),r=``):r+=i}return n.push(r.trim()),n},ef=(e,t)=>{if(!e.includes(`-`))return null;let n=$d(e);return n.length!==t||!n.every(e=>Xd.test(e))?null:n.map(e=>{let t=e.startsWith(`:`),n=e.endsWith(`:`);return t&&n?`center`:t?`left`:n?`right`:null})},tf=class e{closings=[];lines;depth;constructor(e,t){this.lines=e,this.depth=t,e.forEach((e,t)=>{let n=e.trim();/^`{3,}$/.test(n)&&Ud(e)<=3&&this.closings.push({index:t,length:n.length})})}closeOf(e,t){return this.closings.find(n=>n.index>e&&n.length>=t)?.index??-1}fenceAt(e){let t=Wd.exec(this.lines[e]??``);if(t===null)return null;let n=this.closeOf(e,t[2]?.length??3);return n===-1?null:{close:n,opening:t}}tableAt(e){let t=this.lines[e]??``,n=this.lines[e+1];return!t.includes(`|`)||n===void 0?null:ef(n,$d(t).length)}interrupts(e){let t=this.lines[e]??``;if(Hd(t)||Gd.test(t)||Kd.test(t)||this.fenceAt(e)!==null||this.tableAt(e)!==null)return!0;if(this.depth>=ud)return!1;if(qd.test(t))return!0;let n=Zd(t);return n!==null&&n.content.trim()!==``&&(!n.ordered||n.number===1)}read(){let{lines:e}=this,t=[],n=[],r=()=>{let e=n.join(`
|
|
70
|
+
`).trim();e!==``&&t.push({kind:`paragraph`,spans:Rd(e)}),n=[]},i=0;for(;i<e.length;){let a=e[i]??``;if(n.length>0&&!this.interrupts(i)){n.push(a.trimEnd()),i+=1;continue}if(Hd(a)){r(),i+=1;continue}r();let o=this.blockAt(i,t);o===null?(n.push(a.trimEnd()),i+=1):i=o}return r(),t}blockAt(e,t){let n=this.lines[e]??``,r=this.fenceAt(e);if(r!==null)return t.push(this.fenced(e,r.close,r.opening)),r.close+1;let i=Gd.exec(n);if(i!==null){let n=(i[2]??``).replace(/(?:^|[ \t]+)#+[ \t]*$/,``).trim();return t.push({kind:`heading`,level:i[1]?.length??1,spans:Rd(n)}),e+1}if(Kd.test(n))return t.push({kind:`rule`}),e+1;let a=this.tableAt(e);if(a!==null)return this.table(e,a,t);if(this.depth>=ud)return null;if(qd.test(n))return this.quote(e,t);let o=Zd(n);return o===null?null:this.list(e,o,t)}fenced(e,t,n){let r=n[1]?.length??0,i=n[2]??``,a=(n[3]??``).trim(),o=this.lines.slice(e+1,t).map(e=>e.slice(Math.min(r,Ud(e)))),s=a.split(/\s+/)[0]??``,c=o.some(e=>{let t=/^`{3,}/.exec(e)?.[0];return t!==void 0&&t.length===i.length});return s===`suggestion`&&!c&&this.depth===0?{kind:`suggestion`,lines:o}:{kind:`code`,language:s===``||s===`suggestion`?null:s,text:o.join(`
|
|
71
|
+
`)}}nested(t){return new e(t,this.depth+1).read()}quote(e,t){let n=[],r=e;for(;r<this.lines.length;){let e=this.lines[r]??``,t=qd.exec(e);if(t!==null)n.push(t[1]??``);else if(!Hd(n.at(-1)??``)&&!this.interrupts(r))n.push(e);else break;r+=1}return t.push({kind:`quote`,blocks:this.nested(n)}),r}list(e,t,n){let{lines:r}=this,i=[],a=e,o=t;for(;o!==null;){let e=[o.content];for(a+=1;a<r.length;){let t=r[a]??``;if(Hd(t)){let t=a;for(;t<r.length&&Hd(r[t]??``);)t+=1;if(t<r.length&&Ud(r[t]??``)>=o.contentIndent){for(;a<t;a+=1)e.push(``);continue}break}if(Ud(t)>=o.contentIndent)e.push(t.slice(o.contentIndent));else if(!Hd(e.at(-1)??``)&&!this.interrupts(a)&&Zd(t)===null)e.push(t.trimStart());else break;a+=1}let[n=``,...s]=e,c=Yd.exec(n);i.push({checked:c===null?null:c[1]!==` `,blocks:this.nested([c===null?n:n.slice(c[0].length),...s])});let l=a;for(;l<r.length&&Hd(r[l]??``);)l+=1;let u=l<r.length?Zd(r[l]??``):null;u!==null&&Qd(t,u)?(a=l,o=u):o=null}return n.push({kind:`list`,ordered:t.ordered,start:t.number,items:i}),a}table(e,t,n){let r=t.length,i=e=>{let t=$d(e).slice(0,r);for(;t.length<r;)t.push(``);return t.map(Rd)},a=[],o=e+2;for(;o<this.lines.length&&!this.interrupts(o);)a.push(i(this.lines[o]??``)),o+=1;return n.push({kind:`table`,align:t,head:i(this.lines[e]??``),rows:a}),o}},nf=e=>new tf(e.replaceAll(`\r
|
|
72
|
+
`,`
|
|
73
|
+
`).split(`
|
|
74
|
+
`),0).read(),rf=e=>({blocks:nf(e)}),af=Gs([`approve`,`request_changes`,`comment`]),of=K().regex(/^(summary|decision:d[1-9][0-9]*|hunk:h_[0-9a-f]{16}(-[2-9]|-[1-9][0-9]+)?:(new|old):[1-9][0-9]*)$/).brand(),sf=q({hunkId:Vc,side:Gs([`new`,`old`]),line:ws().int().positive(),startLine:ws().int().positive().optional(),body:K(),suggestion:Ps(K()).readonly().optional()}).readonly().refine(e=>e.startLine===void 0||e.startLine<e.line,{message:`startLine must come before line`}),cf=q({key:of,path:K().min(1),line:ws().int().positive(),startLine:ws().int().positive().optional(),side:Gs([`new`,`old`]),body:K().min(1)}).readonly(),lf=q({verdict:af,summary:K(),comments:Ps(cf).readonly()}).readonly(),uf=as().brand(),df=e=>e.verdict===`comment`&&e.summary.trim()===``&&e.comments.length===0,ff=q({url:Cc.nullable(),publishedAt:xc,postedCommentIds:Us(of,K().min(1)).readonly()}).readonly(),pf=Gs([`open`,`draft`,`merged`,`closed`]),mf=Gs([`approved`,`changes-requested`,`commented`]),hf=q({id:K().min(1),name:K(),team:Os(),verdict:mf.nullable()}).readonly(),gf=Gs([`approved`,`changes-requested`]),_f=Gs([`passed`,`failed`,`running`,`skipped`]),vf=q({name:K().min(1),state:_f,url:Cc.nullable()}).readonly(),yf=q({state:pf,reviewStatus:gf.nullable(),reviewers:Ps(hf).readonly(),checks:Ps(vf).readonly().nullable(),checksUnreadable:K().nullable()}).readonly(),bf={"changes-requested":0,approved:1,commented:2,none:3},xf=e=>[...e].sort((e,t)=>bf[e.verdict??`none`]-bf[t.verdict??`none`]),Sf={failed:0,running:1,passed:2,skipped:3},Cf=e=>[...e].sort((e,t)=>Sf[e.state]-Sf[t.state]||e.name.localeCompare(t.name)),wf=e=>{let t=t=>e.filter(e=>e.state===t).length,n=t(`passed`),r=t(`failed`),i=t(`running`),a=t(`skipped`);return{state:r>0?`failed`:i>0?`running`:n>0?`passed`:a>0?`skipped`:null,total:n+r+i,passed:n,failed:r,running:i,skipped:a}},Tf={"github.com":{kind:`github`,pullSegment:`pull`},"bitbucket.org":{kind:`bitbucket`,pullSegment:`pull-requests`}},Ef=/^[A-Za-z0-9._-]+$/,Df=/^[1-9][0-9]*$/,Of=e=>e!==void 0&&Ef.test(e)&&e!==`.`&&e!==`..`,kf=e=>/^(github\.com|bitbucket\.org)\//i.test(e)?`https://${e}`:e,Af=e=>{let t;try{t=new URL(kf(e.trim()))}catch{return _l(`unsupported-url`)}let n=Tf[t.hostname];if(n===void 0||t.protocol!==`https:`||t.port!==``||t.username!==``||t.password!==``)return _l(`unsupported-url`);let[r,i,a,o,s]=t.pathname.split(`/`);return r!==``||!Of(i)||!Of(a)||o!==n.pullSegment||s===void 0||!Df.test(s)||!Number.isSafeInteger(Number(s))?_l(`unsupported-url`):gl({repo:{host:n.kind,owner:i.toLowerCase(),repo:a.toLowerCase()},number:Number(s)})},jf=e=>{let{host:t,owner:n,repo:r}=e.repo;switch(t){case`github`:return`https://github.com/${n}/${r}/pull/${e.number}`;case`bitbucket`:return`https://bitbucket.org/${n}/${r}/pull-requests/${e.number}`}},Mf=K().regex(/^[A-Za-z0-9_-]{1,200}$/),Nf=q({id:K().regex(/^[A-Za-z0-9_-]{1,200}$/),author:Dc,body:K(),createdAt:xc,originalCommit:Sc.nullable()}).readonly(),Pf=q({reply:Os(),resolve:Os()}).readonly(),Ff=q({threads:Ps(q({id:Mf,path:K().min(1),side:Gs([`new`,`old`]),line:ws().int().positive().nullable(),startLine:ws().int().positive().nullable(),originalLine:ws().int().positive().nullable(),resolved:Os(),resolvedBy:Dc.nullable(),outdated:Os(),can:Pf,comments:Ps(Nf).min(1).readonly()}).readonly()).readonly()}).readonly();q({kind:Gs([`missing`,`duplicate`,`unknown`]),id:Hc}).readonly();var If=`x-megareviewer-token`,Lf=`token`,Rf=q({configured:Os(),user:Dc.nullable(),error:K().nullable()}).readonly(),zf=q({version:K(),hosts:q({github:Rf,bitbucket:Rf}).readonly(),jira:q({configured:Os()}).readonly(),model:zl}).readonly(),Bf=q({items:Ps(Ac).readonly(),errors:Ps(q({host:wc,message:K()}).readonly()).readonly()}).readonly(),Vf=q({url:K().min(1)}).readonly(),Hf=q({optionId:Ll.optional(),tour:Os().optional()}).readonly().optional(),Uf=q({analysisId:Pu}).readonly(),Wf=q({analysis:Xu,pointReviews:Ps(wu).readonly(),publication:ff.nullable(),isAuthor:Os(),currentUserId:K().nullable(),stale:Os()}).readonly(),Gf=q({analysis:Xu,pointReviews:Ps(wu).readonly()}).readonly(),Kf=q({state:Cu}).readonly(),qf={hunkComments:Ps(sf).readonly().optional(),verdict:af.nullable().optional()},Jf=q({summary:K(),...qf}).readonly(),Yf=q({publicationId:uf,summary:K(),allowStale:Os(),...qf}).readonly(),Xf=q({stage:Mu,status:Nu}).readonly(),Zf=q({}).readonly(),Qf=q({content:K().nullable()}).readonly(),$f=Ff,ep=q({body:K().trim().min(1)}).readonly(),tp=q({}).readonly(),np=q({}).readonly(),rp=q({resolved:Os()}).readonly(),ip=rp,ap=q({repo:Tc,guidelineFiles:Ps(lu).readonly().nullable(),guidelineNote:K().nullable()}).readonly(),op=q({preferences:Ps(iu).readonly(),proposals:Ps(au).readonly(),repositories:Ps(ap).readonly()}).readonly(),sp=q({kind:eu,text:ru,scope:tu,source:Gs([`written`,`learned`]).optional()}).readonly(),cp=q({kind:eu.optional(),text:ru.optional(),scope:tu.optional(),enabled:Os().optional()}).readonly(),lp=q({}).readonly(),up=q({repo:Tc,optionId:Ll.optional()}).readonly(),dp=q({proposals:Ps(au).readonly(),signals:ws().int().nonnegative(),comments:ws().int().nonnegative(),pullRequests:ws().int().nonnegative()}).readonly(),fp=q({decision:Gs([`accept`,`reject`]),kind:eu.optional(),text:ru.optional(),scope:tu.optional()}).readonly(),pp=q({preference:iu.nullable()}).readonly(),mp=q({repo:Tc,path:su,enabled:Os()}).readonly(),hp=q({}).readonly(),gp=q({error:q({code:Gs([`bad-request`,`unsupported-url`,`host-not-configured`,`unauthorized`,`not-found`,`stale-analysis`,`analysis-not-complete`,`host-error`,`model-error`,`model-unavailable`,`internal`]),message:K()}).readonly()}).readonly(),_p=q({id:Pu}).readonly(),vp=q({id:Pu,pointId:Su}).readonly(),yp=q({id:Pu,side:Gs([`base`,`head`]),path:K().min(1)}).readonly(),bp=q({id:Pu,threadId:Mf}).readonly(),xp=q({preferenceId:Ql}).readonly(),Sp=q({proposalId:$l}).readonly(),Cp=q({}).readonly(),wp={getStatus:{method:`GET`,path:`/api/status`,params:Cp,request:null,response:zf},listPullRequests:{method:`GET`,path:`/api/pull-requests`,params:Cp,request:null,response:Bf},getReviewActivity:{method:`GET`,path:`/api/review-activity`,params:Cp,request:null,response:jc},startAnalysis:{method:`POST`,path:`/api/analyses`,params:Cp,request:Vf,response:Uf},getAnalysis:{method:`GET`,path:`/api/analyses/:id`,params:_p,request:null,response:Wf},getFileContent:{method:`GET`,path:`/api/analyses/:id/files/:side/:path`,params:yp,request:null,response:Qf},retryAnalysis:{method:`POST`,path:`/api/analyses/:id/retry`,params:_p,request:null,response:Uf},runModel:{method:`POST`,path:`/api/analyses/:id/model`,params:_p,request:Hf,response:Uf},removeModelRun:{method:`DELETE`,path:`/api/analyses/:id/model`,params:_p,request:null,response:Gf},putPointState:{method:`PUT`,path:`/api/analyses/:id/points/:pointId`,params:vp,request:Kf,response:wu},previewPublication:{method:`POST`,path:`/api/analyses/:id/publication/preview`,params:_p,request:Jf,response:lf},publish:{method:`POST`,path:`/api/analyses/:id/publication`,params:_p,request:Yf,response:ff},revokeApproval:{method:`DELETE`,path:`/api/analyses/:id/approval`,params:_p,request:null,response:np},getThreads:{method:`GET`,path:`/api/analyses/:id/threads`,params:_p,request:null,response:$f},getPullRequestStatus:{method:`GET`,path:`/api/analyses/:id/pull-request-status`,params:_p,request:null,response:yf},replyToThread:{method:`POST`,path:`/api/analyses/:id/threads/:threadId/replies`,params:bp,request:ep,response:Nf},postComment:{method:`POST`,path:`/api/analyses/:id/comments`,params:_p,request:sf,response:tp},resolveThread:{method:`PUT`,path:`/api/analyses/:id/threads/:threadId/resolved`,params:bp,request:rp,response:ip},getPreferences:{method:`GET`,path:`/api/preferences`,params:Cp,request:null,response:op},addPreference:{method:`POST`,path:`/api/preferences`,params:Cp,request:sp,response:iu},suggestPreferences:{method:`POST`,path:`/api/preferences/suggestions`,params:Cp,request:up,response:dp},setGuidelineSwitch:{method:`PUT`,path:`/api/preferences/guidelines`,params:Cp,request:mp,response:hp},decideProposal:{method:`PUT`,path:`/api/preferences/proposals/:proposalId`,params:Sp,request:fp,response:pp},updatePreference:{method:`PUT`,path:`/api/preferences/:preferenceId`,params:xp,request:cp,response:iu},deletePreference:{method:`DELETE`,path:`/api/preferences/:preferenceId`,params:xp,request:null,response:lp}},Tp={method:`GET`,path:`/api/analyses/:id/events`,params:_p,events:{updated:Xf,done:Zf}},Ep={method:`GET`,path:`/api/analyses/:id/attachment`,params:_p,query:q({url:ss({protocol:/^https$/})}).readonly()},Dp=(e,t)=>e.replace(/:([A-Za-z]+)/g,(n,r)=>{let i=t[r];if(i===void 0)throw Error(`missing path param ${r} for ${e}`);return encodeURIComponent(i)}),Op=`The server sent a response this page doesn't understand, so the server and the UI may be different versions. Reload the page.`,kp=`Can't reach megareviewer. Check that it's still running in your terminal.`,Ap=e=>{let t=async(t,n,r)=>{let i;try{i=await e.fetch(Dp(t.path,n),{method:t.method,headers:{[If]:e.token,...r===void 0?{}:{"content-type":`application/json`}},...r===void 0?{}:{body:JSON.stringify(r)}})}catch{return _l({code:`unreachable`,message:kp})}let a=await i.json().catch(()=>void 0);if(!i.ok){i.status===401&&e.onUnauthorized();let t=gp.safeParse(a);return t.success?_l(t.data.error):_l({code:i.status>=500?`unreachable`:`internal`,message:i.status>=500?kp:Op})}let o=t.response.safeParse(a);return o.success?gl(o.data):_l({code:`internal`,message:Op})};return{getStatus:()=>t(wp.getStatus,{}),listPullRequests:()=>t(wp.listPullRequests,{}),getReviewActivity:()=>t(wp.getReviewActivity,{}),startAnalysis:e=>t(wp.startAnalysis,{},e),getAnalysis:e=>t(wp.getAnalysis,{id:e}),getFileContent:(e,n,r)=>t(wp.getFileContent,{id:e,side:n,path:r}),retryAnalysis:e=>t(wp.retryAnalysis,{id:e}),runModel:(e,n={})=>t(wp.runModel,{id:e},n),removeModelRun:e=>t(wp.removeModelRun,{id:e}),putPointState:(e,n,r)=>t(wp.putPointState,{id:e,pointId:n},r),previewPublication:(e,n)=>t(wp.previewPublication,{id:e},n),publish:(e,n)=>t(wp.publish,{id:e},n),revokeApproval:e=>t(wp.revokeApproval,{id:e}),getThreads:e=>t(wp.getThreads,{id:e}),getPullRequestStatus:e=>t(wp.getPullRequestStatus,{id:e}),replyToThread:(e,n,r)=>t(wp.replyToThread,{id:e,threadId:n},r),resolveThread:(e,n,r)=>t(wp.resolveThread,{id:e,threadId:n},r),postComment:(e,n)=>t(wp.postComment,{id:e},n),getPreferences:()=>t(wp.getPreferences,{}),addPreference:e=>t(wp.addPreference,{},e),suggestPreferences:e=>t(wp.suggestPreferences,{},e),setGuidelineSwitch:e=>t(wp.setGuidelineSwitch,{},e),decideProposal:(e,n)=>t(wp.decideProposal,{proposalId:e},n),updatePreference:(e,n)=>t(wp.updatePreference,{preferenceId:e},n),deletePreference:e=>t(wp.deletePreference,{preferenceId:e}),attachmentUrl:(t,n)=>`${Dp(Ep.path,{id:t})}?${new URLSearchParams({url:n,[Lf]:e.token})}`}},jp=2,Mp=(e,t,n,r=e=>new EventSource(e))=>{let i=new URLSearchParams({[Lf]:t}),a=r(`${Dp(Tp.path,{id:e})}?${i}`),o=!1,s=!1,c=()=>{s=!0,a.close()};return a.addEventListener(`open`,()=>{o&&(o=!1,n({type:`changed`}))}),a.addEventListener(`error`,()=>{o=!0,!(s||a.readyState!==jp)&&(s=!0,n({type:`closed`}))}),a.addEventListener(`updated`,()=>n({type:`changed`})),a.addEventListener(`done`,()=>{c(),n({type:`done`})}),()=>{s||c()}},Np=(0,J.createContext)(null),Pp=()=>{let e=(0,J.useContext)(Np);if(e===null)throw Error(`useApi needs an ApiContext provider`);return e},Fp={data:null,error:null,loading:!0},Ip=e=>{let[t,n]=(0,J.useState)(Fp),[r,i]=(0,J.useState)(0);(0,J.useEffect)(()=>{let t=!0;return n(e=>({...e,loading:!0})),e().then(e=>{t&&n(t=>e.ok?{data:e.value,error:null,loading:!1}:{data:t.data,error:e.error,loading:!1})}),()=>{t=!1}},[e,r]);let a=(0,J.useCallback)(()=>i(e=>e+1),[]);return{...t,refresh:a}},Lp=()=>{let{client:e}=Pp(),{data:t,...n}=Ip((0,J.useCallback)(()=>e.getStatus(),[e]));return{status:t,...n}},Rp=()=>{let{client:e}=Pp(),{data:t,...n}=Ip((0,J.useCallback)(()=>e.listPullRequests(),[e]));return{pullRequests:t,...n}},zp=()=>{let{client:e}=Pp(),{data:t,...n}=Ip((0,J.useCallback)(()=>e.getReviewActivity(),[e]));return{activity:t,...n}},Bp=()=>{let{client:e}=Pp(),{data:t,...n}=Ip((0,J.useCallback)(()=>e.getPreferences(),[e]));return{preferences:t,...n}},Vp=(e,t=null)=>{let{client:n,subscribe:r}=Pp(),[i,a]=(0,J.useState)({view:t,error:null,loading:t===null}),o=(0,J.useRef)(0),s=(0,J.useRef)(t),c=(0,J.useRef)(t!==null&&!nd(t.analysis)?t.analysis.id:null),[l,u]=(0,J.useState)(0),d=(0,J.useRef)(null),f=(0,J.useCallback)(async()=>{o.current+=1;let t=o.current,r=await n.getAnalysis(e);t===o.current&&(r.ok&&(s.current=r.value),a(e=>r.ok?{view:r.value,error:null,loading:!1}:{view:e.view,error:r.error,loading:!1}))},[n,e]);(0,J.useEffect)(()=>{if(l===0&&c.current===e){d.current=e;return}d.current!==e&&s.current?.analysis.id!==e&&(s.current=null,a({view:null,error:null,loading:!0})),d.current=e,f();let t,n=r(e,e=>{if(clearTimeout(t),e.type===`changed`){t=setTimeout(()=>void f(),100);return}let n=s.current;(n===null||nd(n.analysis))&&f()});return()=>{clearTimeout(t),n(),o.current+=1}},[e,f,r,l]);let p=(0,J.useCallback)(()=>u(e=>e+1),[]);return{...i,refetch:f,follow:p}},Hp=e=>{let[t,n]=(0,J.useState)({pending:!1,error:null}),r=(0,J.useCallback)(async(...t)=>{n({pending:!0,error:null});let r=await e(...t);return n({pending:!1,error:r.ok?null:r.error}),r},[e]),i=(0,J.useCallback)(()=>n({pending:!1,error:null}),[]);return{...t,run:r,reset:i}},Up=e=>{let t=e.trim();return t===``||/[.!?]$/.test(t)?t:`${t}.`},Wp={"bad-request":e=>`megareviewer rejected the request: ${Up(e)}`,"unsupported-url":()=>`Only github.com and bitbucket.org pull request links are supported.`,"host-not-configured":e=>`${Up(e)} Run npx megareviewer doctor to see how to set it up.`,unauthorized:()=>`This session has ended. Open megareviewer from the link printed in your terminal.`,"not-found":e=>Up(e),"stale-analysis":()=>`The pull request has new commits since this analysis.`,"analysis-not-complete":()=>`The analysis isn't complete yet.`,"host-error":e=>`The git host returned an error: ${Up(e)}`,"model-error":e=>`The model call failed: ${Up(e)}`,"model-unavailable":e=>Up(e),internal:e=>Up(e)||`Something went wrong.`,unreachable:e=>Up(e)},Gp=e=>Wp[e.code](e.message),Kp=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})),Y=o(((e,t)=>{t.exports=Kp()}))(),qp=(0,J.createContext)(null),Jp=(0,J.createContext)(()=>{}),Yp=({children:e})=>{let[t,n]=(0,J.useState)(null);return(0,Y.jsx)(Jp.Provider,{value:n,children:(0,Y.jsx)(qp.Provider,{value:t,children:e})})},Xp=()=>(0,J.useContext)(qp),Zp=e=>{let t=(0,J.useContext)(Jp),n=(0,J.useRef)(e.onChange);n.current=e.onChange;let r=(0,J.useRef)((e.toggles??[]).map(e=>e.onChange));r.current=(e.toggles??[]).map(e=>e.onChange);let{label:i,options:a,value:o}=e,s=(e.toggles??[]).map(e=>e.label).join(`
|
|
75
|
+
`),c=(e.toggles??[]).map(e=>e.checked?`1`:`0`).join(``),l=(0,J.useMemo)(()=>{let e=(s===``?[]:s.split(`
|
|
76
|
+
`)).map((e,t)=>({label:e,checked:c[t]===`1`,onChange:e=>r.current[t]?.(e)}));return{label:i,options:a,value:o,onChange:e=>n.current(e),...e.length===0?{}:{toggles:e}}},[i,a,o,s,c]);(0,J.useEffect)(()=>t(l),[t,l]),(0,J.useEffect)(()=>()=>t(null),[t])};function Qp(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Qp(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function $p(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Qp(e))&&(r&&(r+=` `),r+=t);return r}var em=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},tm=(e,t)=>({classGroupId:e,validator:t}),nm=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rm=`-`,im=[],am=`arbitrary..`,om=e=>{let t=lm(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return cm(e);let n=e.split(rm);return sm(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?em(i,t):t:i||im}return n[e]||im}}},sm=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=sm(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(rm):e.slice(t).join(rm),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},cm=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?am+r:void 0})(),lm=e=>{let{theme:t,classGroups:n}=e;return um(n,t)},um=(e,t)=>{let n=nm();for(let r in e){let i=e[r];dm(i,n,r,t)}return n},dm=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];fm(i,t,n,r)}},fm=(e,t,n,r)=>{typeof e==`string`?pm(e,t,n):typeof e==`function`?mm(e,t,n,r):hm(e,t,n,r)},pm=(e,t,n)=>{let r=e===``?t:gm(t,e);r.classGroupId=n},mm=(e,t,n,r)=>{_m(e)?dm(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(tm(n,e)))},hm=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];dm(o,gm(t,a),n,r)}},gm=(e,t)=>{let n=e,r=t.split(rm),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=nm(),n.nextPart.set(t,i)),n=i}return n},_m=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,vm=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ym=`!`,bm=`:`,xm=[],Sm=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Cm=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===bm){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ym)?(c=s.slice(0,-1),l=!0):s.startsWith(ym)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Sm(t,l,c,u)};if(t){let e=t+bm,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Sm(xm,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},wm=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Tm=e=>({cache:vm(e.cacheSize),parseClassName:Cm(e),sortModifiers:wm(e),postfixLookupClassGroupIds:Em(e),...om(e)}),Em=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Dm=/\s+/,Om=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Dm),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+ym:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},km=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Am(n))&&(i&&(i+=` `),i+=r);return i},Am=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Am(e[r]))&&(n&&(n+=` `),n+=t);return n},jm=(e,...t)=>{let n,r,i,a,o=o=>(n=Tm(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Om(e,n);return i(e,a),a};return a=o,(...e)=>a(km(...e))},Mm=[],Nm=e=>{let t=t=>t[e]||Mm;return t.isThemeGetter=!0,t.themeKey=e,t},Pm=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fm=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Im=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Lm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Rm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Bm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hm=e=>Im.test(e),Um=e=>!!e&&!Number.isNaN(Number(e)),Wm=e=>!!e&&Number.isInteger(Number(e)),Gm=e=>e.endsWith(`%`)&&Um(e.slice(0,-1)),Km=e=>Lm.test(e),qm=()=>!0,Jm=e=>Rm.test(e)&&!zm.test(e),Ym=()=>!1,Xm=e=>Bm.test(e),Zm=e=>Vm.test(e),Qm=e=>!th(e)&&!lh(e),$m=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),eh=e=>_h(e,xh,Ym),th=e=>Pm.test(e),nh=e=>_h(e,Sh,Jm),rh=e=>_h(e,Ch,Um),ih=e=>_h(e,Th,qm),ah=e=>_h(e,wh,Ym),oh=e=>_h(e,yh,Ym),sh=e=>_h(e,bh,Zm),ch=e=>_h(e,Eh,Xm),lh=e=>Fm.test(e),uh=e=>vh(e,Sh),dh=e=>vh(e,wh),fh=e=>vh(e,yh),ph=e=>vh(e,xh),mh=e=>vh(e,bh),hh=e=>vh(e,Eh,!0),gh=e=>vh(e,Th,!0),_h=(e,t,n)=>{let r=Pm.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},vh=(e,t,n=!1)=>{let r=Fm.exec(e);return r?r[1]?t(r[1]):n:!1},yh=e=>e===`position`||e===`percentage`,bh=e=>e===`image`||e===`url`,xh=e=>e===`length`||e===`size`||e===`bg-size`,Sh=e=>e===`length`,Ch=e=>e===`number`,wh=e=>e===`family-name`,Th=e=>e===`number`||e===`weight`,Eh=e=>e===`shadow`,Dh=()=>{let e=Nm(`color`),t=Nm(`font`),n=Nm(`text`),r=Nm(`font-weight`),i=Nm(`tracking`),a=Nm(`leading`),o=Nm(`breakpoint`),s=Nm(`container`),c=Nm(`spacing`),l=Nm(`radius`),u=Nm(`shadow`),d=Nm(`inset-shadow`),f=Nm(`text-shadow`),p=Nm(`drop-shadow`),m=Nm(`blur`),h=Nm(`perspective`),g=Nm(`aspect`),_=Nm(`ease`),v=Nm(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),lh,th],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[lh,th,c],T=()=>[Hm,`full`,`auto`,...w()],E=()=>[Wm,`none`,`subgrid`,lh,th],D=()=>[`auto`,{span:[`full`,Wm,lh,th]},Wm,lh,th],O=()=>[Wm,`auto`,lh,th],k=()=>[`auto`,`min`,`max`,`fr`,lh,th],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Hm,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,Hm,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Hm,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,lh,th],L=()=>[...b(),fh,oh,{position:[lh,th]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ee=()=>[`auto`,`cover`,`contain`,ph,eh,{size:[lh,th]}],z=()=>[Gm,uh,nh],B=()=>[``,`none`,`full`,l,lh,th],V=()=>[``,Um,uh,nh],te=()=>[`solid`,`dashed`,`dotted`,`double`],H=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],U=()=>[Um,Gm,fh,oh],ne=()=>[``,`none`,m,lh,th],re=()=>[`none`,Um,lh,th],ie=()=>[`none`,Um,lh,th],ae=()=>[Um,lh,th],oe=()=>[Hm,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Km],breakpoint:[Km],color:[qm],container:[Km],"drop-shadow":[Km],ease:[`in`,`out`,`in-out`],font:[Qm],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Km],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Km],shadow:[Km],spacing:[`px`,Um],text:[Km],"text-shadow":[Km],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Hm,th,lh,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,lh,th]}],"container-named":[$m],columns:[{columns:[Um,`auto`,th,lh,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Wm,`auto`,lh,th]}],basis:[{basis:[Hm,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Um,Hm,`auto`,`initial`,`none`,th]}],grow:[{grow:[``,Um,lh,th]}],shrink:[{shrink:[``,Um,lh,th]}],order:[{order:[Wm,`first`,`last`,`none`,lh,th]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,uh,nh]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,gh,ih]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Gm,th]}],"font-family":[{font:[dh,ah,t]}],"font-features":[{"font-features":[th]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,lh,th]}],"line-clamp":[{"line-clamp":[Um,`none`,lh,rh]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,lh,th]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,lh,th]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...te(),`wavy`]}],"text-decoration-thickness":[{decoration:[Um,`from-font`,`auto`,lh,nh]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Um,`auto`,lh,th]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Wm,lh,th]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,lh,th]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,lh,th]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Wm,lh,th],radial:[``,lh,th],conic:[``,Wm,lh,th]},mh,sh]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...te(),`hidden`,`none`]}],"divide-style":[{divide:[...te(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...te(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Um,lh,th]}],"outline-w":[{outline:[``,Um,uh,nh]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,hh,ch]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,hh,ch]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Um,nh]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,hh,ch]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Um,lh,th]}],"mix-blend":[{"mix-blend":[...H(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Um]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[lh,th]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Um]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,lh,th]}],filter:[{filter:[``,`none`,lh,th]}],blur:[{blur:ne()}],brightness:[{brightness:[Um,lh,th]}],contrast:[{contrast:[Um,lh,th]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,hh,ch]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Um,lh,th]}],"hue-rotate":[{"hue-rotate":[Um,lh,th]}],invert:[{invert:[``,Um,lh,th]}],saturate:[{saturate:[Um,lh,th]}],sepia:[{sepia:[``,Um,lh,th]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,lh,th]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[Um,lh,th]}],"backdrop-contrast":[{"backdrop-contrast":[Um,lh,th]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Um,lh,th]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Um,lh,th]}],"backdrop-invert":[{"backdrop-invert":[``,Um,lh,th]}],"backdrop-opacity":[{"backdrop-opacity":[Um,lh,th]}],"backdrop-saturate":[{"backdrop-saturate":[Um,lh,th]}],"backdrop-sepia":[{"backdrop-sepia":[``,Um,lh,th]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,lh,th]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Um,`initial`,lh,th]}],ease:[{ease:[`linear`,`initial`,_,lh,th]}],delay:[{delay:[Um,lh,th]}],animate:[{animate:[`none`,v,lh,th]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,lh,th]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[lh,th,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Wm,lh,th]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,lh,th]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,lh,th]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Um,uh,nh,rh]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},Oh=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(kh(e,`cacheSize`,t),kh(e,`prefix`,n),kh(e,`experimentalParseClassName`,r),Ah(e.theme,a.theme),Ah(e.classGroups,a.classGroups),Ah(e.conflictingClassGroups,a.conflictingClassGroups),Ah(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),kh(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),kh(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),jh(e.theme,i.theme),jh(e.classGroups,i.classGroups),jh(e.conflictingClassGroups,i.conflictingClassGroups),jh(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Mh(e,i,`postfixLookupClassGroups`),Mh(e,i,`orderSensitiveModifiers`),e),kh=(e,t,n)=>{n!==void 0&&(e[t]=n)},Ah=(e,t)=>{if(t)for(let n in t)kh(e,n,t[n])},jh=(e,t)=>{if(t)for(let n in t)Mh(e,t,n)},Mh=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},Nh=((e,...t)=>typeof e==`function`?jm(Dh,e,...t):jm(()=>Oh(Dh(),e),...t))({extend:{theme:{text:[`title`,`heading`,`body`,`ui`,`caption`,`code`,`code-compact`,`code-comfy`,`code-gutter`,`tree`,`tree-folder`,`kbd`]}}}),X=(...e)=>Nh($p(e)),Ph=e=>e,Fh=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Ih(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Fh(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Lh=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Rh=e=>{let t=Lh(e);return t.charAt(0).toUpperCase()+t.slice(1)},zh=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Bh={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Vh(e){return e!=null}function Hh(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Bh.width,a=e.size??e.height??Bh.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?zh(...c):zh(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Bh[`stroke-width`])*Number(e.size??e.width??Bh.width)/Number(t.size??t.width??Bh.width):t.strokeWidth??Bh[`stroke-width`];return[`svg`,{...Object.entries(Bh).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Vh(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Vh(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Vh(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Uh(e,t={}){return Hh(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Wh=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Gh=(0,J.createContext)({}),Kh=()=>(0,J.useContext)(Gh),qh=(0,J.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Kh()??{},y=!!c||Wh(d),[b,x,S=[]]=Uh(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:zh(v,s),hasA11yProp:y,attributes:d});return(0,J.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,J.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Jh(e,t=[],n=[]){let r=typeof e==`string`?Ih(e,t,n):e,i=(0,J.forwardRef)(({className:e,...t},n)=>(0,J.createElement)(qh,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Rh(r.name)),i}var Yh={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Yh.node;var Xh=Jh(Yh),Zh={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};Zh.node;var Qh=Jh(Zh),$h={name:`bug`,size:24,node:[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]};$h.node;var eg=Jh($h),tg={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};tg.node;var ng=Jh(tg),rg={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};rg.node;var ig=Jh(rg),ag={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};ag.node;var og=Jh(ag),sg={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};sg.node;var cg=Jh(sg),lg={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};lg.node;var ug=Jh(lg),dg={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};dg.node;var fg=Jh(dg),pg={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};pg.node;var mg=Jh(pg),hg={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};hg.node;var gg=Jh(hg),_g={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};_g.node;var vg=Jh(_g),yg={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};yg.node;var bg=Jh(yg),xg={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};xg.node;var Sg=Jh(xg),Cg={name:`flag-off`,size:24,node:[[`path`,{d:`M16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1q158e`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M4 22V4`,key:`1plyxx`}],[`path`,{d:`M7.656 2H8c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10.347`,key:`xj1b71`}]]};Cg.node;var wg=Jh(Cg),Tg={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};Tg.node;var Eg=Jh(Tg),Dg={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Dg.node;var Og=Jh(Dg),kg={name:`git-pull-request-arrow`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v12`,key:`ih889a`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}]]};kg.node;var Ag=Jh(kg),jg={name:`git-pull-request-closed`,size:24,node:[[`path`,{d:`m15.5 3.5 5 5`,key:`1kmx7t`}],[`path`,{d:`m15.5 8.5 5-5`,key:`saftza`}],[`path`,{d:`M18 11.62V15`,key:`1greaj`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}]]};jg.node;var Mg=Jh(jg),Ng={name:`git-pull-request-draft`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M18 6V5`,key:`1oao2s`}],[`path`,{d:`M18 11v-1`,key:`11c8tz`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Ng.node;var Pg=Jh(Ng),Fg={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Fg.node;var Ig=Jh(Fg),Lg={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Lg.node;var Rg=Jh(Lg),zg={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};zg.node;var Bg=Jh(zg),Vg={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};Vg.node;var Hg=Jh(Vg),Ug={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Ug.node;var Wg=Jh(Ug),Gg={name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]};Gg.node;var Kg=Jh(Gg),qg={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};qg.node;var Jg=Jh(qg),Yg={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]};Yg.node;var Xg=Jh(Yg),Zg={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Zg.node;var Qg=Jh(Zg),$g={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};$g.node;var e_=Jh($g),t_={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};t_.node;var n_=Jh(t_),r_={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};r_.node;var i_=Jh(r_),a_={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};a_.node;var o_=Jh(a_),s_={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};s_.node;var c_=Jh(s_),l_={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};l_.node;var u_=Jh(l_),d_={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};d_.node;var f_=Jh(d_),p_={name:`scan-eye`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0`,key:`11ak4c`}]]};p_.node;var m_=Jh(p_),h_={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};h_.node;var g_=Jh(h_),__={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};__.node;var v_=Jh(__),y_={name:`shield-question-mark`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`shield-question`]};y_.node;var b_=Jh(y_),x_={name:`signpost`,size:24,node:[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M12 3v3`,key:`1n5kay`}],[`path`,{d:`M2.354 10.354a1.207 1.207 0 0 1 0-1.708l2.06-2.06A2 2 0 0 1 5.828 6h12.344a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H5.828a2 2 0 0 1-1.414-.586z`,key:`1tm261`}]]};x_.node;var S_=Jh(x_),C_={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};C_.node;var w_=Jh(C_),T_={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};T_.node;var E_=Jh(T_),D_={name:`ticket`,size:24,node:[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`M13 5v2`,key:`dyzc3o`}],[`path`,{d:`M13 17v2`,key:`1ont0d`}],[`path`,{d:`M13 11v2`,key:`1wjjxi`}]]};D_.node;var O_=Jh(D_),k_={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};k_.node;var A_=Jh(k_),j_={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};j_.node;var M_=Jh(j_),N_={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};N_.node;var P_=Jh(N_),F_={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};F_.node;var I_=Jh(F_),L_={page:`not-found`},R_=`/preferences`,z_=e=>e===null?R_:`${R_}?scope=${e.split(`/`).map(encodeURIComponent).join(`/`)}`,B_=e=>new URLSearchParams(e).get(`scope`),V_=e=>{if(e===void 0)return null;try{return decodeURIComponent(e)}catch{return null}},H_=(e,t)=>V_(RegExp(`^/${t}/([^/]+)/?$`).exec(e)?.[1]),U_=e=>{if(e===`/`)return{page:`picker`};if(e===`/preferences`||e===`/preferences/`)return{page:`preferences`};let t=H_(e,`review`);if(t!==null){let e=Pu.safeParse(t);return e.success?{page:`review`,analysisId:e.data}:L_}let n=/^\/pr\/([^/]+)\/([^/]+)\/([^/]+)\/([^/]+)\/?$/.exec(e);if(n!==null){let e=wc.safeParse(n[1]),t=V_(n[2]),r=V_(n[3]),i=V_(n[4]);if(!e.success||t===null||r===null||i===null)return L_;let a=Af(jf({repo:{host:e.data,owner:t,repo:r},number:Number(i)}));return a.ok&&String(a.value.number)===i?{page:`open`,ref:a.value}:L_}return L_},W_=({repo:e,number:t})=>`/pr/${e.host}/${[e.owner,e.repo].map(encodeURIComponent).join(`/`)}/${t}`,G_=e=>`/review/${encodeURIComponent(e)}`,K_=e=>(window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)),q_=()=>(0,J.useSyncExternalStore)(K_,()=>window.location.pathname),J_=()=>(0,J.useSyncExternalStore)(K_,()=>window.location.search),Y_=e=>{window.history.pushState(null,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))},X_=e=>{window.history.replaceState(null,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))},Z_=e=>!e.defaultPrevented&&e.button===0&&!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey),Q_=({to:e,onClick:t,...n})=>(0,Y.jsx)(`a`,{href:e,onClick:n=>{t?.(n),Z_(n)&&(n.preventDefault(),Y_(e))},...n});function $_(){return typeof window<`u`}function ev(e){return rv(e)?(e.nodeName||``).toLowerCase():`#document`}function tv(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nv(e){return((rv(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function rv(e){return $_()?e instanceof Node||e instanceof tv(e).Node:!1}function iv(e){return $_()?e instanceof Element||e instanceof tv(e).Element:!1}function av(e){return $_()?e instanceof HTMLElement||e instanceof tv(e).HTMLElement:!1}function ov(e){return!$_()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof tv(e).ShadowRoot}function sv(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=vv(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function cv(e){return/^(table|td|th)$/.test(ev(e))}function lv(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var uv=/transform|translate|scale|rotate|perspective|filter/,dv=/paint|layout|strict|content/,fv=e=>!!e&&e!==`none`,pv;function mv(e){let t=iv(e)?vv(e):e;return fv(t.transform)||fv(t.translate)||fv(t.scale)||fv(t.rotate)||fv(t.perspective)||!gv()&&(fv(t.backdropFilter)||fv(t.filter))||uv.test(t.willChange||``)||dv.test(t.contain||``)}function hv(e){let t=bv(e);for(;av(t)&&!_v(t);){if(mv(t))return t;if(lv(t))return null;t=bv(t)}return null}function gv(){return pv??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),pv}function _v(e){return/^(html|body|#document)$/.test(ev(e))}function vv(e){return tv(e).getComputedStyle(e)}function yv(e){return iv(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bv(e){if(ev(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ov(e)&&e.host||nv(e);return ov(t)?t.host:t}function xv(e){let t=bv(e);return _v(t)?(e.ownerDocument||e).body:av(t)&&sv(t)?t:xv(t)}function Sv(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xv(e),i=r===e.ownerDocument?.body,a=tv(r);if(i){let e=Cv(a);return t.concat(a,a.visualViewport||[],sv(r)?r:[],e&&n?Sv(e):[])}return t.concat(r,Sv(r,[],n))}function Cv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var wv={...J},Tv={};function Ev(e,t){let n=J.useRef(Tv);return n.current===Tv&&(n.current=e(t)),n}var Dv=wv.useInsertionEffect,Ov=Dv&&Dv!==wv.useLayoutEffect?Dv:e=>e();function Z(e){let t=Ev(kv).current;return t.next=e,Ov(t.effect),t.trampoline}function kv(){let e={next:void 0,callback:Av,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Av(){}var Q=typeof document<`u`?J.useLayoutEffect:()=>{};function jv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Mv={};function Nv(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Fv(t);let a=Fv(e);return t&&(a=Iv(a,t)),n&&(a=Iv(a,n)),r&&(a=Iv(a,r)),i&&(a=Iv(a,i)),a}function Pv(e){if(e.length===0)return Mv;if(e.length===1)return Fv(e[0]);let t=Fv(e[0]);for(let n=1;n<e.length;n+=1)t=Iv(t,e[n]);return t}function Fv(e){return Bv(e)?{...e(Mv)}:Lv(e)}function Iv(e,t){return Bv(t)?t(e):Rv(e,t)}function Lv(e){let t={...e};for(let e in t){let n=t[e];zv(e,n)&&(t[e]=Hv(n))}return t}function Rv(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=jv(e.style,r);break;case`className`:e[n]=Wv(e.className,r);break;default:e[n]=zv(n,r)?Vv(e[n],r):r}}return e}function zv(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Bv(e){return typeof e==`function`}function Vv(e,t){return t?e?(...n)=>{let r=n[0];if(Gv(r)){let i=r;Uv(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Hv(t):e}function Hv(e){return e&&((...t)=>{let n=t[0];return Gv(n)&&Uv(n),e(...t)})}function Uv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Wv(e,t){return t?e?t+` `+e:t:e}function Gv(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Kv(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var qv=Kv(`https://base-ui.com/production-error`,`Base UI`),Jv=J.createContext(void 0);function Yv(e=!1){let t=J.useContext(Jv);if(t===void 0&&!e)throw Error(qv(16));return t}function Xv(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:J.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Zv(e){return e?.ownerDocument||document}function Qv(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(tv(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function $v(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=J.useRef(null),s=Yv(!0),c=a??s!==void 0,{props:l}=Xv({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=J.useCallback(()=>{let e=o.current;ey(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Q(u,[u]),{getButtonProps:J.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Nv({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Uv(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=ey(r),s=!i&&ty(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Qv(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Qv(r,e)))},onKeyUp(e){t||(Uv(e),a?.(e),e.target===e.currentTarget&&i&&c&&ey(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Qv(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Z(e=>{o.current=e,u()})}}function ey(e){return av(e)&&e.tagName===`BUTTON`}function ty(e){return av(e)&&e.tagName===`A`&&!!e.href}function ny(e,t,n,r){let i=Ev(iy).current;return ay(i,e,t,n,r)&&sy(i,[e,t,n,r]),i.callback}function ry(e){let t=Ev(iy).current;return oy(t,e)&&sy(t,e),t.callback}function iy(){return{callback:null,cleanup:null,refs:[]}}function ay(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function oy(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function sy(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var cy=19;function ly(e){return cy>=e}function uy(e){if(!J.isValidElement(e))return null;let t=e,n=t.props;return(ly(19)?n?.ref:t.ref)??null}function dy(){}var fy=Object.freeze([]),py=Object.freeze({});function my(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function hy(e,t){return typeof e==`function`?e(t):e}function gy(e,t){return typeof e==`function`?e(t):e}function _y(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=xy(r));let i=vy(t,n,r);if(n.enabled===!1)return null;let a=n.state??py;return Sy(e,r,i,a)}function vy(e,t,n){let{className:r,style:i}=e,{state:a=py,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?hy(r,a):void 0,d=l?gy(i,a):void 0,f=l?my(a,c):py,p=l&&s?yy(s):void 0,m=l?jv(f,p)??{}:py;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?ry([m.ref,uy(n),...o]):ny(m.ref,uy(n),o):ny(null,null)),l?(u!==void 0&&(m.className=Wv(m.className,u)),d!==void 0&&(m.style=jv(m.style,d)),m):py}function yy(e){return Array.isArray(e)?Pv(e):Nv(void 0,e)}var by=Symbol.for(`react.lazy`);function xy(e){if(e?.$$typeof!==by)return e;let t=J.Children.toArray(e)[0];return J.isValidElement(t)?t:e}function Sy(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Nv(n,t.props);return e.ref=n.ref,J.cloneElement(t,e)}return Cy(e,n)}function Cy(e,t){return e===`button`?(0,J.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,J.createElement)(`img`,{alt:``,...t,key:t.key}):J.createElement(e,t)}var wy=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=$v({disabled:i,focusableWhenDisabled:a,native:o});return _y(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Ty=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ey=$p,Dy=(e,t)=>n=>{if(t?.variants==null)return Ey(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ty(t)||Ty(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ey(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Oy=Dy(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-ui font-medium whitespace-nowrap transition-all select-none active:not-aria-[haspopup]:not-aria-disabled:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80 aria-disabled:hover:bg-primary`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground aria-disabled:hover:bg-background`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20`,link:`text-primary underline-offset-4 hover:underline`,ai:`border-primary bg-ai-soft text-primary hover:bg-ai-soft-hover active:bg-ai-soft-active aria-expanded:bg-ai-soft-hover aria-disabled:hover:bg-ai-soft`,"ai-strong":`border-ai-soft-bd-strong bg-ai-soft text-primary hover:bg-ai-soft-hover active:bg-ai-soft-active aria-expanded:bg-ai-soft-hover aria-disabled:hover:bg-ai-soft`,"ai-quiet":`border-ai-soft-bd bg-card text-primary hover:bg-ai-quiet-hover active:bg-ai-quiet-active aria-expanded:bg-ai-quiet-hover aria-disabled:hover:bg-card`,approve:`bg-review-approved text-primary-foreground hover:bg-review-approved-hover active:bg-review-approved-active aria-disabled:hover:bg-review-approved`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-md px-2 text-caption in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-md px-2.5 text-ui in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-md in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-md in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function $({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Y.jsx)(wy,{"data-slot":`button`,className:X(Oy({variant:t,size:n,className:e})),...r})}var ky=[],Ay=void 0;function jy(){return Ay}function My(e){ky.push(e)}function Ny(e){let t=(t,n)=>{let r=Ev(Fy).current,i;try{Ay=r;for(let e of ky)e.before(r);i=e(t,n);for(let e of ky)e.after(r);r.didInitialize=!0}finally{Ay=void 0}return i};return t.displayName=e.displayName||e.name,t}function Py(e){return J.forwardRef(Ny(e))}function Fy(){return{didInitialize:!1}}function Iy(e){J.useEffect(e,fy)}var Ly=0,Ry=class e{static create(){return new e}currentId=Ly;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ly,t()},e)}isStarted(){return this.currentId!==Ly}clear=()=>{this.currentId!==Ly&&(clearTimeout(this.currentId),this.currentId=Ly)};disposeEffect=()=>this.clear};function zy(){let e=Ev(Ry.create).current;return Iy(e.disposeEffect),e}function By(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Vy,platform:Hy,maxTouchPoints:Uy}=By(),Wy=Vy.toLowerCase(),Gy=Hy.toLowerCase(),Ky=/^i(os$|p)/.test(Gy)||Gy===`macintel`&&Uy>1,qy=`android`,Jy=Gy===qy||Wy.includes(qy),Yy=!Ky&&Gy.startsWith(`mac`);Gy.startsWith(`win`),!Jy&&/^(linux|chrome os)/.test(Gy);var Xy=Yy||Ky,Zy=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Zy&&Wy.includes(`firefox`),!Zy&&Wy.includes(`chrom`);var Qy=Xy,$y=/jsdom|happydom/.test(Wy);function eb(e){e.preventDefault(),e.stopPropagation()}function tb(e){return`nativeEvent`in e}function nb(e){return e.pointerType===``&&e.isTrusted?!0:Jy&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function rb(e){return $y?!1:!Jy&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Jy||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ib(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function ab(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function ob(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function sb(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ov(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function cb(e,t){let n=e;for(;n;){if(iv(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(ov(n)?n.host:null)}return null}function lb(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var ub=`data-base-ui-focusable`,db=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,fb=`ArrowLeft`,pb=`ArrowRight`,mb=`ArrowUp`,hb=`ArrowDown`,gb=`data-starting-style`,_b=`data-ending-style`,vb={[gb]:``},yb={[_b]:``},bb={transitionStatus(e){return e===`starting`?vb:e===`ending`?yb:null}},xb=`data-open`,Sb=`data-closed`,Cb=`data-anchor-hidden`,wb=`data-popup-open`,Tb=`data-pressed`,Eb={[wb]:``},Db={[wb]:``,[Tb]:``},Ob={[xb]:``},kb={[Sb]:``},Ab={[Cb]:``},jb={open(e){return e?Eb:null}},Mb={open(e){return e?Db:null}},Nb={open(e){return e?Ob:kb},anchorHidden(e){return e?Ab:null}},Pb={...Nb,...bb},Fb=`data-trigger-disabled`;function Ib(e,t){if(!iv(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Fb);for(let[,e]of t.entries())if(sb(e,n))return!e.hasAttribute(Fb);return!1}function Lb(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Rb(e){return e.matches(`html,body`)}function zb(e){return av(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Bb(e){return cb(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${db}`)!=null}function Vb(e){return e?e.getAttribute(`role`)===`combobox`&&zb(e):!1}function Hb(e){if(!e||$y)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ub(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Wb(e,t){return t!=null&&!ib(t)?0:typeof e==`function`?e():e}function Gb(e,t,n){let r=Wb(e,n);return typeof r==`number`?r:r?.[t]}function Kb(e){return typeof e==`function`?e():e}function qb(e,t){return t||e===`click`||e===`mousedown`}function Jb(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Yb(e,t,n,r){let i=!1,a=!1,o=r??py;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Xb(e,t,n){let r=n??py;return{reason:e,event:t??new Event(`base-ui`),...r}}var Zb=`none`,Qb=`trigger-press`,$b=`trigger-hover`,ex=`trigger-focus`,tx=`outside-press`,nx=`item-press`,rx=`close-press`,ix=`focus-out`,ax=`escape-key`,ox=`list-navigation`,sx=`keyboard`,cx=`pointer`,lx=`cancel-open`,ux=`sibling-open`,dx=`disabled`,fx=`missing`,px=`initial`,mx=`imperative-action`,hx=`window-resize`,gx=J.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ry,currentIdRef:{current:null},currentContextRef:{current:null}});function _x(e,t){e.current=t.current}function vx(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=J.useRef(n),a=J.useRef(n),o=J.useRef(null),s=J.useRef(null),c=zy();return Q(()=>{a.current=n,o.current?i.current={open:Gb(i.current,`open`),close:Gb(n,`close`)}:i.current=n},[n,o,i,a]),(0,Y.jsx)(gx.Provider,{value:J.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function yx(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=J.useContext(gx),[d,f]=J.useState(!1),p=J.useRef(n);return Q(()=>{p.current=n},[n]),Q(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),Q(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:Gb(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,Yb(Zb))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),Q(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,_x(a,s),u.clear()}},[c,i,a,r,s,u]),J.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function bx(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function xx(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Sx(e){let t=Ev(Cx,e).current;return t.next=e,Q(t.effect),t}function Cx(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var wx=null;globalThis.requestAnimationFrame;var Tx=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Ex=class e{static create(){return new e}static request(e){return Tx.request(e)}static cancel(e){return Tx.cancel(e)}currentId=wx;request(e){this.cancel(),this.currentId=Tx.request(()=>{this.currentId=wx,e()})}cancel=()=>{this.currentId!==wx&&(Tx.cancel(this.currentId),this.currentId=wx)};disposeEffect=()=>this.cancel};function Dx(){let e=Ev(Ex.create).current;return Iy(e.disposeEffect),e}var Ox={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},kx={...Ox,position:`fixed`,margin:0,top:0,left:0},Ax={...Ox,position:`absolute`},jx=J.forwardRef(function(e,t){let[n,r]=J.useState();Q(()=>{Qy&&Zy&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:kx,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Mx=Math.min,Nx=Math.max,Px=Math.round,Fx=Math.floor,Ix=e=>({x:e,y:e}),Lx={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Rx(e,t,n){return Nx(e,Mx(t,n))}function zx(e,t){return typeof e==`function`?e(t):e}function Bx(e){return e.split(`-`)[0]}function Vx(e){return e.split(`-`)[1]}function Hx(e){return e===`x`?`y`:`x`}function Ux(e){return e===`y`?`height`:`width`}function Wx(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Gx(e){return Hx(Wx(e))}function Kx(e,t,n){n===void 0&&(n=!1);let r=Vx(e),i=Gx(e),a=Ux(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=tS(o)),[o,tS(o)]}function qx(e){let t=tS(e);return[Jx(e),t,Jx(t)]}function Jx(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Yx=[`left`,`right`],Xx=[`right`,`left`],Zx=[`top`,`bottom`],Qx=[`bottom`,`top`];function $x(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xx:Yx:t?Yx:Xx;case`left`:case`right`:return t?Zx:Qx;default:return[]}}function eS(e,t,n,r){let i=Vx(e),a=$x(Bx(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Jx)))),a}function tS(e){let t=Bx(e);return Lx[t]+e.slice(t.length)}function nS(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function rS(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:nS(e)}function iS(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function aS(e,t){return t<0||t>=e.length}function oS(e,t){return lS(e.current,{disabledIndices:t})}function sS(e,t){return lS(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function cS(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>lS(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:aS(e,u)?-1:u,wrapped:d}}function lS(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&uS(e,a,r));return a}function uS(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!fS(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function dS(e){return e.visibility===`hidden`||e.visibility===`collapse`}function fS(e,t=e?vv(e):null){return!e||!e.isConnected||!t||dS(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var pS=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function mS(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ov(n)?n.host:null}function hS(e){for(let t of Array.from(e.children))if(ev(t)===`summary`)return t;return null}function gS(e,t){let n=hS(t);return!!n&&(e===n||sb(n,e))}function _S(e){let t=e?ev(e):``;return e!=null&&e.matches(pS)&&(t!==`summary`||e.parentElement!=null&&ev(e.parentElement)===`details`&&hS(e.parentElement)===e)&&(t!==`details`||hS(e)==null)&&(t!==`input`||e.type!==`hidden`)}function vS(e){if(!_S(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=mS(t)){let n=t!==e,r=ev(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ev(t)===`details`&&!t.open&&!gS(e,t)||t.hasAttribute(`hidden`)||!r&&!yS(t,n))return!1}return!0}function yS(e,t){let n=vv(e);return t?n.display!==`none`:fS(e,n)}function bS(e){let t=e.tabIndex;if(t<0){let t=ev(e);if(t===`details`||t===`audio`||t===`video`||av(e)&&e.isContentEditable)return 0}return t}function xS(e){if(ev(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function SS(e,t){let n=xS(e);if(!n)return!0;let r=t.find(e=>{let t=xS(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=xS(e);return t?.name===n.name&&t.form===n.form})===n}function CS(e){if(av(e)&&ev(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return av(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function wS(e,t){CS(e).forEach(e=>{_S(e)&&t.push(e),wS(e,t)})}function TS(e,t,n){CS(e).forEach(e=>{av(e)&&e.matches(t)&&n.push(e),TS(e,t,n)})}function ES(e){return vS(e)&&bS(e)>=0}function DS(e){let t=[];return wS(e,t),t.filter(vS)}function OS(e){let t=DS(e);return t.filter(e=>bS(e)>=0&&SS(e,t))}function kS(e,t){let n=OS(e),r=n.length;if(r===0)return;let i=ob(Zv(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function AS(e){return kS(Zv(e).body,1)||e}function jS(e){return kS(Zv(e).body,-1)||e}function MS(e,t,n){if(!e)return null;let r=[];wS(Zv(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(vS);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!sb(n,o)&&ES(o)&&SS(o,a))return o}return r[i]}function NS(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!sb(n,r)}function PS(e){OS(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function FS(e){let t=[];TS(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function IS(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...IS(e,t.id,n)])}function LS(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function RS(e){return`data-base-ui-${e}`}var zS=0;function BS(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(zS);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),dy;let o=requestAnimationFrame(a);return zS=o,()=>{zS===o&&(cancelAnimationFrame(o),zS=0)}}var VS=`data-base-ui-inert`,HS=new WeakMap,US=new WeakSet,WS=new WeakMap,GS=0;function KS(e){return e?ov(e)?e.host:KS(e.parentNode):null}var qS=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=KS(t);return e.contains(n)?n:null}).filter(e=>e!=null),JS=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},YS=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{ev(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function XS(e,t,n,{mark:r=!0}){let i=qS(t,e),a=r?YS(t,JS(i),new Set(i)):[],o=[],s=[];if(n){let e=qS(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);YS(t,JS(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(HS.get(e)||0)+1;HS.set(e,r),o.push(e),r===1&&n&&US.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(WS.get(e)||0)+1;WS.set(e,t),s.push(e),t===1&&e.setAttribute(VS,``)}),GS+=1,()=>{o.forEach(e=>{let t=(HS.get(e)||0)-1;HS.set(e,t),t||(US.has(e)||e.removeAttribute(`aria-hidden`),US.delete(e))}),r&&s.forEach(e=>{let t=(WS.get(e)||0)-1;WS.set(e,t),t||e.removeAttribute(VS)}),--GS,GS||(HS=new WeakMap,US=new WeakSet,WS=new WeakMap)}}function ZS(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Zv(e[0]).body;return XS(e,i,n,{mark:r})}function QS(){let[,e]=J.useState({});return J.useCallback(()=>{e({})},[])}var $S=0;function eC(e,t=`mui`){let n=J.useRef(void 0),r=QS(),i=e??n.current;return J.useEffect(()=>{n.current??($S+=1,n.current=`${t}-${$S}`,e??r())},[e,t,r]),i}var tC=wv.useId;function nC(e,t){if(tC!==void 0){let n=tC();return e??(t?`${t}-${n}`:n)}return eC(e,t)}var rC={style:{transition:`none`}},iC=`data-base-ui-click-trigger`,aC={fallbackAxisSide:`none`},oC={fallbackAxisSide:`end`},sC={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},cC=l(h(),1),lC=J.createContext(null),uC=()=>J.useContext(lC),dC=RS(`portal`);function fC(e={}){let{ref:t,container:n,componentProps:r=py,elementProps:i}=e,a=nC(),o=uC()?.portalNode,[s,c]=J.useState(null),[l,u]=J.useState(null),d=Z(e=>{e!==null&&u(e)}),f=J.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(rv(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=_y(`div`,r,{ref:[t,d],props:[{id:a,[dC]:``},i]}),m=s&&p?cC.createPortal(p,s):null;return{node:l,nodeId:J.isValidElement(p)?p.props.id:void 0,subtree:m}}var pC=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=fC({container:o,ref:t,componentProps:e,elementProps:c}),f=J.useRef(null),p=J.useRef(null),m=J.useRef(null),h=J.useRef(null),[g,_]=J.useState(null),v=J.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;J.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&NS(e)&&(e.type===`focusin`?v.current&&=(FS(l),!1):(PS(l),v.current=!0))}return xx(bx(l,`focusin`,e,!0),bx(l,`focusout`,e,!0))},[l,y]),Q(()=>{l&&b===!0&&v.current&&(FS(l),v.current=!1)},[b,l]);let S=J.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Y.jsxs)(J.Fragment,{children:[d,(0,Y.jsxs)(lC.Provider,{value:S,children:[x&&l&&(0,Y.jsx)(jx,{"data-type":`outside`,ref:f,onFocus:e=>{NS(e,l)?m.current?.focus():jS(g?g.domReference:null)?.focus()}}),x&&l&&(0,Y.jsx)(`span`,{role:s,"aria-owns":u,style:sC}),l&&cC.createPortal(a,l),x&&l&&(0,Y.jsx)(jx,{"data-type":`outside`,ref:p,onFocus:e=>{NS(e,l)?h.current?.focus():(AS(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Yb(`focus-out`,e.nativeEvent)))}})]})]})});function mC(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var hC=class{nodesRef={current:[]};events=mC();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},gC=J.createContext(null),_C=J.createContext(null),vC=()=>J.useContext(gC)?.id||null,yC=e=>{let t=J.useContext(_C);return e??t};function bC(e){let t=nC(),n=yC(e),r=vC();return Q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function xC(e){let{children:t,id:n}=e,r=vC();return(0,Y.jsx)(gC.Provider,{value:J.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function SC(e){let{children:t,externalTree:n}=e,r=Ev(()=>n??new hC).current;return(0,Y.jsx)(_C.Provider,{value:r,children:t})}function CC(e){return e==null?e:`current`in e?e.current:e}function wC(e,t){let n=tv(lb(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(nb(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var TC=20,EC=[];function DC(){EC=EC.filter(e=>e.deref()?.isConnected)}function OC(e){DC(),e&&ev(e)!==`body`&&(EC.push(new WeakRef(e)),EC.length>TC&&(EC=EC.slice(-20)))}function kC(){return DC(),EC[EC.length-1]?.deref()}function AC(e){return e?ES(e)?e:OS(e)[0]||e:null}function jC(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=DS(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return ES(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function MC(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=Z(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Vb(_)&&S,w=Sx(i),T=Sx(a),E=Sx(o),D=Sx(u),O=Sx(g),k=yC(m),A=uC(),j=J.useRef(!1),M=J.useRef(!1),N=J.useRef(!1),P=J.useRef(null),F=J.useRef(``),I=J.useRef(``),L=J.useRef(null),R=J.useRef(null),ee=ny(L,p,A?.beforeInsideRef),z=ny(R,A?.afterInsideRef),B=zy(),V=zy(),te=Dx(),H=A!=null,U=Ub(v),ne=Z((e=U)=>e?OS(e):[]),re=Z(()=>h?.().filter(e=>e!=null)??[]);J.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&sb(U,ob(Zv(U)))&&ne().length===0&&!C&&eb(e)}return bx(Zv(U),`keydown`,e)},[r,U,c,C,ne]),J.useEffect(()=>{if(r||!g)return;let e=Zv(U);function t(){N.current=!1}function n(e){let t=lb(e),n=re(),r=sb(v,t)||sb(_,t)||sb(A?.portalNode,t)||n.some(e=>e===t||sb(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,cb(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,V.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return xx(bx(e,`pointerdown`,n,!0),bx(e,`pointerup`,t,!0),bx(e,`pointercancel`,t,!0),bx(e,`keydown`,i,!0),t)},[r,v,_,U,g,A,V,re]),J.useEffect(()=>{if(r||!l)return;let e=Zv(U);function n(){M.current=!0,V.start(0,()=>{M.current=!1})}function i(e){let t=lb(e);ES(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=lb(n);c&&r==null&&a!=null&&sb(v,a)&&OC(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=re(),p=r?.hasAttribute(RS(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,CC(f),CC(d)].includes(r),m=!(sb(_,r)||sb(v,r)||sb(r,v)||sb(A?.portalNode,r)||u.some(e=>e===r||sb(e,r))||l.hasMatchingElement(e=>sb(e,r))||p||k&&(IS(k.nodesRef.current,o).find(e=>sb(e.context?.elements.floating,r)||sb(e.context?.elements.domReference,r))||LS(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,Ub(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&U&&jC(U),s&&i!==_&&!fS(a)&&ob(e)===e.body){if(av(U)&&(U.focus(),s===`popup`)){te.request(()=>{U.focus()});return}let e=ne(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;av(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==kC())&&(j.current=!0,t.setOpen(!1,Yb(ix,n)))})}function o(){N.current||(b.current.insideReactTree=!0,B.start(0,()=>{b.current.insideReactTree=!1}))}let u=av(_)?_:null;if(v||u)return xx(u&&bx(u,`focusout`,a),u&&bx(u,`pointerdown`,n),v&&bx(v,`focusin`,i),v&&bx(v,`focusout`,a),v&&A&&bx(v,`focusout`,o,!0))},[r,_,v,U,c,k,A,t,l,s,ne,C,x,b,B,V,te,d,f,re]),J.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${RS(`portal`)}]`)||[]),t=(k?LS(k.nodesRef.current,x()):[]).find(e=>Vb(e.context?.elements.domReference||null))?.context?.elements.domReference,n=ZS([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...re(),t,CC(f),CC(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=ZS([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,re]),Q(()=>{if(!g||r||!av(U))return;F.current=``,I.current=``;let e=Zv(U),t=ob(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||sb(U,t))return;let i=null,a=()=>(i??=ne(U),i[0]||U),o;o=r===!0||r===null?a():CC(r),o||=a();let s=sb(U,ob(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&nb(c);BS(o,{sync:l,preventScroll:o===U,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=ob(e);return!(t!==o&&sb(U,t))}})})},[r,g,U,ne,w,D,O,b]);let ie=J.useRef(null);Q(()=>{if(r||!U){ie.current=null;return}ie.current&&=(ie.current.cancelled=!0,null);let e=Zv(U),t=ob(e),n=D.current==null;OC(t);function i(e){if(e.open||(F.current=wC(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(RS(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(nb(e.nativeEvent)||rb(e.nativeEvent))j.current=!1;else{let e=!1;Zv(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&ev(t)!==`body`?t:null,s=n?o||a:a||o;return s||=kC()||null,typeof i==`boolean`?s:CC(i)||s||null}return()=>{y.off(`openchange`,i);let t=ob(e),n=re(),r=sb(v,t)||n.some(e=>e===t||sb(e,t))||k&&IS(k.nodesRef.current,x(),!1).some(e=>sb(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};ie.current=l,queueMicrotask(()=>{ie.current===l&&(ie.current=null);let n=AC(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&av(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,U,T,E,D,y,k,_,x,re]),Q(()=>{if(!Zy||g||!v)return;let e=ob(Zv(v));av(e)&&zb(e)&&sb(v,e)&&e.blur()},[g,v]),Q(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),Q(()=>{if(!r&&U)return jC(U),()=>{queueMicrotask(DC)}},[r,U]);let ae=!r&&(!c||!C)&&(H||c);return(0,Y.jsxs)(J.Fragment,{children:[ae&&(0,Y.jsx)(jx,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c){let e=ne();BS(e[e.length-1])}else A?.portalNode&&(j.current=!1,NS(e,A.portalNode)?AS(_)?.focus():CC(f??A.beforeOutsideRef)?.focus())}}),n,ae&&(0,Y.jsx)(jx,{"data-type":`inside`,ref:z,onFocus:e=>{c?BS(ne()[0]):A?.portalNode&&(l&&(j.current=!0),NS(e,A.portalNode)?jS(_)?.focus():CC(d??A.afterOutsideRef)?.focus())}})]})}function NC(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Qb}=t,l=e.context.dataRef,u=J.useRef(void 0),d=Dx(),f=zy(),p=J.useMemo(()=>{function t(t,n,r,i){let a=Yb(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=ib(e.pointerType,!0)&&rb(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||ib(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=lb(s),p=zb(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:ib(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return J.useMemo(()=>n?{reference:p}:py,[n,p])}function PC(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function FC(e){return e!=null&&e.clientX!=null}function IC(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=J.useRef(!1),l=J.useRef(null),[u,d]=J.useState(),[f,p]=J.useState([]),m=Z(t=>{e.set(`positionReference`,t)}),h=Z((t,n,i)=>{c.current||(!s.current.openEvent||FC(s.current.openEvent))&&e.set(`positionReference`,PC(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=Z(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=ib(u)?a:i;J.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=tv(a);function r(t){let n=lb(t);sb(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||FC(s.current.openEvent)?l.current=bx(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),J.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),J.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),J.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=J.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return J.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function LC(){return!1}function RC(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function zC(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=LC,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=yC(c),m=Z(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Z(()=>a),{escapeKey:v,outsidePress:y}=RC(s),b=J.useRef(!1),x=J.useRef(!1),S=J.useRef(!1),C=J.useRef(!1),w=J.useRef(!1),T=J.useRef(``),E=J.useRef(null),D=zy(),O=zy(),k=zy(),A=Z(()=>{O.clear(),d.current.insideReactTree=!1}),j=Z(e=>{let t=d.current.floatingContext?.nodeId;return(p?IS(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=Z(t=>Lb(t,e.select(`floatingElement`))||Lb(t,e.select(`domReferenceElement`))),N=Z(t=>{o()&&e.setOpen(!1,Yb(Qb,t.nativeEvent))}),P=Z(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=tb(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=Yb(ax,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=Z(()=>{d.current.insideReactTree=!0,O.start(0,A)}),I=Z(t=>{if(!l||!n||t.button!==0)return;let r=lb(t.nativeEvent);sb(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),L=Z(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});J.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),J.useEffect(()=>A,[A]),J.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new Ry,i=Zv(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(Zy?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&IS(p.nodesRef.current,t).some(t=>Lb(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=lb(n),i=`[${RS(`inert`)}]`,a=iv(r)?r.getRootNode():null,o=Array.from((ov(a)?a:Zv(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>sb(e,r))))return;let c=iv(r)?r:null;for(;c&&!_v(c);){let e=bv(c);if(_v(e)||!iv(e))break;c=e}if(!(o.length&&iv(r)&&!Rb(r)&&!sb(r,e.select(`floatingElement`))&&o.every(e=>!sb(c,e)))){if(av(r)&&!(`touches`in n)){let e=_v(r),t=vv(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!nb(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}(typeof h!=`function`||h(n))&&(j(`__outsidePressBubbles`)||(e.setOpen(!1,Yb(tx,n)),A()))}}}function F(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!M(t)&&N(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=lb(e);if(!n)return;let r=bx(n,e.type,()=>{t(e),r()})}function R(e){T.current=`touch`,L(e,I)}function ee(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function z(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():O(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,A())))}function B(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function V(e){L(e,B)}function te(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function H(e){L(e,te)}let U=xx(r&&xx(bx(i,`keydown`,P),bx(i,`compositionstart`,a),bx(i,`compositionend`,o)),g&&xx(bx(i,`click`,ee,!0),bx(i,`pointerdown`,ee,!0),bx(i,`pointerup`,z,!0),bx(i,`pointercancel`,z,!0),bx(i,`mousedown`,ee,!0),bx(i,`mouseup`,z,!0),bx(i,`touchstart`,R,{capture:!0,passive:!0}),bx(i,`touchmove`,V,{capture:!0,passive:!0}),bx(i,`touchend`,H,{capture:!0,passive:!0})));return()=>{U(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let R=J.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),ee=J.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return J.useMemo(()=>n?{reference:R,floating:ee,trigger:R}:{},[n,R,ee])}function BC(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function VC(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function HC(e){let t=[],n,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of Array.from(e).sort((e,t)=>e.top-t.top)){if(r=Math.min(r,s.left),i=Math.min(i,s.top),a=Math.max(a,s.right),o=Math.max(o,s.bottom),!n||s.top-n.top>n.height/2)t.push(VC(s));else{let e=t[t.length-1];e.left=Math.min(e.left,s.left),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}n=s}return{lines:t,fallback:BC(r,i,a,o)}}function UC(e,t,n){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&n>e.top-2&&n<e.bottom+2)}function WC(e){return BC(e.left,e.top,e.right,e.bottom)}function GC(e,t,n){let{lines:r}=HC(e.getClientRects());if(r.length<2)return;let i=UC(r,t,n);return{x:t,y:n,lineIndex:i===-1?void 0:i,element:e}}function KC(e,t,n){let{lines:r,fallback:i}=HC(e.getClientRects());if(r.length<2)return null;let a=n?.x,o=n?.y,s=t[0];if(n?.lineIndex!=null&&r[n.lineIndex])return WC(r[n.lineIndex]);if(a!=null&&o!=null){let e=UC(r,a,o);if(e!==-1)return WC(r[e])}if(r.length===2&&r[0].left>r[1].right&&a!=null&&o!=null)return i;if(s===`t`||s===`b`){let e=r[0],t=r[r.length-1],n=s===`t`?e:t;return BC(n.left,e.top,n.right,t.bottom)}let c=s===`l`,l=r[0].left,u=r[0].right,d=c?1/0:-1/0,f=r[0],p=r[0];for(let e of r){l=Math.min(l,e.left),u=Math.max(u,e.right);let t=c?e.left:e.right;c&&t<d||!c&&t>d?(d=t,f=e,p=e):t===d&&(p=e)}return BC(l,f.top,u,p.bottom)}function qC(e){return`contextElement`in e&&e.contextElement?e.contextElement:iv(e)?e:void 0}function JC(e,t){function n(t){YC(e,t.currentTarget,t.clientX,t.clientY)}function r(e){t||n(e)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function YC(e,t,n,r){let i=GC(t,n,r);return e.current=i,i}function XC(e){return{name:`inline`,async fn(t){let n=t.elements.reference;if(typeof n?.getClientRects!=`function`)return{};let r=qC(n),i=e.current,a=i?.element===n||i?.element===r?i:void 0,o=KC(n,t.placement,a);if(!o||typeof t.platform.getElementRects!=`function`)return{};let s=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return o}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===s.reference.x&&t.rects.reference.y===s.reference.y&&t.rects.reference.width===s.reference.width&&t.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}var ZC=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(qv(99,this.componentName,e,this.componentName));t.setOpen(!0,Yb(mx,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,Yb(mx))}};function QC(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),Q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};iv(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function $C(e,t=!1,n=!1,r=!1){let[i,a]=J.useState(e&&t?`idle`:void 0),[o,s]=J.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Q(()=>{if(!e&&o&&i!==`ending`&&n){let e=Ex.request(()=>{a(`ending`)});return()=>{Ex.cancel(e)}}},[e,o,i,n]),Q(()=>{if(!e||t||i===void 0)return;let n=Ex.request(()=>{a(void 0)});return()=>{Ex.cancel(n)}},[t,e,i]),Q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Ex.request(()=>{a(`idle`)});return()=>{Ex.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function ew(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var tw=null;function nw(e){if(!tw){let e=[];tw=e,queueMicrotask(()=>{tw=null,cC.flushSync(()=>{for(let t of e)t()})})}tw.push(e)}function rw(e,t=!1,n=!1){let r=Dx();return Z((i,a=null)=>{r.cancel();let o=CC(e);if(o==null)return;let s=o,c=()=>{n?nw(()=>{a?.aborted||i()}):cC.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(ew(s).map(e=>e.finished.then(dy))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(ew(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=gb;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function iw(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Z(a),s=rw(r,n,i);J.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function aw(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=Z(i),{mounted:c,setMounted:l,transitionStatus:u}=$C(t,!1,!1,o),d=!t&&r;Q(()=>{t&&s(!1)},[t,s]);let f=J.useRef(c),p=J.useRef(!1),m=QS(),h=()=>{f.current=!1,l(!1),a()};Q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=Z(()=>{f.current&&(t?(p.current=!0,m()):h())});return iw({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var ow={tabIndex:-1,[ub]:``};function sw(e){return t=>t!==`touch`||e.current}function cw(e,t=!1){let n=nC(),r=vC()!=null,i=Ev(()=>e(n,r)).current;return QC({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function lw({handle:e,store:t}){return Q(()=>e.attachStore(t),[e,t]),null}function uw(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function dw(e,t){let n=J.useRef(null);return Z(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),uw(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),uw(t))})}function fw(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function pw(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function mw(e,t,n,r={}){let i=n.reason,a=i===$b,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=pw(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=fw(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?cC.flushSync(l):l()}function hw(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=dw(e,n),o=Z(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Z(e=>{a(e),e&&o(e)});return Q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function gw(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=J.useRef(null),i=e.useState(`open`);Q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Yb(Zb);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function _w(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=aw({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return Ev(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function vw(e,t){e.useSyncedValues(t),Q(()=>()=>{e.update({activeTriggerProps:py,inactiveTriggerProps:py,popupProps:py})},[e])}function yw(e,t){Q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var bw=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},xw=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Sw=o(((e,t)=>{t.exports=xw()})),Cw=o((e=>{var t=d(),n=Sw();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ww=o(((e,t)=>{t.exports=Cw()})),Tw=Sw(),Ew=ww(),Dw=ly(19)?Aw:jw;function Ow(e,t,n,r,i){return Dw(e,t,n,r,i)}function kw(e,t,n,r,i){let a=J.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Tw.useSyncExternalStore)(e.subscribe,a,a)}My({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Tw.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Aw(e,t,n,r,i){let a=jy();if(!a)return kw(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function jw(e,t,n,r,i){return(0,Ew.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Mw=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Ow(this,e,t,n,r)}},Nw=class extends Mw{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){J.useDebugValue(e);let n=this;Q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){J.useDebugValue(e);let n=this,r=t!==void 0;Q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return J.useDebugValue(e),Ow(this,this.selectors[e],t,n,r)}useContextCallback(e,t){J.useDebugValue(e);let n=Z(t??dy);this.context[e]=n}useStateSetter(e){let t=J.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Pw={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Fw=class extends Nw{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:mC(),nested:n,triggerElements:i},Pw),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&ab(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Iw(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Fw({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:py,inactiveTriggerProps:py,popupProps:py}}var Lw=e=>e.triggerIdProp??e.activeTriggerId,Rw=e=>e.openProp??e.open,zw=e=>(e.popupElement?.id??e.floatingId)||void 0;function Bw(e,t){return t!==void 0&&Rw(e)&&Lw(e)===t}function Vw(e,t){return Bw(e,t)?!0:t!==void 0&&Rw(e)&&Lw(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Hw={open:Rw,mounted:e=>e.mounted,transitionStatus:e=>Rw(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Lw,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:zw,isTriggerActive:(e,t)=>t!==void 0&&Lw(e)===t,isOpenedByTrigger:(e,t)=>Bw(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Lw(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Vw(e,t)?zw(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Uw(e){let t=J.useCallback(t=>e===void 0?dy:e.subscribeStore(t),[e]),n=J.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Tw.useSyncExternalStore)(t,n,()=>e?.serverStore)}function Ww(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=nC(),a=vC()!=null,o=Ev(()=>new Fw({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new bw,floatingId:i,syncOnly:!1,nested:a})).current;return Q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=iv(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Gw=Yy&&Zy;function Kw(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=J.useRef(!1),s=J.useRef(null),c=J.useRef(!0),l=zy();J.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=tv(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&av(t)&&t===ob(Zv(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return xx(bx(r,`blur`,i),Gw&&bx(r,`keydown`,a,!0),Gw&&bx(r,`pointerdown`,l,!0))},[e,n]),J.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);iv(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=J.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=lb(n.nativeEvent);if(iv(a)){if(Gw&&!n.relatedTarget){if(!c.current&&!zb(a))return}else if(!Hb(a))return}let u=Ib(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,Yb(ex,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,Yb(ex,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=iv(r)&&r.hasAttribute(RS(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=ob(Zv(t));(r||n!==t)&&(sb(a.current.floatingContext?.refs.floating.current,n)||sb(t,n)||o||Ib(r??n,e.context.triggerElements)||e.setOpen(!1,Yb(ex,i)))})}}},[a,r,e,l]);return J.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var qw=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Ry;restTimeout=new Ry;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Jw=new WeakMap;function Yw(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Jw.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Jw.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Xw(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Jw.get(n);a&&a!==e&&Yw(a),Yw(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Jw.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Zw(e){let t=e.context.dataRef.current,n=Ev(()=>t.hoverInteractionState??qw.create()).current;return t.hoverInteractionState||=n,Iy(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Qw(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=yC(),u=vC(),d=Zw(e),f=zy(),p=Z(()=>qb(c.current.openEvent?.type,d.interactedInside)),m=Z(()=>Jb(c.current.openEvent?.type)),h=Z(()=>{Yw(d)});Q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),J.useEffect(()=>h,[h]),Q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&iv(s)&&o){let e=s,t=o,n=Zv(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??cb(e,`[data-rootownerid]`)??n.body;return Xw(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),J.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&IS(l.nodesRef.current,u).length>0)}function a(t){let n=Gb(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,Yb($b,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=lb(e);Bb(t)?d.interactedInside=cb(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Ib(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&iv(o)&&IS(l.nodesRef.current,r,!1).some(e=>sb(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,Yb($b,n)),l.events.emit(`floating.closed`,n)})}let y=o;return xx(y&&bx(y,`mouseenter`,g),y&&bx(y,`mouseleave`,_),y&&bx(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var $w={current:null};function eT(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=$w,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=yC(l),v=Zw(e),y=J.useRef(!1),b=Sx(i),x=Sx(r),S=Sx(o),C=Sx(n),w=Sx(p),T=Sx(f),E=Z(()=>qb(h.current.openEvent?.type,v.interactedInside)),D=Z(()=>w.current?.()!==!1),O=Z((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!sb(t,n);if(!iv(r))return!1;let a=r;return i.hasMatchingElement(e=>sb(e,a))&&(!t||!sb(t,a))}),k=Z(()=>{v.handler&&=(Zv(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=Z(()=>{Yw(v)});return u&&(v.handleCloseOptions=i?.__options),J.useEffect(()=>k,[k]),J.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===$b,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),J.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Gb(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,Yb($b,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,Yb($b,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!iv(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!ib(v.pointerType))return;let n=Kb(S.current),r=Gb(x.current,`open`,v.pointerType),i=lb(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(iv(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(sb(t,i)){c=t;break}}iv(o)&&iv(s)&&!e.context.triggerElements.hasElement(o)&&sb(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&iv(c)&&iv(s)&&sb(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,Yb($b,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,Yb($b,t,c))}):g&&D()&&e.setOpen(!0,Yb($b,t,c)))}function o(n){if(E()){A();return}k();let r=Zv(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Ib(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else(v.pointerType!==`touch`||!sb(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){sb(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?bx(r,`mouseout`,l):void 0;return s?xx(bx(r,`mousemove`,i,{once:!0}),bx(r,`mouseenter`,i),bx(r,`mouseleave`,o),f):xx(bx(r,`mouseenter`,i),bx(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),J.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!ib(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Xw(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Kb(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,Yb($b,n,r))}v.pointerType===`touch`?cC.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function tT(e){return Zy&&e.movementX===0&&e.movementY===0}function nT(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function rT(e,t){return nT(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function iT(e,t,n){return nT(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function aT(e,t,n){return nT(t,n?e===fb:e===pb,e===hb)}function oT(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:nT(t,n?e===pb:e===fb,e===mb)}function sT(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=Ub(E),A=Vb(D),j=Sx(k),M=vC(),N=yC(x),P=J.useRef(f),F=J.useRef(o??-1),I=J.useRef(null),L=J.useRef(!0),R=Z(e=>{i(F.current===-1?null:F.current,e)}),ee=J.useRef(!!E),z=J.useRef(T),B=J.useRef(!1),V=J.useRef(!1),te=J.useRef(null),H=Sx(h),U=Sx(T),ne=Sx(o),re=Sx(b),ie=Dx(),ae=Dx(),oe=Z(()=>{ie.cancel();function e(e){d||(te.current=BS(e,{sync:B.current,preventScroll:!0}))}let t=n.current[F.current],r=V.current;t&&e(t),(B.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),de&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Q(()=>{O.current.orientation=g},[O,g]),Q(()=>{T||(I.current=null),(!T||f!==`auto`)&&(P.current=f)},[T,f]),Q(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(V.current=!0,R())):ee.current&&(F.current=-1,R()))},[a,T,E,o,R]),Q(()=>{if(a){if(!T)B.current=!1;else if(E){if(r==null){if(B.current=!1,ne.current!=null)return;if(ee.current&&(F.current=-1,oe()),(!z.current||!ee.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||iT(I.current,_,u)||l?oS(n):sS(n),I.current=null,R())};t()}}else aS(n.current,r)||(F.current=r,oe(),V.current=!1)}}},[a,T,E,r,ne,l,n,_,u,R,oe,ae]),Q(()=>{if(!a||E||!N||d||!ee.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=ob(Zv(D??t??null)),r=e.some(e=>e.context&&sb(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),Q(()=>{z.current=T,ee.current=!!E});let W=r!=null,se=Z(e=>{if(!U.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),ce=Z(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),le=Z(()=>oS(n,H.current)),ue=Z(t=>{if(L.current=!1,B.current=!0,t.which===229||!U.current&&t.currentTarget===j.current)return;if(l&&oT(t.key,g,u,w)){rT(t.key,ce())||eb(t),e.setOpen(!1,Yb(ox,t.nativeEvent));let n=S?.current??D;av(n)&&n.focus();return}r!=null&&r!==F.current&&!aS(n.current,r)&&(F.current=r);let i=F.current,a=oS(n,h),o=sS(n,h);if(A||(t.key===`Home`&&(eb(t),F.current=a,R(t)),t.key===`End`&&(eb(t),F.current=o,R(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,R(t)),g===`both`)return}if(rT(t.key,g)){eb(t);let e=ob(t.currentTarget.ownerDocument);if(T&&!d&&sb(t.currentTarget,e)&&!n.current.some(t=>t!=null&&sb(t,e))){F.current=iT(t.key,g,u)?a:o,R(t),r===F.current&&oe();return}let{index:l,wrapped:f}=cS(n.current,i,{decrement:!iT(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(B.current=!1),F.current=l,R(t)}}),de=J.useMemo(()=>({onFocus(e){B.current=!0,se(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){tT(e)||(B.current=!0,V.current=!1,p&&se(e))},onPointerLeave(e){if(!U.current||!L.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&re.current&&(te.current?.(),te.current=null,F.current=-1,R(e),!d)){let e=j.current,t=ob(Zv(e));e&&sb(e,t)&&e.focus({preventScroll:!0})}}}),[se,U,j,p,n,R,re,d]),fe=J.useMemo(()=>d&&T&&W&&{"aria-activedescendant":`${y}-${r}`},[d,T,W,y,r]),pe=J.useMemo(()=>({...A?{}:fe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=lb(t.nativeEvent);if(n&&!sb(j.current,n))return;eb(t);let r=Yb(ix,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&av(i)&&i.focus()}else ue(t)},onPointerMove(e){tT(e)||(L.current=!0)}}),[fe,ue,j,A,e,T,d,D,S]),me=J.useMemo(()=>{function t(t){e.setOpen(!0,Yb(ox,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&nb(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&rb(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=aT(n.key,ce(),u),o=rT(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||zb(n.currentTarget)))return ue(n);if(r||m||!i){if(s){let e=rT(n.key,ce());I.current=l&&e?null:n.key}l?a&&(eb(n),r?(F.current=le(),R(n),d&&j.current?.focus()):t(n)):o&&(ne.current!=null&&(F.current=ne.current),eb(n),!r&&m?t(n):ue(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[ue,f,le,l,R,e,m,g,_,ce,u,ne,d,j]),he=J.useMemo(()=>({...fe,...me}),[fe,me]);return J.useMemo(()=>a?{reference:he,floating:pe,item:de,trigger:me}:{},[a,he,pe,me,de])}function cT(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=Z(s),f=e.useState(`open`),p=zy(),m=J.useRef(``),h=J.useRef(u??i??-1),g=J.useRef(null),_=Z(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!fS(n)||n?.matches(`:disabled`)?!1:o==null||!uS(fy,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(eb(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(eb(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=Z(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);sb(r,n)||sb(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=J.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return J.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var lT=.1,uT=lT*lT,dT=.5;function fT(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function pT(e,t,n,r,i,a,o,s,c,l){let u=!1;return fT(e,t,n,r,i,a)&&(u=!u),fT(e,t,i,a,o,s)&&(u=!u),fT(e,t,o,s,c,l)&&(u=!u),fT(e,t,c,l,n,r)&&(u=!u),u}function mT(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function hT(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function gT(e={}){let{blockPointerEvents:t=!1}=e,n=new Ry,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*uT;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=lb(r),g=r.type===`mouseleave`,_=sb(u,h),v=sb(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&iv(r.relatedTarget)&&sb(u,r.relatedTarget))return;function y(){return!!(s&&IS(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=hT(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=hT(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=hT(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=hT(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!mT(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?dT/2:dT*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+dT+1,o=C||T?S.bottom-dT:S.top,s=C?T?S.bottom-dT:S.top:S.bottom-dT;M=pT(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?dT/2:dT*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-dT,o=C||T?S.top+dT:S.bottom,s=C?T?S.top+dT:S.bottom:S.top+dT;M=pT(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?dT/2:dT*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+dT+1,o=w||E?S.right-dT:S.left,s=w?E?S.right-dT:S.left:S.right-dT;M=pT(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?dT/2:dT*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-dT,o=w||E?S.left+dT:S.right,s=w?E?S.left+dT:S.right:S.left+dT;M=pT(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function _T(e,t,n){let{reference:r,floating:i}=e,a=Wx(t),o=Gx(t),s=Ux(o),c=Bx(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Vx(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function vT(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=zx(t,e),p=rS(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=iS(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=iS(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var yT=50,bT=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:vT},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_T(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<yT&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_T(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xT=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=zx(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Bx(r),_=Wx(o),v=Bx(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[tS(o)]:qx(o)),x=p!==`none`;!d&&x&&b.push(...eS(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Kx(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wx(t)||T.every(e=>Wx(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wx(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},ST=new Set([`left`,`top`]);async function CT(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Bx(n),s=Vx(n),c=Wx(n)===`y`,l=ST.has(o)?-1:1,u=a&&c?-1:1,d=zx(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var wT=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await CT(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},TT=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=zx(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wx(i),p=Hx(f),m=u[p],h=u[f],g=(e,t)=>Rx(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ET=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=zx(e,t),u={x:n,y:r},d=Wx(i),f=Hx(d),p=u[f],m=u[d],h=zx(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ST.has(Bx(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},DT=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=zx(e,t),c=await i.detectOverflow(t,s),l=Bx(n),u=Vx(n),d=Wx(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Mx(p-c[m],g),y=Mx(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Nx(c.left,c.right):S=p-2*Nx(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function OT(e){let t=vv(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=av(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Px(n)!==a||Px(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function kT(e){return iv(e)?e:e.contextElement}function AT(e){let t=kT(e);if(!av(t))return Ix(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=OT(t),o=(a?Px(n.width):n.width)/r,s=(a?Px(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var jT=Ix(0);function MT(e){let t=tv(e);return!gv()||!t.visualViewport?jT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function NT(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===tv(e)}function PT(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=kT(e),o=Ix(1);t&&(r?iv(r)&&(o=AT(r)):o=AT(e));let s=NT(a,n,r)?MT(a):Ix(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=tv(a),t=iv(r)?tv(r):r,n=e,i=Cv(n);for(;i&&t!==n;){let e=AT(i),t=i.getBoundingClientRect(),r=vv(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=tv(i),i=Cv(n)}}return iS({width:u,height:d,x:c,y:l})}function FT(e,t){let n=yv(e).scrollLeft;return t?t.left+n:PT(nv(e)).left+n}function IT(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-FT(e,n),y:n.top+t.scrollTop}}function LT(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=nv(r),s=t?lv(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ix(1),u=Ix(0),d=av(r);if((d||!a)&&((ev(r)!==`body`||sv(o))&&(c=yv(r)),d)){let e=PT(r);l=AT(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?IT(o,c):Ix(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function RT(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function zT(e){let t=yv(e),n=e.ownerDocument.body,r=Nx(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Nx(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+FT(e),o=-t.scrollTop;return vv(n).direction===`rtl`&&(a+=Nx(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var BT=25;function VT(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=tv(e),a=nv(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!gv()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(FT(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=BT&&(s-=o)}return{width:s,height:c,x:l,y:u}}function HT(e,t){let n=PT(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=AT(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function UT(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=VT(e,n,t);else if(t===`document`)r=zT(nv(e));else if(iv(t))r=HT(t,n);else{let n=MT(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return iS(r)}function WT(e,t){let n=t.get(e);if(n)return n;let r=Sv(e,[],!1).filter(e=>iv(e)&&ev(e)!==`body`),i=null,a=vv(e).position===`fixed`,o=a?bv(e):e;for(;iv(o)&&!_v(o);){let e=vv(o),t=mv(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bv(o)}return t.set(e,r),r}function GT(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?lv(t)?[]:WT(t,this._c):[].concat(n),r],o=UT(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=UT(t,a[e],i);s=Nx(n.top,s),c=Mx(n.right,c),l=Mx(n.bottom,l),u=Nx(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function KT(e){let{width:t,height:n}=OT(e);return{width:t,height:n}}function qT(e,t,n){let r=av(t),i=nv(t),a=n===`fixed`,o=PT(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ix(0);if((r||!a)&&((ev(t)!==`body`||sv(i))&&(s=yv(t)),r)){let e=PT(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=FT(i));let l=i&&!r&&!a?IT(i,s):Ix(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function JT(e){return vv(e).position===`static`}function YT(e,t){if(!av(e)||vv(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return nv(e)===n&&(n=n.ownerDocument.body),n}function XT(e,t){let n=tv(e);if(lv(e))return n;if(!av(e)){let t=bv(e);for(;t&&!_v(t);){if(iv(t)&&!JT(t))return t;t=bv(t)}return n}let r=YT(e,t);for(;r&&cv(r)&&JT(r);)r=YT(r,t);return r&&_v(r)&&JT(r)&&!mv(r)?n:r||hv(e)||n}var ZT=async function(e){let t=this.getOffsetParent||XT,n=this.getDimensions,r=await n(e.floating);return{reference:qT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function QT(e){return vv(e).direction===`rtl`}var $T={convertOffsetParentRelativeRectToViewportRelativeRect:LT,getDocumentElement:nv,getClippingRect:GT,getOffsetParent:XT,getElementRects:ZT,getClientRects:RT,getDimensions:KT,getScale:AT,isElement:iv,isRTL:QT};function eE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tE(e,t,n){let r=null,i,a=nv(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Fx(d),h=Fx(a.clientWidth-(u+f)),g=Fx(a.clientHeight-(d+p)),_=Fx(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Nx(0,Mx(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!eE(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=tv(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function nE(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=kT(e),u=i||a?[...l?Sv(l):[],...t?Sv(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?tE(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?PT(e):null;c&&g();function g(){let t=PT(e);h&&!eE(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var rE=wT,iE=TT,aE=xT,oE=DT,sE=ET,cE=(e,t,n)=>{let r=new Map,i=n??{},a={...$T,...i.platform,_c:r};return bT(e,t,{...i,platform:a})},lE=typeof document<`u`?J.useLayoutEffect:function(){};function uE(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uE(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!uE(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function dE(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fE(e,t){let n=dE(e);return Math.round(t*n)/n}function pE(e){let t=J.useRef(e);return lE(()=>{t.current=e}),t}function mE(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);uE(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=pE(c),D=pE(i),O=pE(l),k=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),cE(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!uE(w.current,t)&&(w.current=t,cC.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);lE(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=J.useRef(!1);lE(()=>(A.current=!0,()=>{A.current=!1}),[]),lE(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=J.useMemo(()=>({reference:b,floating:x}),[b,x]),N=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=fE(M.floating,u.x),r=fE(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...dE(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var hE=(e,t)=>{let n=rE(e);return{name:n.name,fn:n.fn,options:[e,t]}},gE=(e,t)=>{let n=iE(e);return{name:n.name,fn:n.fn,options:[e,t]}},_E=(e,t)=>({fn:sE(e).fn,options:[e,t]}),vE=(e,t)=>{let n=aE(e);return{name:n.name,fn:n.fn,options:[e,t]}},yE=(e,t)=>{let n=oE(e);return{name:n.name,fn:n.fn,options:[e,t]}},bE=J.createContext(void 0);function xE(e){let t=J.useContext(bE);if(t===void 0&&!e)throw Error(qv(50));return t}var SE=class extends Nw{setState(e){}update(e){}set(e,t){}notifyAll(){}},CE={...Hw,instantType:e=>e.instantType,adaptiveOrigin:e=>e.adaptiveOrigin,closeDelay:e=>e.closeDelay},wE=class extends Nw{constructor(e,t,n){let r=new bw;super(EE(e,r,t,n),DE(r),CE)}setOpen=(e,t)=>{let{inlineRectCoordsRef:n}=this.context;mw(this,e,t,{onBeforeDispatch(){let r=t.event;e&&t.reason===`trigger-hover`&&t.trigger&&`clientX`in r&&`clientY`in r&&n.current?.element!==t.trigger&&YC(n,t.trigger,r.clientX,r.clientY)}})}};function TE(){let e=new bw;return new SE(Object.freeze(EE(void 0,e)),Object.freeze(DE(e)),CE)}function EE(e,t,n,r=!1){return{...Iw(t,n,r),instantType:void 0,adaptiveOrigin:void 0,closeDelay:300,...e}}function DE(e){return{popupRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e,inlineRectCoordsRef:{current:void 0}}}function OE(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:i,actionsRef:a,handle:o,triggerId:s,defaultTriggerId:c=null,children:l}=e,u=cw((e,r)=>new wE({open:n,openProp:t,activeTriggerId:c,triggerIdProp:s},e,r));u.useControlledProp(`openProp`,t),u.useControlledProp(`triggerIdProp`,s),u.useContextCallback(`onOpenChange`,r),u.useContextCallback(`onOpenChangeComplete`,i);let d=u.useState(`open`),f=u.useState(`activeTriggerId`),p=u.useState(`mounted`),m=u.useState(`payload`);gw(u,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:h}=_w(d,u,()=>{u.context.inlineRectCoordsRef.current=void 0});Q(()=>{d&&(f??u.set(`payload`,void 0))},[u,f,d]),J.useImperativeHandle(a,()=>({unmount:h,close:()=>u.setOpen(!1,Yb(mx))}),[h,u]);let g=d||p||o!=null;return(0,Y.jsxs)(bE.Provider,{value:u,children:[o&&(0,Y.jsx)(lw,{handle:o,store:u}),g&&(0,Y.jsx)(kE,{store:u}),typeof l==`function`?l({payload:m}):l]})}function kE({store:e}){let t=zC(e.useState(`floatingRootContext`));return vw(e,{activeTriggerProps:t.reference,inactiveTriggerProps:t.trigger,popupProps:t.floating}),null}var AE=Ny(function(e){return xE(!0)?(0,Y.jsx)(OE,{...e}):(0,Y.jsx)(SC,{children:(0,Y.jsx)(OE,{...e})})}),jE=J.createContext(void 0);function ME(){let e=J.useContext(jE);if(e===void 0)throw Error(qv(48));return e}var NE=J.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=fC({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Y.jsxs)(J.Fragment,{children:[l,c&&cC.createPortal(n,c)]})}),PE=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return xE().useState(`mounted`)||n?(0,Y.jsx)(jE.Provider,{value:n,children:(0,Y.jsx)(NE,{ref:t,...r})}):null});function FE(e){return nC(e,`base-ui`)}var IE=Py(function(e,t){let{render:n,className:r,delay:i,closeDelay:a,id:o,payload:s,handle:c,style:l,...u}=e,d=xE(!0),f=Uw(c)??d;if(!f)throw Error(qv(89));let p=FE(o),m=f.useState(`isTriggerActive`,p),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`floatingRootContext`),_=f.context.inlineRectCoordsRef,v=J.useRef(null),y=i??600,b=a??300,{registerTrigger:x,isMountedByThisTrigger:S}=hw(p,v,f,{payload:s,closeDelay:b}),C=eT(g,{mouseOnly:!0,move:!1,handleClose:gT(),delay:()=>({open:y,close:b}),triggerElementRef:v,isActiveTrigger:m,isClosing:()=>f.select(`transitionStatus`)===`ending`}),w=Kw(g,{delay:y}),T={open:h},E=f.useState(`triggerProps`,S),D=JC(_,h);return _y(`a`,e,{state:T,ref:[t,x,v],props:[C,w.reference,E,D,{id:p},u],stateAttributesMapping:jb})}),LE=J.createContext(void 0);function RE(){let e=J.useContext(LE);if(e===void 0)throw Error(qv(49));return e}function zE(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=J.useState(null),d=J.useRef(null),f=yC(n),p=J.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=mE({...e,elements:{...p,...l&&{reference:l}}}),h=J.useCallback(e=>{let t=iv(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=J.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=J.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=J.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return Q(()=>{o&&(d.current=o)},[o]),Q(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),J.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var BE=J.createContext(void 0);function VE(){return J.useContext(BE)?.direction??`ltr`}var HE=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=zx(e,t)||{};if(l==null)return{};let d=rS(u),f={x:n,y:r},p=Gx(i),m=Ux(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Rx(D,k,O),j=!c.arrow&&Vx(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),UE=(e,t)=>{let{name:n,fn:r}=HE(e);return{name:n,fn:r,options:[e,t]}},WE={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},GE={sideX:`left`,sideY:`top`},KE=`--available-width`,qE=`--available-height`,JE=`--anchor-width`,YE=`--anchor-height`,XE=`--transform-origin`,ZE=KE,QE=qE;function $E(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function eD(e,t,n){let{rects:r,placement:i}=e;return{side:$E(t,Bx(i),n),align:Vx(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function tD(e){return nD(e,zE)}function nD(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=Z(O),A=O?k:n,j=Sx(n),M=Sx(g),N=VE()===`rtl`,[P,F]=J.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,L=P?Bx(P):null,R=P&&I?Vx(P)||`center`:null,ee=L||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],z=R||o,B=z===`center`?ee:`${ee}-${z}`,V=l;typeof V==`number`?V={top:V,right:V,bottom:V,left:V}:V&&={top:V.top||0,right:V.right||0,bottom:V.bottom||0,left:V.left||0};let te=+(i===`bottom`),H=+(i===`top`),U=+(i===`right`),ne=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:V},ie=J.useRef(null),ae=Sx(a),oe=Sx(s),W=typeof a==`function`?0:a,se=typeof s==`function`?0:s,ce=[];p&&ce.push(p),ce.push(hE(e=>{let t=eD(e,i,N),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[W,se,N,i]));let le=w===`none`&&C!==`shift`,ue=!le&&(u||E||C===`shift`),de=C===`none`?null:vE({...re,padding:{top:V.top+1+te,right:V.right+1+ne,bottom:V.bottom+1+H,left:V.left+1+U},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),fe=le?null:gE({...re,rootBoundary:D,mainAxis:w!==`none`,crossAxis:ue,limiter:u||E?void 0:_E(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=Wx(Bx(e.placement)),i=r===`y`?t:n,a=r===`y`?V.left+V.right:V.top+V.bottom;return{offset:i/2+a/2}})},[re,u,E,D,V,w]);C===`shift`||w===`shift`||z===`center`?ce.push(fe,de):ce.push(de,fe),ce.push(yE({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(ZE,`${t}px`),i.setProperty(QE,`${n}px`);let a=tv(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(JE,`${u}px`),i.setProperty(YE,`${d}px`)}}),UE(e=>({element:ie.current||Zv(e.elements.floating).createElement(`div`),padding:ie.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Bx(r),u=Vx(r),d=Wx(l)===`y`,f=ie.current,p=typeof a==`function`?a(eD(e,i,N)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ue&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(XE,d?`${m} ${h}`:`${h} ${m}`),{}}},WE,b),Q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let pe=J.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:h,open:m?g:void 0,placement:B,middleware:ce,strategy:r,whileElementsMounted:m?void 0:(...e)=>nE(...e,pe),nodeId:y,externalTree:S}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||GE,Ee=Se?r:`fixed`,De=J.useMemo(()=>{let e;return e=Se?b?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[ZE]=`100vw`,e[QE]=`100vh`,Se||(e.opacity=0),e},[b,Ee,we,ge,Te,_e,Ce,Se]),Oe=J.useRef(null);Q(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(rD(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[g,me,A,j]),J.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&rD(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[g,me,A,j]),J.useEffect(()=>{if(m&&g&&he.reference&&he.floating)return nE(he.reference,he.floating,ye,pe)},[m,g,he,ye,pe]);let ke=Bx(be),Ae=$E(i,ke,N),je=Vx(be)||`center`,Me=!!ve.hide?.referenceHidden;Q(()=>{x&&g&&Se&&(ke!==ee||I&&je!==z)&&F(be)},[x,I,g,Se,be,ke,je,ee,z]);let Ne=J.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return J.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:ie,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,ie,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function rD(e){return e!=null&&`current`in e}function iD(e){return e===`starting`?rC:py}function aD(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),_y(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},iD(r),i],stateAttributesMapping:Nb})}var oD=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=oC,style:g,..._}=e,v=xE(),y=ME(),b=bC(),x=v.useState(`open`),S=v.useState(`mounted`),C=v.useState(`floatingRootContext`),w=v.useState(`instantType`),T=v.useState(`transitionStatus`),E=v.useState(`adaptiveOrigin`),D=v.context.inlineRectCoordsRef,O=tD({anchor:i,floatingRootContext:C,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:y,nodeId:b,collisionAvoidance:h,adaptiveOrigin:E,inline:XC(D)}),k=O.update;Q(()=>{x&&S&&k()},[x,S,k]);let A=aD(e,{open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:w},{styles:O.positionerStyles,transitionStatus:T,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!S,inert:!x});return(0,Y.jsx)(LE.Provider,{value:O,children:(0,Y.jsx)(xC,{id:b,children:A})})}),sD=J.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=xE(),{side:s,align:c}=RE(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`closeDelay`);return iw({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Qw(p,{closeDelay:m}),_y(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[ow,f,iD(d),a],stateAttributesMapping:Pb})});function cD(e){return ly(19)?e:e?`true`:void 0}function lD(e){let[t,n]=J.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var uD=class extends ZC{constructor(){super(TE(),`PreviewCard`)}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(`open`)??!1}};function dD(){return new uD}function fD({...e}){return(0,Y.jsx)(AE,{"data-slot":`hover-card`,...e})}function pD({...e}){return(0,Y.jsx)(IE,{"data-slot":`hover-card-trigger`,...e})}var mD=()=>dD();function hD({className:e,side:t=`bottom`,sideOffset:n=4,align:r=`center`,alignOffset:i=4,...a}){return(0,Y.jsx)(PE,{"data-slot":`hover-card-portal`,children:(0,Y.jsx)(oD,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,Y.jsx)(sD,{"data-slot":`hover-card-content`,className:X(`z-50 w-64 origin-(--transform-origin) rounded-xl bg-popover p-2.5 text-ui text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-(--duration-fast) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var gD={compact:`text-code-compact`,default:`text-code`,comfy:`text-code-comfy`},_D={compact:``,default:`text-code-gutter`,comfy:`text-code-gutter`},vD={add:{row:`bg-diff-add-bg`,gutter:`bg-diff-add-gutter text-diff-add-fg`,word:`bg-diff-add-word`,marker:`+`,label:`added`},del:{row:`bg-diff-del-bg`,gutter:`bg-diff-del-gutter text-diff-del-fg`,word:`bg-diff-del-word`,marker:`−`,label:`removed`},context:{row:`bg-background`,gutter:`bg-diff-gutter-bg text-diff-gutter-fg`,word:``,marker:` `,label:`unchanged`}},yD={keyword:`text-syntax-keyword`,string:`text-syntax-string`,function:`text-syntax-function`,comment:`text-syntax-comment`,number:`text-syntax-number`,decorator:`text-syntax-decorator`,attribute:`text-syntax-attribute`},bD=(e,t,n,r=[])=>{let i=[],a=0;for(let o of t??[{text:e,type:null}]){let t=a+o.text.length,s=new Set([a,t]);for(let e of[...n,...r])e.start>a&&e.start<t&&s.add(e.start),e.end>a&&e.end<t&&s.add(e.end);let c=[...s].sort((e,t)=>e-t);for(let r=0;r+1<c.length;r++){let s=c[r]??a,l=c[r+1]??t;i.push({text:e.slice(s,l),type:o.type,changed:n.some(e=>e.start<=s&&l<=e.end),start:s})}a=t}return i},xD={finding:`isolate font-medium text-review-changes before:absolute before:inset-0 before:-z-1 before:bg-review-changes-bg before:shadow-[inset_-3px_0_0_var(--review-changes)]`,risk:`isolate font-medium text-risk-contract before:absolute before:inset-0 before:-z-1 before:bg-risk-contract-bg before:shadow-[inset_-3px_0_0_var(--risk-contract-solid)]`,decision:``,step:`isolate font-medium text-primary before:absolute before:inset-0 before:-z-1 before:bg-ai-soft before:shadow-[inset_-3px_0_0_var(--primary)]`},SD=(0,J.memo)(function({line:e,id:t,layout:n=`unified`,density:r=`default`,wrap:i=!1,focused:a=!1,selected:o=!1,marked:s=!1,pointKind:c=null,pointLanding:l,onComment:u,onGutterClick:d,numberButton:f,onRowClick:p,cellRole:m=`gridcell`,marks:h=CD,flagged:g=!1,end:_}){let v=vD[e.kind],y=e.newNo??e.oldNo,b=n===`split-old`?`old`:`new`,x=(t,n)=>(0,Y.jsxs)(`span`,{role:m,onClick:d===void 0?void 0:t=>d(e,t),"data-point-mark":c!==null&&c!==`decision`&&n===b?c:void 0,className:X(`tabular relative w-12 shrink-0 select-none text-right`,_D[r],f?.side===n&&t!==null?`pr-0`:`pr-2`,v.gutter,c!==null&&n===b&&xD[c],d!==void 0&&`cursor-pointer hover:text-foreground`),children:[f?.side===n&&t!==null?(0,Y.jsx)(`button`,{type:`button`,"aria-label":f.label,onClick:f.onClick,"data-inline-target":!0,className:X(`h-full w-full pr-2 text-right hover:bg-primary hover:text-primary-foreground focus-visible:-outline-offset-2`,p!==void 0&&`group-hover/line:bg-primary group-hover/line:text-primary-foreground focus-visible:bg-primary focus-visible:text-primary-foreground`,p!==void 0&&t<1e4&&`before:mr-1 before:content-none group-hover/line:before:content-['+'] focus-visible:before:content-['+']`),children:t}):t??``,n===`new`&&g&&t!==null&&t<1e3&&(0,Y.jsx)(eg,{"aria-hidden":`true`,"data-slot":`finding-flag`,className:`pointer-events-none absolute top-1/2 left-1 size-3 -translate-y-1/2 text-review-changes group-hover/line:hidden`}),n===`new`&&u!==void 0&&f===void 0&&(0,Y.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Comment on line ${y??``}`,onClick:t=>{t.stopPropagation(),u(e)},className:`absolute top-0 left-0 hidden h-full w-5 items-center justify-center rounded-sm bg-primary text-primary-foreground group-hover/line:flex group-data-focused/line:flex`,children:(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`+`})})]});return(0,Y.jsxs)(`div`,{role:`row`,id:t,onClick:p,"aria-selected":o||void 0,"data-line":e.key,"data-kind":e.kind,"data-focused":a||void 0,"data-marked":s||void 0,"data-point":c??void 0,"data-point-line":l===void 0?void 0:l.line,style:l===void 0?void 0:Ph({"--landing-i":l.at,"--point-line":l.line,"--point-lines":l.lines}),className:X(`group/line relative flex min-w-full font-code`,p!==void 0&&`cursor-pointer`,gD[r],v.row,o&&`before:pointer-events-none before:absolute before:inset-0 before:z-[1] before:bg-primary/15`,!o&&p!==void 0&&`hover:before:pointer-events-none hover:before:absolute hover:before:inset-0 hover:before:z-[1] hover:before:bg-primary/8`,(a||s)&&`after:pointer-events-none after:absolute after:inset-y-0 after:left-0 after:z-[1] after:w-[3px] after:bg-ring`),children:[n!==`split-new`&&x(e.oldNo,`old`),n!==`split-old`&&x(e.newNo,`new`),(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`w-5 shrink-0 select-none text-center`,e.kind===`add`&&`text-diff-add-fg`,e.kind===`del`&&`text-diff-del-fg`),children:v.marker}),(0,Y.jsxs)(`span`,{role:m,className:X(`pr-4`,i?`min-w-0 flex-1 whitespace-pre-wrap break-all`:`whitespace-pre`),children:[(0,Y.jsx)(`span`,{className:`sr-only`,children:`${v.label} line ${y??``}: `}),wD(bD(e.text,e.tokens,e.wordRanges,h).map(e=>({start:e.start,element:(0,Y.jsx)(`span`,{"data-changed":e.changed||void 0,className:X(e.type!==null&&yD[e.type],e.changed&&X(v.word,`rounded-sm`)),children:e.text},e.start)})),h),e.notes.map(e=>(0,Y.jsx)(`span`,{className:`ml-2 rounded-sm border px-1 align-middle font-sans text-caption text-muted-foreground`,children:e},e)),_]})]})}),CD=[],wD=(e,t)=>{if(t.length===0)return e.map(({element:e})=>e);let n=[];for(let{start:r,element:i}of e){let e=t.find(e=>r>=e.start&&r<e.end)??null,a=n.at(-1);e!==null&&a?.mark===e?a.code.push(i):n.push({mark:e,code:[i]})}return n.flatMap(({mark:e,code:t})=>e===null?t:[(0,Y.jsx)(J.Fragment,{children:e.render(t)},`mark-${e.start}`)])},TD=({kind:e,className:t})=>(0,Y.jsx)(`div`,{"aria-hidden":`true`,"data-slot":`line-end`,"data-kind":e,className:X(`flex min-w-full`,vD[e].row,t),children:(0,Y.jsx)(`span`,{className:X(`w-12 shrink-0`,vD[e].gutter)})}),ED={finding:{label:`Finding`,glyph:`⚠`,className:`text-review-changes bg-review-changes-bg border-review-changes/25`},risk:{label:`Risk`,glyph:`▲`,className:`text-risk-contract bg-risk-contract-bg border-risk-contract-border`},decision:{label:`Decision`,glyph:`◇`,className:`text-muted-foreground bg-muted border-border`}},DD={finding:eg,risk:m_,decision:S_},OD={contract:{label:`Contract`,glyph:`▲`,className:`text-risk-contract bg-risk-contract-bg border-risk-contract-border`},logic:{label:`Logic`,glyph:`●`,className:`text-risk-logic bg-risk-logic-bg border-risk-logic-border`},mechanical:{label:`Mechanical`,glyph:`○`,className:`text-risk-mechanical bg-risk-mechanical-bg border-risk-mechanical-border`}},kD={added:{kind:`mark`,label:`new`,tone:`text-diff-add-fg`,name:`text-diff-add-fg`},modified:null,deleted:{kind:`mark`,label:`deleted`,tone:`text-diff-del-fg`,name:`text-diff-del-fg line-through`},renamed:{kind:`chip`,label:`renamed`,className:`text-diff-hunk-fg bg-diff-hunk-bg border-diff-hunk-fg/25`}},AD={open:{label:`Open`,className:`text-foreground bg-secondary border-transparent`},draft:{label:`Draft`,className:`text-muted-foreground bg-muted border-border`},merged:{label:`Merged`,className:`text-pr-merged bg-pr-merged-bg border-pr-merged/25`},closed:{label:`Closed`,className:`text-review-changes bg-review-changes-bg border-review-changes/25`}},jD={approved:{label:`Approved`,glyph:`✓`,className:`text-review-approved bg-review-approved-bg border-review-approved/25`},"changes-requested":{label:`Changes requested`,glyph:`✕`,className:`text-review-changes bg-review-changes-bg border-review-changes/25`}},MD={passed:{label:`Passed`,glyph:`✓`,tone:`text-ci-success`},failed:{label:`Failed`,glyph:`✕`,tone:`text-ci-failure`},running:{label:`Running`,glyph:`◌`,tone:`text-ci-running`},skipped:{label:`Skipped`,glyph:`–`,tone:`text-ci-skipped`}},ND={"changes-requested":{label:`Requested changes`,tone:`text-review-changes`},approved:{label:`Approved`,tone:`text-review-approved`},commented:{label:`Commented`,tone:`text-review-commented`},waiting:{label:`Not reviewed yet`,tone:`text-muted-foreground`}},PD=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='6.5'%20fill='%23E7EFFD'%20stroke='%233574F0'/%3e%3cpath%20d='M8.13295%2011.5C9.61223%2011.5%2010.8836%2010.6105%2011.2075%209.33909H10.2213C9.90229%2010.0739%209.11914%2010.6057%208.13295%2010.6057C6.77936%2010.6057%205.80284%209.51796%205.80284%208C5.80284%206.48204%206.77936%205.39434%208.13295%205.39434C9.11914%205.39434%209.90229%205.92611%2010.2213%206.66091H11.2075C10.8836%205.3895%209.61223%204.5%208.13295%204.5C6.21859%204.5%204.79248%205.99378%204.79248%208C4.79248%2010.0062%206.21859%2011.5%208.13295%2011.5Z'%20fill='%233574F0'/%3e%3c/svg%3e`,FD=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.9497%203.05025C15.6834%205.78392%2015.6834%2010.2161%2012.9497%2012.9497C10.216%2015.6834%205.78388%2015.6834%203.05021%2012.9497C0.316541%2010.2161%200.316541%205.78392%203.05021%203.05025C5.78388%200.316583%2010.216%200.316583%2012.9497%203.05025Z'%20fill='%23E7EFFD'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.9143%206.90481L13.9264%207.06045C13.7359%205.85124%2013.1755%204.69027%2012.2426%203.75736C11.3097%202.82445%2010.1487%202.26404%208.93951%202.07352L9.09515%201.0857C10.5062%201.30802%2011.8623%201.96287%2012.9497%203.05025C14.0371%204.13763%2014.6919%205.49375%2014.9143%206.90481ZM6.90477%201.0857L7.06041%202.07352C5.8512%202.26404%204.69023%202.82445%203.75732%203.75736C2.82441%204.69027%202.26399%205.85124%202.07348%207.06045L1.08566%206.90481C1.30798%205.49375%201.96283%204.13763%203.05021%203.05025C4.13759%201.96287%205.49371%201.30802%206.90477%201.0857ZM1.08566%209.09519C1.30798%2010.5063%201.96283%2011.8624%203.05021%2012.9497C4.13759%2014.0371%205.49371%2014.692%206.90477%2014.9143L7.0604%2013.9265C5.8512%2013.736%204.69023%2013.1755%203.75732%2012.2426C2.82441%2011.3097%202.26399%2010.1488%202.07348%208.93955L1.08566%209.09519ZM9.09515%2014.9143L8.93951%2013.9265C10.1487%2013.736%2011.3097%2013.1755%2012.2426%2012.2426C13.1755%2011.3097%2013.7359%2010.1488%2013.9264%208.93955L14.9143%209.09519C14.6919%2010.5063%2014.0371%2011.8624%2012.9497%2012.9497C11.8623%2014.0371%2010.5062%2014.692%209.09515%2014.9143Z'%20fill='%233574F0'/%3e%3cpath%20d='M8.13295%2011.5C9.61223%2011.5%2010.8836%2010.6105%2011.2075%209.33909H10.2213C9.90229%2010.0739%209.11914%2010.6057%208.13295%2010.6057C6.77936%2010.6057%205.80284%209.51796%205.80284%208C5.80284%206.48204%206.77936%205.39434%208.13295%205.39434C9.11914%205.39434%209.90229%205.92611%2010.2213%206.66091H11.2075C10.8836%205.3895%209.61223%204.5%208.13295%204.5C6.21859%204.5%204.79248%205.99378%204.79248%208C4.79248%2010.0062%206.21859%2011.5%208.13295%2011.5Z'%20fill='%233574F0'/%3e%3c/svg%3e`,ID=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.9497%203.05025C15.6834%205.78392%2015.6834%2010.2161%2012.9497%2012.9497C10.216%2015.6834%205.78388%2015.6834%203.05021%2012.9497C0.316541%2010.2161%200.316541%205.78392%203.05021%203.05025C5.78388%200.316583%2010.216%200.316583%2012.9497%203.05025Z'%20fill='%2325324D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.9143%206.90481L13.9264%207.06045C13.7359%205.85124%2013.1755%204.69027%2012.2426%203.75736C11.3097%202.82445%2010.1487%202.26404%208.93951%202.07352L9.09515%201.0857C10.5062%201.30802%2011.8623%201.96287%2012.9497%203.05025C14.0371%204.13763%2014.6919%205.49375%2014.9143%206.90481ZM6.90477%201.0857L7.06041%202.07352C5.8512%202.26404%204.69023%202.82445%203.75732%203.75736C2.82441%204.69027%202.26399%205.85124%202.07348%207.06045L1.08566%206.90481C1.30798%205.49375%201.96283%204.13763%203.05021%203.05025C4.13759%201.96287%205.49371%201.30802%206.90477%201.0857ZM1.08566%209.09519C1.30798%2010.5063%201.96283%2011.8624%203.05021%2012.9497C4.13759%2014.0371%205.49371%2014.692%206.90477%2014.9143L7.0604%2013.9265C5.8512%2013.736%204.69023%2013.1755%203.75732%2012.2426C2.82441%2011.3097%202.26399%2010.1488%202.07348%208.93955L1.08566%209.09519ZM9.09515%2014.9143L8.93951%2013.9265C10.1487%2013.736%2011.3097%2013.1755%2012.2426%2012.2426C13.1755%2011.3097%2013.7359%2010.1488%2013.9264%208.93955L14.9143%209.09519C14.6919%2010.5063%2014.0371%2011.8624%2012.9497%2012.9497C11.8623%2014.0371%2010.5062%2014.692%209.09515%2014.9143Z'%20fill='%23548AF7'/%3e%3cpath%20d='M8.13295%2011.5C9.61223%2011.5%2010.8836%2010.6105%2011.2075%209.33909H10.2213C9.90229%2010.0739%209.11914%2010.6057%208.13295%2010.6057C6.77936%2010.6057%205.80284%209.51796%205.80284%208C5.80284%206.48204%206.77936%205.39434%208.13295%205.39434C9.11914%205.39434%209.90229%205.92611%2010.2213%206.66091H11.2075C10.8836%205.3895%209.61223%204.5%208.13295%204.5C6.21859%204.5%204.79248%205.99378%204.79248%208C4.79248%2010.0062%206.21859%2011.5%208.13295%2011.5Z'%20fill='%23548AF7'/%3e%3c/svg%3e`,LD=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='6.5'%20fill='%2325324D'%20stroke='%23548AF7'/%3e%3cpath%20d='M8.13295%2011.5C9.61223%2011.5%2010.8836%2010.6105%2011.2075%209.33909H10.2213C9.90229%2010.0739%209.11914%2010.6057%208.13295%2010.6057C6.77936%2010.6057%205.80284%209.51796%205.80284%208C5.80284%206.48204%206.77936%205.39434%208.13295%205.39434C9.11914%205.39434%209.90229%205.92611%2010.2213%206.66091H11.2075C10.8836%205.3895%209.61223%204.5%208.13295%204.5C6.21859%204.5%204.79248%205.99378%204.79248%208C4.79248%2010.0062%206.21859%2011.5%208.13295%2011.5Z'%20fill='%23548AF7'/%3e%3c/svg%3e`,RD=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='6.5'%20fill='%23FAF5FF'%20stroke='%23834DF0'/%3e%3cpath%20d='M5.49023%2011.5H10.5102V10.585H6.48023V8.435H10.0702V7.515H6.48023V5.415H10.4102V4.5H5.49023V11.5Z'%20fill='%23834DF0'/%3e%3c/svg%3e`,zD=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='6.5'%20fill='%232F2936'%20stroke='%23A571E6'/%3e%3cpath%20d='M5.49023%2011.5H10.5102V10.585H6.48023V8.435H10.0702V7.515H6.48023V5.415H10.4102V4.5H5.49023V11.5Z'%20fill='%23A571E6'/%3e%3c/svg%3e`,BD=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.10584%204.34613L8.25344%204.5H8.46667H13C13.8284%204.5%2014.5%205.17157%2014.5%206V12.1333C14.5%2012.9529%2013.932%2013.5%2013.3667%2013.5H2.63333C2.06804%2013.5%201.5%2012.9529%201.5%2012.1333V3.86667C1.5%203.04707%202.06804%202.5%202.63333%202.5H6.1217C6.25792%202.5%206.38824%202.55557%206.48253%202.65387L8.10584%204.34613Z'%20fill='%23EBECF0'%20stroke='%236C707E'/%3e%3c/svg%3e`,VD=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.10584%204.34613L8.25344%204.5H8.46667H13C13.8284%204.5%2014.5%205.17157%2014.5%206V12.1333C14.5%2012.9529%2013.932%2013.5%2013.3667%2013.5H2.63333C2.06804%2013.5%201.5%2012.9529%201.5%2012.1333V3.86667C1.5%203.04707%202.06804%202.5%202.63333%202.5H6.1217C6.25792%202.5%206.38824%202.55557%206.48253%202.65387L8.10584%204.34613Z'%20fill='%2343454A'%20stroke='%23CED0D6'/%3e%3c/svg%3e`,HD=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='6.5'%20fill='%23F2FCF3'%20stroke='%23208A3C'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%204.5V5.5L8.5%205.5V10.5H10V11.5L8.5%2011.5H7.5L6%2011.5V10.5H7.5V5.5L6%205.5V4.5H7.5H8.5H10Z'%20fill='%23208A3C'/%3e%3c/svg%3e`,UD=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='6.5'%20fill='%23253627'%20stroke='%2357965C'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%204.5V5.5L8.5%205.5V10.5H10V11.5L8.5%2011.5H7.5L6%2011.5V10.5H7.5V5.5L6%205.5V4.5H7.5H8.5H10Z'%20fill='%2357965C'/%3e%3c/svg%3e`,WD=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='2'%20y='13'%20width='12'%20height='1'%20rx='0.5'%20fill='%23E66D17'/%3e%3cpath%20d='M2.5%203.6C2.5%203.31172%202.50039%203.12559%202.51196%202.98392C2.52306%202.84809%202.5419%202.79773%202.5545%202.773C2.60243%202.67892%202.67892%202.60243%202.773%202.5545C2.79773%202.5419%202.84809%202.52306%202.98392%202.51196C3.12559%202.50039%203.31172%202.5%203.6%202.5H11.4C11.6883%202.5%2011.8744%202.50039%2012.0161%202.51196C12.1519%202.52306%2012.2023%202.5419%2012.227%202.5545C12.3211%202.60243%2012.3976%202.67892%2012.4455%202.773L12.8864%202.54834L12.4455%202.773C12.4581%202.79773%2012.4769%202.84809%2012.488%202.98392C12.4996%203.12559%2012.5%203.31172%2012.5%203.6V6.5C12.5%207.93194%2012.4946%208.53707%2012.3493%209.016C12.01%2010.1346%2011.1346%2011.01%2010.016%2011.3493C9.53707%2011.4946%208.93194%2011.5%207.5%2011.5C6.06806%2011.5%205.46293%2011.4946%204.984%2011.3493C3.8654%2011.01%202.99003%2010.1346%202.65071%209.016C2.50543%208.53707%202.5%207.93194%202.5%206.5V3.6Z'%20fill='%23FFF4EB'%20stroke='%23E66D17'/%3e%3cpath%20d='M12.5%202.5H14.5C14.7761%202.5%2015%202.72386%2015%203V4.18121C15%204.78125%2014.6424%205.32356%2014.0909%205.55993L12.5%206.24173V2.5Z'%20stroke='%23E66D17'/%3e%3c/svg%3e`,GD=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%204C14%202.89543%2013.1046%202%2012%202H4C2.89543%202%202%202.89543%202%204V12C2%2013.1046%202.89543%2014%204%2014H12C13.1046%2014%2014%2013.1046%2014%2012V4Z'%20fill='%23FFAF0F'/%3e%3cpath%20d='M9.55434%2011.8593C9.88209%2012.0132%2010.2583%2012.0901%2010.6829%2012.0901C11.1047%2012.0901%2011.4795%2012.0117%2011.8073%2011.855C12.135%2011.6982%2012.3901%2011.4831%2012.5725%2011.2095C12.7549%2010.933%2012.8461%2010.6238%2012.8461%2010.2818C12.8461%209.99963%2012.7834%209.73315%2012.658%209.48235C12.5326%209.23155%2012.3545%209.02208%2012.1236%208.85393C11.8956%208.68578%2011.6348%208.57605%2011.3413%208.52475L10.3452%208.3623C10.1429%208.3281%209.97899%208.24118%209.85359%208.10153C9.72819%207.95903%209.66549%207.79088%209.66549%207.59708C9.66549%207.43178%209.70824%207.28643%209.79374%207.16103C9.87924%207.03563%209.99894%206.93873%2010.1528%206.87033C10.3067%206.80193%2010.4849%206.76773%2010.6872%206.76773C10.8896%206.76773%2011.0677%206.80335%2011.2216%206.8746C11.3755%206.94585%2011.4952%207.04703%2011.5807%207.17813C11.6662%207.30638%2011.7089%207.45173%2011.7089%207.61418H12.7221C12.7193%207.28073%2012.6309%206.98433%2012.4571%206.72498C12.2832%206.46563%2012.041%206.26328%2011.7303%206.11793C11.4225%205.97258%2011.0705%205.8999%2010.6744%205.8999C10.2868%205.8999%209.93909%205.97543%209.63129%206.12648C9.32349%206.27468%209.08266%206.4813%208.90881%206.74635C8.73781%207.00855%208.65231%207.30495%208.65231%207.63555C8.65231%207.912%208.70931%208.16708%208.82331%208.40078C8.94016%208.63163%209.10546%208.824%209.31921%208.9779C9.53296%209.1318%209.78519%209.2344%2010.0759%209.2857L11.0891%209.4567C11.3114%209.49375%2011.4895%209.5935%2011.6234%209.75595C11.7574%209.91555%2011.8244%2010.1065%2011.8244%2010.3288C11.8244%2010.5055%2011.7773%2010.6623%2011.6833%2010.7991C11.5921%2010.933%2011.461%2011.037%2011.29%2011.1111C11.119%2011.1852%2010.9209%2011.2223%2010.6958%2011.2223C10.4649%2011.2223%2010.2597%2011.1824%2010.0802%2011.1026C9.90346%2011.0199%209.76524%2010.9045%209.66549%2010.7563C9.56574%2010.6081%209.51586%2010.44%209.51586%2010.2519H8.50269C8.50554%2010.611%208.59959%2010.9302%208.78484%2011.2095C8.97009%2011.4859%209.22659%2011.7025%209.55434%2011.8593Z'%20fill='black'/%3e%3cpath%20d='M5.22179%2011H4.21289V12H5.32012C5.64787%2012%205.93857%2011.9316%206.19222%2011.7948C6.44587%2011.6551%206.64394%2011.4613%206.78644%2011.2134C6.92894%2010.9654%207.00019%2010.6804%207.00019%2010.3584L7.00024%206H5.99989L5.99984%2010.222C5.99984%2010.3759%205.96707%2010.5127%205.90152%2010.6324C5.83882%2010.7492%205.74762%2010.8404%205.62792%2010.906C5.51107%2010.9687%205.37569%2011%205.22179%2011Z'%20fill='black'/%3e%3c/svg%3e`,KD=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%204C14%202.89543%2013.1046%202%2012%202H4C2.89543%202%202%202.89543%202%204V12C2%2013.1046%202.89543%2014%204%2014H12C13.1046%2014%2014%2013.1046%2014%2012V4Z'%20fill='%23F2C55C'/%3e%3cpath%20d='M9.55434%2011.8593C9.88209%2012.0132%2010.2583%2012.0901%2010.6829%2012.0901C11.1047%2012.0901%2011.4795%2012.0117%2011.8073%2011.855C12.135%2011.6982%2012.3901%2011.4831%2012.5725%2011.2095C12.7549%2010.933%2012.8461%2010.6238%2012.8461%2010.2818C12.8461%209.99963%2012.7834%209.73315%2012.658%209.48235C12.5326%209.23155%2012.3545%209.02208%2012.1236%208.85393C11.8956%208.68578%2011.6348%208.57605%2011.3413%208.52475L10.3452%208.3623C10.1429%208.3281%209.97899%208.24118%209.85359%208.10153C9.72819%207.95903%209.66549%207.79088%209.66549%207.59708C9.66549%207.43178%209.70824%207.28643%209.79374%207.16103C9.87924%207.03563%209.99894%206.93873%2010.1528%206.87033C10.3067%206.80193%2010.4849%206.76773%2010.6872%206.76773C10.8896%206.76773%2011.0677%206.80335%2011.2216%206.8746C11.3755%206.94585%2011.4952%207.04703%2011.5807%207.17813C11.6662%207.30638%2011.7089%207.45173%2011.7089%207.61418H12.7221C12.7193%207.28073%2012.6309%206.98433%2012.4571%206.72498C12.2832%206.46563%2012.041%206.26328%2011.7303%206.11793C11.4225%205.97258%2011.0705%205.8999%2010.6744%205.8999C10.2868%205.8999%209.93909%205.97543%209.63129%206.12648C9.32349%206.27468%209.08266%206.4813%208.90881%206.74635C8.73781%207.00855%208.65231%207.30495%208.65231%207.63555C8.65231%207.912%208.70931%208.16708%208.82331%208.40078C8.94016%208.63163%209.10546%208.824%209.31921%208.9779C9.53296%209.1318%209.78519%209.2344%2010.0759%209.2857L11.0891%209.4567C11.3114%209.49375%2011.4895%209.5935%2011.6234%209.75595C11.7574%209.91555%2011.8244%2010.1065%2011.8244%2010.3288C11.8244%2010.5055%2011.7773%2010.6623%2011.6833%2010.7991C11.5921%2010.933%2011.461%2011.037%2011.29%2011.1111C11.119%2011.1852%2010.9209%2011.2223%2010.6958%2011.2223C10.4649%2011.2223%2010.2597%2011.1824%2010.0802%2011.1026C9.90346%2011.0199%209.76524%2010.9045%209.66549%2010.7563C9.56574%2010.6081%209.51586%2010.44%209.51586%2010.2519H8.50269C8.50554%2010.611%208.59959%2010.9302%208.78484%2011.2095C8.97009%2011.4859%209.22659%2011.7025%209.55434%2011.8593Z'%20fill='%231E1F22'/%3e%3cpath%20d='M5.22179%2011H4.21289V12H5.32012C5.64787%2012%205.93857%2011.9316%206.19222%2011.7948C6.44587%2011.6551%206.64394%2011.4613%206.78644%2011.2134C6.92894%2010.9654%207.00019%2010.6804%207.00019%2010.3584L7.00024%206H5.99989L5.99984%2010.222C5.99984%2010.3759%205.96707%2010.5127%205.90152%2010.6324C5.83882%2010.7492%205.74762%2010.8404%205.62792%2010.906C5.51107%2010.9687%205.37569%2011%205.22179%2011Z'%20fill='%231E1F22'/%3e%3c/svg%3e`,qD=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='2'%20y='13'%20width='12'%20height='1'%20rx='0.5'%20fill='%23C77D55'/%3e%3cpath%20d='M2.5%203C2.5%202.72386%202.72386%202.5%203%202.5H12C12.2761%202.5%2012.5%202.72386%2012.5%203V8C12.5%209.933%2010.933%2011.5%209%2011.5H6C4.067%2011.5%202.5%209.933%202.5%208V3Z'%20fill='%2345322B'%20stroke='%23C77D55'/%3e%3cpath%20d='M12.5%202.5H14.5C14.7761%202.5%2015%202.72386%2015%203V4.18121C15%204.78125%2014.6424%205.32356%2014.0909%205.55993L12.5%206.24173V2.5Z'%20stroke='%23C77D55'/%3e%3c/svg%3e`,JD=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.98755%209.77751C3.99755%209.39251%203.87005%209.08501%203.60505%208.85501C3.34005%208.62501%202.98255%208.51001%202.53255%208.51001H2V7.43001H2.53255C2.98255%207.43001%203.34005%207.31501%203.60505%207.08501C3.87005%206.85501%203.99755%206.54751%203.98755%206.16251L3.95755%204.58C3.94755%204.06%204.05505%203.605%204.28005%203.215C4.51005%202.825%204.83755%202.525%205.26255%202.315C5.68755%202.105%206.18755%202%206.76255%202H7.5V3.005H6.77005C6.25005%203.005%205.83755%203.15%205.53255%203.44C5.23255%203.725%205.08505%204.1125%205.09005%204.6025L5.12005%206.17001C5.13005%206.68001%204.99255%207.09751%204.70755%207.42251C4.42255%207.74251%204.03755%207.92001%203.55255%207.95501C4.03755%208.04501%204.42255%208.25501%204.70755%208.58501C4.99255%208.91001%205.13005%209.30501%205.12005%209.77001L5.09005%2011.5475C5.08005%2011.9875%205.21255%2012.3375%205.48755%2012.5975C5.76755%2012.8625%206.14505%2012.995%206.62005%2012.995H7.5V14H6.61255C6.07755%2014%205.60755%2013.9%205.20255%2013.7C4.80255%2013.505%204.49255%2013.2225%204.27255%2012.8525C4.05755%2012.4875%203.95255%2012.06%203.95755%2011.57L3.98755%209.77751Z'%20fill='%23834DF0'/%3e%3cpath%20d='M12.0145%209.77751C12.0045%209.39251%2012.132%209.08501%2012.397%208.85501C12.662%208.62501%2013.0195%208.51001%2013.4695%208.51001H14V7.43001H13.4695C13.0195%207.43001%2012.662%207.31501%2012.397%207.08501C12.132%206.85501%2012.0045%206.54751%2012.0145%206.16251L12.0445%204.58C12.0545%204.06%2011.9445%203.605%2011.7145%203.215C11.4895%202.825%2011.1645%202.525%2010.7395%202.315C10.3145%202.105%209.81455%202%209.23955%202H8.5V3.005H9.23205C9.75205%203.005%2010.162%203.15%2010.462%203.44C10.767%203.725%2010.917%204.1125%2010.912%204.6025L10.882%206.17001C10.872%206.68001%2011.0095%207.09751%2011.2945%207.42251C11.5795%207.74251%2011.9645%207.92001%2012.4495%207.95501C11.9645%208.04501%2011.5795%208.25501%2011.2945%208.58501C11.0095%208.91001%2010.872%209.30501%2010.882%209.77001L10.912%2011.5475C10.922%2011.9875%2010.787%2012.3375%2010.507%2012.5975C10.232%2012.8625%209.85705%2012.995%209.38205%2012.995H8.5V14H9.38955C9.92455%2014%2010.392%2013.9%2010.792%2013.7C11.197%2013.505%2011.507%2013.2225%2011.722%2012.8525C11.942%2012.4875%2012.0495%2012.06%2012.0445%2011.57L12.0145%209.77751Z'%20fill='%23834DF0'/%3e%3c/svg%3e`,YD=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.98755%209.77751C3.99755%209.39251%203.87005%209.08501%203.60505%208.85501C3.34005%208.62501%202.98255%208.51001%202.53255%208.51001H2V7.43001H2.53255C2.98255%207.43001%203.34005%207.31501%203.60505%207.08501C3.87005%206.85501%203.99755%206.54751%203.98755%206.16251L3.95755%204.58C3.94755%204.06%204.05505%203.605%204.28005%203.215C4.51005%202.825%204.83755%202.525%205.26255%202.315C5.68755%202.105%206.18755%202%206.76255%202H7.5V3.005H6.77005C6.25005%203.005%205.83755%203.15%205.53255%203.44C5.23255%203.725%205.08505%204.1125%205.09005%204.6025L5.12005%206.17001C5.13005%206.68001%204.99255%207.09751%204.70755%207.42251C4.42255%207.74251%204.03755%207.92001%203.55255%207.95501C4.03755%208.04501%204.42255%208.25501%204.70755%208.58501C4.99255%208.91001%205.13005%209.30501%205.12005%209.77001L5.09005%2011.5475C5.08005%2011.9875%205.21255%2012.3375%205.48755%2012.5975C5.76755%2012.8625%206.14505%2012.995%206.62005%2012.995H7.5V14H6.61255C6.07755%2014%205.60755%2013.9%205.20255%2013.7C4.80255%2013.505%204.49255%2013.2225%204.27255%2012.8525C4.05755%2012.4875%203.95255%2012.06%203.95755%2011.57L3.98755%209.77751Z'%20fill='%23B589EC'/%3e%3cpath%20d='M12.0145%209.77751C12.0045%209.39251%2012.132%209.08501%2012.397%208.85501C12.662%208.62501%2013.0195%208.51001%2013.4695%208.51001H14V7.43001H13.4695C13.0195%207.43001%2012.662%207.31501%2012.397%207.08501C12.132%206.85501%2012.0045%206.54751%2012.0145%206.16251L12.0445%204.58C12.0545%204.06%2011.9445%203.605%2011.7145%203.215C11.4895%202.825%2011.1645%202.525%2010.7395%202.315C10.3145%202.105%209.81455%202%209.23955%202H8.5V3.005H9.23205C9.75205%203.005%2010.162%203.15%2010.462%203.44C10.767%203.725%2010.917%204.1125%2010.912%204.6025L10.882%206.17001C10.872%206.68001%2011.0095%207.09751%2011.2945%207.42251C11.5795%207.74251%2011.9645%207.92001%2012.4495%207.95501C11.9645%208.04501%2011.5795%208.25501%2011.2945%208.58501C11.0095%208.91001%2010.872%209.30501%2010.882%209.77001L10.912%2011.5475C10.922%2011.9875%2010.787%2012.3375%2010.507%2012.5975C10.232%2012.8625%209.85705%2012.995%209.38205%2012.995H8.5V14H9.38955C9.92455%2014%2010.392%2013.9%2010.792%2013.7C11.197%2013.505%2011.507%2013.2225%2011.722%2012.8525C11.942%2012.4875%2012.0495%2012.06%2012.0445%2011.57L12.0145%209.77751Z'%20fill='%23B589EC'/%3e%3c/svg%3e`,XD=`data:image/svg+xml,%3c!--%20Copyright%202000-2024%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.3798%202.71174C15.5435%202.86906%2015.5436%203.13098%2015.3799%203.2884L12.6774%205.8876C12.4232%206.13204%2012%205.95194%2012%205.59934L12%200.403813C12%200.0513186%2012.423%20-0.128819%2012.6772%200.115408L15.3798%202.71174Z'%20fill='%2355A76A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.62255%203.28826C7.45909%203.13088%207.45916%202.8692%207.62271%202.71191L10.3216%200.116292C10.5757%20-0.128147%2010.9989%200.0519476%2010.9989%200.404547V5.59865C10.9989%205.95135%2010.5755%206.1314%2010.3214%205.88675L7.62255%203.28826Z'%20fill='%23E55765'/%3e%3c/svg%3e`,ZD=`data:image/svg+xml,%3c!--%20Copyright%202000-2024%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.3798%202.71174C15.5435%202.86906%2015.5436%203.13098%2015.3799%203.2884L12.6774%205.8876C12.4232%206.13204%2012%205.95194%2012%205.59934L12%200.403813C12%200.0513186%2012.423%20-0.128819%2012.6772%200.115408L15.3798%202.71174Z'%20fill='%2357965C'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.62255%203.28826C7.45909%203.13088%207.45916%202.8692%207.62271%202.71191L10.3216%200.116292C10.5757%20-0.128147%2010.9989%200.0519476%2010.9989%200.404547V5.59865C10.9989%205.95135%2010.5755%206.1314%2010.3214%205.88675L7.62255%203.28826Z'%20fill='%23DB5C5C'/%3e%3c/svg%3e`,QD=`data:image/svg+xml,%3c!--%20Copyright%202000-2024%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.3337%2012.6314C13.6699%2012.9396%2013.4519%2013.5%2012.9958%2013.5H3C2.72386%2013.5%202.5%2013.2761%202.5%2013V3C2.5%202.72386%202.72386%202.5%203%202.5H12.9958C13.4519%202.5%2013.6699%203.06044%2013.3337%203.36858L8.68333%207.63142C8.46715%207.82959%208.46715%208.17041%208.68333%208.36858L13.3337%2012.6314Z'%20fill='%23FAF5FF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%203C2%202.44772%202.44771%202%203%202H12.9958C13.9079%202%2014.3439%203.12089%2013.6716%203.73715L9.0212%208L13.6716%2012.2628C14.3439%2012.8791%2013.9079%2014%2012.9958%2014H3C2.44771%2014%202%2013.5523%202%2013V3ZM12.9958%203L3%203V13H12.9958L8.34547%208.73715C7.91311%208.34082%207.9131%207.65918%208.34547%207.26285L12.9958%203Z'%20fill='%23834DF0'/%3e%3c/svg%3e`,$D=`data:image/svg+xml,%3c!--%20Copyright%202000-2024%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.3337%2012.6314C13.6699%2012.9396%2013.4519%2013.5%2012.9958%2013.5H3C2.72386%2013.5%202.5%2013.2761%202.5%2013V3C2.5%202.72386%202.72386%202.5%203%202.5H12.9958C13.4519%202.5%2013.6699%203.06044%2013.3337%203.36858L8.68333%207.63142C8.46715%207.82959%208.46715%208.17041%208.68333%208.36858L13.3337%2012.6314Z'%20fill='%232F2936'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%203C2%202.44772%202.44771%202%203%202H12.9958C13.9079%202%2014.3439%203.12089%2013.6716%203.73715L9.0212%208L13.6716%2012.2628C14.3439%2012.8791%2013.9079%2014%2012.9958%2014H3C2.44771%2014%202%2013.5523%202%2013V3ZM12.9958%203L3%203V13H12.9958L8.34547%208.73715C7.91311%208.34082%207.9131%207.65918%208.34547%207.26285L12.9958%203Z'%20fill='%23A571E6'/%3e%3c/svg%3e`,eO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5929%209.9438L12.5929%204.70001L13.7929%204.70002L13.7929%209.94379L15.0763%208.66037L15.9248%209.5089L13.1929%2012.2409L10.4609%209.5089L11.3095%208.66037L12.5929%209.9438Z'%20fill='%233574F0'/%3e%3cpath%20d='M0.5%204.70001H2.94558L4.65385%209.14463L4.76288%209.60155L4.85635%209.14463L6.51269%204.70001H8.98423V11.9692H7.14096V7.59732L7.17212%207.12482L5.34442%2011.9692H4.08269L2.31212%207.17155L2.34327%207.59732V11.9692H0.5V4.70001Z'%20fill='%233574F0'/%3e%3c/svg%3e`,tO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5929%209.9438L12.5929%204.70001L13.7929%204.70002L13.7929%209.94379L15.0763%208.66037L15.9248%209.5089L13.1929%2012.2409L10.4609%209.5089L11.3095%208.66037L12.5929%209.9438Z'%20fill='%23548AF7'/%3e%3cpath%20d='M0.5%204.70001H2.94558L4.65385%209.14463L4.76288%209.60155L4.85635%209.14463L6.51269%204.70001H8.98423V11.9692H7.14096V7.59732L7.17212%207.12482L5.34442%2011.9692H4.08269L2.31212%207.17155L2.34327%207.59732V11.9692H0.5V4.70001Z'%20fill='%23548AF7'/%3e%3c/svg%3e`,nO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='9.5'%20y='9.5'%20width='6'%20height='6'%20rx='1.5'%20fill='%23E7EFFD'%20stroke='%233574F0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%203.86667C1%202.83574%201.7835%202%202.75%202H6.03823C6.29871%202%206.5489%202.10163%206.73559%202.28327L8.5%204L13%204C14.1046%204%2015%204.89543%2015%206V8.17071C14.6872%208.06015%2014.3506%208%2014%208H11C9.34315%208%208%209.34315%208%2011V14H2.75C1.7835%2014%201%2013.1643%201%2012.1333V3.86667Z'%20fill='%23EBECF0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.80265%204.71673L8.09379%205H8.5H13C13.5523%205%2014%205.44772%2014%206V8C14.3506%208%2014.6872%208.06015%2015%208.17071V6C15%204.89543%2014.1046%204%2013%204L8.5%204L6.73559%202.28327C6.5489%202.10163%206.29871%202%206.03823%202H2.75C1.7835%202%201%202.83574%201%203.86667V12.1333C1%2013.1643%201.7835%2014%202.75%2014H8V13H2.75C2.3956%2013%202%2012.6738%202%2012.1333V3.86667C2%203.32624%202.3956%203%202.75%203H6.03823L7.80265%204.71673Z'%20fill='%236C707E'/%3e%3c/svg%3e`,rO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='9.5'%20y='9.5'%20width='6'%20height='6'%20rx='1.5'%20fill='%2325324D'%20stroke='%23548AF7'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%203.86667C1%202.83574%201.7835%202%202.75%202H6.03823C6.29871%202%206.5489%202.10163%206.73559%202.28327L8.5%204L13%204C14.1046%204%2015%204.89543%2015%206V8.17071C14.6872%208.06015%2014.3506%208%2014%208H11C9.34315%208%208%209.34315%208%2011V14H2.75C1.7835%2014%201%2013.1643%201%2012.1333V3.86667Z'%20fill='%2343454A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.80265%204.71673L8.09379%205H8.5H13C13.5523%205%2014%205.44772%2014%206V8C14.3506%208%2014.6872%208.06015%2015%208.17071V6C15%204.89543%2014.1046%204%2013%204L8.5%204L6.73559%202.28327C6.5489%202.10163%206.29871%202%206.03823%202H2.75C1.7835%202%201%202.83574%201%203.86667V12.1333C1%2013.1643%201.7835%2014%202.75%2014H8V13H2.75C2.3956%2013%202%2012.6738%202%2012.1333V3.86667C2%203.32624%202.3956%203%202.75%203H6.03823L7.80265%204.71673Z'%20fill='%23CED0D6'/%3e%3c/svg%3e`,iO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%203.86667C1%202.83574%201.73127%202%202.63333%202H6.1217C6.39413%202%206.65477%202.11115%206.84336%202.30775L8.46667%204H13C14.1046%204%2015%204.89543%2015%206V12.1333C15%2013.1643%2014.2687%2014%2013.3667%2014H2.63333C1.73127%2014%201%2013.1643%201%2012.1333V3.86667ZM6%2010C6.55228%2010%207%209.55228%207%209C7%208.44772%206.55228%208%206%208C5.44772%208%205%208.44772%205%209C5%209.55228%205.44772%2010%206%2010Z'%20fill='%23EBECF0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.04022%205L6.1217%203H2.63333C2.40481%203%202%203.25841%202%203.86667V12.1333C2%2012.7416%202.40481%2013%202.63333%2013H13.3667C13.5952%2013%2014%2012.7416%2014%2012.1333V6C14%205.44771%2013.5523%205%2013%205H8.04022ZM8.46667%204L6.84336%202.30775C6.65477%202.11115%206.39413%202%206.1217%202H2.63333C1.73127%202%201%202.83574%201%203.86667V12.1333C1%2013.1643%201.73127%2014%202.63333%2014H13.3667C14.2687%2014%2015%2013.1643%2015%2012.1333V6C15%204.89543%2014.1046%204%2013%204H8.46667ZM4%209C4%207.89543%204.89543%207%206%207C7.10457%207%208%207.89543%208%209C8%2010.1046%207.10457%2011%206%2011C4.89543%2011%204%2010.1046%204%209ZM7%209C7%209.55228%206.55228%2010%206%2010C5.44772%2010%205%209.55228%205%209C5%208.44772%205.44772%208%206%208C6.55228%208%207%208.44772%207%209Z'%20fill='%236C707E'/%3e%3c/svg%3e`,aO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%203.86667C1%202.83574%201.73127%202%202.63333%202H6.1217C6.39413%202%206.65477%202.11115%206.84336%202.30775L8.46667%204H13C14.1046%204%2015%204.89543%2015%206V12.1333C15%2013.1643%2014.2687%2014%2013.3667%2014H2.63333C1.73127%2014%201%2013.1643%201%2012.1333V3.86667ZM6%2010C6.55228%2010%207%209.55228%207%209C7%208.44772%206.55228%208%206%208C5.44772%208%205%208.44772%205%209C5%209.55228%205.44772%2010%206%2010Z'%20fill='%2343454A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.04022%205L6.1217%203H2.63333C2.40481%203%202%203.25841%202%203.86667V12.1333C2%2012.7416%202.40481%2013%202.63333%2013H13.3667C13.5952%2013%2014%2012.7416%2014%2012.1333V6C14%205.44771%2013.5523%205%2013%205H8.04022ZM8.46667%204L6.84336%202.30775C6.65477%202.11115%206.39413%202%206.1217%202H2.63333C1.73127%202%201%202.83574%201%203.86667V12.1333C1%2013.1643%201.73127%2014%202.63333%2014H13.3667C14.2687%2014%2015%2013.1643%2015%2012.1333V6C15%204.89543%2014.1046%204%2013%204H8.46667ZM4%209C4%207.89543%204.89543%207%206%207C7.10457%207%208%207.89543%208%209C8%2010.1046%207.10457%2011%206%2011C4.89543%2011%204%2010.1046%204%209ZM7%209C7%209.55228%206.55228%2010%206%2010C5.44772%2010%205%209.55228%205%209C5%208.44772%205.44772%208%206%208C6.55228%208%207%208.44772%207%209Z'%20fill='%23CED0D6'/%3e%3c/svg%3e`,oO=`/assets/properties-B3r0DjE7.svg`,sO=`/assets/properties_dark-DnHs7phT.svg`,cO=`data:image/svg+xml,%3c!--%20Copyright%202000-2024%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.00001%201C11%201%2011%202%2011%204L11%206.5C11%207.32843%2010.3284%208%209.5%208H6.5C5.11929%208%204%209.11929%204%2010.5V11C2%2011%201%2011%201%207.99999C1%204.99999%202%204.99998%204%204.99998L7.5%205C7.77614%205%208%204.77614%208%204.5C8%204.22386%207.77614%204%207.5%204H5.00001C5.00001%202%205.00001%201%208.00001%201ZM6.5%203C6.77614%203%207%202.77614%207%202.5C7%202.22386%206.77614%202%206.5%202C6.22386%202%206%202.22386%206%202.5C6%202.77614%206.22386%203%206.5%203Z'%20fill='%234682FA'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%205V6.5C12%207.88071%2010.8807%209%209.5%209H6.5C5.67157%209%205%209.67157%205%2010.5L5.00001%2012C4.99946%2014%205.00001%2015%208.00001%2015C11%2015%2011%2014%2011%2012L8.5%2012C8.22386%2012%208%2011.7761%208%2011.5C8%2011.2239%208.22386%2011%208.5%2011L12%2011C14%2011.0005%2015%2011%2015%207.99999C15%205.00002%2014%205.00001%2012%205ZM9.5%2014C9.77614%2014%2010%2013.7761%2010%2013.5C10%2013.2239%209.77614%2013%209.5%2013C9.22386%2013%209%2013.2239%209%2013.5C9%2013.7761%209.22386%2014%209.5%2014Z'%20fill='%23FFAF0F'/%3e%3c/svg%3e`,lO=`data:image/svg+xml,%3c!--%20Copyright%202000-2024%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.00001%201C11%201%2011%202%2011%204L11%206.5C11%207.32843%2010.3284%208%209.5%208H6.5C5.11929%208%204%209.11929%204%2010.5V11C2%2011%201%2011%201%207.99999C1%204.99999%202%204.99998%204%204.99998L7.5%205C7.77614%205%208%204.77614%208%204.5C8%204.22386%207.77614%204%207.5%204H5.00001C5.00001%202%205.00001%201%208.00001%201ZM6.5%203C6.77614%203%207%202.77614%207%202.5C7%202.22386%206.77614%202%206.5%202C6.22386%202%206%202.22386%206%202.5C6%202.77614%206.22386%203%206.5%203Z'%20fill='%23548AF7'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%205V6.5C12%207.88071%2010.8807%209%209.5%209H6.5C5.67157%209%205%209.67157%205%2010.5L5.00001%2012C4.99946%2014%205.00001%2015%208.00001%2015C11%2015%2011%2014%2011%2012L8.5%2012C8.22386%2012%208%2011.7761%208%2011.5C8%2011.2239%208.22386%2011%208.5%2011L12%2011C14%2011.0005%2015%2011%2015%207.99999C15%205.00002%2014%205.00001%2012%205ZM9.5%2014C9.77614%2014%2010%2013.7761%2010%2013.5C10%2013.2239%209.77614%2013%209.5%2013C9.22386%2013%209%2013.2239%209%2013.5C9%2013.7761%209.22386%2014%209.5%2014Z'%20fill='%23F2C55C'/%3e%3c/svg%3e`,uO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='6.5'%20fill='%23E7EFFD'%20stroke='%233574F0'/%3e%3cpath%20d='M7.92995%208.405H9.02495L10.925%2011.5H9.77495L7.92995%208.405ZM5.69995%204.5H8.58495C9.04828%204.5%209.45328%204.58667%209.79995%204.76C10.15%204.93%2010.42%205.17167%2010.61%205.485C10.8%205.795%2010.895%206.15833%2010.895%206.575C10.895%206.98833%2010.7983%207.35333%2010.605%207.67C10.4116%207.98667%2010.1383%208.23167%209.78495%208.405C9.43162%208.575%209.01828%208.66%208.54495%208.66H6.69995V11.5H5.69995V4.5ZM8.55995%207.77C8.81995%207.77%209.04662%207.72167%209.23995%207.625C9.43328%207.52833%209.58328%207.39%209.68995%207.21C9.79662%207.03%209.84995%206.81833%209.84995%206.575C9.84995%206.335%209.79662%206.12667%209.68995%205.95C9.58328%205.77%209.43328%205.63167%209.23995%205.535C9.04662%205.43833%208.81995%205.39%208.55995%205.39H6.69995V7.77H8.55995Z'%20fill='%233574F0'/%3e%3c/svg%3e`,dO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='6.5'%20fill='%2325324D'%20stroke='%23548AF7'/%3e%3cpath%20d='M7.92995%208.405H9.02495L10.925%2011.5H9.77495L7.92995%208.405ZM5.69995%204.5H8.58495C9.04828%204.5%209.45328%204.58667%209.79995%204.76C10.15%204.93%2010.42%205.17167%2010.61%205.485C10.8%205.795%2010.895%206.15833%2010.895%206.575C10.895%206.98833%2010.7983%207.35333%2010.605%207.67C10.4116%207.98667%2010.1383%208.23167%209.78495%208.405C9.43162%208.575%209.01828%208.66%208.54495%208.66H6.69995V11.5H5.69995V4.5ZM8.55995%207.77C8.81995%207.77%209.04662%207.72167%209.23995%207.625C9.43328%207.52833%209.58328%207.39%209.68995%207.21C9.79662%207.03%209.84995%206.81833%209.84995%206.575C9.84995%206.335%209.79662%206.12667%209.68995%205.95C9.58328%205.77%209.43328%205.63167%209.23995%205.535C9.04662%205.43833%208.81995%205.39%208.55995%205.39H6.69995V7.77H8.55995Z'%20fill='%23548AF7'/%3e%3c/svg%3e`,fO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1.5'%20y='2.5'%20width='13'%20height='11'%20rx='1.5'%20fill='%23EBECF0'%20stroke='%236C707E'/%3e%3cpath%20d='M4%206L6%208L4%2010'%20stroke='%236C707E'%20stroke-width='1.2'/%3e%3cpath%20d='M7.5%2010.5H11.5'%20stroke='%236C707E'%20stroke-width='1.2'/%3e%3c/svg%3e`,pO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1.5'%20y='2.5'%20width='13'%20height='11'%20rx='1.5'%20fill='%2343454A'%20stroke='%23CED0D6'/%3e%3cpath%20d='M4%206L6%208L4%2010'%20stroke='%23CED0D6'%20stroke-width='1.2'/%3e%3cpath%20d='M7.5%2010.5H11.5'%20stroke='%23CED0D6'%20stroke-width='1.2'/%3e%3c/svg%3e`,mO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='2'%20y='12'%20width='8'%20height='1'%20rx='0.5'%20fill='%236C707E'/%3e%3crect%20x='2'%20y='6'%20width='8'%20height='1'%20rx='0.5'%20fill='%236C707E'/%3e%3crect%20x='2'%20y='9'%20width='12'%20height='1'%20rx='0.5'%20fill='%236C707E'/%3e%3crect%20x='2'%20y='3'%20width='12'%20height='1'%20rx='0.5'%20fill='%236C707E'/%3e%3c/svg%3e`,hO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='2'%20y='12'%20width='8'%20height='1'%20rx='0.5'%20fill='%23CED0D6'/%3e%3crect%20x='2'%20y='6'%20width='8'%20height='1'%20rx='0.5'%20fill='%23CED0D6'/%3e%3crect%20x='2'%20y='9'%20width='12'%20height='1'%20rx='0.5'%20fill='%23CED0D6'/%3e%3crect%20x='2'%20y='3'%20width='12'%20height='1'%20rx='0.5'%20fill='%23CED0D6'/%3e%3c/svg%3e`,gO=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%204C14%202.89543%2013.1046%202%2012%202H4C2.89543%202%202%202.89543%202%204V12C2%2013.1046%202.89543%2014%204%2014H12C13.1046%2014%2014%2013.1046%2014%2012V4Z'%20fill='%233574F0'/%3e%3cpath%20d='M3.13501%205.99999H7.87171V6.99999H6V12H5V6.99999H3.13501V5.99999Z'%20fill='white'/%3e%3cpath%20d='M10.6833%2012.0902C10.2587%2012.0902%209.8825%2012.0133%209.55475%2011.8594C9.227%2011.7026%208.9705%2011.486%208.78525%2011.2096C8.6%2010.9303%208.50595%2010.6111%208.5031%2010.252H9.51627C9.51627%2010.4401%209.56615%2010.6082%209.6659%2010.7564C9.76565%2010.9046%209.90387%2011.02%2010.0806%2011.1027C10.2601%2011.1825%2010.4653%2011.2224%2010.6962%2011.2224C10.9213%2011.2224%2011.1194%2011.1853%2011.2904%2011.1112C11.4614%2011.0371%2011.5925%2010.9331%2011.6837%2010.7992C11.7777%2010.6624%2011.8248%2010.5056%2011.8248%2010.3289C11.8248%2010.1066%2011.7578%209.91567%2011.6238%209.75607C11.4899%209.59362%2011.3118%209.49387%2011.0895%209.45682L10.0763%209.28582C9.7856%209.23452%209.53337%209.13192%209.31962%208.97802C9.10587%208.82412%208.94057%208.63175%208.82372%208.4009C8.70972%208.1672%208.65272%207.91212%208.65272%207.63567C8.65272%207.30507%208.73822%207.00867%208.90922%206.74647C9.08307%206.48142%209.3239%206.2748%209.6317%206.1266C9.9395%205.97555%2010.2872%205.90002%2010.6748%205.90002C11.0709%205.90002%2011.4229%205.9727%2011.7307%206.11805C12.0414%206.2634%2012.2836%206.46575%2012.4575%206.7251C12.6313%206.98445%2012.7197%207.28085%2012.7225%207.6143H11.7093C11.7093%207.45185%2011.6666%207.3065%2011.5811%207.17825C11.4956%207.04715%2011.3759%206.94597%2011.222%206.87472C11.0681%206.80347%2010.89%206.76785%2010.6876%206.76785C10.4853%206.76785%2010.3071%206.80205%2010.1532%206.87045C9.99935%206.93885%209.87965%207.03575%209.79415%207.16115C9.70865%207.28655%209.6659%207.4319%209.6659%207.5972C9.6659%207.791%209.7286%207.95915%209.854%208.10165C9.9794%208.2413%2010.1433%208.32822%2010.3456%208.36242L11.3417%208.52487C11.6352%208.57617%2011.896%208.6859%2012.124%208.85405C12.3549%209.0222%2012.533%209.23167%2012.6584%209.48247C12.7838%209.73327%2012.8465%209.99975%2012.8465%2010.2819C12.8465%2010.6239%2012.7553%2010.9331%2012.5729%2011.2096C12.3905%2011.4832%2012.1354%2011.6983%2011.8077%2011.8551C11.4799%2012.0118%2011.1051%2012.0902%2010.6833%2012.0902Z'%20fill='white'/%3e%3c/svg%3e`,_O=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%204C14%202.89543%2013.1046%202%2012%202H4C2.89543%202%202%202.89543%202%204V12C2%2013.1046%202.89543%2014%204%2014H12C13.1046%2014%2014%2013.1046%2014%2012V4Z'%20fill='%23548AF7'/%3e%3cpath%20d='M3.13501%205.99999H7.87171V6.99999H6V12H5V6.99999H3.13501V5.99999Z'%20fill='white'/%3e%3cpath%20d='M10.6833%2012.0902C10.2587%2012.0902%209.8825%2012.0133%209.55475%2011.8594C9.227%2011.7026%208.9705%2011.486%208.78525%2011.2096C8.6%2010.9303%208.50595%2010.6111%208.5031%2010.252H9.51627C9.51627%2010.4401%209.56615%2010.6082%209.6659%2010.7564C9.76565%2010.9046%209.90387%2011.02%2010.0806%2011.1027C10.2601%2011.1825%2010.4653%2011.2224%2010.6962%2011.2224C10.9213%2011.2224%2011.1194%2011.1853%2011.2904%2011.1112C11.4614%2011.0371%2011.5925%2010.9331%2011.6837%2010.7992C11.7777%2010.6624%2011.8248%2010.5056%2011.8248%2010.3289C11.8248%2010.1066%2011.7578%209.91567%2011.6238%209.75607C11.4899%209.59362%2011.3118%209.49387%2011.0895%209.45682L10.0763%209.28582C9.7856%209.23452%209.53337%209.13192%209.31962%208.97802C9.10587%208.82412%208.94057%208.63175%208.82372%208.4009C8.70972%208.1672%208.65272%207.91212%208.65272%207.63567C8.65272%207.30507%208.73822%207.00867%208.90922%206.74647C9.08307%206.48142%209.3239%206.2748%209.6317%206.1266C9.9395%205.97555%2010.2872%205.90002%2010.6748%205.90002C11.0709%205.90002%2011.4229%205.9727%2011.7307%206.11805C12.0414%206.2634%2012.2836%206.46575%2012.4575%206.7251C12.6313%206.98445%2012.7197%207.28085%2012.7225%207.6143H11.7093C11.7093%207.45185%2011.6666%207.3065%2011.5811%207.17825C11.4956%207.04715%2011.3759%206.94597%2011.222%206.87472C11.0681%206.80347%2010.89%206.76785%2010.6876%206.76785C10.4853%206.76785%2010.3071%206.80205%2010.1532%206.87045C9.99935%206.93885%209.87965%207.03575%209.79415%207.16115C9.70865%207.28655%209.6659%207.4319%209.6659%207.5972C9.6659%207.791%209.7286%207.95915%209.854%208.10165C9.9794%208.2413%2010.1433%208.32822%2010.3456%208.36242L11.3417%208.52487C11.6352%208.57617%2011.896%208.6859%2012.124%208.85405C12.3549%209.0222%2012.533%209.23167%2012.6584%209.48247C12.7838%209.73327%2012.8465%209.99975%2012.8465%2010.2819C12.8465%2010.6239%2012.7553%2010.9331%2012.5729%2011.2096C12.3905%2011.4832%2012.1354%2011.6983%2011.8077%2011.8551C11.4799%2012.0118%2011.1051%2012.0902%2010.6833%2012.0902Z'%20fill='white'/%3e%3c/svg%3e`,vO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='2.5'%20y='2.5'%20width='11'%20height='11'%20rx='1.5'%20fill='%23EBECF0'%20stroke='%236C707E'/%3e%3cpath%20d='M7.32546%209.03C7.32546%208.80334%207.3638%208.605%207.44046%208.435C7.52046%208.26167%207.61546%208.115%207.72546%207.995C7.8388%207.87167%207.98546%207.73167%208.16546%207.575C8.32546%207.435%208.45046%207.31834%208.54046%207.225C8.6338%207.12834%208.71046%207.01667%208.77046%206.89C8.8338%206.76334%208.86546%206.62167%208.86546%206.465C8.86546%206.215%208.7888%206.01167%208.63546%205.855C8.48213%205.695%208.2788%205.615%208.02546%205.615C7.74546%205.615%207.52046%205.705%207.35046%205.885C7.1838%206.065%207.10213%206.3%207.10546%206.59H5.72546C5.72546%206.13%205.8188%205.735%206.00546%205.405C6.19213%205.07167%206.4588%204.81834%206.80546%204.645C7.15546%204.46834%207.56713%204.38%208.04046%204.38C8.49713%204.38%208.8938%204.46167%209.23046%204.625C9.56713%204.78834%209.82546%205.02%2010.0055%205.32C10.1855%205.61667%2010.2738%205.96667%2010.2705%206.37C10.2705%206.67334%2010.2221%206.935%2010.1255%207.155C10.0288%207.375%209.9138%207.555%209.78046%207.695C9.64713%207.835%209.47213%207.99334%209.25546%208.17C9.10546%208.29%208.98713%208.39%208.90046%208.47001C8.81713%208.55%208.74713%208.64167%208.69046%208.74501C8.63713%208.84501%208.61046%208.95667%208.61046%209.08V9.255H7.32546V9.03ZM8.74046%2011.5H7.24046V10H8.74046V11.5Z'%20fill='%236C707E'/%3e%3c/svg%3e`,yO=`data:image/svg+xml,%3c!--%20Copyright%202000-2022%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='2.5'%20y='2.5'%20width='11'%20height='11'%20rx='1.5'%20fill='%2343454A'%20stroke='%23CED0D6'/%3e%3cpath%20d='M7.32546%209.03C7.32546%208.80334%207.3638%208.605%207.44046%208.435C7.52046%208.26167%207.61546%208.115%207.72546%207.995C7.8388%207.87167%207.98546%207.73167%208.16546%207.575C8.32546%207.435%208.45046%207.31834%208.54046%207.225C8.6338%207.12834%208.71046%207.01667%208.77046%206.89C8.8338%206.76334%208.86546%206.62167%208.86546%206.465C8.86546%206.215%208.7888%206.01167%208.63546%205.855C8.48213%205.695%208.2788%205.615%208.02546%205.615C7.74546%205.615%207.52046%205.705%207.35046%205.885C7.1838%206.065%207.10213%206.3%207.10546%206.59H5.72546C5.72546%206.13%205.8188%205.735%206.00546%205.405C6.19213%205.07167%206.4588%204.81834%206.80546%204.645C7.15546%204.46834%207.56713%204.38%208.04046%204.38C8.49713%204.38%208.8938%204.46167%209.23046%204.625C9.56713%204.78834%209.82546%205.02%2010.0055%205.32C10.1855%205.61667%2010.2738%205.96667%2010.2705%206.37C10.2705%206.67334%2010.2221%206.935%2010.1255%207.155C10.0288%207.375%209.9138%207.555%209.78046%207.695C9.64713%207.835%209.47213%207.99334%209.25546%208.17C9.10546%208.29%208.98713%208.39%208.90046%208.47001C8.81713%208.55%208.74713%208.64167%208.69046%208.74501C8.63713%208.84501%208.61046%208.95667%208.61046%209.08V9.255H7.32546V9.03ZM8.74046%2011.5H7.24046V10H8.74046V11.5Z'%20fill='%23CED0D6'/%3e%3c/svg%3e`,bO=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.0775%202.44037C10.1656%202.12093%209.97809%201.79054%209.65866%201.70242C9.33922%201.6143%209.00882%201.80182%208.9207%202.12126L5.76529%2013.5596C5.67717%2013.8791%205.86469%2014.2095%206.18412%2014.2976C6.50356%2014.3857%206.83396%2014.1982%206.92208%2013.8788L10.0775%202.44037ZM5.41281%204.66699C5.61982%204.92575%205.57786%205.30332%205.31911%205.51033L1.96049%208.19723L5.31911%2010.8841C5.57786%2011.0911%205.61982%2011.4687%205.41281%2011.7275C5.20581%2011.9862%204.82823%2012.0282%204.56947%2011.8212L0.625202%208.66575L0.0395508%208.19723L0.625202%207.7287L4.56947%204.57329C4.82823%204.36628%205.20581%204.40823%205.41281%204.66699ZM10.5872%2011.7275C10.3802%2011.4687%2010.4222%2011.0911%2010.6809%2010.8841L14.0395%208.19725L10.6809%205.51035C10.4222%205.30334%2010.3802%204.92577%2010.5872%204.66701C10.7942%204.40825%2011.1718%204.3663%2011.4305%204.57331L15.3748%207.72872L15.9605%208.19725L15.3748%208.66577L11.4305%2011.8212C11.1718%2012.0282%2010.7942%2011.9862%2010.5872%2011.7275Z'%20fill='%23E66D17'/%3e%3c/svg%3e`,xO=`data:image/svg+xml,%3c!--%20Copyright%202000-2023%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.0775%202.44037C10.1656%202.12093%209.97809%201.79054%209.65866%201.70242C9.33922%201.6143%209.00882%201.80182%208.9207%202.12126L5.76529%2013.5596C5.67717%2013.8791%205.86469%2014.2095%206.18412%2014.2976C6.50356%2014.3857%206.83396%2014.1982%206.92208%2013.8788L10.0775%202.44037ZM5.41281%204.66699C5.61982%204.92575%205.57786%205.30332%205.31911%205.51033L1.96049%208.19723L5.31911%2010.8841C5.57786%2011.0911%205.61982%2011.4687%205.41281%2011.7275C5.20581%2011.9862%204.82823%2012.0282%204.56947%2011.8212L0.625202%208.66575L0.0395508%208.19723L0.625202%207.7287L4.56947%204.57329C4.82823%204.36628%205.20581%204.40823%205.41281%204.66699ZM10.5872%2011.7275C10.3802%2011.4687%2010.4222%2011.0911%2010.6809%2010.8841L14.0395%208.19725L10.6809%205.51035C10.4222%205.30334%2010.3802%204.92577%2010.5872%204.66701C10.7942%204.40825%2011.1718%204.3663%2011.4305%204.57331L15.3748%207.72872L15.9605%208.19725L15.3748%208.66577L11.4305%2011.8212C11.1718%2012.0282%2010.7942%2011.9862%2010.5872%2011.7275Z'%20fill='%23C77D55'/%3e%3c/svg%3e`,SO=`data:image/svg+xml,%3c!--%20Copyright%202000-2025%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11%202C11.5523%202%2012%202.44772%2012%203V9H11C10.4477%209%2010%209.44772%2010%2010V14H5C4.44772%2014%204%2013.5523%204%2013V6H6C7.10457%206%208%205.10457%208%204V2H11Z'%20fill='%23FFF7F7'/%3e%3cpath%20d='M7%204C7%204.06893%206.99277%204.13617%206.97949%204.20117C6.88625%204.65686%206.48325%205%206%205H4.41406L7%202.41406V4Z'%20fill='%23FFF7F7'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%201C12.1046%201%2013%201.89543%2013%203V9H12V3C12%202.44772%2011.5523%202%2011%202H8V4C8%205.10457%207.10457%206%206%206H4V13C4%2013.5523%204.44772%2014%205%2014H10V15H5C3.89543%2015%203%2014.1046%203%2013V5.41406C3.00004%205.1489%203.10547%204.89453%203.29297%204.70703L6.70703%201.29297C6.89453%201.10547%207.1489%201.00004%207.41406%201H11ZM4.41406%205H6C6.55228%205%207%204.55228%207%204V2.41406L4.41406%205Z'%20fill='%23DB3B4B'/%3e%3cpath%20d='M12.4018%2016V13.827L10.647%2010.014H11.7212L12.656%2012.0886C12.727%2012.2526%2012.7872%2012.4139%2012.8364%2012.5724C12.8856%2012.7309%2012.9184%2012.8539%2012.9348%2012.9414C12.9566%2012.8539%2012.9894%2012.7309%2013.0332%2012.5724C13.0824%2012.4139%2013.1425%2012.2526%2013.2136%2012.0886L14.1238%2010.014H15.1898L13.435%2013.827V16H12.4018Z'%20fill='%236C707E'/%3e%3c/svg%3e`,CO=`data:image/svg+xml,%3c!--%20Copyright%202000-2025%20JetBrains%20s.r.o.%20and%20contributors.%20Use%20of%20this%20source%20code%20is%20governed%20by%20the%20Apache%202.0%20license.%20--%3e%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11%202C11.5523%202%2012%202.44772%2012%203V9H11C10.4477%209%2010%209.44772%2010%2010V14H5C4.44772%2014%204%2013.5523%204%2013V6H6C7.10457%206%208%205.10457%208%204V2H11Z'%20fill='%23402929'/%3e%3cpath%20d='M7%204C7%204.06893%206.99277%204.13617%206.97949%204.20117C6.88625%204.65686%206.48325%205%206%205H4.41406L7%202.41406V4Z'%20fill='%23402929'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%201C12.1046%201%2013%201.89543%2013%203V9H12V3C12%202.44772%2011.5523%202%2011%202H8V4C8%205.10457%207.10457%206%206%206H4V13C4%2013.5523%204.44772%2014%205%2014H10V15H5C3.89543%2015%203%2014.1046%203%2013V5.41406C3.00004%205.1489%203.10547%204.89453%203.29297%204.70703L6.70703%201.29297C6.89453%201.10547%207.1489%201.00004%207.41406%201H11ZM4.41406%205H6C6.55228%205%207%204.55228%207%204V2.41406L4.41406%205Z'%20fill='%23DB5C5C'/%3e%3cpath%20d='M12.4018%2016V13.827L10.647%2010.014H11.7212L12.656%2012.0886C12.727%2012.2526%2012.7872%2012.4139%2012.8364%2012.5724C12.8856%2012.7309%2012.9184%2012.8539%2012.9348%2012.9414C12.9566%2012.8539%2012.9894%2012.7309%2013.0332%2012.5724C13.0824%2012.4139%2013.1425%2012.2526%2013.2136%2012.0886L14.1238%2010.014H15.1898L13.435%2013.827V16H12.4018Z'%20fill='%23CED0D6'/%3e%3c/svg%3e`,wO={kt:[`kotlin`,`Kotlin`],kts:[`kotlin`,`Kotlin`],ts:[`typeScript`,`TypeScript`],tsx:[`typeScript`,`TypeScript`],mts:[`typeScript`,`TypeScript`],cts:[`typeScript`,`TypeScript`],js:[`javaScript`,`JavaScript`],jsx:[`javaScript`,`JavaScript`],mjs:[`javaScript`,`JavaScript`],cjs:[`javaScript`,`JavaScript`],json:[`json`,`JSON`],jsonc:[`json`,`JSON`],yml:[`yaml`,`YAML`],yaml:[`yaml`,`YAML`],md:[`markdown`,`Markdown`],xml:[`xml`,`XML`],properties:[`properties`,`Properties`],sh:[`shell`,`Shell script`],bash:[`shell`,`Shell script`],py:[`python`,`Python`],pyi:[`python`,`Python`],txt:[`text`,`Text`]},TO=(e,t)=>{let n=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();if(n.endsWith(`.java`))return t===`deleted`?{icon:`java`,testMark:!1,label:`Java file`}:ll(e)?{icon:`class`,testMark:!0,label:`Java test class`}:{icon:`class`,testMark:!1,label:`Java class`};if(/\/meta-inf\/services\//i.test(`/${e}`))return{icon:`text`,testMark:!1,label:`Text`};let[r,i]=wO[/\.([a-z0-9]+)$/.exec(n)?.[1]??``]??[`unknown`,`File`];return{icon:r,testMark:!1,label:i}},EO=/^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$/,DO=/(^|\/)src\/(main|test)\/(java|kotlin)\/./,OO=(e,t)=>{if(/(^|\/)META-INF(\/|$)/.test(e))return`folder`;let n=e.split(`/`),r=e=>{let r=`${n.slice(0,e+1).join(`/`)}/src/`;return EO.test(n[e]??``)&&t.some(e=>e.startsWith(r))};return r(n.length-1)?`module`:DO.test(e)||n.slice(0,-1).some((e,t)=>r(t))?`package`:`folder`},kO=Object.assign({"./icons/class.svg":PD,"./icons/classAbstract.svg":FD,"./icons/classAbstract_dark.svg":ID,"./icons/class_dark.svg":LD,"./icons/enum.svg":RD,"./icons/enum_dark.svg":zD,"./icons/folder.svg":BD,"./icons/folder_dark.svg":VD,"./icons/interface.svg":HD,"./icons/interface_dark.svg":UD,"./icons/java.svg":WD,"./icons/javaScript.svg":GD,"./icons/javaScript_dark.svg":KD,"./icons/java_dark.svg":qD,"./icons/json.svg":JD,"./icons/json_dark.svg":YD,"./icons/junitTestMark.svg":XD,"./icons/junitTestMark_dark.svg":ZD,"./icons/kotlin.svg":QD,"./icons/kotlin_dark.svg":$D,"./icons/markdown.svg":eO,"./icons/markdown_dark.svg":tO,"./icons/module.svg":nO,"./icons/module_dark.svg":rO,"./icons/package.svg":iO,"./icons/package_dark.svg":aO,"./icons/properties.svg":oO,"./icons/properties_dark.svg":sO,"./icons/python.svg":cO,"./icons/python_dark.svg":lO,"./icons/record.svg":uO,"./icons/record_dark.svg":dO,"./icons/shell.svg":fO,"./icons/shell_dark.svg":pO,"./icons/text.svg":mO,"./icons/text_dark.svg":hO,"./icons/typeScript.svg":gO,"./icons/typeScript_dark.svg":_O,"./icons/unknown.svg":vO,"./icons/unknown_dark.svg":yO,"./icons/xml.svg":bO,"./icons/xml_dark.svg":xO,"./icons/yaml.svg":SO,"./icons/yaml_dark.svg":CO}),AO=(e,t)=>kO[`./icons/${e}${t?`_dark`:``}.svg`]??``,jO=({name:e,className:t})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`img`,{src:AO(e,!1),alt:``,draggable:!1,className:X(`block size-4 dark:hidden`,t)}),(0,Y.jsx)(`img`,{src:AO(e,!0),alt:``,draggable:!1,className:X(`hidden size-4 dark:block`,t)})]}),MO=({path:e,status:t,className:n})=>{let r=TO(e,t);return(0,Y.jsxs)(`span`,{"aria-hidden":`true`,"data-icon":r.icon,...r.testMark?{"data-test-mark":``}:{},className:X(`relative inline-block size-4 shrink-0`,n),children:[(0,Y.jsx)(jO,{name:r.icon}),r.testMark&&(0,Y.jsx)(jO,{name:`junitTestMark`,className:`absolute inset-0`})]})},NO=({kind:e})=>(0,Y.jsx)(`span`,{"aria-hidden":`true`,"data-icon":e,className:`inline-block size-4 shrink-0`,children:(0,Y.jsx)(jO,{name:e})}),PO=({path:e,name:t})=>{let n=e.lastIndexOf(`/`)+1;return(0,Y.jsxs)(Y.Fragment,{children:[n>0&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.slice(0,n)}),(0,Y.jsx)(`span`,{"data-slot":`file-name`,className:X(`font-medium`,t),children:e.slice(n)})]})},FO=({file:e,status:t,className:n})=>{let r=t===void 0?null:kD[t],i=r?.kind===`mark`?r:null;return(0,Y.jsxs)(`span`,{"data-slot":`file-path`,className:X(`min-w-0 break-all font-mono text-code`,n),children:[t!==void 0&&(0,Y.jsx)(MO,{path:e.path,status:t,className:`mr-1 align-[-3px]`}),e.oldPath!==null&&e.oldPath!==e.path?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.oldPath}),` `,(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`→`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`renamed to`}),` `,(0,Y.jsx)(PO,{path:e.path,name:i?.name})]}):(0,Y.jsx)(PO,{path:e.path,name:i?.name}),i!==null&&(0,Y.jsxs)(`span`,{className:`sr-only`,children:[`, `,i.label]})]})},IO=({status:e})=>{let t=kD[e];return t?.kind===`chip`?(0,Y.jsx)(`span`,{"data-slot":`file-status`,className:X(`shrink-0 rounded-full border px-1.5 text-caption font-medium leading-4`,t.className),children:t.label}):null},LO=(e,t)=>`${e} ${t}${e===1?``:`s`}`,RO=({callers:e,named:t})=>{let[n,r]=(0,J.useState)(!1),i=(0,J.useId)(),{uses:a,more:o}=e,s=a.filter(e=>ll(e.path)).length,c=a.length-s,l=`${[...c>0?[LO(c,`place`)]:[],...s>0?[LO(s,`test`)]:[]].join(` and `)}${o>0?`, and ${o} more`:``}`;return(0,Y.jsxs)(`div`,{"data-slot":`unchanged-uses`,className:`border-b bg-surface-subtle px-3 py-1.5`,children:[(0,Y.jsx)(`p`,{children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":n,"aria-controls":i,onClick:()=>r(!n),className:`min-h-6 rounded-sm text-primary underline-offset-2 hover:underline`,children:[t&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`code`,{className:`font-mono text-code-compact`,children:e.symbol}),` `]}),t?`used`:`Used`,` unchanged in `,l]})}),n&&(0,Y.jsxs)(`ul`,{id:i,className:`mt-1.5 flex flex-col gap-2`,children:[a.map(e=>(0,Y.jsxs)(`li`,{"data-slot":`unchanged-use`,children:[(0,Y.jsxs)(`p`,{"data-slot":`unchanged-place`,className:`font-mono text-code-compact text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:`text-foreground`,children:e.path}),`:`,e.line,e.use===`type`&&(0,Y.jsx)(`span`,{children:` type`})]}),(0,Y.jsx)(`pre`,{className:`overflow-x-auto rounded-md border bg-background py-1 font-code text-code-compact`,children:e.excerpt.lines.map((t,n)=>{let r=e.excerpt.start+n,i=r===e.line;return(0,Y.jsxs)(`span`,{"data-slot":`unchanged-line`,"data-used":i||void 0,className:X(`block pr-3`,i&&`bg-diff-hunk-bg text-diff-hunk-fg`),children:[(0,Y.jsx)(`span`,{className:`tabular inline-block w-12 select-none pr-3 text-right text-diff-gutter-fg`,children:r}),t]},r)})})]},`${e.path}:${e.line}`)),o>0&&(0,Y.jsxs)(`li`,{className:`text-muted-foreground`,children:[`and `,o,` more`]})]})]})};function zO(e){return _y(e.defaultTagName??`div`,e,e)}var BO=Dy(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-caption font-medium whitespace-nowrap transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function VO({className:e,variant:t=`default`,render:n,...r}){return zO({defaultTagName:`span`,props:Nv({className:X(BO({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function HO({status:e,label:t=e.label,className:n}){return(0,Y.jsxs)(VO,{variant:`outline`,className:X(e.className,n),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:e.glyph}),t]})}function UO({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=J.useRef(e!==void 0),[a,o]=J.useState(()=>t);return[i&&e!==void 0?e:a,J.useCallback(e=>{i||o(e)},[])]}var WO=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function GO(){return J.useContext(WO)}function KO(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Z(i),[,o]=J.useState(0),s=Ev(JO).current,c=Ev(qO).current,l=J.useRef(0),u=J.useRef(!0),d=J.useRef(null),f=J.useRef(null),p=Z(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=Z((e,t)=>{c.set(e,t),p()}),h=Z(e=>{c.delete(e),p()}),g=Z(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!ZO(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&QO(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=XO(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=Z(()=>{let[e,t]=YO(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Q(()=>{u.current&&v()}),Q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=Z(e=>(s.add(e),()=>{s.delete(e)})),b=J.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Y.jsx)(WO.Provider,{value:b,children:t})}function qO(){return new Map}function JO(){return new Set}function YO(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>QO(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function XO(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ZO(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function QO(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var $O=J.createContext(void 0);function ek(){let e=J.useContext($O);if(e===void 0)throw Error(qv(64));return e}var tk=`data-activation-direction`,nk={tabActivationDirection:e=>({[tk]:e})},rk=J.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=J.useRef([]),[f,p]=J.useState(()=>new Map),[m,h]=UO({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=J.useState(()=>new Map),y=J.useRef(void 0),b=J.useCallback(e=>ik(_,e),[_]),[x,S]=J.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=ak(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;Q(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=Z((e,t)=>{t.activationDirection=ak(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),A=Z((e,t)=>{i?.(e,Yb(t,void 0,void 0,{activationDirection:`none`}))}),j=Z((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=J.useCallback(e=>f.get(e),[f]),N=J.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=J.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),F=J.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),I=J.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),L=J.useRef(!u),R=J.useRef(r),ee=J.useRef(u),z=J.useRef(!1);Q(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),L.current=!1}if(_.size===0){z.current&&m!==null&&!y.current?.isConnected&&e(null,fx);return}z.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===R.current&&(ee.current=!1),ee.current&&t&&m===R.current)return;let r=L.current;if(t||n){let n=I??null;if(m===n){L.current=!1;return}let i=fx;r?i=px:t&&(i=dx),e(n,i)}else r&&F!=null&&(A(m,px),L.current=!1)},[I,g,A,F,h,_,m]);let B=_y(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:nk});return(0,Y.jsx)($O.Provider,{value:P,children:(0,Y.jsx)(KO,{elementsRef:d,children:B})})});function ik(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function ak(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=ik(r,e),c=ik(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var ok=`data-composite-item-active`;function sk(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=GO(),u=J.useRef(-1),[d,f]=J.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=J.useRef(null),h=J.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function ck(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Yv(),{ref:i,index:a}=sk(e),o=n===a,s=J.useRef(null),c=ny(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var lk=J.createContext(void 0);function uk(){let e=J.useContext(lk);if(e===void 0)throw Error(qv(65));return e}var dk=J.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=ek(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=uk(),{highlightedIndex:v,onHighlightedIndexChange:y}=Yv(),b=FE(o),{compositeProps:x,compositeRef:S,index:C}=ck({metadata:J.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),w=a===u,T=J.useRef(!1),E=J.useRef(null),D=Z(e=>{E.current?.(),E.current=e?g(e):null});Q(()=>{if(T.current){T.current=!1;return}if(!(w&&C>-1&&v!==C))return;let e=_;if(e!=null){let t=ob(Zv(e));if(t&&sb(e,t))return}r||y(C)},[w,C,v,y,r,_]);let{getButtonProps:O,buttonRef:k}=$v({disabled:r,native:s,focusableWhenDisabled:!0}),A=d(a),j=J.useRef(!1),M=J.useRef(!1);function N(e){f(a,Yb(Zb,e.nativeEvent,void 0,{activationDirection:`none`}))}function P(e){w||r||N(e)}function F(e){w||r||h&&(!j.current||M.current)&&N(e)}function I(e){if(w||r)return;j.current=!0,M.current=e.button===0;let t=Zv(e.currentTarget);function n(){j.current=!1,M.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return _y(`button`,e,{state:{disabled:r,active:w,orientation:p,tabActivationDirection:m},ref:[t,k,S,D],props:[x,{role:`tab`,"aria-controls":A,"aria-selected":w,id:b,onClick:P,onFocus:F,onPointerDown:I,[ok]:w?``:void 0,onKeyDownCapture(){T.current=!0}},l,O],stateAttributesMapping:nk})}),fk=J.createContext(void 0),pk={disableStyleElements:!1};function mk(){return J.useContext(fk)??pk}var hk=`data-index`,gk={...nk,...bb},_k=J.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=ek(),p=FE(),{ref:m,index:h}=sk(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=$C(g),b=!_,x=l(r),S={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},C=J.useRef(null),w=_y(`div`,e,{state:S,ref:[t,m,C],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:cD(!g),[hk]:h},s],stateAttributesMapping:gk});return iw({open:g,ref:C,onComplete(){g||y(!1)}}),Q(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?w:null});function vk(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var yk=`ArrowUp`,bk=`ArrowDown`,xk=`ArrowLeft`,Sk=`ArrowRight`,Ck=new Set([yk,bk,xk,Sk,`Home`,`End`]),wk=`Shift`,Tk=[wk,`Control`,`Alt`,`Meta`];function Ek(e){return av(e)&&e.tagName===`INPUT`}function Dk(e){return!!(Ek(e)&&e.selectionStart!=null||av(e)&&e.tagName===`TEXTAREA`)}function Ok(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=kk(e,t,`left`),a=Ak(e),o=Ak(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=kk(e,t,`top`),r=Ak(e),i=Ak(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function kk(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Ak(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function jk(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=fy}=e,[p,m]=J.useState(0),h=r!=null,g=J.useRef(null),_=ny(g,c),v=J.useRef([]),y=J.useRef(!1),b=J.useRef(null),x=o??p,S=Z((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];Ok(g.current,t,a,n)}}),C=Z(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||uS(e,x,d)?S(Mk(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(uS(t,x,d)){let e=lS(t,{disabledIndices:d});aS(t,e)||S(e)}Ok(g.current,r,a,n)});Q(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(uS(e,x,d)){let t=lS(e,{disabledIndices:d});aS(e,t)||S(t)}},[d,o,x,v,S]);let w=Z((e,t,n)=>i?i(e,t,n,v):n),T=Z(e=>{let o=e.key===`Home`||e.key===`End`;if(!Ck.has(e.key)||!l&&o||Nk(e,f)||!g.current)return;let s=a===`rtl`,c=s?xk:Sk,p=s?Sk:xk,m=n===`vertical`?bk:c,_=n===`vertical`?yk:p,y=lb(e.nativeEvent);if(y!=null&&Dk(y)&&!vk(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=oS(v,d),T=sS(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=lS(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!aS(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=lb(e.nativeEvent);t&&n!=null&&Dk(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:T},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:T}}function Mk(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!uS(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function Nk(e,t){for(let n of Tk)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Pk(e){let{render:t,className:n,style:r,refs:i=fy,props:a=fy,state:o=py,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=jk({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:VE(),disabledIndices:v,modifierKeys:y}),k=_y(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=J.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,Y.jsx)(Jv.Provider,{value:A,children:(0,Y.jsx)(KO,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var Fk=J.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=ek(),[d,f]=J.useState(0),[p,m]=J.useState(null),h=J.useRef(new Set),g=J.useRef(new Set),_=J.useRef(null);Q(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=Z(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=Z(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=J.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,Y.jsx)(lk.Provider,{value:S,children:(0,Y.jsx)(Pk,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:nk,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:fy})})});function Ik({className:e,orientation:t=`horizontal`,...n}){return(0,Y.jsx)(rk,{"data-slot":`tabs`,"data-orientation":t,className:X(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Lk=Dy(`group/tabs-list inline-flex w-fit items-center justify-center rounded-md p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=underline]:rounded-none`,{variants:{variant:{default:`bg-muted`,underline:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Rk({className:e,variant:t=`default`,...n}){return(0,Y.jsx)(Fk,{"data-slot":`tabs-list`,"data-variant":t,className:X(Lk({variant:t}),e),...n})}function zk({className:e,...t}){return(0,Y.jsx)(dk,{"data-slot":`tabs-trigger`,className:X(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-ui font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=underline]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=underline]/tabs-list:bg-transparent group-data-[variant=underline]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:ring-1 group-data-[variant=default]/tabs-list:data-active:ring-muted-foreground`,`after:absolute after:bg-primary after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=underline]/tabs-list:data-active:after:opacity-100`,e),...t})}function Bk({className:e,...t}){return(0,Y.jsx)(_k,{"data-slot":`tabs-content`,className:X(`flex-1 text-ui -outline-offset-2`,e),...t})}function Vk({className:e,onSubmitShortcut:t,onKeyDown:n,...r}){return(0,Y.jsx)(`textarea`,{"data-slot":`textarea`,onKeyDown:e=>{n?.(e),t!==void 0&&!e.defaultPrevented&&e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t())},className:X(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-ui transition-colors placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,e),...r})}var Hk=[{id:`nextFile`,chords:[{key:`n`}],action:`Next file`,scope:`diff`},{id:`previousFile`,chords:[{key:`p`}],action:`Previous file`,scope:`diff`},{id:`lineDown`,chords:[{key:`ArrowDown`}],action:`Focus the next line`,scope:`diff`},{id:`lineUp`,chords:[{key:`ArrowUp`}],action:`Focus the previous line`,scope:`diff`},{id:`extendDown`,chords:[{key:`ArrowDown`,shift:!0}],action:`Extend the selection down`,scope:`diff`},{id:`extendUp`,chords:[{key:`ArrowUp`,shift:!0}],action:`Extend the selection up`,scope:`diff`},{id:`comment`,chords:[{key:`c`}],action:`Comment on the selected decision, or on the focused change`,scope:`diff`},{id:`openCall`,chords:[{key:`o`}],action:`Show the code a call on the focused line runs; again for the next call`,scope:`diff`},{id:`toggleSplit`,chords:[{key:`u`}],action:`Unified or split diff`,scope:`diff`},{id:`toggleLayout`,chords:[{key:`v`}],action:`Map or overview`,scope:`global`},{id:`moveFile`,chords:[{key:`ArrowLeft`},{key:`ArrowRight`},{key:`ArrowUp`},{key:`ArrowDown`}],action:`Move between files`,scope:`overview`},{id:`openFile`,chords:[{key:`Enter`}],action:`Open the file's code in the map, or a group of files in place`,scope:`overview`},{id:`filterTree`,chords:[{key:`/`}],action:`Filter the files`,scope:`tree`},{id:`openReview`,chords:[{key:`R`,shift:!0}],action:`Open the review to publish`,scope:`global`},{id:`submit`,chords:[{key:`Enter`,mod:!0}],action:`Send the comment or review`,scope:`composer`},{id:`close`,chords:[{key:`Escape`}],action:`Close, clear the highlight, or go back to the overview`,scope:`global`},{id:`help`,chords:[{key:`?`,shift:!0}],action:`Show all shortcuts`,scope:`global`},{id:`focusLink`,chords:[{key:`/`}],action:`Paste a pull request link`,scope:`picker`},{id:`moveRow`,chords:[{key:`ArrowUp`},{key:`ArrowDown`},{key:`ArrowLeft`},{key:`ArrowRight`},{key:`Home`},{key:`End`}],action:`Move between a list's pull requests, or the activity calendar's days`,scope:`picker`},{id:`openRow`,chords:[{key:`Enter`}],action:`Open the pull request`,scope:`picker`},{id:`openInNewTab`,chords:[{key:`Enter`,mod:!0}],action:`Open the pull request or the link in a new tab`,scope:`picker`},{id:`cancelOpening`,chords:[{key:`Escape`}],action:`Stop waiting for a review to open`,scope:`picker`}],Uk=new Map(Hk.map(e=>[e.id,e])),Wk=e=>{let t=Uk.get(e);if(t===void 0)throw Error(`No shortcut ${e}`);return t},Gk=new Set([`Escape`]),Kk=e=>e.mod!==!0&&!Gk.has(e.key),qk=e=>e.mod!==!0&&e.key.length===1,Jk={ArrowDown:`↓`,ArrowUp:`↑`,ArrowLeft:`←`,ArrowRight:`→`,Enter:`↵`,Escape:`Esc`,Home:`Home`,End:`End`},Yk=(e,t)=>{let n=[];return e.mod===!0&&n.push(t?`⌘`:`Ctrl`),e.shift===!0&&e.key!==`?`&&n.push(`⇧`),n.push(Jk[e.key]??e.key),n},Xk=(e,t,n)=>{let r=n?e.metaKey:e.ctrlKey,i=n?e.ctrlKey:e.metaKey;return e.altKey||i||r!==(t.mod===!0)||t.key.length>1&&e.shiftKey!==(t.shift===!0)?!1:e.key===t.key},Zk=e=>e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?!0:e instanceof HTMLInputElement&&![`checkbox`,`radio`,`button`,`submit`,`reset`,`range`,`color`,`file`].includes(e.type):!1,Qk=(e,t,n)=>{let r=Zk(e.target);for(let i of t)for(let t of Wk(i).chords)if(Xk(e,t,n.mac)&&!(Kk(t)&&r)&&(!qk(t)||n.singleKeys))return i;return null},$k=()=>typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform),eA=`megareviewer:singleKeyShortcuts`,tA=new Set,nA=()=>{try{return window.localStorage.getItem(eA)!==`false`}catch{return!0}},rA=e=>(tA.add(e),window.addEventListener(`storage`,e),()=>{tA.delete(e),window.removeEventListener(`storage`,e)}),iA=()=>[(0,J.useSyncExternalStore)(rA,nA),(0,J.useCallback)(e=>{try{window.localStorage.setItem(eA,String(e))}catch{}for(let e of tA)e()},[])],aA=(e,t=!0)=>{let[n]=iA(),r=(0,J.useRef)(e);r.current=e,(0,J.useEffect)(()=>{if(!t)return;let e=$k(),i=t=>{if(t.defaultPrevented)return;let i=Qk(t,Hk.filter(e=>r.current[e.id]!==void 0).map(e=>e.id),{mac:e,singleKeys:n});i!==null&&(t.preventDefault(),r.current[i]?.(t))};return window.addEventListener(`keydown`,i),()=>window.removeEventListener(`keydown`,i)},[t,n])};function oA({className:e,...t}){return(0,Y.jsx)(`kbd`,{"data-slot":`kbd`,className:X(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm border-b-2 border-border bg-muted px-1 font-mono text-kbd font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background [&_svg:not([class*='size-'])]:size-3`,e),...t})}function sA({className:e,...t}){return(0,Y.jsx)(`kbd`,{"data-slot":`kbd-group`,className:X(`inline-flex items-center gap-1`,e),...t})}var cA=({id:e,className:t})=>{let[n]=iA(),r=(0,J.useMemo)($k,[]),[i]=Wk(e).chords;return i===void 0||!n&&qk(i)?null:(0,Y.jsx)(sA,{"aria-hidden":`true`,className:X(`shrink-0`,t),children:Yk(i,r).map(e=>(0,Y.jsx)(oA,{children:e},e))})},lA=({hints:e,className:t})=>(0,Y.jsx)(`p`,{"aria-hidden":`true`,"data-slot":`key-hint-line`,className:X(`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-caption text-muted-foreground`,t),children:e.map(({id:e,action:t},n)=>(0,Y.jsxs)(J.Fragment,{children:[n>0&&(0,Y.jsx)(`span`,{children:`·`}),(0,Y.jsx)(cA,{id:e}),(0,Y.jsx)(`span`,{children:t})]},e))}),uA={draft:`bg-review-pending`,open:`bg-thread-marker`,resolved:`bg-review-approved`,outdated:`bg-muted-foreground`},dA=({as:e=`div`,state:t,className:n,children:r,...i})=>(0,Y.jsxs)(e,{"data-slot":`comment-card`,"data-state":t,className:X(`relative rounded-lg border bg-thread-bg py-2.5 pr-4 pl-5 font-sans`,`[&_:is(textarea,input):focus-visible]:-outline-offset-1`,n),...i,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`comment-bar`,className:X(`absolute top-2 bottom-2 left-1.5 w-[3px] rounded-full`,uA[t])}),r]}),fA=e=>{let t=e.trim().split(/[\s._-]+/).filter(Boolean),n=(t.length===1?[...t[0]??``].slice(0,2):t.slice(0,2).map(e=>[...e][0]??``)).join(``).toUpperCase();return n===``?`?`:n},pA=[`bg-avatar-1-bg text-avatar-1-fg`,`bg-avatar-2-bg text-avatar-2-fg`,`bg-avatar-3-bg text-avatar-3-fg`,`bg-avatar-4-bg text-avatar-4-fg`,`bg-avatar-5-bg text-avatar-5-fg`,`bg-avatar-6-bg text-avatar-6-fg`,`bg-avatar-7-bg text-avatar-7-fg`,`bg-avatar-8-bg text-avatar-8-fg`],mA=e=>{let t=0;for(let n of e)t=t*31+(n.codePointAt(0)??0)>>>0;return pA[t%pA.length]??pA[0]},hA=6e4,gA=60*hA,_A=24*gA,vA=(e,t)=>{let n=Math.max(0,t-Date.parse(e));if(n<hA)return`just now`;if(n<gA)return`${Math.floor(n/hA)}m ago`;if(n<_A)return`${Math.floor(n/gA)}h ago`;let r=Math.floor(n/_A);return r<30?r===1?`yesterday`:`${r} days ago`:new Date(e).toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})},yA=e=>new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}),bA=(e,t,n)=>`${e===`old`?`L`:`R`}${t===null||t===n?n:`${t}–${n}`}`,xA=({children:e})=>(0,Y.jsx)(`code`,{className:`rounded-sm bg-diff-hunk-bg px-1 font-mono text-code-compact text-diff-hunk-fg`,children:e}),SA=`modulepreload`,CA=function(e){return`/`+e},wA={},TA=function(e){return e.pathname.endsWith(`.css`)},EA=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},DA=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,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?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=CA(t,n);let r=s(t),i=TA(r);return EA(wA,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:SA,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}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)})},OA={name:`java-constants`,scopeName:`source.java.constants`,injectTo:[`source.java`],injectionSelector:`L:source.java -comment -string -meta.import -meta.package`,repository:{},patterns:[{match:`(?<![\\w$])[A-Z][A-Z0-9_]*[A-Z0-9](?![\\w$])`,name:`variable.other.constant.java`},{match:`(\\.)\\s*([A-Z][A-Z0-9_]*[A-Z0-9])(?![\\w$]|\\s*\\()`,captures:{1:{name:`punctuation.separator.period.java`},2:{name:`variable.other.constant.java`}}}]},kA={c:()=>DA(()=>import(`./c-Cz4nF6n_.js`),__vite__mapDeps([0,1])),cpp:()=>DA(()=>import(`./cpp-DzjeI0uH.js`),__vite__mapDeps([2,3,1])),csharp:()=>DA(()=>import(`./csharp-dmMxLVLW.js`),[]),css:()=>DA(()=>import(`./css-DgaLhXQH.js`),__vite__mapDeps([4,5])),diff:()=>DA(()=>import(`./diff-woXpYk--.js`),[]),docker:()=>DA(()=>import(`./docker-IyjqRm3v.js`),[]),go:()=>DA(()=>import(`./go-rLFTqkRN.js`),[]),graphql:()=>DA(()=>import(`./graphql-BHtseKAV.js`),__vite__mapDeps([6,7,8,9,10,11])),html:()=>DA(()=>import(`./html-BWDvXlHg.js`),__vite__mapDeps([12,13,5,8])),ini:()=>DA(()=>import(`./ini-B5eOa1yu.js`),[]),java:async()=>({default:[...(await DA(async()=>{let{default:e}=await import(`./java-_ATy9zCa.js`);return{default:e}},__vite__mapDeps([14,15]))).default,OA]}),javascript:()=>DA(()=>import(`./javascript-CpIGwZ_Y.js`),__vite__mapDeps([16,8])),json:()=>DA(()=>import(`./json-C3WlssX3.js`),__vite__mapDeps([17,18])),jsonc:()=>DA(()=>import(`./jsonc-CYpm1nAK.js`),[]),jsx:()=>DA(()=>import(`./jsx-C4yDKi0A.js`),__vite__mapDeps([19,10])),kotlin:()=>DA(()=>import(`./kotlin-DhhofPvG.js`),[]),make:()=>DA(()=>import(`./make-Dixweg8N.js`),[]),markdown:()=>DA(()=>import(`./markdown-BYOwaDjH.js`),[]),php:()=>DA(()=>import(`./php-CUj1wjLQ.js`),__vite__mapDeps([20,5,8,13,18,21,15,22])),python:()=>DA(()=>import(`./python-gzcpVVnB.js`),[]),ruby:()=>DA(()=>import(`./ruby-DAHFNlv9.js`),__vite__mapDeps([23,1,3,5,8,7,9,10,11,13,21,15,22,24,25])),rust:()=>DA(()=>import(`./rust-DpiIf5JO.js`),[]),scss:()=>DA(()=>import(`./scss-8bKmll0B.js`),__vite__mapDeps([26,5])),shellscript:()=>DA(()=>import(`./shellscript-CVTB3cr6.js`),__vite__mapDeps([27,24])),sql:()=>DA(()=>import(`./sql-CfM2IJm3.js`),__vite__mapDeps([28,22])),svelte:()=>DA(()=>import(`./svelte-DAcAPYhA.js`),__vite__mapDeps([29,5,8,9])),swift:()=>DA(()=>import(`./swift-CyEgAFGc.js`),[]),toml:()=>DA(()=>import(`./toml-CcmNWLt0.js`),[]),tsx:()=>DA(()=>import(`./tsx-CGosfAUg.js`),__vite__mapDeps([30,11])),typescript:()=>DA(()=>import(`./typescript-Bb1J8qyy.js`),__vite__mapDeps([31,9])),vue:()=>DA(()=>import(`./vue-DfeOw4hL.js`),__vite__mapDeps([32,5,8,9,13,18])),xml:()=>DA(()=>import(`./xml-DuKfbPI6.js`),__vite__mapDeps([33,21,15])),yaml:()=>DA(()=>import(`./yaml-DDA_XMNu.js`),__vite__mapDeps([34,25]))},AA={c_sharp:`csharp`},jA={bash:`shellscript`,c:`c`,cc:`cpp`,cjs:`javascript`,cpp:`cpp`,cs:`csharp`,css:`css`,cts:`typescript`,cxx:`cpp`,diff:`diff`,go:`go`,gql:`graphql`,graphql:`graphql`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,ini:`ini`,java:`java`,js:`javascript`,json:`json`,jsonc:`jsonc`,jsx:`jsx`,kt:`kotlin`,kts:`kotlin`,md:`markdown`,mjs:`javascript`,mts:`typescript`,patch:`diff`,php:`php`,py:`python`,pyi:`python`,rb:`ruby`,rs:`rust`,scss:`scss`,sh:`shellscript`,sql:`sql`,svelte:`svelte`,swift:`swift`,toml:`toml`,ts:`typescript`,tsx:`tsx`,vue:`vue`,xml:`xml`,yaml:`yaml`,yml:`yaml`,zsh:`shellscript`},MA={Dockerfile:`docker`,GNUmakefile:`make`,Makefile:`make`},NA=e=>{let t=e.language===null?null:AA[e.language]??e.language;if(t!==null&&t in kA)return t;let n=e.path.slice(e.path.lastIndexOf(`/`)+1),r=n.lastIndexOf(`.`),i=r>0?n.slice(r+1).toLowerCase():``;return MA[n]??jA[i]??null},PA=e=>({old:FA(e,`add`),new:FA(e,`del`)}),FA=(e,t)=>e.filter(({line:e})=>e.kind!==t).map(({text:e})=>e).join(`
|
|
77
|
+
`),IA=e=>`class _ {
|
|
78
|
+
`.repeat(e),LA=e=>`class _ {\nvoid _() {\n${`{
|
|
79
|
+
`.repeat(e-2)}`,RA=/^(?:@\w|(?:public|protected|private|abstract|static|native|transient|volatile)\b)/,zA=/^(?:[}\])]|default\s*(?:->|:)|(?:if|else|for|while|do|switch|case|return|throw|try|catch|finally|yield|break|continue|var|this|super|assert|new)\b|[\w$.]+(?:\[[^\]]*\])?\s*(?:[-+*/%&|^]?=(?!=)|\+\+|--|\())/,BA=/^\*/,VA=(e,t)=>{if(t!==`java`)return``;let n=e.split(`
|
|
80
|
+
`).filter(e=>e.trim()!==``),r=n[0];if(r===void 0)return``;let i=BA.test(r.trim()),a=n.find(e=>!/^(?:\*|\/\*|\/\/)/.test(e.trim())),o=i?`/*
|
|
81
|
+
`:``;if(a===void 0)return o;let s=HA(a,n),c=a.trim();return(s===0?``:RA.test(c)||s===1&&!zA.test(c)?IA(s):LA(Math.max(s,2)))+o},HA=(e,t)=>{let n=/^[ \t]*/.exec(e)?.[0]??``,r=n.split(` `).length-1;if(r>0)return r+Math.floor((n.length-r)/4);let i=t.some(e=>(/^ */.exec(e)?.[0].length??0)%4==2&&!BA.test(e.trim()));return Math.floor(n.length/(i?2:4))},UA=e=>{let t=e.map(e=>e.text.endsWith(`\r`)),n=t.includes(!0)&&t.includes(!1);return e.map((e,r)=>({line:e,text:t[r]?e.text.slice(0,-1):e.text,carriageReturn:n&&t[r]===!0}))},WA=e=>({added:e.lines.filter(e=>e.kind===`add`).length,deleted:e.lines.filter(e=>e.kind===`del`).length}),GA=(e,t)=>t<=1?`${e}`:`${e}–${e+t-1}`,KA=e=>e.newLines>0?`lines ${GA(e.newStart,e.newLines)}`:`deleted lines ${GA(e.oldStart,e.oldLines)}`,qA={"token-keyword":`keyword`,"token-string":`string`,"token-string-expression":`string`,"token-function":`function`,"token-comment":`comment`,"token-constant":`number`,"token-decorator":`decorator`,"token-attribute":`attribute`},JA=e=>{let t=/^var\(--shiki-([\w-]+)/.exec(e??``)?.[1];return t===void 0?null:qA[t]??null},YA=e=>{let t=[];for(let{content:n,color:r}of e){let e=JA(r),i=t.at(-1);i!==void 0&&i.type===e?t[t.length-1]={text:i.text+n,type:e}:t.push({text:n,type:e})}return t},XA=(e,t,n)=>{let r=0,i=0;return UA(e.lines).map(({line:e,text:a})=>{let o=e.kind===`del`?t?.[r]:n?.[i];return e.kind!==`add`&&r++,e.kind!==`del`&&i++,o!==void 0&&o.map(e=>e.text).join(``)===a?o:null})},ZA=e=>`var(--shiki-${e})`,QA=[{scope:[`entity.name.function.decorator`,`punctuation.definition.decorator`,`meta.function.decorator support.type`,`punctuation.decorator`,`meta.decorator entity.name.function`,`meta.decorator variable.other.readwrite`,`storage.type.annotation`,`punctuation.definition.annotation`,`entity.name.type.annotation`],color:ZA(`token-decorator`)},{scope:[`entity.other.attribute-name`,`variable.parameter.function-call`],color:ZA(`token-attribute`)},{scope:[`variable.other.object`,`variable.other.class`,`variable.other.constant`,`support.class`,`support.type`,`support.variable`],color:ZA(`foreground`)},{scope:[`support.type.primitive`],color:ZA(`token-keyword`)}],$A=[{scope:[`variable.language.java`,`variable.other.constant.java`],color:ZA(`token-constant`)},{scope:[`storage.type.primitive.java`,`storage.type.primitive.array.java`,`keyword.operator.instanceof.java`],color:ZA(`token-keyword`)},{scope:[`storage.type.java`,`storage.type.generic.java`,`storage.type.object.array.java`,`storage.type.generic.wildcard.java`,`entity.other.inherited-class.java`,`meta.function-call.java`,`storage.modifier.package.java`,`storage.modifier.import.java`,`variable.other.object.java`,`variable.other.object.property.java`,`source.java keyword.operator`,`keyword.control.ternary.java`],color:ZA(`foreground`)}],ej=1e3,tj=(0,J.createContext)((()=>{let e=null,t=new Map,n=new Map,r=(e,t,r)=>{let i=`${r}\0${t}`,a=n.get(i)??e.getLastGrammarState(t,{lang:r,theme:`hunk`});return n.set(i,a),a},i=async()=>{let[{createHighlighterCore:e,createCssVariablesTheme:t},{createJavaScriptRegexEngine:n}]=await Promise.all([DA(()=>import(`./core-bY0eVDTo.js`),[]),DA(()=>import(`./engine-javascript-D-6se_EF.js`),[])]),r=t({name:`hunk`,variablePrefix:`--shiki-`});return e({themes:[{...r,tokenColors:[...r.tokenColors??[],...[...QA,...$A].map(({scope:e,color:t})=>({scope:[...e],settings:{foreground:t}}))]}],langs:[],engine:n()})},a=(e,n)=>{let r=t.get(n)??(async()=>{let t=kA[n];return t!==void 0&&(await e.loadLanguage(...(await t()).default),!0)})();return t.set(n,r),r};return{async highlight(t,n){if(kA[n]===void 0)return null;e??=i();let o=await e;if(!await a(o,n))return null;let s=VA(t,n);return o.codeToTokensBase(t,{lang:n,theme:`hunk`,tokenizeMaxLineLength:ej,...s===``?{}:{grammarState:r(o,s,n)}}).map(e=>YA(e))}}})()),nj=new WeakMap,rj=(e,t,n)=>{let r=nj.get(e)??new Map;nj.set(e,r);let i=`${n}\0${t.id}\0${t.oldStart},${t.newStart},${t.lines.length}`,a=r.get(i);if(a!==void 0)return a;let o=UA(t.lines),s=PA(o),c=(t,r)=>r?e.highlight(t,n):Promise.resolve(null),l={promise:Promise.all([c(s.old,o.some(({line:e})=>e.kind!==`add`)),c(s.new,o.some(({line:e})=>e.kind!==`del`))]).then(([e,n])=>{let r=XA(t,e,n);return l.value=r,r}),value:null};return r.set(i,l),l},ij=`1200px 0px`,aj=null,oj=new Map,sj=(e,t)=>(aj??=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(oj.get(t.target)?.(),oj.delete(t.target),aj?.unobserve(t.target))},{rootMargin:ij}),oj.set(e,t),aj.observe(e),()=>{oj.delete(e),aj?.unobserve(e)}),cj=e=>{let[t,n]=(0,J.useState)(()=>typeof IntersectionObserver>`u`);return(0,J.useEffect)(()=>{let r=e.current;if(!(t||r===null))return sj(r,()=>n(!0))},[e,t]),t},lj=(e,t,n=!0)=>{let r=(0,J.useContext)(tj),i=NA(t),a=i===null||!n?null:rj(r,e,i),[o,s]=(0,J.useState)();return(0,J.useEffect)(()=>{if(a===null)return;let e=!0;return a.promise.then(t=>{e&&s(e=>e?.entry===a?e:{entry:a,tokens:t})}),()=>{e=!1}},[a]),a?.value??(o?.entry===a?o.tokens:null)},uj=(e,t)=>{let n=(0,J.useContext)(tj),r=NA(t),[i,a]=(0,J.useState)(null);return(0,J.useEffect)(()=>{if(r===null||e===null)return;let t=!0;return n.highlight(e.join(`
|
|
82
|
+
`),r).then(n=>{t&&n!==null&&a({lines:e,tokens:e.map((e,t)=>{let r=n[t];return r!==void 0&&r.map(e=>e.text).join(``)===e?r:null})})}),()=>{t=!1}},[n,r,e]),i?.lines===e?i.tokens:null},dj={keyword:`text-syntax-keyword`,string:`text-syntax-string`,function:`text-syntax-function`,comment:`text-syntax-comment`,number:`text-syntax-number`,decorator:`text-syntax-decorator`,attribute:`text-syntax-attribute`},fj=(e,t)=>{let n=(0,J.useContext)(tj),[r,i]=(0,J.useState)(null),a=`${t??``}\0${e}`;return(0,J.useEffect)(()=>{if(t===null)return;let r=!0;return n.highlight(e,t).then(e=>{r&&i({key:a,lines:e})}),()=>{r=!1}},[n,e,t,a]),r?.key===a?r.lines:null},pj=({text:e,tokens:t})=>t!=null&&t.map(e=>e.text).join(``)===e?t.map((e,t)=>(0,Y.jsx)(`span`,{className:X(e.type!==null&&dj[e.type]),children:e.text},t)):e,mj=({kind:e,text:t,tokens:n})=>(0,Y.jsxs)(`div`,{"data-kind":e,className:X(`flex min-h-5 whitespace-pre`,e===`add`?`bg-diff-add-bg`:`bg-diff-del-bg`),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`w-5 shrink-0 select-none text-center`,e===`add`?`bg-diff-add-gutter text-diff-add-fg`:`bg-diff-del-gutter text-diff-del-fg`),children:e===`add`?`+`:`−`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:e===`add`?`added line `:`removed line `}),(0,Y.jsx)(`span`,{className:`px-2`,children:(0,Y.jsx)(pj,{text:t,tokens:n})})]}),hj=({removed:e,added:t,language:n,title:r})=>{let i=fj((e??[]).join(`
|
|
83
|
+
`),e===null?null:n),a=fj(t.join(`
|
|
84
|
+
`),n);return(0,Y.jsxs)(`div`,{"data-slot":`suggestion-diff`,className:`overflow-x-auto rounded-md border font-code text-code-compact`,children:[r!==void 0&&(0,Y.jsx)(`p`,{className:`border-b px-2 py-1 font-sans text-caption font-medium text-primary`,children:r}),(e??[]).map((e,t)=>(0,Y.jsx)(mj,{kind:`del`,text:e,tokens:i?.[t]},`del:${t}`)),t.map((e,t)=>(0,Y.jsx)(mj,{kind:`add`,text:e,tokens:a?.[t]},`add:${t}`)),t.length===0&&(0,Y.jsxs)(`p`,{className:`px-2 py-1 font-sans text-caption text-muted-foreground`,children:[`Deletes`,` `,e===null?`the lines`:e.length===1?`the line`:`the ${e.length} lines`,`.`]})]})},gj=J.createContext(void 0);function _j(e){let t=J.useContext(gj);if(!e&&t===void 0)throw Error(qv(27));return t}var vj=J.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=_j(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return _y(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Pb,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),yj=J.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=_j(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=$v({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Yb(rx,e.nativeEvent))}return _y(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),bj=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=_j(),c=FE(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),_y(`p`,e,{ref:t,props:[{id:c},o]})}),xj=J.createContext(void 0);function Sj(){let e=J.useContext(xj);if(e===void 0)throw Error(qv(26));return e}var Cj=`--nested-dialogs`,wj=`data-nested-dialog-open`,Tj={...Nb,...bb,nestedDialogOpen(e){return e?{[wj]:``}:null}},Ej=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=_j(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Sj(),iw({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?sw(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=_y(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...ow,hidden:!m,onKeyDown(e){Ck.has(e.key)&&e.stopPropagation()},style:{[Cj]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:Tj});return(0,Y.jsx)(MC,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),Dj=J.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Oj=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=_j(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Y.jsx)(xj.Provider,{value:n,children:(0,Y.jsxs)(pC,{ref:t,...r,children:[a&&o===!0&&(0,Y.jsx)(Dj,{ref:i.context.internalBackdropRef,inert:cD(!s)}),e.children]})}):null}),kj={},Aj={},jj=``;function Mj(e,t){return sv(e)?e:t}function Nj(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Mj(t,n)).overflowY)}function Pj(e){if(typeof document>`u`)return!1;let t=Zv(e);return tv(t).innerWidth-t.documentElement.clientWidth>0}function Fj(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Zv(e),n=t.documentElement,r=t.body,i=Mj(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Ij(e){let t=Zv(e),n=t.documentElement,r=t.body,i=Mj(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Lj(e){let t=Zv(e),n=t.documentElement,r=t.body,i=tv(n),a=0,o=0,s=!1,c=Ex.create();if(Zy&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,kj={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},jj=n.style.scrollBehavior,Aj={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Mj(n,r);s=Fj(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,kj),Object.assign(r.style,Aj),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=jj)}function d(){u(),c.request(l)}l();let f=bx(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Rj=new class{lockCount=0;restore=null;timeoutLock=Ry.create();timeoutUnlock=Ry.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Zv(e),n=t.documentElement,r=t.body,i=tv(n);if(Nj(i,n,r)){let t=new i.MutationObserver(()=>{Nj(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Ky||!Pj(e);this.restore=a?Ij(e):Lj(e)}};function zj(e=!0,t=null){Q(()=>{if(e)return Rj.acquire(t)},[e,t])}function Bj({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=J.useState(0),[d,f]=J.useState(0),p=l===0,m=zC(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=lb(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||sb(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return zj(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),Q(()=>{!r&&!i&&(u(0),f(0))},[r,i]),Q(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),vw(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Vj={...Hw,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Hj=class extends Nw{constructor(e,t,n){let r=new bw,i=Uj(e,r,t,n);super(i,Wj(r),Vj)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(fw(this.state,e,t.trigger)))}};function Uj(e,t,n,r=!1){return{...Iw(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Wj(e){return{popupRef:J.createRef(),backdropRef:J.createRef(),internalBackdropRef:J.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Gj(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=_j(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=cw((e,t)=>new Hj({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);yw(b,x),gw(b);let{forceUnmount:w}=_w(x,b);J.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,Yb(mx))}),[w,b]);let T=x||S||u!=null;return(0,Y.jsxs)(gj.Provider,{value:b,children:[u&&(0,Y.jsx)(lw,{handle:u,store:b}),T&&(0,Y.jsx)(Bj,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var Kj=Ny(function(e){return Gj(`dialog`,e)}),qj=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=_j(),c=FE(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),_y(`h2`,e,{ref:t,props:[{id:c},o]})});function Jj(e){let t=J.useRef(``),n=J.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:J.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Yj(e,t){let n=J.useRef(e),r=Z(t);Q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Xj(e,t){let{onClick:n,onPointerDown:r}=Jj(Z((n,r)=>{(typeof e==`function`?e():e)||t(r||(Ky?`touch`:``))}));return J.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Zj(e){let[t,n]=J.useState(null),r=Xj(e,n);return Yj(e,t=>{t&&!e&&n(null)}),J.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Qj({...e}){return(0,Y.jsx)(Kj,{"data-slot":`dialog`,...e})}function $j({...e}){return(0,Y.jsx)(Oj,{"data-slot":`dialog-portal`,...e})}function eM({className:e,...t}){return(0,Y.jsx)(vj,{"data-slot":`dialog-overlay`,className:X(`fixed inset-0 isolate z-50 bg-background/70 duration-(--duration-fast) supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function tM({className:e,children:t,showCloseButton:n=!0,...r}){return(0,Y.jsxs)($j,{children:[(0,Y.jsx)(eM,{}),(0,Y.jsxs)(Ej,{"data-slot":`dialog-content`,className:X(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-ui text-popover-foreground ring-1 ring-foreground/10 duration-(--duration-fast) outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,Y.jsxs)(yj,{"data-slot":`dialog-close`,render:(0,Y.jsx)($,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Y.jsx)(I_,{}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function nM({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`dialog-header`,className:X(`flex flex-col gap-2`,e),...t})}function rM({className:e,...t}){return(0,Y.jsx)(qj,{"data-slot":`dialog-title`,className:X(`text-heading font-semibold`,e),...t})}function iM({className:e,...t}){return(0,Y.jsx)(bj,{"data-slot":`dialog-description`,className:X(`text-ui text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}var aM=({src:e,alt:t,onClose:n})=>(0,Y.jsx)(Qj,{open:!0,onOpenChange:e=>{e||n()},children:(0,Y.jsxs)(tM,{"data-slot":`image-viewer`,className:`top-0 left-0 flex h-dvh w-screen max-w-none translate-x-0 translate-y-0 items-center justify-center rounded-none bg-background/95 p-4 pt-12 ring-0 sm:max-w-none`,onClick:e=>{e.target===e.currentTarget&&n()},children:[(0,Y.jsx)(rM,{className:`sr-only`,children:t}),(0,Y.jsx)(`img`,{src:e,alt:t,className:`max-h-full max-w-full object-contain`})]})}),oM=e=>e===null?null:NA({path:`code.${e}`,language:e}),sM=({text:e,language:t})=>{let n=fj(e,oM(t)),r=e.split(`
|
|
85
|
+
`);return(0,Y.jsx)(`pre`,{"data-slot":`thread-code`,className:`overflow-x-auto rounded-md border bg-surface-subtle px-2.5 py-1.5 font-code text-code-compact`,children:(0,Y.jsx)(`code`,{children:r.map((e,t)=>(0,Y.jsx)(`span`,{className:`block min-h-[1lh] whitespace-pre`,children:(0,Y.jsx)(pj,{text:e,tokens:n?.[t]})},t))})})},cM=({kind:e,alt:t,src:n,size:r})=>{let[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1);if(i)return(0,Y.jsxs)(`span`,{"data-slot":`thread-image`,className:`inline-flex items-center gap-1 rounded-sm border bg-muted px-1 text-caption text-muted-foreground`,children:[(0,Y.jsx)(Bg,{"aria-hidden":`true`,className:`size-3`}),e===`image`?`Image`:`Video`,t===``?``:`: ${t}`,` couldn't be loaded`]});let c=`block max-h-[28rem] max-w-full rounded-md border bg-muted`,l=t===``?`Image from the comment`:t;return e===`image`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Open ${l} full screen`,onClick:()=>s(!0),className:`block max-w-full cursor-zoom-in rounded-md`,children:(0,Y.jsx)(`img`,{"data-slot":`thread-media`,src:n,alt:l,...r===void 0?{}:{width:r.width,height:r.height},loading:`lazy`,onError:()=>a(!0),className:X(c,`h-auto w-auto`)})}),o&&(0,Y.jsx)(aM,{src:n,alt:l,onClose:()=>s(!1)})]}):(0,Y.jsx)(`video`,{"data-slot":`thread-media`,src:n,controls:!0,preload:`metadata`,onError:()=>a(!0),className:c})},lM=({span:e,mediaUrl:t})=>{switch(e.kind){case`text`:return(0,Y.jsx)(Y.Fragment,{children:e.text});case`code`:return(0,Y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 font-code text-code-compact`,children:e.text});case`strong`:return(0,Y.jsx)(`strong`,{className:`font-semibold`,children:(0,Y.jsx)(uM,{spans:e.spans,mediaUrl:t})});case`emphasis`:return(0,Y.jsx)(`em`,{children:(0,Y.jsx)(uM,{spans:e.spans,mediaUrl:t})});case`strike`:return(0,Y.jsx)(`del`,{children:(0,Y.jsx)(uM,{spans:e.spans,mediaUrl:t})});case`link`:return e.url===null?(0,Y.jsx)(uM,{spans:e.spans,mediaUrl:t}):(0,Y.jsx)(`a`,{href:e.url,title:e.url,target:`_blank`,rel:`noreferrer noopener nofollow`,className:`underline`,children:(0,Y.jsx)(uM,{spans:e.spans,mediaUrl:t})});case`image`:case`video`:{if(e.url!==null&&t)return(0,Y.jsx)(cM,{kind:e.kind,alt:e.text,src:t(e.url),size:e.size});let n=e.kind===`image`?`Image`:`Video`;return(0,Y.jsxs)(`span`,{"data-slot":`thread-image`,className:`inline-flex items-center gap-1 rounded-sm border bg-muted px-1 text-caption text-muted-foreground`,children:[(0,Y.jsx)(Bg,{"aria-hidden":`true`,className:`size-3`}),e.text===``?n:`${n}: ${e.text}`,(0,Y.jsx)(`span`,{className:`sr-only`,children:`, not loaded: it isn't in the host's own attachments`})]})}}},uM=({spans:e,mediaUrl:t})=>e.map((e,n)=>(0,Y.jsx)(lM,{span:e,mediaUrl:t},`${e.kind}:${n}`)),dM={1:`text-heading font-semibold`,2:`text-heading font-semibold`,3:`text-body font-semibold`},fM={left:`text-left`,center:`text-center`,right:`text-right`},pM=({blocks:e,...t})=>e.map((e,n)=>(0,Y.jsx)(mM,{block:e,...t},`${e.kind}:${n}`)),mM=({block:e,suggestion:t,mediaUrl:n})=>{switch(e.kind){case`suggestion`:return(0,Y.jsx)(`div`,{children:t(e.lines)});case`code`:return(0,Y.jsx)(sM,{text:e.text,language:e.language});case`paragraph`:return(0,Y.jsx)(`p`,{className:`whitespace-pre-wrap`,children:(0,Y.jsx)(uM,{spans:e.spans,mediaUrl:n})});case`heading`:return(0,Y.jsx)(`p`,{"data-slot":`thread-heading`,className:X(`whitespace-pre-wrap`,dM[e.level]??`font-semibold`),children:(0,Y.jsx)(uM,{spans:e.spans,mediaUrl:n})});case`quote`:return(0,Y.jsx)(`blockquote`,{className:`flex flex-col gap-2 border-l-2 border-border pl-3 text-muted-foreground`,children:(0,Y.jsx)(pM,{blocks:e.blocks,suggestion:t,mediaUrl:n})});case`list`:{let r=e.items.map((e,r)=>(0,Y.jsx)(`li`,{className:X(`pl-1`,e.checked!==null&&`list-none -ml-5 pl-0`),children:(0,Y.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[e.checked!==null&&(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`w-4 shrink-0 text-center`,children:e.checked?`☑`:`☐`}),e.checked!==null&&(0,Y.jsx)(`span`,{className:`sr-only`,children:e.checked?`Done: `:`Not done: `}),(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:(0,Y.jsx)(pM,{blocks:e.blocks,suggestion:t,mediaUrl:n})})]})},r));return e.ordered?(0,Y.jsx)(`ol`,{start:e.start,className:`flex list-decimal flex-col gap-1 pl-5`,children:r}):(0,Y.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5`,children:r})}case`table`:return(0,Y.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Y.jsxs)(`table`,{className:`border-collapse text-ui`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsx)(`tr`,{children:e.head.map((t,r)=>(0,Y.jsx)(`th`,{className:X(`border bg-muted px-2 py-1 font-semibold`,fM[e.align[r]??`left`]),children:(0,Y.jsx)(uM,{spans:t,mediaUrl:n})},r))})}),(0,Y.jsx)(`tbody`,{children:e.rows.map((t,r)=>(0,Y.jsx)(`tr`,{children:t.map((t,r)=>(0,Y.jsx)(`td`,{className:X(`border px-2 py-1`,fM[e.align[r]??`left`]),children:(0,Y.jsx)(uM,{spans:t,mediaUrl:n})},r))},r))})]})});case`rule`:return(0,Y.jsx)(`hr`,{className:`border-border`})}},hM=({blocks:e,suggestion:t,mediaUrl:n})=>(0,Y.jsx)(`div`,{"data-slot":`thread-body`,className:`flex flex-col gap-2 text-body break-words`,children:(0,Y.jsx)(pM,{blocks:e,suggestion:t,mediaUrl:n})}),gM=`inline-flex items-center gap-1 rounded-sm border px-1.5 text-caption font-medium`,_M=`shadow-[inset_0_0_0_2px_var(--ring)]`,vM=({person:e})=>(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`flex size-6 shrink-0 items-center justify-center rounded-full text-caption font-medium`,mA(e.id)),children:fA(e.name)}),yM=e=>{let t=e.line??e.originalLine;if(t===null)return e.path;let n=e.side===`old`?`old `:``;return e.startLine!==null&&e.line!==null?`${n}lines ${e.startLine}–${t}`:`${n}line ${t}`},bM=e=>{let t=[];for(let n of e){let e=t.at(-1);e!==void 0&&e[0]?.author.id===n.author.id?e.push(n):t.push([n])}return t},xM=({thread:e,authorId:t,now:n,language:r,covered:i,onReply:a,onResolve:o,replying:s=!1,mediaUrl:c,initialReply:l,current:u=!1,anchorId:d,linesAbove:f=0,className:p})=>{let[m,h]=(0,J.useState)(!e.resolved||u),[g,_]=(0,J.useState)(u);u!==g&&(_(u),u&&h(!0));let[v,y]=(0,J.useState)(l!==void 0),[b,x]=(0,J.useState)(0),[S,C]=(0,J.useState)(l?.text??``),[w,T]=(0,J.useState)(l?.status===`posting`),[E,D]=(0,J.useState)(l?.status===`failed`?l.error??``:null),[O,k]=(0,J.useState)(!1),[A,j]=(0,J.useState)(null),M=(0,J.useRef)(null),N=(0,J.useId)(),P=e.resolved?`resolved`:e.outdated?`outdated`:`open`,F=!e.outdated&&e.line!==null&&e.side===`new`,I=a!==void 0&&e.can.reply,L=o!==void 0&&e.can.resolve,R=I&&(v||S!==``||w||E!==null),ee=()=>{h(!0),y(!0),x(e=>e+1)};(0,J.useEffect)(()=>{b>0&&M.current?.focus()},[b]),(0,J.useEffect)(()=>{s&&ee()},[s]);let z=()=>M.current?.closest(`[data-slot=review-thread]`)?.focus(),B=()=>{w||(z(),C(``),D(null),y(!1))},V=async()=>{let e=S.trim();if(e===``||w||a===void 0)return;let t=M.current?.closest(`[data-slot=review-thread]`);T(!0),D(null);let n=await a(e);T(!1),n===null?(C(``),y(!1),t?.focus()):D(n)},te=async()=>{if(o===void 0||O)return;k(!0),j(null);let t=await o(!e.resolved);k(!1),t===null?h(e.resolved):j(t)},H=e=>(0,Y.jsx)(hj,{title:`Suggested change`,removed:F?i:null,added:e,language:r}),U=e=>(0,Y.jsx)(`time`,{dateTime:e.createdAt,title:yA(e.createdAt),className:`ml-auto shrink-0 pl-3 text-caption text-muted-foreground`,children:vA(e.createdAt,n)}),ne=e=>{let[n]=e;return n===void 0?null:(0,Y.jsxs)(`section`,{"data-slot":`thread-group`,className:`grid grid-cols-[1.5rem_minmax(0,1fr)] gap-x-2.5 gap-y-0.5`,children:[(0,Y.jsx)(vM,{person:n.author}),(0,Y.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:n.author.name}),t!==null&&n.author.id===t&&(0,Y.jsx)(`span`,{className:X(`inline-flex items-center gap-1 rounded-sm border px-1.5 text-caption font-medium`,`border-border bg-muted text-muted-foreground`),children:`Author`}),U(n)]}),e.length>1?(0,Y.jsx)(`span`,{"data-slot":`thread-run`,"aria-hidden":`true`,className:`flex justify-center pt-1.5 pb-1`,children:(0,Y.jsx)(`span`,{className:`w-px bg-thread-run`})}):(0,Y.jsx)(`span`,{"aria-hidden":`true`}),(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:e.map((e,t)=>{let{blocks:n}=rf(e.body);return(0,Y.jsxs)(`div`,{"data-slot":`thread-comment`,className:`flex items-baseline`,children:[(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1.5`,children:(0,Y.jsx)(`div`,{className:`w-full`,children:(0,Y.jsx)(hM,{blocks:n,suggestion:H,...c===void 0?{}:{mediaUrl:c}})})}),t>0&&U(e)]},e.id)})})]})},[re]=e.comments,ie=e.line??e.originalLine,ae=e.resolvedBy?.name,oe=I||L;return(0,Y.jsx)(dA,{as:`article`,state:P,"data-slot":`review-thread`,id:d,"data-current":u||void 0,"aria-label":`Thread on ${yM(e)}${e.resolved?`, resolved`:``}`,tabIndex:-1,style:Ph({"--lines-above":Math.min(f,5)}),className:X(`flex scroll-mt-[calc(6rem+var(--lines-above)*var(--text-code--line-height))] flex-col gap-3 -outline-offset-2`,!m&&`py-1.5`,u&&_M,p),children:m?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{"data-slot":`thread-header`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-caption text-muted-foreground`,children:[ie!==null&&(0,Y.jsxs)(Y.Fragment,{children:[e.startLine!==null&&e.line!==null?`Lines`:`Line`,` `,(0,Y.jsx)(xA,{children:bA(e.side,e.line===null?null:e.startLine,ie)}),(0,Y.jsx)(`span`,{children:`·`})]}),(0,Y.jsxs)(`span`,{children:[e.comments.length,` `,e.comments.length===1?`comment`:`comments`]}),e.outdated&&(0,Y.jsx)(`span`,{className:X(`inline-flex items-center gap-1 rounded-sm border px-1.5 text-caption font-medium`,`border-border bg-muted text-muted-foreground`),children:`Outdated`}),e.resolved&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`text-review-approved`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`✓ `}),`Resolved`,ae===void 0?``:` by ${ae}`]}),(0,Y.jsx)($,{variant:`ghost`,size:`sm`,onClick:()=>h(!1),"aria-expanded":!0,children:`Hide`})]})]}),bM(e.comments).map((e,t)=>(0,Y.jsxs)(J.Fragment,{children:[t>0&&(0,Y.jsx)(`hr`,{"data-slot":`thread-divider`}),ne(e)]},e[0]?.id??t)),A!==null&&(0,Y.jsxs)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:[`✕ `,e.resolved?`Not reopened`:`Not resolved`,`: `,A]}),R?(0,Y.jsxs)(`div`,{"data-slot":`thread-reply`,className:`flex flex-col gap-1.5 border-t pt-3 pl-8.5`,children:[(0,Y.jsxs)(`label`,{htmlFor:N,className:`sr-only`,children:[`Reply to the thread on `,yM(e)]}),(0,Y.jsx)(Vk,{id:N,ref:M,rows:2,value:S,placeholder:`Reply…`,disabled:w,"aria-invalid":E!==null||void 0,onChange:e=>C(e.target.value),onSubmitShortcut:()=>void V(),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),B())},className:`min-h-14 bg-background`}),E!==null&&(0,Y.jsxs)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:[`✕ Not sent: `,E,` Your reply is still here; send it again when you're ready.`]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(lA,{hints:[{id:`submit`,action:`reply`},{id:`close`,action:`cancel`}]}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Y.jsx)($,{variant:`ghost`,size:`sm`,disabled:w,onClick:B,children:`Cancel`}),(0,Y.jsx)($,{size:`sm`,disabled:S.trim()===``||w,onClick:()=>void V(),children:w?`Sending…`:`Reply`})]})]})]}):oe&&(0,Y.jsxs)(`div`,{"data-slot":`thread-actions`,className:`flex items-center gap-2 pl-8.5`,children:[I&&(0,Y.jsx)(`button`,{type:`button`,onClick:ee,className:`h-8 min-w-0 flex-1 cursor-text truncate rounded-md border border-input bg-background px-2.5 text-left text-ui text-muted-foreground hover:border-foreground/40`,children:`Reply…`}),L&&(0,Y.jsx)($,{variant:`outline`,size:`sm`,disabled:O,onClick:()=>void te(),className:X(!I&&`ml-auto`),children:e.resolved?`Reopen`:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ng,{"aria-hidden":`true`}),`Resolve`]})})]})]}):(0,Y.jsxs)(`div`,{className:`flex min-h-7 flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(`span`,{className:`text-caption text-review-approved`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`✓ `}),`Resolved`,ae===void 0?``:` by ${ae}`]}),re!==void 0&&(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-caption text-muted-foreground`,children:[re.author.name,`: `,Vd(re.body)]}),(0,Y.jsxs)($,{variant:`ghost`,size:`sm`,onClick:()=>h(!0),"aria-expanded":!1,children:[`Show `,e.comments.length,` `,e.comments.length===1?`comment`:`comments`]})]})})},SM=/[\p{L}\p{N}_]+|\s+|[^\p{L}\p{N}_\s]/gu,CM=e=>e.match(SM)??[],wM=e=>{let t=new Map,n=0;for(;n<e.length;){if(e[n]?.kind!==`del`){n++;continue}let r=n;for(;e[n]?.kind===`del`;)n++;let i=n;for(;e[n]?.kind===`add`;)n++;let a=Math.min(i-r,n-i);for(let n=0;n<a;n++){let a=TM(e[r+n]?.text??``,e[i+n]?.text??``);a!==null&&(t.set(r+n,a.old),t.set(i+n,a.new))}}return t},TM=(e,t)=>{if(e.length>500||t.length>500)return null;let n=CM(e),r=CM(t),{inOld:i,inNew:a}=DM(n,r),o=n.reduce((e,t,n)=>e+(i[n]?t.length:0),0),s=e.length+t.length;return s>0&&2*o/s<.3?null:{old:EM(n,i),new:EM(r,a)}},EM=(e,t)=>{let n=[],r=0;return e.forEach((e,i)=>{let a=r+e.length;if(!t[i]){let e=n.at(-1);e?.end===r?n[n.length-1]={start:e.start,end:a}:n.push({start:r,end:a})}r=a}),n},DM=(e,t)=>{let n=e.map(()=>!1),r=t.map(()=>!1),i=new Map([[1,0]]),a=[],o=(e,t)=>a[e]?.[t+e+1]??0,s=0;search:for(let n=0;n<=e.length+t.length;n++){let r=new Int32Array(2*n+3);for(let e=-n-1;e<=n+1;e++)r[e+n+1]=i.get(e)??0;a.push(r);for(let r=-n;r<=n;r+=2){let a=r===-n||r!==n&&(i.get(r-1)??0)<(i.get(r+1)??0)?i.get(r+1)??0:(i.get(r-1)??0)+1,o=a-r;for(;a<e.length&&o<t.length&&e[a]===t[o];)a++,o++;if(i.set(r,a),a>=e.length&&o>=t.length){s=n;break search}}}let c=e.length,l=t.length;for(let e=s;e>=0;e--){let t=c-l,i=t===-e||t!==e&&o(e,t-1)<o(e,t+1)?t+1:t-1,a=o(e,i),s=a-i;for(;c>a&&l>s;)c--,l--,n[c]=!0,r[l]=!0;c=a,l=s}return{inOld:n,inNew:r}},OM=(e,t=null)=>{let n=wM(e.lines);return UA(e.lines).map(({line:r,text:i,carriageReturn:a},o)=>({key:`${e.id}:${o}`,hunkId:e.id,kind:r.kind,oldNo:r.oldLine,newNo:r.newLine,text:i,tokens:t?.[o]??null,wordRanges:n.get(o)??[],notes:[...a?[`CRLF`]:[],...r.noNewlineAtEnd?[`No newline at end of file`]:[]]}))},kM=e=>e.kind===`del`?e.oldLine===null?null:{side:`old`,line:e.oldLine}:e.newLine===null?null:{side:`new`,line:e.newLine},AM=`sticky left-0 w-[100cqw]`,jM=`pr-3 pl-29`,MM=({inset:e,children:t})=>(0,Y.jsx)(`div`,{role:`row`,"data-slot":`line-row`,className:X(e&&X(jM,`py-2`),`font-sans`,AM),children:(0,Y.jsx)(`div`,{role:`cell`,children:t})}),NM=(e,t)=>e.side===t.side&&e.line===t.line,PM=e=>e.startLine===void 0?`Comment on ${e.side===`old`?`old `:``}line ${e.line}`:`Comment on ${e.side===`old`?`old `:``}lines ${e.startLine}–${e.line}`,FM=(e,t,n)=>{let r=new Map(e.lines.flatMap(e=>e.kind!==`del`&&e.newLine!==null?[[e.newLine,e.text]]:[])),i=[];for(let e=t;e<=n;e+=1){let t=r.get(e);if(t===void 0)return null;i.push(t)}return i},IM=[],LM=(0,J.memo)(function({id:e,hunk:t,file:n,risk:r,proofs:i=[],highlighted:a=!1,focused:o=!1,onFocus:s,lineLimit:c,unchanged:l=[],comments:u=[],openComment:d=null,onOpenComment:f,onCancelComment:p,onComment:m,onCommentNow:h,draftNote:g,afterHeader:_,threadsAt:v,rangeNote:y,inFile:b=!1,marks:x,pointLines:S,pointsAt:C,pointsAtEnd:w,flagged:T}){let E=e??t.id,D=(0,J.useRef)(null),[O,k]=(0,J.useState)(!1),A=lj(t,n,cj(D)),j=(0,J.useMemo)(()=>OM(t,A),[t,A]),M=c===void 0||O||j.length<=c?j:j.slice(0,c);(0,J.useEffect)(()=>{let e=D.current;o&&e!==null&&!e.contains(document.activeElement)&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:`start`}))},[o]);let N=WA(t),P=!b||i.length>0,F=f!==void 0&&m!==void 0,I=(e,t)=>{let n=d;if(n!==null&&n.side===e.side&&n.line===e.line)f?.(E,null);else if(t&&n!==null&&n.side===e.side){let t=Math.min(n.startLine??n.line,e.line),r=Math.max(n.line,e.line);f?.(E,{side:e.side,line:r,startLine:t})}else f?.(E,e)};return(0,Y.jsxs)(`section`,{ref:D,"data-slot":`hunk-card`,"data-risk":r?.riskClass,"data-highlighted":a||void 0,className:X(`relative scroll-mt-24 bg-card -outline-offset-2`,!b&&`overflow-hidden rounded-lg border`,a&&`bg-primary/5 shadow-[inset_0_0_0_2px_var(--ring)]`),"aria-label":`${n.path}, ${KA(t)}`,tabIndex:0,onFocus:()=>s?.(E),children:[P&&(0,Y.jsxs)(`header`,{"data-slot":`hunk-header`,className:X(`flex flex-wrap items-center gap-x-3 gap-y-1 border-b bg-surface-subtle px-3 py-1.5`,b&&`sticky left-0 w-[100cqw]`),children:[!b&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(FO,{file:n,status:n.status}),(0,Y.jsx)(IO,{status:n.status}),t.sectionHeading!==null&&(0,Y.jsx)(`code`,{className:`font-mono text-code-compact text-diff-hunk-fg`,children:t.sectionHeading}),(0,Y.jsxs)(`span`,{className:`tabular font-mono text-code-compact`,children:[(0,Y.jsxs)(`span`,{className:`text-diff-add-fg`,children:[`+`,N.added]}),` `,(0,Y.jsxs)(`span`,{className:`text-diff-del-fg`,children:[`−`,N.deleted]})]})]}),i.map(e=>(0,Y.jsxs)(`span`,{className:`text-caption text-review-approved`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`✓ `}),e.detail]},e.kind)),!b&&r!==null&&(0,Y.jsxs)(`span`,{className:`ml-auto`,title:r.reason===``?void 0:r.reason,children:[(0,Y.jsx)(HO,{status:OD[r.riskClass]}),r.reason!==``&&(0,Y.jsxs)(`span`,{className:`sr-only`,children:[`: `,r.reason]})]})]}),(l.length>0||_!=null)&&(0,Y.jsxs)(`div`,{className:X(b&&`sticky left-0 w-[100cqw]`),children:[l.map(e=>(0,Y.jsx)(RO,{callers:e,named:l.length>1},e.symbol)),_]}),(0,Y.jsx)(`div`,{role:`table`,"aria-label":`Lines`,className:X(`[content-visibility:auto]`,!b&&`overflow-x-auto`),style:{containIntrinsicSize:`auto ${M.length*20}px`},children:(0,Y.jsx)(`div`,{className:`w-max min-w-full`,children:M.map(e=>{let r=kM({kind:e.kind,oldLine:e.oldNo,newLine:e.newNo}),i=r===null?void 0:u.find(e=>NM(e,r)),a=r!==null&&d!==null&&NM(d,r),o=a?d:i,s=r===null?null:v?.(r)??null,c=r===null?null:C?.(r)??null,l=r===null?null:w?.(r)??null,_=r===null?null:`${r.side}:${r.line}`,D=_===null?void 0:S?.get(_);return(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsx)(SD,{line:e,cellRole:`cell`,pointKind:D?.kind??null,flagged:_!==null&&T?.has(_)===!0,...l===null?{}:{end:l},...D?.landing===void 0?{}:{pointLanding:D.landing},marks:(e.kind===`del`||e.newNo===null?void 0:x?.get(e.newNo))??IM,marked:r!==null&&m!==void 0&&d!==null&&d.side===r.side&&r.line>=(d.startLine??d.line)&&r.line<=d.line,numberButton:r===null||!F?void 0:{side:r.side,label:PM(r),onClick:e=>I(r,e.shiftKey)},...r===null||!F?{}:{onRowClick:e=>{window.getSelection()?.isCollapsed!==!1&&(e.target instanceof Element&&e.target.closest(`button`)||I(r,e.shiftKey))}}}),c,r!==null&&o!=null&&(i!==void 0||a&&m!==void 0)&&(0,Y.jsx)(RM,{place:o,comment:i,editing:a&&m!==void 0,shown:(e,n)=>FM(t,e,n),language:NA(n),rangeNote:y,fileName:n.path.split(`/`).at(-1)??n.path,onChange:m===void 0?void 0:e=>m(E,{side:o.side,line:o.line,...o.startLine===void 0?{}:{startLine:o.startLine},...e}),onEdit:()=>f?.(E,{side:o.side,line:o.line,...o.startLine===void 0?{}:{startLine:o.startLine}}),onDone:()=>f?.(E,null),onCancel:()=>p?.(E,o),...h===void 0?{}:{onPostNow:e=>h(E,{side:o.side,line:o.line,...o.startLine===void 0?{}:{startLine:o.startLine},...e})},pinned:b,...g===void 0||i===void 0||m===void 0?{}:{note:g(i,e=>m(E,{...i,body:e}))}}),s!==null&&(0,Y.jsx)(`div`,{role:`row`,"data-slot":`line-threads`,className:X(jM,`py-2 font-sans`,b&&`sticky left-0 w-[100cqw]`),children:(0,Y.jsx)(`div`,{role:`cell`,className:`flex max-w-3xl flex-col gap-2`,children:s})})]},e.key)})})}),M.length<j.length&&(0,Y.jsx)(`div`,{className:X(`border-t p-2`,b&&`sticky left-0 w-[100cqw]`),children:(0,Y.jsxs)($,{variant:`outline`,size:`sm`,onClick:()=>k(!0),children:[`Show all `,j.length,` lines`]})})]})}),RM=({place:e,comment:t,editing:n,shown:r,language:i,rangeNote:a,fileName:o,onChange:s,onEdit:c,onDone:l,onCancel:u,onPostNow:d,pinned:f,note:p})=>{let m=(0,J.useRef)(null),h=(0,J.useRef)(null),[g,_]=(0,J.useState)(`write`),[v,y]=(0,J.useState)(!1),[b,x]=(0,J.useState)(null);(0,J.useEffect)(()=>{n?h.current?.focus():(_(`write`),x(null))},[n]);let S=PM(e),C=t?.body??``,w=t?.suggestion,T={body:C,...w===void 0?{}:{suggestion:w}},E=(0,J.useRef)(null);n?E.current===null&&(E.current=T):E.current=null;let D=e.side===`new`?r(e.startLine??e.line,e.line):null,O=e.startLine===void 0?null:`Lines ${e.startLine}–${e.line}`,k=()=>m.current?.closest(`[data-slot=hunk-card]`)?.focus({preventScroll:!0}),A=()=>s?.({body:``}),j=()=>{k(),C.trim()===``&&w===void 0&&s?.({body:``}),l()},M=async()=>{if(d===void 0||v||C.trim()===``)return;y(!0),x(null);let e=await d(T);y(!1),e===null?(k(),s?.({body:``}),l()):x(e)},N=()=>{k();let e=E.current;s?.(e===null||e.body.trim()===``&&e.suggestion===void 0?{body:``}:e),u?.(),l()},P=e=>(0,Y.jsx)(hj,{title:`Suggested change`,removed:D,added:e,language:i});return(0,Y.jsx)(`div`,{ref:m,role:`row`,"data-slot":`line-comment`,"data-editing":n||void 0,className:X(jM,`py-2 font-sans`,f&&`sticky left-0 w-[100cqw]`),children:(0,Y.jsx)(dA,{role:`cell`,state:`draft`,className:`flex max-w-3xl flex-col gap-2`,onKeyDown:n?e=>{if(e.key===`Enter`&&(e.metaKey||e.ctrlKey)){if(e.defaultPrevented)return;e.preventDefault(),j()}else e.key===`Escape`&&(e.stopPropagation(),N())}:void 0,children:n?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-caption text-muted-foreground`,children:[`Commenting on `,(0,Y.jsx)(xA,{children:o}),e.startLine===void 0?`line`:`lines`,` `,(0,Y.jsx)(xA,{children:bA(e.side,e.startLine??null,e.line)}),a!==void 0&&e.startLine!==void 0&&(0,Y.jsx)(`span`,{children:a})]}),(0,Y.jsxs)(Ik,{value:g,onValueChange:e=>_(e===`preview`?`preview`:`write`),children:[(0,Y.jsxs)(Rk,{children:[(0,Y.jsx)(zk,{value:`write`,children:`Write`}),(0,Y.jsx)(zk,{value:`preview`,children:`Preview`})]}),(0,Y.jsx)(Bk,{value:`write`,children:(0,Y.jsx)(Vk,{ref:h,rows:2,"aria-label":S,placeholder:`Leave a comment`,value:C,onChange:e=>s?.({...T,body:e.target.value}),onSubmitShortcut:j,className:`min-h-14 bg-background`})}),(0,Y.jsx)(Bk,{value:`preview`,"data-slot":`comment-preview`,className:`min-h-14 rounded-md border px-2.5 py-2`,children:C.trim()===``?(0,Y.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:`Nothing to preview`}):(0,Y.jsx)(hM,{blocks:rf(C).blocks,suggestion:P})})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(lA,{hints:[{id:`submit`,action:`add to review`},{id:`close`,action:`cancel`}]}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Y.jsx)($,{variant:`ghost`,size:`sm`,disabled:v,onClick:N,children:`Cancel`}),d!==void 0&&(0,Y.jsx)($,{variant:`outline`,size:`sm`,disabled:v||C.trim()===``,onClick:()=>void M(),children:v?`Posting…`:`Comment now`}),(0,Y.jsx)($,{size:`sm`,disabled:v,onClick:j,children:`Add to review`})]})]}),b!==null&&(0,Y.jsxs)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:[`✕ Not posted: `,b,` Your comment is still here.`]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(`span`,{className:`sr-only`,children:[S,`: `]}),(0,Y.jsx)(`span`,{className:X(gM,`border-review-pending/25 bg-review-pending-bg text-review-pending`),children:s===void 0?`Posted with your review`:`Draft · posts with your review`}),O!==null&&(0,Y.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:O})]}),C.trim()!==``&&(0,Y.jsx)(hM,{blocks:rf(C).blocks,suggestion:P}),w!==void 0&&P(w),s!==void 0&&p,s!==void 0&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)($,{variant:`outline`,size:`sm`,onClick:c,children:`Edit`}),(0,Y.jsx)($,{variant:`ghost`,size:`sm`,onClick:A,children:`Discard`})]})]})})})},zM=()=>mD(),BM=({handle:e,payload:t,id:n,render:r=(0,Y.jsx)(`span`,{}),children:i})=>(0,Y.jsx)(pD,{handle:e,payload:t,id:n,delay:300,closeDelay:150,render:r,"data-slot":`call`,className:`underline decoration-current decoration-dotted underline-offset-3 hover:decoration-primary hover:decoration-solid data-popup-open:decoration-primary data-popup-open:decoration-solid`,children:i}),VM=({handle:e,onGoTo:t})=>(0,Y.jsx)(fD,{handle:e,children:({payload:n})=>n===void 0?null:(0,Y.jsx)(hD,{side:`bottom`,align:`start`,"aria-label":n.label??`Code ${n.symbol} runs`,className:`flex max-h-[min(26rem,60vh)] w-[min(44rem,calc(100vw-2rem))] flex-col overflow-hidden p-0`,children:(0,Y.jsx)(HM,{payload:n,onGoTo:n=>{e.close(),t(n)}})})}),HM=({payload:e,onGoTo:t})=>{let n=(0,J.useRef)(null),r=e.targets[0],i=r===void 0?null:`${r.hunk.id}:${WM(r.hunk,e.symbol)}`;return(0,J.useEffect)(()=>{let e=n.current,t=i===null?null:e?.querySelector(`[data-line="${i}"]`),r=e?.querySelector(`header`);e!=null&&t!=null&&(e.scrollTop=t.offsetTop-(r?.offsetHeight??0))},[i]),(0,Y.jsx)(`div`,{ref:n,"data-slot":`peek-scroller`,className:`@container relative min-h-0 overflow-auto`,children:(0,Y.jsx)(`div`,{className:`w-max min-w-full`,children:e.targets.map((n,r)=>(0,Y.jsx)(UM,{target:n,symbol:e.symbol,onGoTo:t,divided:r>0,last:r===e.targets.length-1},n.id))})})},UM=({target:e,symbol:t,onGoTo:n,divided:r,last:i})=>{let{hunk:a,file:o}=e,s=lj(a,o,!0),c=(0,J.useMemo)(()=>OM(a,s),[a,s]),l=WA(a),u=KA(a);return(0,Y.jsxs)(`section`,{"aria-label":`${o.path}, ${u}`,className:r?`border-t`:void 0,children:[(0,Y.jsxs)(`header`,{className:X(AM,`top-0 z-[2] flex flex-wrap items-center gap-x-3 gap-y-1 border-b bg-surface-subtle px-3 py-1 text-caption`),children:[(0,Y.jsx)(FO,{file:o,status:o.status}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:u}),(0,Y.jsxs)(`span`,{className:`tabular font-mono text-code-compact`,children:[(0,Y.jsxs)(`span`,{className:`text-diff-add-fg`,children:[`+`,l.added]}),` `,(0,Y.jsxs)(`span`,{className:`text-diff-del-fg`,children:[`−`,l.deleted]})]}),(0,Y.jsx)($,{variant:`link`,size:`xs`,className:`ml-auto px-0`,onClick:()=>n(e.id),children:`Go to file`})]}),(0,Y.jsx)(`div`,{role:`table`,"aria-label":`Lines of ${t}`,className:`w-max min-w-full`,children:c.map(e=>(0,Y.jsx)(SD,{line:e,layout:`split-new`,cellRole:`cell`,density:`compact`},e.key))}),i&&(0,Y.jsx)(TD,{kind:c.at(-1)?.kind??`context`,className:`h-3`})]})},WM=(e,t)=>{let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=RegExp(`(?<![\\w$])${n}(?![\\w$])`),i=RegExp(`\\b(def|class|function|func|fn|const|let|var|type|interface|enum|struct|trait|impl)\\b[^=(]*?(?<![\\w$])${n}(?![\\w$])`),a=e.lines.map((e,t)=>({line:e,at:t})).filter(({line:e})=>e.kind!==`del`);return a.find(({line:e})=>i.test(e.text))?.at??a.find(({line:e})=>r.test(e.text))?.at??0},GM=J.createContext(void 0);function KM(){return J.useContext(GM)}function qM(e){let{render:t,className:n,style:r,state:i=py,props:a=fy,refs:o=fy,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=ck({metadata:s});return _y(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var JM=J.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,style:f,...p}=e,m=FE(u||void 0),h=KM(),g=h?.value??[],_=(i||h?.disabled)??!1,[v,y]=UO({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:b,buttonRef:x}=$v({disabled:_,native:d}),S={disabled:_,pressed:v},C=[x,t],w=[{"aria-pressed":v,onClick(e){let t=!v,n=Yb(Zb,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&y(t))}},p,b],T=_y(`button`,e,{enabled:!h,state:S,ref:C,props:w}),E=J.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,Y.jsx)(qM,{tag:`button`,render:c,className:n,style:f,metadata:E,state:S,refs:C,props:w}):T}),YM=J.createContext(void 0);function XM(e){let t=J.useContext(YM);if(t===void 0&&!e)throw Error(qv(69));return t}var ZM=Dy(`group/toggle inline-flex items-center justify-center gap-1 rounded-md text-ui font-medium whitespace-nowrap transition-all hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-background aria-pressed:text-foreground aria-pressed:shadow-sm aria-pressed:ring-1 aria-pressed:ring-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-md px-2.5 text-ui has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function QM({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Y.jsx)(JM,{"data-slot":`toggle`,className:X(ZM({variant:t,size:n,className:e})),...r})}J.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});var $M=(e,t)=>{let n=new Set,r=e=>{let r=t.filter(t=>!n.has(t)&&e(t));for(let e of r)n.add(e);return r},i=e.flatMap(e=>{let t=r(t=>t.path===e.path&&t.hunkId===null).map(t=>({key:`${e.path}\0${t.kind}`,path:e.path,file:e,hunk:null,proofs:[t],summary:eN(t,e)})),n=e.hunks.flatMap(t=>{let n=r(e=>e.hunkId===t.id);if(n.length===0)return[];let{added:i,deleted:a}=WA(t),o=n.map(e=>e.detail).join(`; `);return[{key:t.id,path:e.path,file:e,hunk:t,proofs:n,summary:`${e.path} — ${o} (+${i} −${a})`}]});return[...t,...n]}),a=t.filter(e=>!n.has(e)).map((e,t)=>({key:`orphan-${t}`,path:e.path,file:null,hunk:null,proofs:[e],summary:`${e.path} — ${e.detail}`}));return[...i,...a]},eN=(e,t)=>e.kind===`rename`&&t.oldPath!==null?`${t.oldPath} → ${t.path} — renamed, content unchanged`:`${t.path} — ${e.detail}`,tN=`flex min-h-8 w-full items-center gap-2 rounded-md px-2 py-1 text-left text-muted-foreground`,nN=({open:e,children:t,...n})=>(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`mechanical-toggle`,"aria-expanded":e,className:X(tN,`hover:bg-accent hover:text-accent-foreground`),...n,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`w-3 shrink-0 transition-transform duration-(--duration-fast) ease-standard`,!e&&`-rotate-90`),children:`▾`}),(0,Y.jsx)(`span`,{className:`min-w-0`,children:t})]}),rN=(0,J.memo)(function({hunk:e,file:t,risk:n,proofs:r,focused:i=!1,onFocus:a}){let o=(0,J.useRef)(null),[s,c]=(0,J.useState)(!1),{added:l,deleted:u}=WA(e);return(0,J.useEffect)(()=>{let e=o.current;i&&e!==null&&e!==document.activeElement&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:`start`}))},[i]),(0,Y.jsxs)(`div`,{"data-slot":`mechanical-hunk`,className:`bg-surface-subtle`,children:[(0,Y.jsxs)(nN,{ref:o,open:s,onClick:()=>c(e=>!e),onFocus:()=>a?.(e.id),children:[t.path,`, `,KA(e),` — `,r.map(e=>e.detail).join(`; `),` (+`,l,` −`,u,`)`]}),s&&(0,Y.jsx)(LM,{hunk:e,file:t,risk:n,proofs:r,lineLimit:500})]})}),iN=({files:e,proofs:t,risk:n})=>{let r=(0,J.useId)(),i=(0,J.useMemo)(()=>$M(e,t),[e,t]),[a,o]=(0,J.useState)(new Set),s=i.filter(e=>e.hunk!==null).map(e=>e.key),c=s.length>0&&s.every(e=>a.has(e));if(i.length===0)return null;let l=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,Y.jsxs)(`section`,{"aria-labelledby":r,className:`flex flex-col gap-2 rounded-lg border bg-card p-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(`h2`,{id:r,className:`flex items-center gap-2 text-heading font-semibold`,children:[`Mechanical changes`,` `,(0,Y.jsx)(`span`,{className:`tabular rounded-full bg-muted px-2 text-caption font-medium text-muted-foreground`,children:i.length})]}),s.length>0&&(0,Y.jsx)($,{variant:`outline`,size:`sm`,onClick:()=>o(new Set(c?[]:s)),children:c?`Collapse all`:`Expand all`})]}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-1`,children:i.map(e=>{let t=a.has(e.key);return(0,Y.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[e.hunk===null||e.file===null?(0,Y.jsxs)(`span`,{className:tN,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`w-3 shrink-0`}),e.summary]}):(0,Y.jsx)(nN,{open:t,onClick:()=>l(e.key),children:e.summary}),t&&e.hunk!==null&&e.file!==null&&(0,Y.jsx)(LM,{hunk:e.hunk,file:e.file,risk:n.find(t=>t.hunkId===e.hunk?.id)??null,proofs:e.proofs,lineLimit:500})]},e.key)})})]})},aN={added:`added`,deleted:`deleted`,modified:`changed`,renamed:`changed`},oN=e=>e.flatMap(e=>{let t=e.oldMode!==null||e.newMode!==null,n=!e.binary&&!t&&e.hunks.length===0&&e.status!==`renamed`;return[...e.binary?[{key:`${e.path}\0binary`,file:e,text:`binary file ${aN[e.status]}`}]:[],...t?[{key:`${e.path}\0mode`,file:e,text:`mode ${e.oldMode??`unknown`} → ${e.newMode??`unknown`}`}]:[],...n?[{key:`${e.path}\0empty`,file:e,text:e.status===`modified`?`changed, no lines to show`:`empty file ${e.status}`}]:[]]}),sN=({files:e})=>{let t=(0,J.useId)(),n=oN(e);return n.length===0?null:(0,Y.jsxs)(`section`,{"aria-labelledby":t,className:`flex flex-col gap-2 rounded-lg border bg-card p-3`,children:[(0,Y.jsx)(`h2`,{id:t,className:`text-heading font-semibold`,children:`Changes without lines to show`}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(({key:e,file:t,text:n})=>(0,Y.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(FO,{file:t,status:t.status}),(0,Y.jsx)(IO,{status:t.status}),(0,Y.jsx)(`span`,{children:n})]},e))})]})},cN=({hunkId:e,lines:t})=>t.length===0?null:(0,Y.jsx)(`div`,{role:`table`,"aria-label":`Unchanged lines`,children:(0,Y.jsx)(`div`,{className:`w-max min-w-full`,children:t.map(({oldNo:t,newNo:n,text:r,tokens:i})=>{let a={key:`${e}:unchanged:${n}`,hunkId:e,kind:`context`,oldNo:t,newNo:n,text:r,tokens:i,wordRanges:[],notes:[]};return(0,Y.jsx)(SD,{line:a,cellRole:`cell`},n)})})}),lN=J.createContext(void 0);function uN(e){let t=J.useContext(lN);if(t===void 0&&!e)throw Error(qv(47));return t}var dN={...Hw,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!Hw.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&Hw.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>Hw.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},fN=class extends Nw{constructor(e,t,n){let r=new bw;super(pN(e,r,t,n),mN(r),dN)}setOpen=(e,t)=>{let n=t.reason===$b,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=pw(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=fw(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),cC.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function pN(e,t,n,r=!1){let i={...Iw(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function mN(e){return{popupRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:J.createRef(),beforeTriggerFocusGuardRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),stickIfOpenTimeout:new Ry,stickIfOpen:!0,triggerElements:e}}var hN=Ny(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=_N(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),yw(u,d),gw(u);let{forceUnmount:m}=_w(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),J.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),J.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,Yb(mx))}),[m,u]);let h=d||f||s!=null;return(0,Y.jsxs)(lN.Provider,{value:u,children:[s&&(0,Y.jsx)(lw,{handle:s,store:u}),h&&(0,Y.jsx)(vN,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function gN(e){return uN(!0)?(0,Y.jsx)(hN,{props:e}):(0,Y.jsx)(SC,{children:(0,Y.jsx)(hN,{props:e})})}function _N(e,t){let n=cw((e,n)=>new fN(t,e,n));return J.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function vN({store:e,modal:t}){let n=zC(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return vw(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}function yN(e,t){function n(n,r,i){let a=n.currentTarget;cC.flushSync(()=>{e.setOpen(!1,Yb(ix,n.nativeEvent,a))}),MS(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&NS(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}var bN=Py(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=uN(!0),h=Uw(s)??m;if(!h)throw Error(qv(74));let g=FE(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=J.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=hw(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=eT(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:gT(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=NC(v,{stickIfOpen:Z(()=>h.context.stickIfOpen)}),k=Xj(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),A=h.useState(`triggerProps`,C),{getButtonProps:j,buttonRef:M}=$v({disabled:a,native:o}),N={open(e){return w?Mb.open(e):jb.open(e)}},{handlePreFocusGuardFocus:P,handleFocusTargetFocus:F}=yN(h,x),I=_y(`button`,e,{state:{disabled:a,open:y},ref:[M,t,S,x],props:[O.reference,D,A,k,{[iC]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,j],stateAttributesMapping:N}),L=(0,Y.jsx)(J.Fragment,{children:I},g);return E?(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsx)(jx,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:P}),L,(0,Y.jsx)(jx,{ref:h.context.triggerFocusTargetRef,onFocus:F})]}):L}),xN=J.createContext(void 0);function SN(){let e=J.useContext(xN);if(e===void 0)throw Error(qv(45));return e}var CN=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return uN().useState(`mounted`)||n?(0,Y.jsx)(xN.Provider,{value:n,children:(0,Y.jsx)(pC,{ref:t,...r})}):null}),wN=J.createContext(void 0);function TN(){let e=J.useContext(wN);if(!e)throw Error(qv(46));return e}function EN(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=J.useRef(null),o=J.useRef(null),s=rw(r);Q(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Q(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var DN=20;function ON(e,t,n,r){let[i,a]=J.useState(!1);Q(()=>{if(!e||!t||n==null){a(!1);return}let r=Zv(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-DN)},[e,t,n]),zj(e&&(!t||i),r)}var kN=J.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=oC,..._}=e,v=uN(),y=SN(),b=bC(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=tD({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});EN({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;ON(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=aD(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,Y.jsxs)(wN.Provider,{value:j,children:[S&&M&&(0,Y.jsx)(Dj,{inert:cD(!C),cutout:T}),(0,Y.jsx)(xC,{id:b,children:P})]})}),AN=J.createContext(void 0);function jN(){let[e,t]=J.useState(0),n=Z(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:J.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var MN=J.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=uN(),l=TN(),u=XM(!0)!=null,{context:d,hasClosePart:f}=jN(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);iw({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Qw(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?sw(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=_y(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...ow,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&Ck.has(e.key)&&e.stopPropagation()}},iD(g),s],stateAttributesMapping:Pb});return(0,Y.jsx)(MC,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:av(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Y.jsx)(AN.Provider,{value:d,children:M})})}),NN=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=uN(),s=FE(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),_y(`h2`,e,{ref:t,props:[{id:s},a]})});function PN({...e}){return(0,Y.jsx)(gN,{"data-slot":`popover`,...e})}function FN({...e}){return(0,Y.jsx)(bN,{"data-slot":`popover-trigger`,...e})}function IN({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,Y.jsx)(CN,{children:(0,Y.jsx)(kN,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,Y.jsx)(MN,{"data-slot":`popover-content`,className:X(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-xl bg-popover p-2.5 text-ui text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-(--duration-fast) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}function LN({className:e,...t}){return(0,Y.jsx)(NN,{"data-slot":`popover-title`,className:X(`font-medium`,e),...t})}var RN={open:Ag,draft:Pg,merged:Og,closed:Mg},zN=({state:e})=>{let{label:t,className:n}=AD[e],r=RN[e];return(0,Y.jsxs)(VO,{"data-slot":`pr-state`,variant:`outline`,className:n,children:[(0,Y.jsx)(r,{"aria-hidden":`true`}),t]})},BN=({status:e})=>e===null?null:(0,Y.jsx)(`span`,{"data-slot":`review-status`,children:(0,Y.jsx)(HO,{status:jD[e]})}),VN=e=>{switch(e.state){case`failed`:return`CI ${e.failed} of ${e.total} failed`;case`running`:return`CI ${e.running} of ${e.total} running`;case`skipped`:return`CI ${e.skipped} skipped`;default:return`CI ${e.passed}/${e.total} passed`}},HN=e=>{let t=e=>`${e} ${e===1?`check`:`checks`}`;switch(e.state){case`failed`:return`CI: ${e.failed} of ${t(e.total)} failed`;case`running`:return`CI: ${e.running} of ${t(e.total)} running`;case`skipped`:return`CI: ${t(e.skipped)} skipped`;default:return`CI: ${e.passed} of ${t(e.total)} passed`}},UN=`h-6 gap-1.5 px-1.5 font-normal text-muted-foreground`,WN=({check:e})=>{let t=MD[e.state];return(0,Y.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`w-3 shrink-0 text-center`,t.tone),children:t.glyph}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:e.name}),(0,Y.jsx)(`span`,{className:`shrink-0 text-caption text-muted-foreground`,children:t.label}),e.url!==null&&(0,Y.jsx)(`a`,{className:`shrink-0 text-caption`,href:e.url,target:`_blank`,rel:`noreferrer noopener`,"aria-label":`Details of ${e.name}`,children:`Details`})]})},GN=({checks:e,unreadable:t,head:n})=>{let r=e===null?null:wf(e),i=r===null||r.state===null?null:HN(r),a=KN(i);if(e===null)return(0,Y.jsxs)(PN,{children:[(0,Y.jsx)(FN,{render:(0,Y.jsx)($,{variant:`ghost`,size:`xs`,className:UN,"data-slot":`ci-summary`,children:`CI not readable`})}),(0,Y.jsxs)(IN,{align:`end`,children:[(0,Y.jsx)(LN,{children:`CI not readable`}),(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:t})]})]});if(r===null||r.state===null)return null;let o=MD[r.state];return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(PN,{children:[(0,Y.jsx)(FN,{render:(0,Y.jsxs)($,{variant:`ghost`,size:`xs`,className:UN,"data-slot":`ci-summary`,"data-state":r.state,"aria-label":`${i}, show checks`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:o.tone,children:o.glyph}),(0,Y.jsx)(`span`,{className:`tabular`,children:VN(r)})]})}),(0,Y.jsxs)(IN,{align:`end`,className:`w-96`,children:[(0,Y.jsxs)(LN,{children:[`Checks on `,(0,Y.jsx)(`code`,{className:`font-mono text-code-compact`,children:n.slice(0,7)})]}),(0,Y.jsx)(`ul`,{className:`flex max-h-80 flex-col gap-1.5 overflow-y-auto`,"aria-label":`Checks`,children:Cf(e).map(e=>(0,Y.jsx)(WN,{check:e},`${e.name}:${e.url??``}`))})]})]}),(0,Y.jsx)(`span`,{role:`status`,className:`sr-only`,children:a})]})},KN=e=>{let t=(0,J.useRef)(void 0),[n,r]=(0,J.useState)(``);return(0,J.useEffect)(()=>{t.current===void 0?t.current=e:e!==null&&e!==t.current&&(t.current=e,r(e))},[e]),n},qN={"changes-requested":I_,approved:ng,commented:n_},JN=3,YN=({reviewer:e})=>{let t=e.verdict===null?null:qN[e.verdict];return(0,Y.jsxs)(`span`,{className:X(`relative flex size-6 shrink-0 items-center justify-center rounded-full text-caption font-medium ring-2 ring-background`,mA(e.id)),children:[fA(e.name),t!==null&&e.verdict!==null&&(0,Y.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 flex size-3 items-center justify-center rounded-full bg-background`,children:(0,Y.jsx)(t,{className:X(`size-2.5`,ND[e.verdict].tone),strokeWidth:3.5})})]})},XN=e=>{let t=new Map;for(let n of e){let e=ND[n.verdict??`waiting`].label.toLowerCase();t.set(e,(t.get(e)??0)+1)}let n=[...t].map(([e,t])=>`${t} ${e}`);return`${`${e.length} ${e.length===1?`reviewer`:`reviewers`}`}: ${n.join(`, `)}`},ZN=({reviewers:e})=>{if(e.length===0)return null;let t=xf(e),n=t.length>JN?t.slice(0,2):t,r=t.length-n.length;return(0,Y.jsxs)(PN,{children:[(0,Y.jsx)(FN,{render:(0,Y.jsx)($,{variant:`ghost`,size:`xs`,className:`h-7 px-1`,"data-slot":`reviewers`,"aria-label":`${XN(t)}, show reviewers`,children:(0,Y.jsxs)(`span`,{"aria-hidden":`true`,className:`flex items-center -space-x-1`,children:[n.map(e=>(0,Y.jsx)(YN,{reviewer:e},e.id)),r>0&&(0,Y.jsxs)(`span`,{className:`flex size-6 items-center justify-center rounded-full bg-muted text-caption font-medium text-muted-foreground ring-2 ring-background`,children:[`+`,r]})]})})}),(0,Y.jsxs)(IN,{align:`end`,children:[(0,Y.jsx)(LN,{children:`Reviewers`}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-2`,"aria-label":`Reviewers`,children:t.map(e=>{let t=ND[e.verdict??`waiting`];return(0,Y.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:(0,Y.jsx)(YN,{reviewer:e})}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.name,e.team&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:` (team)`})]}),(0,Y.jsx)(`span`,{className:X(`shrink-0 text-caption`,t.tone),children:t.label})]},e.id)})})]})]})};function QN(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var $N=e=>{switch(e){case`success`:return nP;case`info`:return iP;case`warning`:return rP;case`error`:return aP;default:return null}},eP=Array(12).fill(0),tP=({visible:e,className:t})=>J.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},J.createElement(`div`,{className:`sonner-spinner`},eP.map((e,t)=>J.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),nP=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},J.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),rP=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},J.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),iP=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},J.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),aP=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},J.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),oP=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},J.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),J.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),sP=()=>{let[e,t]=J.useState(document.hidden);return J.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},cP=1,lP=100,uP=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:cP++,dP=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-lP;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=uP(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],J.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(pP(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!J.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!J.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!J.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!J.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=uP(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},fP=(e,t)=>dP.message(e,t),pP=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(fP,{success:dP.success,info:dP.info,warning:dP.warning,error:dP.error,custom:dP.custom,message:dP.message,promise:dP.promise,dismiss:dP.dismiss,loading:dP.loading},{getHistory:()=>dP.toasts,getToasts:()=>dP.getActiveToasts()}),QN(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function mP(e){return e.label!==void 0}var hP=3,gP=`24px`,_P=`16px`,vP=4e3,yP=356,bP=14,xP=45,SP=200;function CP(...e){return e.filter(Boolean).join(` `)}function wP(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var TP=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=J.useState(null),[O,k]=J.useState(null),[A,j]=J.useState(!1),[M,N]=J.useState(!1),[P,F]=J.useState(!1),[I,L]=J.useState(!1),[R,ee]=J.useState(!1),[z,B]=J.useState(0),[V,te]=J.useState(0),H=J.useRef(n.duration||y||vP),U=J.useRef(null),ne=J.useRef(null),re=c===0,ie=c+1<=o,ae=n.type,oe=ae??`default`,W=n.dismissible!==!1,se=n.className||``,ce=n.descriptionClassName||``,le=J.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ue=J.useMemo(()=>n.closeButton??p,[n.closeButton,p]),de=J.useMemo(()=>n.duration||y||vP,[n.duration,y]),fe=J.useRef(0),pe=J.useRef(0),me=J.useRef(0),he=J.useRef(null),[ge,_e]=b.split(`-`),ve=J.useMemo(()=>s.reduce((e,t,n)=>n>=le?e:e+t.height,0),[s,le]),ye=sP(),be=J.useMemo(()=>e.swipeDirections??wP(b),[e.swipeDirections,b]),xe=n.invert||t,Se=ae===`loading`;pe.current=J.useMemo(()=>le*x+ve,[le,ve]),J.useEffect(()=>{H.current=de},[de]),J.useEffect(()=>{j(!0)},[]),J.useEffect(()=>{let e=ne.current;if(e){let t=e.getBoundingClientRect().height;return te(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),J.useLayoutEffect(()=>{if(!A)return;let e=ne.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,te(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ce=J.useCallback(()=>{N(!0),B(pe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},SP)},[n,d,a,pe]);J.useEffect(()=>{if(n.promise&&ae===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||ye?(()=>{if(me.current<fe.current){let e=new Date().getTime()-fe.current;H.current-=e}me.current=new Date().getTime()})():H.current!==1/0&&(fe.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ce()},H.current)),()=>clearTimeout(e)},[u,i,n,ae,ye,Ce]),J.useEffect(()=>{n.delete&&(Ce(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ce,n.delete]);function we(){return w?.loading?J.createElement(`div`,{className:CP(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ae===`loading`},w.loading):J.createElement(tP,{className:CP(C?.loader,n?.classNames?.loader),visible:ae===`loading`})}let Te=n.icon||w?.[ae]||$N(ae);return J.createElement(`li`,{tabIndex:0,ref:ne,className:CP(_,se,C?.toast,n?.classNames?.toast,C?.[oe],n?.classNames?.[oe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":R,"data-removed":M,"data-visible":ie,"data-y-position":ge,"data-x-position":_e,"data-index":c,"data-front":re,"data-swiping":P,"data-dismissible":W,"data-type":ae,"data-invert":xe,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?z:pe.current}px`,"--initial-height":S?`auto`:`${V}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),he.current=null},onPointerDown:e=>{e.button!==2&&!Se&&W&&(U.current=new Date,B(pe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),he.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(I||!W)return;he.current=null;let e=Number(ne.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ne.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-U.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?be.includes(e>0?`right`:`left`):be.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=xP||a>.11))B(pe.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ce(),L(!0);else{var o,s;(o=ne.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ne.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ee(!1),F(!1),D(null)}},onPointerMove:e=>{var t,n;if(!he.current||!W||window.getSelection()?.toString().length>0)return;let r=e.clientY-he.current.y,i=e.clientX-he.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(be.includes(`top`)||be.includes(`bottom`)){if(be.includes(`top`)&&r<0||be.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(be.includes(`left`)||be.includes(`right`))){if(be.includes(`left`)&&i<0||be.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ee(!0),(t=ne.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ne.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ue&&!n.jsx&&ae!==`loading`?J.createElement(`button`,{"aria-label":T,"data-disabled":Se,"data-close-button":!0,onClick:Se||!W?()=>{}:()=>{Ce(),n.onDismiss==null||n.onDismiss.call(n,n)},className:CP(C?.closeButton,n?.classNames?.closeButton)},w?.close??oP):null,(ae||n.icon||n.promise)&&n.icon!==null&&(w?.[ae]!==null||n.icon)?J.createElement(`div`,{"data-icon":``,className:CP(C?.icon,n?.classNames?.icon)},ae===`loading`?n.icon||we():n.promise?we():null,ae===`loading`?null:Te):null,J.createElement(`div`,{"data-content":``,className:CP(C?.content,n?.classNames?.content)},J.createElement(`div`,{"data-title":``,className:CP(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?J.createElement(`div`,{"data-description":``,className:CP(v,ce,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),J.isValidElement(n.cancel)?n.cancel:n.cancel&&mP(n.cancel)?J.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{mP(n.cancel)&&W&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ce())},className:CP(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,J.isValidElement(n.action)?n.action:n.action&&mP(n.action)?J.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{mP(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ce())},className:CP(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function EP(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function DP(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?_P:gP;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var OP=J.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=hP,toastOptions:g,dir:_=EP(),gap:v=bP,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=J.useState([]),w=J.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=J.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=J.useState([]),[O,k]=J.useState(!1),[A,j]=J.useState(!1),[M,N]=J.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=J.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=J.useRef(null),L=J.useRef(!1),R=J.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||dP.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return J.useEffect(()=>dP.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{cC.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),J.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),J.useEffect(()=>{S.length<=1&&k(!1)},[S]),J.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),J.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[P.current]),J.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?J.createElement(`ol`,{key:t,dir:_===`auto`?EP():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${yP}px`,"--gap":`${v}px`,...m,...DP(l,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>J.createElement(TP,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))});function kP({className:e,...t}){return(0,Y.jsx)(`label`,{"data-slot":`label`,className:X(`flex items-center gap-2 text-ui leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var AP=`data-valid`,jP=`data-invalid`,MP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},NP={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},PP={valid(e){return e===null?null:e?{[AP]:``}:{[jP]:``}}},FP=`data-checked`,IP=`data-unchecked`,LP={checked(e){return e?{[FP]:``}:{[IP]:``}},...bb,...PP},RP={invalid:void 0,name:void 0,validityData:{state:MP,errors:[],error:``,value:``,initialValue:null},setValidityData:dy,disabled:void 0,setTouched:dy,setDirty:dy,setFilled:dy,setFocused:dy,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:NP,registerFieldControl:dy,validation:{getValidationProps:(e,t=py)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:dy,getInputControl:()=>null,commit:async()=>{},change:dy}},zP=J.createContext(RP);function BP(e=!0){let t=J.useContext(zP);if(t.setValidityData===dy&&!e)throw Error(qv(28));return t}function VP(e,t,n){let{setFocused:r,focusOwnerRef:i}=BP(),a=Z(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}var HP=J.createContext({disabled:!1});function UP(){return J.useContext(HP)}var WP=J.createContext({controlId:void 0,registerControlId:dy,resetControlId:dy,labelId:void 0,setLabelId:dy,messageIds:[],setMessageIds:dy,getDescriptionProps:e=>e});function GP(){return J.useContext(WP)}function KP(e,t,n,r=!0,i,a){let[o,s]=J.useState(),c=FE(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return Q(()=>{let i=e||t||l||!r?void 0:qP(n.current,c);o!==i&&s(i)}),u}function qP(e,t){let n=JP(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function JP(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function YP(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=GP(),o=FE(),s=Ev(()=>Symbol()),c=J.useRef(!1),l=J.useRef(!1),u=Z(()=>{c.current&&i!==dy&&(c.current=!1,i(s.current,void 0))});return Q(()=>{if(!n||i===dy){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Q(()=>u,[u]),(n?r:void 0)??t??o}var XP=J.createContext(void 0);function ZP(){return J.useContext(XP)}function QP(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var $P=J.createContext(void 0),eF=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,readOnly:a=!1,required:o=!1,"aria-labelledby":s,value:c,inputRef:l,nativeButton:u=!1,id:d,style:f,...p}=e,m=ZP(),{disabled:h,readOnly:g,required:_,form:v,checkedValue:y,touched:b=!1,validation:x,name:S,setCheckedValue:C=dy,setTouched:w=dy,registerInputRef:T=dy}=m??{},{setTouched:E,setFilled:D,state:O,disabled:k}=BP(),A=UP(),{labelId:j,getDescriptionProps:M}=GP(),N=k||A.disabled||h||i,P=g||a,F=_||o,I=v,L=m?y===c:c===``,R=J.useRef(null),ee=VP(N,R),z=J.useRef(null),B=x?.registerInput,V=ny(l,z,T,J.useCallback(e=>B?.(e,{controlRef:R,value:void 0}),[B]));Q(()=>{z.current?.checked&&D(!0)},[D]),Q(()=>{z.current&&T(N&&L?null:z.current)},[L,N,T]);let te=FE(),H=YP({id:d}),U=u?void 0:H,ne={role:`radio`,"aria-checked":L,"aria-labelledby":KP(s,j,z,!u,U,p[`aria-label`]),[ok]:L?``:void 0,id:u?H:te,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){if(e.defaultPrevented||N||P)return;e.preventDefault();let t=z.current;t&&Qv(t,e)},onFocus(e){ee(!0),!(e.defaultPrevented||N||P||!b)&&(z.current?.click(),w(!1))},onBlur(){m||ee(!1)}},{getButtonProps:re,buttonRef:ie}=$v({disabled:N,native:u,composite:!1}),ae={type:`radio`,ref:V,form:I,id:U,name:S,tabIndex:-1,style:S?Ax:kx,"aria-hidden":!0,...c===void 0?py:{value:QP(c)},disabled:N,checked:L,required:F,readOnly:P,onChange(e){if(e.nativeEvent.defaultPrevented||N||P||c===void 0)return;let t=Yb(Zb,e.nativeEvent);C(c,t),!t.isCanceled&&E(!0)},onClick(e){e.stopPropagation()},onFocus(){R.current?.focus()}},oe=J.useMemo(()=>({...O,required:F,disabled:N,readOnly:P,checked:L}),[O,N,P,L,F]),W=oe,se=m!==void 0,ce=[t,R,ie],le=[ne,p,re,M,x?e=>x.getValidationProps(N,e):py],ue=_y(`span`,e,{enabled:!se,state:oe,ref:ce,props:le,stateAttributesMapping:LP});return(0,Y.jsxs)($P.Provider,{value:W,children:[se?(0,Y.jsx)(qM,{tag:`span`,render:n,className:r,style:f,state:oe,refs:ce,props:le,stateAttributesMapping:LP}):ue,(0,Y.jsx)(`input`,{...ae,suppressHydrationWarning:!0})]})});function tF(e,t,n,r,i=!0,a){let{registerFieldControl:o}=BP(),s=Ev(()=>Symbol());Q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var nF=J.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:dy,validationMode:`onSubmit`,submitCountRef:{current:0}});function rF(){return J.useContext(nF)}Object.keys(MP);function iF(e,t){return e.matches(`:disabled`)?!1:!t||e.form===t||e.form===null&&!e.hasAttribute(`form`)}var aF=J.createContext(void 0);function oF(e=!1){let t=J.useContext(aF);if(!t&&!e)throw Error(qv(86));return t}var sF=[wk],cF=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i,readOnly:a,required:o,onValueChange:s,value:c,defaultValue:l,form:u,name:d,inputRef:f,id:p,style:m,...h}=e,{setTouched:g,setFocused:_,validationMode:v,name:y,disabled:b,state:x,validation:S,setDirty:C,setFilled:w,validityData:T}=BP(),{labelId:E}=GP(),{clearErrors:D,elementRef:O}=rF(),k=oF(!0),A=b||i,j=y??d,M=FE(p),[N,P]=UO({controlled:c,default:l,name:`RadioGroup`,state:`value`}),[F,I]=J.useState(!1),L=Z((e,t)=>{s?.(e,t),!t.isCanceled&&P(e)}),R=S.getInputControl,ee=J.useMemo(()=>({get current(){return R()}}),[R]),z=J.useRef(null),B=J.useRef(null),V=ny(z,f),te=J.useRef(V),H=Z(e=>{(z.current!==e||te.current!==V)&&(te.current=V,V?.(e))});Q(()=>{H(z.current)},[V,H]);let U=Z(e=>{if(e){if(!e.disabled){B.current||=e;let t=z.current;(e.checked||t==null||t.disabled)&&H(e)}return()=>{B.current===e&&(B.current=null),z.current===e&&H(null)}}}),ne=Z(()=>{let e=O.current;if(!e)return N??null;for(let t of S.registeredInputs.keys())if(t.checked&&iF(t,e))return N??null;return null});tF(ee,M,N??null,ne,!A,d),Yj(N,()=>{D(j),C(N!==T.initialValue),w(N!=null),S.change(N);let e=B.current;N==null&&e&&!e.disabled&&H(e)});let re=E??k?.legendId,ie={...x,disabled:A??!1,required:o??!1,readOnly:a??!1},ae=J.useMemo(()=>({checkedValue:N,disabled:A,form:u,validation:S,name:j,readOnly:a,registerInputRef:U,required:o,setCheckedValue:L,setTouched:I,touched:F}),[N,A,u,S,j,a,U,o,L,I,F]),oe={id:p,role:`radiogroup`,"aria-required":o||void 0,"aria-disabled":A||void 0,"aria-readonly":a||void 0,"aria-labelledby":re,onBlur(e){sb(e.currentTarget,e.relatedTarget)||(I(!1),g(!0),_(!1),v===`onBlur`&&S.commit(N))},onKeyDownCapture(e){e.key.startsWith(`Arrow`)&&I(!0)}};return(0,Y.jsx)(XP.Provider,{value:ae,children:(0,Y.jsx)(Pk,{render:n,className:r,style:m,state:ie,props:[oe,h,e=>S.getValidationProps(A??!1,e)],refs:[t],stateAttributesMapping:PP,enableHomeAndEndKeys:!1,modifierKeys:sF})})});function lF({className:e,...t}){return(0,Y.jsx)(cF,{"data-slot":`radio-group`,className:X(`grid w-full gap-2`,e),...t})}function uF({className:e,...t}){return(0,Y.jsx)(eF,{"data-slot":`radio-group-segment`,className:X(`inline-flex h-7 items-center gap-1.5 rounded-sm px-2.5 text-ui font-medium text-muted-foreground hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-secondary data-checked:text-foreground data-checked:inset-ring data-checked:inset-ring-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...t})}var dF=`rounded-lg border border-review-changes/25 bg-review-changes-bg px-3 py-2 text-review-changes`,fF=`rounded-lg border border-review-pending/25 bg-review-pending-bg px-3 py-2 text-review-pending`;function pF({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`skeleton`,className:X(`animate-pulse rounded-md bg-muted`,e),...t})}var mF=({lines:e=7})=>(0,Y.jsxs)(`div`,{role:`status`,"aria-label":`Loading the diff`,className:`overflow-hidden rounded-lg border bg-card`,children:[(0,Y.jsxs)(`div`,{className:`flex h-10 items-center gap-3 border-b px-3`,children:[(0,Y.jsx)(pF,{className:`h-3 w-3`}),(0,Y.jsx)(pF,{className:`h-3 w-56`}),(0,Y.jsx)(pF,{className:`ml-auto h-3 w-12`})]}),(0,Y.jsx)(`div`,{className:`flex flex-col py-1`,children:Array.from({length:e},(e,t)=>(0,Y.jsxs)(`div`,{className:`flex h-5 items-center gap-3 px-3`,children:[(0,Y.jsx)(pF,{className:`h-2.5 w-8`}),(0,Y.jsx)(pF,{className:`h-2.5`,style:{width:`${30+t*37%55}%`}})]},t))})]}),hF=({rows:e=8})=>(0,Y.jsxs)(`div`,{role:`status`,"aria-label":`Loading the files`,className:`flex flex-col gap-2 px-1`,children:[(0,Y.jsx)(pF,{className:`h-7 w-full`}),Array.from({length:e},(e,t)=>(0,Y.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,style:{paddingLeft:`${t%3*12}px`},children:[(0,Y.jsx)(pF,{className:`h-2.5 flex-1`}),(0,Y.jsx)(pF,{className:`h-2.5 w-10`})]},t))]}),gF=J.createContext(void 0);function _F(){let e=J.useContext(gF);if(e===void 0)throw Error(qv(63));return e}var vF=`data-checked`,yF=`data-unchecked`,bF={...PP,checked(e){return e?{[vF]:``}:{[yF]:``}}},xF=J.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:b}=rF(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,validationMode:E,disabled:D,name:O,validation:k}=BP(),{labelId:A}=GP(),j=D||m,M=O??l,N=J.useRef(null),P=ny(N,c,k.inputRef),F=J.useRef(null),I=VP(j,F),L=FE(),R=YP({id:s}),ee=u?void 0:R,[z,B]=UO({controlled:n,default:!!i,name:`Switch`,state:`checked`});tF(F,L,z,void 0,!j,l),Q(()=>{T(z)},[z,T]),Yj(z,()=>{b(M),C(z!==w.initialValue),k.change(z)});let{getButtonProps:V,buttonRef:te}=$v({disabled:j,native:u}),H=KP(a,A,N,!u,ee,y[`aria-label`]),U={id:u?R:L,role:`switch`,"aria-checked":z,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":H,onFocus(){I(!0)},onBlur(){let e=N.current;e&&!j&&(S(!0),I(!1),E===`onBlur`&&k.commit(e.checked))},onClick(e){if(f||j)return;e.preventDefault();let t=N.current;t&&Qv(t,e)}},ne={...k.getValidationProps(j),checked:z,disabled:j,form:o,id:ee,name:M,required:p,style:M?Ax:kx,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:P,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=Yb(Zb,e.nativeEvent);d?.(t,n),!n.isCanceled&&B(t)},onClick(e){e.stopPropagation()},onFocus(){F.current?.focus()},..._===void 0?py:{value:_}},re=J.useMemo(()=>({...x,checked:z,disabled:j,readOnly:f,required:p}),[x,z,j,f,p]),ie=_y(`span`,e,{state:re,ref:[t,F,te],props:[U,y,V,e=>k.getValidationProps(j,e)],stateAttributesMapping:bF});return(0,Y.jsxs)(gF.Provider,{value:re,children:[ie,!z&&M&&g!==void 0&&(0,Y.jsx)(`input`,{type:`hidden`,form:o,name:M,value:g,disabled:j}),(0,Y.jsx)(`input`,{...ne,suppressHydrationWarning:!0})]})}),SF=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return _y(`span`,e,{state:_F(),ref:t,stateAttributesMapping:bF,props:a})});function CF({className:e,size:t=`default`,...n}){return(0,Y.jsx)(xF,{"data-slot":`switch`,"data-size":t,className:X(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,Y.jsx)(SF,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0`})})}var wF=[{scope:`global`,title:`Anywhere`},{scope:`diff`,title:`In the code`},{scope:`overview`,title:`In the overview`},{scope:`tree`,title:`In the file tree`},{scope:`composer`,title:`Writing a comment or review`},{scope:`picker`,title:`On the pull requests page`}],TF=({open:e,onOpenChange:t,ids:n})=>{let r=Hk.filter(e=>n===void 0||n.includes(e.id)),[i,a]=iA(),o=(0,J.useMemo)($k,[]),s=(0,J.useId)();return(0,Y.jsx)(Qj,{open:e,onOpenChange:t,children:(0,Y.jsxs)(tM,{className:`max-h-[85vh] overflow-y-auto sm:max-w-lg`,children:[(0,Y.jsxs)(nM,{children:[(0,Y.jsx)(rM,{children:`Keyboard shortcuts`}),(0,Y.jsx)(iM,{children:`Keys don't fire while you type in a field.`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border p-3`,children:[(0,Y.jsxs)(kP,{htmlFor:s,className:`leading-snug`,children:[`Single-key shortcuts`,(0,Y.jsx)(`span`,{className:`block text-caption font-normal text-muted-foreground`,children:`Letter keys like n and c. Off if they get in the way of speech input or another tool.`})]}),(0,Y.jsx)(CF,{id:s,checked:i,onCheckedChange:a})]}),wF.filter(({scope:e})=>r.some(t=>t.scope===e)).map(({scope:e,title:t})=>(0,Y.jsxs)(`section`,{"aria-label":t,className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`h3`,{className:`text-caption font-medium text-muted-foreground`,children:t}),(0,Y.jsx)(`dl`,{className:`flex flex-col`,children:r.filter(t=>t.scope===e).map(e=>{let t=!i&&e.chords.every(qk);return(0,Y.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-4 border-b py-1 last:border-0`,children:[(0,Y.jsxs)(`dt`,{className:t?`text-muted-foreground line-through`:void 0,children:[e.action,t&&(0,Y.jsx)(`span`,{className:`sr-only`,children:` (off)`})]}),(0,Y.jsx)(`dd`,{className:`flex gap-2`,children:e.chords.map(e=>(0,Y.jsx)(sA,{children:Yk(e,o).map(e=>(0,Y.jsx)(oA,{children:e},e))},Yk(e,o).join(` `)))})]},e.id)})})]},e))]})})},EF,DF=(e,t)=>{if(EF??=document.createElement(`canvas`).getContext(`2d`),EF===null)return null;let n=getComputedStyle(e);return EF.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,EF.letterSpacing=n.letterSpacing===`normal`?`0px`:n.letterSpacing,EF.measureText(t).width},OF=(e,t)=>{if(t(),document.fonts?.ready.then(t),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},kF=J.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=BP(),{clearErrors:S,elementRef:C,submitCountRef:w}=rF(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=GP(),k=YP({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=Z(()=>x.inputRef.current?.value);tF(x.inputRef,k,j,M,!T,a),Q(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),Yj(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=J.useRef(null),P=VP(T,N),F=zy();return _y(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=Yb(Zb,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;F.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:PP})}),AF=J.forwardRef(function(e,t){return(0,Y.jsx)(kF,{ref:t,...e})});function jF({className:e,type:t,...n}){return(0,Y.jsx)(AF,{type:t,"data-slot":`input`,className:X(`h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-ui transition-colors file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-ui file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,e),...n})}var MF=J.createContext(void 0);function NF(){let e=J.useContext(MF);if(e===void 0)throw Error(qv(53));return e}function PF(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=`${t}${n===`x`?`Inline`:`Block`}`,a=parseFloat(r[`${i}Start`]);return n===`x`&&t===`margin`?a*2:a+parseFloat(r[`${i}End`])}var FF=`base-ui-disable-scrollbar`,IF={className:FF,getElement(e){return(0,Y.jsx)(`style`,{nonce:e,href:FF,precedence:`base-ui:low`,children:`.${FF}{scrollbar-width:none}.${FF}::-webkit-scrollbar{display:none}`})}},LF=`data-has-overflow-x`,RF=`data-has-overflow-y`,zF=`data-overflow-x-start`,BF=`data-overflow-x-end`,VF=`data-overflow-y-start`,HF=`data-overflow-y-end`,UF=e=>t=>t?{[e]:``}:null,WF={hasOverflowX:UF(LF),hasOverflowY:UF(RF),overflowXStart:UF(zF),overflowXEnd:UF(BF),overflowYStart:UF(VF),overflowYEnd:UF(HF),cornerHidden:()=>null},GF=`--scroll-area-corner-height`,KF=`--scroll-area-corner-width`,qF=`data-orientation`,JF={x:0,y:0},YF={width:0,height:0},XF={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},ZF={x:!0,y:!0,corner:!0},QF=J.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,style:a,...o}=e,{xStart:s,xEnd:c,yStart:l,yEnd:u}=$F(i),d=FE(),f=zy(),p=zy(),{nonce:m,disableStyleElements:h}=mk(),[g,_]=J.useState(!1),[v,y]=J.useState(!1),[b,x]=J.useState(!1),[S,C]=J.useState(!1),[w,T]=J.useState(!1),[E,D]=J.useState(YF),[O,k]=J.useState(YF),[A,j]=J.useState(XF),[M,N]=J.useState(ZF),P=J.useRef(null),F=J.useRef(null),I=J.useRef(null),L=J.useRef(null),R=J.useRef(null),ee=J.useRef(null),z=J.useRef(null),B=J.useRef(null),V=J.useRef(0),te=J.useRef(0),H=J.useRef(0),U=J.useRef(0),ne=J.useRef(`vertical`),re=J.useRef(JF),ie=J.useRef(null);function ae(e){let t=e?x:y,n=e?f:p;t(!0),n.start(500,()=>{t(!1)})}let oe=Z(e=>{let t=e.x-re.current.x,n=e.y-re.current.y;re.current=e,n!==0&&ae(!0),t!==0&&ae(!1)}),W=Z(()=>{let e=F.current;e&&ie.current===null&&(ie.current=e.style.scrollSnapType,e.style.scrollSnapType=`none`)}),se=Z(e=>{if(e.button!==0||B.current!==null&&(ne.current===`vertical`?R.current:ee.current)?.hasPointerCapture(B.current))return;B.current=e.pointerId,V.current=e.clientY,te.current=e.clientX,ne.current=e.currentTarget.getAttribute(qF);let t=F.current;t&&(H.current=t.scrollTop,U.current=t.scrollLeft,W()),(ne.current===`vertical`?R.current:ee.current)?.setPointerCapture(e.pointerId)}),ce=Z(e=>{if(e.pointerId!==B.current)return;B.current=null,(ne.current===`vertical`?x:y)(!1),ie.current!==null&&(F.current&&(F.current.style.scrollSnapType=ie.current),ie.current=null);let t=ne.current===`vertical`?R.current:ee.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),le=Z(e=>{if(e.pointerId!==B.current)return;if(e.buttons%2==0){ce(e);return}let t=F.current;if(!t)return;let n=ne.current===`vertical`,r=n?R.current:ee.current,i=n?I.current:L.current;if(!r||!i)return;let a=n?`y`:`x`,o=PF(i,`padding`,a),s=PF(r,`margin`,a),c=n?r.offsetHeight:r.offsetWidth,l=(n?i.offsetHeight:i.offsetWidth)-c-o-s,u=n?e.clientY-V.current:e.clientX-te.current,d=l<=0?0:u/l,f=n?t.scrollHeight:t.scrollWidth,p=n?t.clientHeight:t.clientWidth,m=(n?H.current:U.current)+d*(f-p);n?t.scrollTop=m:t.scrollLeft=m,e.preventDefault(),ae(n)});function ue(e){C(e.pointerType===`touch`)}function de(e){if(ue(e),e.pointerType!==`touch`){let t=sb(P.current,e.target);_(t)}}let fe=J.useMemo(()=>({scrolling:v||b,hasOverflowX:!M.x,hasOverflowY:!M.y,overflowXStart:A.xStart,overflowXEnd:A.xEnd,overflowYStart:A.yStart,overflowYEnd:A.yEnd,cornerHidden:M.corner}),[v,b,M.x,M.y,M.corner,A]),pe={role:`presentation`,onPointerEnter:de,onPointerMove:de,onPointerDown:ue,onPointerLeave(){_(!1)},style:{position:`relative`,[GF]:`${E.height}px`,[KF]:`${E.width}px`}},me=_y(`div`,e,{state:fe,ref:[t,P],props:[pe,o],stateAttributesMapping:WF}),he=J.useMemo(()=>({handlePointerDown:se,handlePointerMove:le,handlePointerUp:ce,handleScroll:oe,disableViewportSnap:W,cornerSize:E,setCornerSize:D,thumbSize:O,setThumbSize:k,hasMeasuredScrollbar:w,setHasMeasuredScrollbar:T,touchModality:S,cornerRef:z,scrollingX:v,scrollingY:b,hovering:g,setHovering:_,viewportRef:F,scrollbarYRef:I,scrollbarXRef:L,thumbYRef:R,thumbXRef:ee,rootId:d,hiddenState:M,setHiddenState:N,overflowEdges:A,setOverflowEdges:j,viewportState:fe,overflowEdgeThreshold:{xStart:s,xEnd:c,yStart:l,yEnd:u}}),[se,le,ce,oe,W,E,O,w,S,v,b,g,d,M,A,fe,s,c,l,u]);return(0,Y.jsxs)(MF.Provider,{value:he,children:[!h&&IF.getElement(m),me]})});function $F(e){let t=typeof e==`number`?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}function eI(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var tI=J.createContext(void 0);function nI(e,t){return Math.max(0,e-t)}function rI(e,t){if(t<=0)return 0;let n=eI(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var iI=`--scroll-area-overflow-x-start`,aI=`--scroll-area-overflow-x-end`,oI=`--scroll-area-overflow-y-start`,sI=`--scroll-area-overflow-y-end`,cI=`--scroll-area-thumb-height`,lI=`--scroll-area-thumb-width`,uI=[iI,aI,oI,sI],dI=!1;function fI(){dI||Zy||(typeof CSS<`u`&&`registerProperty`in CSS&&uI.forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),dI=!0)}var pI=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{viewportRef:o,scrollbarYRef:s,scrollbarXRef:c,thumbYRef:l,thumbXRef:u,cornerRef:d,cornerSize:f,setCornerSize:p,setThumbSize:m,rootId:h,setHiddenState:g,hiddenState:_,setHasMeasuredScrollbar:v,handleScroll:y,touchModality:b,setHovering:x,setOverflowEdges:S,overflowEdgeThreshold:C,viewportState:w}=NF(),T=VE(),E=J.useRef(!0),D=J.useRef([NaN,NaN,NaN,NaN]),O=zy(),k=zy(),A=Z(()=>{let e=o.current,t=s.current,n=c.current,r=l.current,i=u.current,a=d.current;if(!e)return;let h=e.scrollHeight,_=e.scrollWidth,y=e.clientHeight,b=e.clientWidth,x=e.scrollTop,w=e.scrollLeft,E=D.current,O=Number.isNaN(E[0]);if(E[0]=y,E[1]=h,E[2]=b,E[3]=_,O&&v(!0),h===0||_===0)return;let k=mI(e),A=k.y,j=k.x,M=b/_,N=y/h,P=Math.max(0,_-b),F=Math.max(0,h-y),I=0,L=0;j||(I=rI(T===`rtl`?-w:w,P),L=P-I);let R=A?0:rI(x,F),ee=A?0:F-R,z=j?0:b,B=A?0:y,V=0,te=0;!j&&!A&&(V=t?.offsetWidth||0,te=n?.offsetHeight||0);let H=f.width===0&&f.height===0,U=H?V:0,ne=H?te:0,re=PF(n,`padding`,`x`),ie=PF(t,`padding`,`y`),ae=PF(i,`margin`,`x`),oe=PF(r,`margin`,`y`),W=z-re-ae,se=B-ie-oe,ce=n?Math.min(n.offsetWidth-U,W):W,le=t?Math.min(t.offsetHeight-ne,se):se,ue=Math.max(16,ce*M),de=Math.max(16,le*N);if(m(e=>hI(e,{width:ue,height:de})),t&&r){let e=gI(r,cI,x,F,h,de,t.offsetHeight-de-ie-oe);r.style.transform=`translate3d(0,${e}px,0)`}if(n&&i){let e=n.offsetWidth-ue-re-ae,t=gI(i,lI,T===`rtl`?-w:w,P,_,ue,e);i.style.transform=`translate3d(${T===`rtl`?-t:t}px,0,0)`}let fe=[I,L,R,ee];uI.forEach((t,n)=>{e.style.setProperty(t,`${fe[n]}px`)}),a&&p(e=>hI(e,{width:V,height:te})),g(e=>hI(e,k));let pe={xStart:!j&&I>C.xStart,xEnd:!j&&L>C.xEnd,yStart:!A&&R>C.yStart,yEnd:!A&&ee>C.yEnd};S(e=>hI(e,pe))});Q(()=>{fI()},[]),Q(()=>{queueMicrotask(A)},[A,_,T,C.xStart,C.xEnd,C.yStart,C.yEnd]),Q(()=>{o.current?.matches(`:hover`)&&x(!0)},[o,x]),Q(()=>{let e=o.current;if(typeof ResizeObserver>`u`||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;let n=D.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}A()});return n.observe(e),k.start(0,()=>{let t=ew(e,{subtree:!0});t.length!==0&&Promise.allSettled(t.map(e=>e.finished.then(dy))).then(A).catch(()=>{})}),()=>{n.disconnect(),k.clear()}},[A,o,k]);function j(){E.current=!1}let M={...h&&{"data-id":`${h}-viewport`},tabIndex:_.x&&_.y?-1:0,className:IF.className,style:{overflow:`scroll`},onScroll(){o.current&&(A(),(b||!E.current)&&y({x:o.current.scrollLeft,y:o.current.scrollTop}),O.start(100,()=>{E.current=!0}))},onWheel:j,onPointerMove:j,onPointerEnter:j,onKeyDown:j},N=_y(`div`,e,{ref:[t,o],state:w,props:[M,a],stateAttributesMapping:WF}),P=J.useMemo(()=>({computeThumbPosition:A}),[A]);return(0,Y.jsx)(tI.Provider,{value:P,children:N})});function mI(e){let t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function hI(e,t){for(let n in t)if(e[n]!==t[n])return t;return e}function gI(e,t,n,r,i,a,o){let s=eI(n,0,r),c=n-s,l=Math.max(16,a*i/(i+Math.abs(c)));return e.style.setProperty(t,c?`${l}px`:``),(r?s/r*o:0)+(c>0?a-l:0)}var _I=J.createContext(void 0);function vI(){let e=J.useContext(_I);if(e===void 0)throw Error(qv(54));return e}var yI=J.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,style:o,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,scrollbarYRef:f,scrollbarXRef:p,viewportRef:m,thumbYRef:h,thumbXRef:g,handlePointerDown:_,handlePointerUp:v,handleScroll:y,disableViewportSnap:b,rootId:x,thumbSize:S,hasMeasuredScrollbar:C,viewportState:w}=NF(),T=i===`vertical`,E={...w,hovering:c,scrolling:T?u:l,orientation:i},D=VE(),O=!C&&!a,k=T?d.y:d.x,A=a||!k;J.useEffect(()=>{if(!A)return;let e=m.current,t=T?f.current:p.current;if(!t)return;function n(t){if(!e||t.ctrlKey)return;let n=!T,r=n?`scrollLeft`:`scrollTop`,i=n?t.deltaX:t.deltaY;if(i===0)return;let a=n?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,o=n&&D===`rtl`?-a:0,s=n&&D===`rtl`?0:a,c=e[r];c<=o&&i<0||c>=s&&i>0||(t.preventDefault(),e[r]=Math.min(s,Math.max(o,c+i)),y({x:e.scrollLeft,y:e.scrollTop}))}return bx(t,`wheel`,n,{passive:!1})},[D,y,T,p,f,A,m]);let j={...x&&{"data-id":`${x}-scrollbar`},"aria-hidden":!0,onPointerDown(e){if(e.button!==0)return;let t=lb(e.nativeEvent),n=T?h.current:g.current;if(n&&sb(n,t))return;let r=m.current;if(!r)return;let i=T?f.current:p.current;if(!n||!i)return;let a=T?`y`:`x`,o=PF(n,`margin`,a),s=PF(i,`padding`,a),c=T?n.offsetHeight:n.offsetWidth,l=i.getBoundingClientRect(),u=T?e.clientY-l.top-c/2-s+o/2:e.clientX-l.left-c/2-s+o/2,d=T?r.scrollHeight:r.scrollWidth,v=T?r.clientHeight:r.clientWidth,x=(T?i.offsetHeight:i.offsetWidth)-c-s-o;if(x<=0)return;let S=u/x,C=d-v;b(),T?r.scrollTop=S*C:r.scrollLeft=D===`rtl`?-(1-S)*C:S*C,y({x:r.scrollLeft,y:r.scrollTop}),_(e)},onMouseDown(e){e.preventDefault()},onPointerUp:v,onPointerCancel:v,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,visibility:O?`hidden`:void 0,...T?{top:0,bottom:`var(${GF})`,insetInlineEnd:0,[cI]:`${S.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${KF})`,bottom:0,[lI]:`${S.width}px`}}},M=_y(`div`,e,{ref:[t,T?f:p],state:E,props:[j,s],stateAttributesMapping:WF});return A?(0,Y.jsx)(_I.Provider,{value:i,children:M}):null}),bI=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,scrollingX:d,scrollingY:f,hasMeasuredScrollbar:p}=NF(),m=vI(),h=m===`vertical`;return _y(`div`,e,{ref:[t,h?o:s],state:{scrolling:h?f:d,orientation:m},props:[{onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,style:{visibility:p?void 0:`hidden`,...h?{height:`var(--scroll-area-thumb-height)`}:{width:`var(--scroll-area-thumb-width)`}}},a]})}),xI=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{cornerRef:o,cornerSize:s,hiddenState:c}=NF(),l=_y(`div`,e,{ref:[t,o],props:[{"aria-hidden":!0,style:{position:`absolute`,bottom:0,insetInlineEnd:0,width:s.width,height:s.height}},a]});return c.corner?null:l});function SI({className:e,children:t,...n}){return(0,Y.jsxs)(QF,{"data-slot":`scroll-area`,className:X(`relative`,e),...n,children:[(0,Y.jsx)(pI,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] -outline-offset-2`,children:t}),(0,Y.jsx)(CI,{}),(0,Y.jsx)(xI,{})]})}function CI({className:e,orientation:t=`vertical`,...n}){return(0,Y.jsx)(yI,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:X(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:(0,Y.jsx)(bI,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}var wI=(e,t)=>{let n=t.toLowerCase().split(/\s+/).filter(Boolean);return e.filter(e=>{let t=e.path.toLowerCase();return n.every(e=>t.includes(e))})},TI=`…`,EI=e=>e.match(/[A-Z]?[a-z0-9]+|[A-Z]+(?![a-z])|[^A-Za-z0-9]+/g)??[e],DI=(e,t,n)=>{for(let r=1;r<=e.length-2;r++)for(let i=Math.ceil((e.length-r)/2);i>=1;i--){if(i+r>e.length-1)continue;let a=[...e.slice(0,i),TI,...e.slice(i+r)].join(t);if(n(a))return a}return null},OI=(e,t)=>{if(t(e))return e;let n=EI(e);if(n.length>2&&n.join(``)===e){let e=DI(n,``,t);if(e!==null)return e}let r=Math.min(8,e.length>>1),i=e;for(let n=e.length-r-1;n>=3;n--)if(i=`${e.slice(0,n)}${TI}${e.slice(-r)}`,t(i))return i;return i},kI=(e,t)=>{if(t(e))return e;let n=e.split(/(?<=[-_.])(?=.)/);for(let e=1;e<=n.length-2;e++)for(let r=Math.ceil((n.length-e)/2);r>=1;r--){if(r+e>n.length-1)continue;let i=n[r+e-1]?.slice(-1)??``,a=`${n.slice(0,r).join(``)}${TI}${i}${n.slice(r+e).join(``)}`;if(t(a))return a}return OI(e,t)},AI=(e,t)=>{if(t(e))return e;let n=e.split(`/`);return n.length<2?e:DI(n,`/`,t)??`${TI}/${n.at(-1)??``}`},jI=e=>{let t=/(?<=.)\.[a-z][a-z0-9]{0,9}$/.exec(e)?.[0]??``;return[e.slice(0,e.length-t.length),t]},MI=e=>{let t=e.split(`/`);for(let e=0;e<t.length-2;e++){let n=t[e]??``;if(!n.includes(`.`)||t[e+1]!==`src`)continue;let r=n.split(`.`);if(t.slice(e+2,e+2+r.length).join(`.`)===n&&!(e+2+r.length>=t.length)){t.splice(e+1,1+r.length);break}}return t.join(`/`)},NI=(e,t)=>{let n=MI(e).split(`/`),r=MI(t).split(`/`);for(let e=0;e<Math.min(n.length,r.length);e++){let t=n[e]??``,i=r[e]??``;if(t===i)continue;let a=e<n.length-1;if(a!==e<r.length-1)return a?-1:1;let o=t.toLowerCase().localeCompare(i.toLowerCase(),`en`);return o===0?t<i?-1:1:o}return n.length-r.length},PI=e=>e.slice(0,Math.max(e.lastIndexOf(`/`),0)),FI=e=>e.slice(e.lastIndexOf(`/`)+1),II=e=>{let t={directories:new Map,files:[]};for(let n of e){let e=t;for(let t of MI(n).split(`/`).slice(0,-1)){let n=e.directories.get(t)??{directories:new Map,files:[]};e.directories.set(t,n),e=n}e.files.push(n)}let n=(e,t,n,r)=>{let i=e,a=t,o=n===``?e:`${n}/${e}`;for(let[e]=a.directories;a.files.length===0&&a.directories.size===1&&e!==void 0;[e]=a.directories)i=`${i}/${e[0]}`,o=`${o}/${e[0]}`,a=e[1];return{label:`${r}${i}`,path:o,inner:a}},r=(t,n,r)=>({kind:`directory`,path:n,label:t,folder:OO(n,e),children:a(r,n)}),i=e=>e.sort((e,t)=>NI(e.kind===`file`?e.path:`${e.path}/x`,t.kind===`file`?t.path:`${t.path}/x`)),a=(e,t)=>i([...[...e.directories].map(([e,i])=>{let{label:a,path:o,inner:s}=n(e,i,t,``);return r(a,o,s)}),...e.files.map(e=>({kind:`file`,path:e,name:FI(e)}))]),o=(e,t,i)=>[...e.directories].flatMap(([e,a])=>{let{label:s,path:c,inner:l}=n(e,a,t,i),u=s.slice(i.length);return l.files.length===0&&l.directories.size>1&&!u.includes(`.`)?o(l,c,`${s}/`):[{prefix:i,heading:r(s,c,l)}]}),s=o(t,``,``).sort((e,t)=>NI(`${e.heading.path}/x`,`${t.heading.path}/x`)),c=[];for(let e=0;e<s.length;){let t=s[e]?.prefix??``,n=e+1;for(;t!==``&&s[n]?.heading.path.startsWith(t);)n++;let r=s.slice(e,n).map(({heading:e})=>e);c.push(...r.length<2?r:[{kind:`group`,path:t.slice(0,-1),children:r.map(e=>({...e,label:e.path.slice(t.length)}))}]),e=n}return[...c,...i(t.files.map(e=>({kind:`file`,path:e,name:FI(e)})))]},LI=e=>e.flatMap(e=>e.kind===`file`?[e.path]:LI(e.children)),RI={added:`new file`,modified:`modified`,deleted:`deleted`,renamed:`renamed`},zI=(e,t)=>`${e} ${t}${e===1?``:`s`}`,BI=e=>e.status===`renamed`?e.oldPath??null:null,VI=e=>{let{finding:t=0,risk:n=0}=e.points??{},r=BI(e),i=r===null?``:` from ${r}`;return[FI(e.path),`${TO(e.path,e.status).label}, ${RI[e.status]}${i}`,e.additions>0?`${zI(e.additions,`line`)} added`:``,e.deletions>0?`${zI(e.deletions,`line`)} removed`:``,(e.threads??0)>0?zI(e.threads??0,`open thread`):``,t>0?zI(t,`finding`):``,n>0?zI(n,`risk`):``,PI(e.path)===``?``:`in ${PI(e.path)}`].filter(Boolean).join(`, `)},HI=e=>{let t=RI[e.status],n=BI(e),r=n===null?``:` · was ${FI(n)}`;return`${e.path}\n${t[0]?.toUpperCase()}${t.slice(1)}${r}`},UI=({files:e,activePath:t,onSelect:n,navigate:r=!1,className:i})=>{let a=(0,J.useRef)(null),o=(0,J.useRef)(null),s=(0,J.useRef)(null),[c,l]=(0,J.useState)(``),[u,d]=(0,J.useState)(`all`),[f,p]=(0,J.useState)(new Set),[m,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(t);if(g!==t){_(t);let e=t===null?null:MI(t),n=[...f].filter(t=>e?.startsWith(`${t}/`));n.length>0&&p(new Set([...f].filter(e=>!n.includes(e))))}aA({filterTree:()=>s.current?.focus()});let v=(0,J.useMemo)(()=>new Map(e.map(e=>[e.path,e])),[e]),y=(0,J.useMemo)(()=>II(e.map(e=>e.path)),[e]),b=e.filter(e=>(e.points?.finding??0)>0).length,x=e.filter(e=>(e.points?.risk??0)>0).length,S=(0,J.useMemo)(()=>{let t=new Set(wI(e,c).map(e=>e.path));return new Set(e.filter(e=>t.has(e.path)).filter(e=>u===`all`||(e.points?.[u]??0)>0).map(e=>e.path))},[e,c,u]),C=c.trim()!==``,w=(0,J.useMemo)(()=>{let e=[],t=e=>e.kind===`file`?Number(S.has(e.path)):e.children.reduce((e,n)=>e+t(n),0),n=(r,i,a)=>{for(let o of r){if(o.kind===`group`){n(o.children,i,o.path);continue}if(o.kind===`file`){let t=v.get(o.path);t!==void 0&&S.has(t.path)&&e.push({kind:`file`,key:t.path,file:t,depth:i,group:a});continue}let r=t(o);if(r===0)continue;let s=C||!f.has(o.path);e.push({kind:`directory`,key:`${o.path}/`,label:o.label,entry:o,depth:i,group:a,open:s,count:r}),s&&n(o.children,i+1,a)}};return n(y,0,null),e},[y,v,S,f,C]),T=(0,J.useMemo)(()=>w.reduce((e,t)=>{let n=e.at(-1);return n!==void 0&&n.group===t.group?n.rows.push(t):e.push({group:t.group,rows:[t]}),e},[]),[w]),E=(0,J.useMemo)(()=>LI(y).filter(e=>S.has(e)),[y,S]),D=(0,J.useMemo)(()=>{let e=E.filter(e=>{let{finding:t=0,risk:n=0}=v.get(e)?.points??{};return t+n>0});return new Map(e.map((e,t)=>[e,t]))},[E,v]),O=e=>{let r=t===null?-1:E.indexOf(t),i=E[Math.min(E.length-1,Math.max(0,r+e))];i!==void 0&&n(i)};aA({nextFile:()=>O(1),previousFile:()=>O(-1)},r),(0,J.useEffect)(()=>{let e=a.current?.querySelector(`[data-slot=scroll-area-viewport]`),t=o.current?.querySelector(`[aria-selected=true]`);if(e==null||t==null)return;let n=t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;(n<e.scrollTop||n>e.scrollTop+e.clientHeight-40)&&(e.scrollTop=Math.max(0,n-e.clientHeight/3))},[t]);let k=w.find(e=>e.key===m)?.key??w.find(e=>e.kind===`file`&&e.file.path===t)?.key??w[0]?.key,A=e=>{e!==void 0&&(h(e),o.current?.querySelector(`[data-key="${CSS.escape(e)}"]`)?.focus())},j=e=>{let t=new Set(f);t.has(e)?t.delete(e):t.add(e),p(t)},M=e=>{h(e.key),e.kind===`file`?n(e.file.path):C||j(e.entry.path)};return(0,Y.jsxs)(`nav`,{ref:a,"aria-label":`Changed files`,className:X(`flex min-h-0 flex-col font-tree`,i),children:[(0,Y.jsxs)(`div`,{className:`px-2.5 pt-2.5 pb-1`,children:[(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(g_,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,Y.jsx)(jF,{ref:s,type:`text`,value:c,spellCheck:!1,autoComplete:`off`,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),l(``),e.currentTarget.blur()):e.key===`ArrowDown`&&(e.preventDefault(),A(k))},placeholder:`Filter files`,"aria-label":`Filter files by name or path`,className:`h-7.5 pl-7`})]}),(0,Y.jsxs)(`div`,{className:`mt-1 flex h-7 items-center justify-between text-caption text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:`tabular`,"aria-live":`polite`,children:S.size===e.length?`${e.length} files`:`${S.size} of ${e.length} files`}),(0,Y.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex gap-px`,children:[[`all`,`All`],[`finding`,`Findings ${b}`],[`risk`,`Risks ${x}`]].map(([e,t])=>(0,Y.jsx)(`button`,{type:`button`,"aria-pressed":u===e,onClick:()=>d(e),className:X(`tabular rounded-sm px-1.5 py-0.5 text-caption hover:text-foreground`,u===e&&`bg-secondary font-medium text-foreground`),children:t},e))})]})]}),w.length===0?(0,Y.jsxs)(`p`,{className:`border-t px-3 py-4 text-caption text-muted-foreground`,children:[`No files match.`,` `,(0,Y.jsx)(`button`,{type:`button`,onClick:()=>{l(``),d(`all`)},className:`text-primary underline`,children:`Clear filter`})]}):(0,Y.jsx)(SI,{className:`min-h-0 flex-1 border-t`,children:(0,Y.jsx)(`div`,{ref:o,role:`tree`,"aria-label":`Changed files`,onKeyDown:e=>{let t=w.findIndex(t=>t.key===e.target.dataset.key),n=w[t];if(n===void 0)return;let r=t=>{e.preventDefault(),A(w[Math.min(w.length-1,Math.max(0,t))]?.key)};switch(e.key){case`ArrowDown`:return r(t+1);case`ArrowUp`:if(t===0){e.preventDefault(),s.current?.focus();return}return r(t-1);case`Home`:return r(0);case`End`:return r(w.length-1);case`Enter`:case` `:return e.preventDefault(),M(n);case`ArrowRight`:n.kind===`directory`&&!n.open&&(e.preventDefault(),j(n.entry.path));return;case`ArrowLeft`:{if(n.kind===`directory`&&n.open&&!C){e.preventDefault(),j(n.entry.path);return}let i=w.slice(0,t).findLastIndex(e=>e.depth<n.depth);i>=0&&r(i);return}}},className:`pt-1 pb-4`,children:T.map(e=>{let n=e.rows.map(e=>e.kind===`directory`?(0,Y.jsx)(qI,{row:e,tabbable:e.key===k,onActivate:()=>M(e)},e.key):(0,Y.jsx)(ZI,{file:e.file,depth:e.depth,inset:e.group!==null,active:e.file.path===t,tabbable:e.key===k,onActivate:()=>M(e),...D.has(e.file.path)?{landing:{at:D.get(e.file.path)??0,of:D.size}}:{}},e.key)),r=e.rows[0]?.key??``;return e.group===null?(0,Y.jsx)(J.Fragment,{children:n},r):(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`${e.group}/`,children:[(0,Y.jsx)(KI,{path:e.group}),n]},r)})})})]})},WI=`relative flex min-h-7.5 cursor-default items-center whitespace-nowrap pr-[7px] select-none hover:bg-surface-row focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring`,GI=(e,t=!1)=>({paddingLeft:`${6+(e+Number(t))*14}px`}),KI=({path:e})=>(0,Y.jsx)(`div`,{"aria-hidden":`true`,title:e,className:`flex h-6 items-end pr-[7px] pb-0.5 whitespace-nowrap select-none`,style:GI(0),children:(0,Y.jsx)(YI,{path:e,caption:!0})}),qI=({row:e,tabbable:t,onActivate:n})=>(0,Y.jsxs)(`div`,{role:`treeitem`,"aria-level":e.depth+1,"aria-expanded":e.open,"aria-label":`${e.entry.path}, folder, ${zI(e.count,`file`)}`,title:e.entry.path,"data-key":e.key,tabIndex:t?0:-1,onClick:n,className:X(WI,`gap-[5px]`),style:GI(e.depth,e.group!==null),children:[(0,Y.jsx)(cg,{"aria-hidden":`true`,className:X(`size-3 shrink-0 text-muted-foreground transition-transform duration-(--duration-fast) ease-standard`,e.open&&`rotate-90`)}),(0,Y.jsx)(`span`,{className:`mr-px`,children:(0,Y.jsx)(NO,{kind:e.entry.folder})}),(0,Y.jsx)(YI,{path:e.label}),!e.open&&(0,Y.jsx)(`span`,{className:`tabular font-code text-code-compact leading-none text-muted-foreground`,children:e.count})]}),JI={added:[`text-diff-add-fg`,`text-file-ext-add`],deleted:[`text-diff-del-fg line-through decoration-1`,`text-file-ext-del line-through decoration-1`],modified:[``,`text-muted-foreground`],renamed:[``,`text-muted-foreground`]},YI=({path:e,caption:t=!1})=>{let n=(0,J.useRef)(null),r=t?`/`:``,[i,a]=(0,J.useState)(e);(0,J.useLayoutEffect)(()=>{let t=n.current;if(t!==null)return OF(t,()=>{let n=t.clientWidth,i=t.firstElementChild,o=t.lastElementChild;n!==0&&i!==null&&o!==null&&a(AI(e,e=>{let t=e.lastIndexOf(`/`)+1,a=[DF(i,e.slice(0,t)),DF(o,e.slice(t)+r)];return(a[0]??0)+(a[1]??0)<=n+.5}))})},[e,r]);let o=i.lastIndexOf(`/`)+1;return(0,Y.jsxs)(`span`,{ref:n,className:`min-w-0 flex-1 basis-0 truncate text-tree-folder text-muted-foreground`,children:[(0,Y.jsx)(`span`,{children:i.slice(0,o)}),(0,Y.jsxs)(`span`,{className:t?void 0:`font-medium text-foreground`,children:[i.slice(o),r]})]})},XI=({file:e})=>{let t=(0,J.useRef)(null),[n,r]=jI(FI(e.path)),[i,a]=(0,J.useState)(n);(0,J.useLayoutEffect)(()=>{let e=t.current;if(e!==null)return OF(e,()=>{let t=e.clientWidth,i=e.firstElementChild,o=e.lastElementChild;if(t===0||i===null||o===null)return;let s=DF(o,r);s!==null&&a(OI(n,e=>(DF(i,e)??0)+s<=t+.5))})},[n,r]);let[o,s]=JI[e.status];return(0,Y.jsxs)(`span`,{ref:t,"data-slot":`file-name`,className:`min-w-0 flex-1 basis-0 truncate text-tree font-medium tracking-[-0.012em]`,children:[(0,Y.jsx)(`span`,{"data-slot":`file-stem`,className:o,children:i}),(0,Y.jsx)(`span`,{"data-slot":`file-extension`,className:X(`font-normal`,s),children:r})]})},ZI=({file:e,depth:t,inset:n,active:r,tabbable:i,landing:a,onActivate:o})=>{let{finding:s=0,risk:c=0}=e.points??{},l=e.threads??0;return(0,Y.jsxs)(`div`,{role:`treeitem`,"aria-level":t+1,"aria-selected":r,"aria-label":VI(e),title:HI(e),"data-key":e.path,"data-status":e.status,tabIndex:i?0:-1,onClick:o,className:X(WI,`gap-1.5`,r&&`bg-diff-hunk-bg before:absolute before:top-1 before:bottom-1 before:left-0 before:w-0.5 before:rounded-full before:bg-primary hover:bg-diff-hunk-bg`),style:GI(t,n),children:[(0,Y.jsx)(MO,{path:e.path,status:e.status}),(0,Y.jsx)(XI,{file:e}),(0,Y.jsxs)(`span`,{"aria-hidden":`true`,className:`tabular flex flex-none items-center gap-1.5 font-code text-code-compact leading-none text-muted-foreground`,children:[l>0&&(0,Y.jsxs)(`span`,{"data-slot":`thread-count`,className:`inline-flex items-center gap-[2.5px]`,children:[(0,Y.jsx)(n_,{className:`size-3`,strokeWidth:1.75}),l]}),s+c>0&&(0,Y.jsxs)(`span`,{"data-land":`drop`,style:Ph({"--landing-i":a?.at??0,"--landing-n":a?.of??1}),className:`inline-flex items-center gap-1.5`,children:[s>0&&(0,Y.jsxs)(`span`,{"data-slot":`point-count`,"data-kind":`finding`,className:`inline-flex items-center gap-[2.5px]`,children:[(0,Y.jsx)(`i`,{className:`size-1.5 rounded-full bg-severity-minor`}),s>1&&s]}),c>0&&(0,Y.jsx)(`span`,{"data-slot":`point-count`,"data-kind":`risk`,className:`inline-flex items-center`,children:(0,Y.jsx)(`i`,{className:`size-[7px] rounded-full ring-[1.5px] ring-risk-contract-solid ring-inset`})})]}),(e.additions>0||e.deletions>0)&&(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-[5px]`,children:[e.additions>0&&(0,Y.jsxs)(`span`,{className:`text-stat-add`,children:[`+`,e.additions]}),e.deletions>0&&(0,Y.jsxs)(`span`,{className:`text-stat-del`,children:[`−`,e.deletions]})]})]})]})},QI=({count:e})=>(0,Y.jsxs)(`span`,{"data-slot":`thread-count`,className:`tabular inline-flex items-center gap-0.5 text-caption`,children:[(0,Y.jsx)(n_,{"aria-hidden":`true`,className:`size-3`}),e,(0,Y.jsxs)(`span`,{className:`sr-only`,children:[` open `,e===1?`thread`:`threads`]})]}),$I=60,eL=3600,tL=24*eL,nL=(e,t)=>{let n=Math.max(0,Math.round((t-Date.parse(e))/1e3));if(n<$I)return`just now`;if(n<eL)return`${Math.floor(n/$I)} min ago`;if(n<tL)return`${Math.floor(n/eL)} h ago`;let r=Math.floor(n/tL);if(r===1)return`yesterday`;if(r<7)return`${r} days ago`;let i=(e,t)=>`${e} ${t}${e===1?``:`s`} ago`;return r<30?i(Math.floor(r/7),`week`):r<365?i(Math.floor(r/30),`month`):i(Math.floor(r/365),`year`)},rL=e=>new Date(e).toLocaleString(`en`,{dateStyle:`full`,timeStyle:`short`}),iL={github:`GitHub`,bitbucket:`Bitbucket`},aL=({repo:e,number:t})=>`${e.owner}/${e.repo} #${t}`,oL=`animate-spin motion-reduce:animate-[spin_3s_linear_infinite]`,sL=(e,t)=>{let n=e.role===`author`?`you`:e.author.name;return`${e.title}. ${aL(e.ref)} by ${n}, updated ${nL(e.updatedAt,t)}, ${iL[e.ref.repo.host]}`},cL=({item:e,nowMs:t,starting:n,tabbable:r,onOpen:i,onFocus:a})=>{let o=iL[e.ref.repo.host],s=e.role===`author`?`you`:e.author.name;return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`a`,{href:W_(e.ref),"data-pr-row":``,tabIndex:r?0:-1,"aria-label":sL(e,t),"aria-busy":n,onClick:e=>{Z_(e)&&(e.preventDefault(),n||i())},onFocus:a,className:`group flex min-h-[58px] w-full flex-col items-stretch gap-x-3 gap-y-1 px-4 py-2 text-left text-foreground hover:bg-accent hover:no-underline focus-visible:bg-accent focus-visible:-outline-offset-2 aria-busy:bg-diff-hunk-bg max-sm:items-start sm:flex-row sm:items-center`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1 self-stretch`,children:[(0,Y.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-x-1.5 text-caption text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 gap-[1ch] font-mono text-code-compact`,children:[(0,Y.jsxs)(`span`,{className:`min-w-0 truncate`,children:[e.ref.repo.owner,`/`,e.ref.repo.repo]}),(0,Y.jsxs)(`span`,{className:`shrink-0`,children:[`#`,e.ref.number]})]}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`flex size-5 shrink-0 items-center justify-center rounded-full text-[10px] font-medium`,mA(e.author.id)),children:fA(e.author.name)}),(0,Y.jsx)(`span`,{className:`max-w-32 shrink-0 truncate`,children:s}),(0,Y.jsx)(`time`,{dateTime:e.updatedAt,title:rL(e.updatedAt),className:`shrink-0 whitespace-nowrap`,children:nL(e.updatedAt,t)}),(0,Y.jsx)(VO,{variant:`outline`,className:`ml-auto shrink-0 text-muted-foreground @min-[480px]:hidden`,children:o})]})]}),n?(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-caption`,children:[(0,Y.jsx)(Qg,{"aria-hidden":`true`,className:X(`size-4 text-diff-hunk-fg`,oL)}),(0,Y.jsx)(`span`,{className:`font-medium text-diff-hunk-fg`,children:`Opening review…`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`Esc to cancel`})]}):(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 @max-[479px]:hidden`,children:[(0,Y.jsx)(VO,{variant:`outline`,className:`text-muted-foreground @max-[479px]:hidden`,children:o}),(0,Y.jsx)(cA,{id:`openRow`,className:`hidden group-focus-visible:inline-flex`}),(0,Y.jsx)(cg,{"aria-hidden":`true`,className:`size-4 text-muted-foreground opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 max-sm:hidden`})]})]})})},lL={ArrowDown:(e,t)=>Math.min(t,e+1),ArrowUp:e=>Math.max(0,e-1),Home:()=>0,End:(e,t)=>t},uL=({title:e,word:t,items:n,count:r,loading:i,skeletonRows:a,notes:o,blocked:s,empty:c,nowMs:l,startingUrl:u,onOpen:d})=>{let f=(0,J.useId)(),p=(0,J.useRef)(null),[m,h]=(0,J.useState)(0),g=n??[],_=Math.min(m,Math.max(0,g.length-1)),v=e=>{let t=lL[e.key],n=[...p.current?.querySelectorAll(`[data-pr-row]`)??[]],r=e.target instanceof HTMLElement?n.indexOf(e.target):-1;if(t===void 0||r===-1)return;e.preventDefault();let i=t(r,n.length-1);h(i),n[i]?.focus()},y=c.icon;return(0,Y.jsxs)(`section`,{"aria-labelledby":f,className:`@container flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card`,children:[(0,Y.jsxs)(`div`,{className:`flex min-h-11 flex-wrap items-center gap-x-2 gap-y-1 border-b px-4 py-2`,children:[(0,Y.jsx)(`h2`,{id:f,className:`text-heading font-semibold`,children:e}),r!==null&&(0,Y.jsxs)(`span`,{className:`rounded-full bg-muted px-2 text-caption font-medium text-muted-foreground tabular-nums`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:r}),(0,Y.jsx)(`span`,{className:`sr-only`,children:r===`…`?`Loading`:`${r} pull request${r===1?``:`s`}`})]}),(0,Y.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:t})]}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-2 p-3 empty:hidden`,children:o}),s??(n===null?(0,Y.jsxs)(`div`,{"aria-busy":`true`,className:`flex flex-col`,children:[(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 px-4 pt-3 text-caption text-muted-foreground`,children:[(0,Y.jsx)(Qg,{"aria-hidden":`true`,className:X(`size-4`,`animate-spin motion-reduce:animate-[spin_3s_linear_infinite]`)}),i]}),(0,Y.jsx)(`ul`,{"aria-hidden":`true`,className:`flex flex-col gap-3 px-4 py-3`,children:Array.from({length:a},(e,t)=>(0,Y.jsxs)(`li`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(pF,{className:`h-4 w-3/4 motion-reduce:animate-none`}),(0,Y.jsx)(pF,{className:`h-3 w-1/2 motion-reduce:animate-none`})]},t))})]}):g.length===0?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-1 px-6 py-8 text-center`,children:[(0,Y.jsx)(y,{"aria-hidden":`true`,className:`mb-1 size-6 text-muted-foreground`}),(0,Y.jsx)(`p`,{className:`font-medium`,children:c.title}),(0,Y.jsx)(`p`,{className:`max-w-sm text-caption text-muted-foreground`,children:c.text})]}):(0,Y.jsx)(`ul`,{ref:p,className:`divide-y`,onKeyDown:v,children:g.map((e,t)=>(0,Y.jsx)(cL,{item:e,nowMs:l,starting:u===e.url,tabbable:t===_,onOpen:()=>d(e),onFocus:()=>h(t)},e.url))}))]})},dL=wc.options,fL=`flex flex-wrap items-baseline gap-x-2 gap-y-1 text-caption`,pL=`h-6 min-w-6 px-1 text-caption`,mL=e=>e.map(e=>iL[e]).join(` and `),hL=(e,t)=>{let n=e===null?[]:dL.filter(t=>e.hosts[t].configured),r=n.filter(t=>e?.hosts[t].error!=null),i=(t?.errors??[]).filter(e=>!r.includes(e.host));return{configured:n,failing:r,listFailed:i,shown:n.filter(e=>!r.includes(e)&&!i.some(t=>t.host===e))}},gL=(e,t)=>(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-6 py-8 text-center text-caption text-muted-foreground`,children:[(0,Y.jsx)(`p`,{children:e}),t]}),_L=({status:e,list:t,error:n,rowFailure:r,startingUrl:i,nowMs:a,onOpen:o,onRetry:s,onOpenConnections:c,onFix:l})=>{let u=hL(e,t),d=e!==null&&u.configured.length===0,f=t!==null&&u.configured.length>0&&u.shown.length===0,p=u.configured.length>1&&u.shown.length===1&&u.shown[0]!==void 0?`${iL[u.shown[0]]} only`:null,m=e=>n===null?null:(0,Y.jsxs)(`p`,{className:X(dF,fL),role:`alert`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Couldn't list pull requests.`}),(0,Y.jsx)(`span`,{children:Gp(n)}),e&&(0,Y.jsx)($,{variant:`link`,className:`h-6 min-w-6 px-1 text-caption`,onClick:s,children:`Retry`})]}),h=e=>r?.role===e?(0,Y.jsxs)(`p`,{className:X(dF,fL),role:`alert`,children:[(0,Y.jsx)(`span`,{children:r.message}),(0,Y.jsx)($,{variant:`link`,className:pL,onClick:r.onRetry,children:`Try again`})]}):null,g=u.failing.map(e=>(0,Y.jsxs)(`p`,{className:X(fF,fL),role:`status`,children:[(0,Y.jsxs)(`span`,{children:[iL[e],` pull requests are hidden until `,iL[e],` works again.`]}),(0,Y.jsx)($,{variant:`link`,className:pL,onClick:l,children:`Fix…`})]},e)),_=u.listFailed.map(e=>(0,Y.jsxs)(`p`,{className:X(dF,fL),role:`alert`,children:[(0,Y.jsxs)(`span`,{className:`font-medium`,children:[`Couldn't load `,iL[e.host],` pull requests.`]}),(0,Y.jsx)(`span`,{children:e.message}),u.shown.length>0&&(0,Y.jsxs)(`span`,{children:[mL(u.shown),` pull requests are shown.`]}),(0,Y.jsx)($,{variant:`link`,className:pL,onClick:s,children:`Retry`})]},e.host)),v=u.configured.length===0?`Loading`:`Loading from ${mL(u.configured)}`,y=t?.items.filter(e=>e.role===`reviewer`)??null,b=t?.items.filter(e=>e.role===`author`)??null,x=e=>e===null?n===null?`…`:null:f?null:e.length;return(0,Y.jsxs)(`div`,{className:`grid items-start gap-4 lg:grid-cols-[1.55fr_1fr]`,children:[(0,Y.jsx)(uL,{title:`To review`,word:p??`Waiting for your review`,items:y,count:x(y),loading:v,skeletonRows:5,notes:(0,Y.jsxs)(Y.Fragment,{children:[t!==null&&m(!0),g,_,h(`reviewer`)]}),blocked:d?gL(`Connect GitHub or Bitbucket to list pull requests.`,(0,Y.jsx)($,{variant:`outline`,size:`sm`,onClick:c,children:`Open Connections`})):t===null&&n!==null?m(!0):!f&&void 0,empty:{icon:Hg,title:`Nothing is waiting for you`,text:`When someone asks for your review on GitHub or Bitbucket, it appears here. To review something else, paste its link above.`},nowMs:a,startingUrl:i,onOpen:o}),(0,Y.jsx)(uL,{title:`Your pull requests`,word:p??`Open`,items:b,count:x(b),loading:`Loading`,skeletonRows:3,notes:(0,Y.jsxs)(Y.Fragment,{children:[t!==null&&m(!1),h(`author`)]}),blocked:d?gL(`Connect GitHub or Bitbucket to list pull requests.`):t===null&&n!==null?m(!1):f?gL(`Couldn't load pull requests.`):void 0,empty:{icon:Ig,title:`No open pull requests`,text:`Pull requests you open on GitHub or Bitbucket appear here.`},nowMs:a,startingUrl:i,onOpen:o})]})},vL=(0,J.createContext)(null),yL=()=>{let e=(0,J.useContext)(vL);if(e===null)throw Error(`useConnections needs a ConnectionsProvider`);return e},bL=({children:e,now:t=Date.now})=>{let{status:n,error:r,loading:i,refresh:a}=Lp(),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(null),[u,d]=(0,J.useState)(0),[f,p]=(0,J.useState)(!1),[m,h]=(0,J.useState)(!1);(0,J.useEffect)(()=>{!i&&n!==null&&s(t())},[i,n,t]);let g=(0,J.useCallback)(()=>{a(),d(e=>e+1)},[a]),_=(0,J.useCallback)((e,t)=>{h(e&&t?.focusCheckAgain===!0),p(e)},[]),v=(0,J.useMemo)(()=>({status:n,error:r,checking:i,checkedAtMs:o,listed:c,reportListed:l,checkAgain:g,checks:u,open:f,setOpen:_,focusCheckAgain:m}),[n,r,i,o,c,g,u,f,_,m]);return(0,Y.jsx)(vL.Provider,{value:v,children:e})},xL=({pullRequest:e,error:t})=>{let{setOpen:n}=yL(),r=`Couldn't open ${aL(e)}: `;return t.code===`host-not-configured`?(0,Y.jsxs)(Y.Fragment,{children:[r,iL[e.repo.host],` isn't configured.`,` `,(0,Y.jsx)($,{variant:`link`,className:pL,onClick:()=>n(!0),children:`Open Connections`})]}):(0,Y.jsx)(Y.Fragment,{children:`${r}${Gp(t)}`})},SL=({pullRequest:e})=>{let{client:t}=Pp(),[n,r]=(0,J.useState)(0),[i,a]=(0,J.useState)(null),o=aL(e),s=(0,J.useRef)(0);return(0,J.useEffect)(()=>(s.current=n,t.startAnalysis({url:jf(e)}).then(e=>{s.current===n&&(e.ok?X_(G_(e.value.analysisId)):a(e.error))}),()=>{s.current=-1}),[t,e,n]),(0,Y.jsxs)(`div`,{className:`mx-auto flex max-w-2xl flex-col gap-3 py-12`,children:[(0,Y.jsx)(`h1`,{className:`text-title font-semibold tracking-[-0.01em]`,children:o}),(0,Y.jsx)(`p`,{role:`status`,className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-body`,children:i===null?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,Y.jsx)(Qg,{"aria-hidden":`true`,className:X(`size-4`,oL)}),`Fetching `,o,` from `,iL[e.repo.host],`…`]}),(0,Y.jsx)($,{variant:`link`,className:pL,onClick:()=>{s.current=-1,X_(`/`)},children:`Cancel`})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`text-destructive`,children:[(0,Y.jsx)(M_,{"aria-hidden":`true`,className:`mr-1 inline size-4 align-[-3px]`}),(0,Y.jsx)(xL,{pullRequest:e,error:i})]}),(0,Y.jsx)($,{variant:`link`,className:pL,onClick:()=>{a(null),r(e=>e+1)},children:`Try again`})]})}),i!==null&&(0,Y.jsx)(`p`,{className:`text-body`,children:(0,Y.jsx)(Q_,{to:`/`,children:`Go to your pull requests`})})]})},CL=J.createContext(void 0);function wL(e){let t=J.useContext(CL);if(t===void 0&&!e)throw Error(qv(72));return t}var TL={...Hw,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},EL=class extends Nw{constructor(e,t,n){let r=new bw;super(OL(e,r,t,n),kL(r),TL)}setOpen=(e,t)=>{mw(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Yb(Qb,e))}};function DL(){let e=new bw,t=new SE(Object.freeze(OL(void 0,e)),Object.freeze(kL(e)),TL);return Object.assign(t,{setOpen:dy,cancelPendingOpen:dy})}function OL(e,t,n,r=!1){return{...Iw(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function kL(e){return{popupRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var AL=Ny(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=cw((e,t)=>new EL({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),gw(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=_w(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=J.useRef(null);Q(()=>{m&&t&&p.setOpen(!1,Yb(dx))},[m,t,p]),Q(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),Q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),J.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,Yb(mx))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,Y.jsxs)(CL.Provider,{value:p,children:[l&&(0,Y.jsx)(lw,{handle:l,store:p}),T&&(0,Y.jsx)(jL,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function jL({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=zC(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=IC(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=J.useMemo(()=>Nv(a.reference,i.reference),[a.reference,i.reference]);return vw(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??py}),null}var ML=J.createContext(void 0);function NL(){return J.useContext(ML)}var PL=`data-base-ui-tooltip-trigger`;function FL(e){let t=lb(e);return iv(t)?t:null}var IL=Py(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=wL(!0),m=Uw(a)??p;if(!m)throw Error(qv(82));let h=FE(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=J.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=hw(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=NL(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=yx(v,{open:_}),O=Zw(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=Sx(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=J.useRef(!1),F=zy(),I=J.useRef(void 0);function L(){return D&&w.current!=null?0:c??C??600}function R(e){let t=y.current;if(!t||!e)return!1;let n=cb(e,`[${PL}]`);return n!==null&&n!==t&&sb(t,n)}function ee(e){let t=R(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,F.clear()),t}let z=eT(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?gT():null,restMs:L,delay(){return u==null&&D?{close:Gb(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),B=Kw(v,{enabled:!A}).reference,V=e=>{let t=P.current,n=FL(e),r=ee(n),i=y.current,a=i&&n&&sb(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,Yb($b,e));else if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&ib(I.current)){let t=()=>{!P.current&&!j.current&&!m.select(`open`)&&m.setOpen(!0,Yb($b,e,i))},n=L();n===0?(F.clear(),t()):F.start(n,t)}},te=m.useState(`appliedTriggerProps`,S||M!==`none`);return _y(`button`,e,{state:{open:_},ref:[t,x,y],props:[z,B,te,{onMouseOver(e){V(e.nativeEvent)},onFocus(e){R(FL(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,F.clear(),I.current=void 0},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Fb]:A?``:void 0,[PL]:A?void 0:``},f],stateAttributesMapping:jb})}),LL=J.createContext(void 0);function RL(){let e=J.useContext(LL);if(e===void 0)throw Error(qv(70));return e}var zL=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return wL().useState(`mounted`)||n?(0,Y.jsx)(LL.Provider,{value:n,children:(0,Y.jsx)(NE,{ref:t,...r})}):null}),BL=J.createContext(void 0);function VL(){let e=J.useContext(BL);if(e===void 0)throw Error(qv(71));return e}var HL=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=oC,style:g,..._}=e,v=wL(),y=RL(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=tD({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=aD(e,J.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,Y.jsx)(BL.Provider,{value:D,children:O})}),UL=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=wL(),{side:s,align:c}=VL(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);iw({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Qw(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return _y(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[ow,f,iD(d),a],stateAttributesMapping:Pb})}),WL=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=wL(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=VL();return _y(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Nb})}),GL=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=J.useMemo(()=>({open:t,close:n}),[t,n]);return(0,Y.jsx)(ML.Provider,{value:t,children:(0,Y.jsx)(vx,{delay:i,timeoutMs:r,children:e.children})})},KL=class extends ZC{constructor(){super(DL(),`Tooltip`)}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(`open`)??!1}};function qL(){return new KL}function JL({delay:e=0,...t}){return(0,Y.jsx)(GL,{"data-slot":`tooltip-provider`,delay:e,...t})}function YL({...e}){return(0,Y.jsx)(AL,{"data-slot":`tooltip`,...e})}function XL({...e}){return(0,Y.jsx)(IL,{"data-slot":`tooltip-trigger`,...e})}function ZL({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,collisionBoundary:a,children:o,shortcut:s,...c}){return(0,Y.jsx)(zL,{children:(0,Y.jsx)(HL,{collisionBoundary:a,align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,Y.jsxs)(UL,{"data-slot":`tooltip-content`,className:X(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-caption text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...c,children:[o,s!==void 0&&(0,Y.jsx)(oA,{children:s}),(0,Y.jsx)(WL,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var QL=e=>{if(e===null)return 26;let t=e>=900?e-260-32:e,n=Math.floor((t-32)/24);return Math.min(26,Math.max(8,n))},$L=e=>String(e).padStart(2,`0`),eR=e=>{let t=new Date(e);return`${t.getFullYear()}-${$L(t.getMonth()+1)}-${$L(t.getDate())}`},tR=e=>new Date(`${e}T00:00:00Z`),nR=e=>tR(e).toLocaleDateString(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`}),rR=e=>tR(e).toLocaleDateString(`en`,{weekday:`short`,month:`short`,day:`numeric`,timeZone:`UTC`}),iR=e=>tR(e).toLocaleDateString(`en`,{month:`short`,timeZone:`UTC`}),aR=e=>Number(e.slice(8,10)),oR=e=>{let t=Math.ceil(e.length/7);return Array.from({length:t},(t,n)=>{let r=e.slice(n*7,n*7+7),i=r.find(e=>aR(e.date)===1);if(i!==void 0)return iR(i.date);let a=r[0];return n===0&&a!==void 0&&aR(a.date)<=7?iR(a.date):null})},sR=e=>e===1?`1 PR`:`${e} PRs`,cR=e=>e===1?`1 comment`:`${e} comments`,lR=e=>`${e.pullRequests===0?`No PRs`:sR(e.pullRequests)} reviewed · ${cR(e.comments)}`,uR=(e,t)=>`${nR(e.date)}: ${e.pullRequests===0?`No PRs`:sR(e.pullRequests)} reviewed, ${cR(e.comments)}${e.date===t?` (today)`:``}`,dR=e=>`Busiest day: ${nR(e.date)}, ${sR(e.pullRequests)} and ${cR(e.comments)}.`,fR=(e,t,n)=>{let r={ArrowLeft:t-7,ArrowRight:t+7,ArrowUp:t-1,ArrowDown:t+1,Home:0,End:n}[e];return r===void 0||r<0||r>n?null:r},pR=e=>Fc(e),mR={0:`border-input bg-card`,1:`border-primary bg-activity-1`,2:`border-primary bg-activity-2`,3:`border-primary bg-activity-3`,4:`border-primary bg-primary`},hR=[{level:0,label:`0`},{level:1,label:`1`},{level:2,label:`2`},{level:3,label:`3–4`},{level:4,label:`5+`}],gR=[``,`Mon`,``,`Wed`,``,`Fri`,``],_R=({level:e,className:t})=>(0,Y.jsx)(`span`,{className:X(`flex items-center justify-center rounded-[4px] border`,mR[e],t),children:e===4&&(0,Y.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary-foreground`})}),vR=e=>{let[t,n]=(0,J.useState)(null);return(0,J.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let r=t.getBoundingClientRect().width;if(r>0&&n(r),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(([e])=>{e!==void 0&&n(e.contentRect.width)});return i.observe(t),()=>i.disconnect()},[e]),t},yR=qL(),bR=({days:e,today:t,weeks:n})=>{let[r,i]=(0,J.useState)(t),a=(0,J.useRef)(new Map),o=(0,J.useRef)(null),s=e.some(e=>e.date===r)?r:e[0]?.date??t,c=oR(e),l=Math.ceil(e.length/7);return(0,Y.jsxs)(`div`,{ref:o,className:`flex min-w-0 flex-col gap-3`,children:[(0,Y.jsx)(`div`,{"aria-hidden":`true`,className:`grid pl-8 text-caption text-muted-foreground`,style:{gridTemplateColumns:`repeat(${l}, 24px)`},children:c.map((e,t)=>(0,Y.jsx)(`span`,{className:`h-4 overflow-visible whitespace-nowrap`,children:e},t))}),(0,Y.jsx)(`div`,{role:`grid`,"aria-label":`Review activity for the last ${n} weeks, one square per day. Use arrow keys to move between days.`,className:`flex flex-col`,onKeyDown:t=>{let n=e.findIndex(e=>e.date===s),r=fR(t.key,n,e.length-1);if(r===null)return;t.preventDefault();let o=e[r];o!==void 0&&(i(o.date),a.current.get(o.date)?.focus())},children:gR.map((n,r)=>(0,Y.jsxs)(`div`,{role:`row`,className:`flex items-center`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`w-8 shrink-0 text-caption text-muted-foreground`,children:n}),Array.from({length:l},(n,o)=>{let c=e[o*7+r];if(c===void 0||pR(c.date)!==r)return(0,Y.jsx)(`span`,{className:`size-6 shrink-0`},o);let l=zc(c.pullRequests);return(0,Y.jsx)(XL,{handle:yR,payload:c,delay:150,render:(0,Y.jsx)(`div`,{ref:e=>{e===null?a.current.delete(c.date):a.current.set(c.date,e)},role:`gridcell`,tabIndex:c.date===s?0:-1,"aria-label":uR(c,t),onFocus:()=>i(c.date),className:`group flex size-6 shrink-0 items-center justify-center rounded-md`}),children:(0,Y.jsx)(_R,{level:l,className:X(`size-5 group-hover:ring-2 group-hover:ring-foreground`,c.date===t&&`outline-2 outline-offset-1 outline-foreground`)})},c.date)})]},r))}),(0,Y.jsx)(AL,{handle:yR,children:({payload:e})=>e===void 0?null:(0,Y.jsx)(ZL,{collisionBoundary:o.current??void 0,children:(0,Y.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`font-semibold`,children:rR(e.date)}),(0,Y.jsx)(`span`,{children:lR(e)})]})})}),(0,Y.jsxs)(`div`,{"aria-hidden":`true`,className:`flex items-start gap-2 pl-8 text-caption text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:`leading-4`,children:`PRs a day`}),hR.map(({level:e,label:t})=>(0,Y.jsxs)(`span`,{className:`flex w-6 flex-col items-center gap-0.5`,children:[(0,Y.jsx)(_R,{level:e,className:`size-4`}),(0,Y.jsx)(`span`,{className:`whitespace-nowrap`,children:t})]},e))]})]})},xR=({value:e,label:t})=>(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`text-title font-semibold tabular-nums`,children:e}),(0,Y.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:t})]}),SR=({activity:e,error:t,onRetry:n,now:r})=>{let i=(0,J.useId)(),a=(0,J.useRef)(null),o=vR(a),s=QL(o),c=o===null||o>=900,l=eR(r()),u=(0,J.useMemo)(()=>e===null?null:Rc(e,{today:l,weeks:s,dayOf:eR}),[e,l,s]),d=(0,J.useMemo)(()=>e===null?null:Rc(e,{today:l,weeks:26,dayOf:eR}),[e,l]),f=u===null?null:Bc(u),p=d?.every(e=>e.pullRequests===0&&e.comments===0)===!0;return(0,Y.jsxs)(`section`,{"aria-labelledby":i,className:`flex flex-col rounded-xl border bg-card`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 border-b px-4 py-2.5`,children:[(0,Y.jsx)(`h2`,{id:i,className:`text-heading font-semibold`,children:`Review activity`}),(0,Y.jsxs)(`span`,{className:`text-caption text-muted-foreground`,children:[`Last `,s,` weeks`]}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-caption text-muted-foreground max-sm:basis-full sm:ml-auto`,children:[(0,Y.jsx)(Kg,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Reviews and comments posted from megareviewer on this machine`]})]}),(0,Y.jsx)(`div`,{className:`overflow-hidden px-4 py-4`,children:(0,Y.jsx)(`div`,{ref:a,children:u===null||f===null?t===null?(0,Y.jsx)(pF,{"aria-label":`Loading review activity`,className:`h-[244px] w-full motion-reduce:animate-none`}):(0,Y.jsxs)(`p`,{className:X(dF,`flex flex-wrap items-baseline gap-x-2 text-caption`),children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Couldn't read your review activity.`}),(0,Y.jsx)(`span`,{children:Gp(t)}),(0,Y.jsx)($,{variant:`link`,className:`h-6 min-w-6 px-1 text-caption`,onClick:n,children:`Try again`})]}):(0,Y.jsxs)(`div`,{className:X(`flex gap-8`,c?`flex-row`:`flex-col`),children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,Y.jsx)(bR,{days:u,today:l,weeks:s}),p&&(0,Y.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-caption text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:`No reviews yet.`}),` Open a pull request above and post your review. Each day you review fills a square here.`]})]}),(0,Y.jsxs)(`div`,{className:X(`flex flex-col gap-3`,c&&`w-[260px] shrink-0`),children:[(0,Y.jsxs)(`div`,{className:X(`grid gap-x-6 gap-y-3`,c||o!==null&&o<520?`grid-cols-2`:`grid-cols-4`),children:[(0,Y.jsx)(xR,{value:f.pullRequests,label:`PRs reviewed`}),(0,Y.jsx)(xR,{value:f.comments,label:`comments posted`}),(0,Y.jsx)(xR,{value:f.daysWithReviews,label:`days with reviews`}),(0,Y.jsx)(xR,{value:f.thisWeek,label:`PRs this week`})]}),f.busiest!==null&&(0,Y.jsx)(`p`,{className:`border-t pt-3 text-caption text-muted-foreground`,children:dR(f.busiest)})]})]})})})]})},CR=`Paste a pull request link first.`,wR=`That isn't a pull request link. Use github.com/owner/repo/pull/123 or bitbucket.org/workspace/repo/pull-requests/45.`,TR=`h-6 min-w-6 px-1 text-caption`,ER=Wk(`openInNewTab`).chords[0]??{key:`Enter`,mod:!0},DR=({inputRef:e,start:t,onSubmit:n,onSubmitInNewTab:r,onEdit:i,initial:a})=>{let[o,s]=(0,J.useState)(a?.url??``),[c,l]=(0,J.useState)(a?.invalid??null),u=(0,J.useId)(),d=t?.state===`starting`,f=()=>{let e=o.trim();if(e===``)return l(CR),null;let t=Af(e);return t.ok||l(wR),t.ok?t.value:null},p=e=>{if(e.preventDefault(),d)return;let t=f();t!==null&&n(o.trim(),t)},m=e=>{e.preventDefault();let t=f();t!==null&&r(t)},h=$k();return(0,Y.jsx)(`search`,{children:(0,Y.jsxs)(`form`,{"aria-label":`Open a pull request by link`,className:`flex flex-col gap-1.5`,onSubmit:p,noValidate:!0,children:[(0,Y.jsxs)(`div`,{className:`flex gap-2 max-sm:flex-col`,children:[(0,Y.jsxs)(`div`,{className:`relative flex-1`,children:[(0,Y.jsx)(Xg,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,Y.jsx)(`input`,{ref:e,id:`${u}-url`,"aria-label":`Pull request link`,className:X(`h-9 w-full min-w-0 rounded-md border border-input bg-card pr-10 pl-8 placeholder:text-muted-foreground`,c!==null&&`border-destructive`),type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,placeholder:`Paste a GitHub or Bitbucket pull request link`,value:o,readOnly:d,onKeyDown:e=>{Xk(e,ER,h)&&m(e)},onChange:e=>{s(e.target.value),l(null),i()},"aria-invalid":c!==null,"aria-describedby":`${u}-message`}),(0,Y.jsx)(cA,{id:`focusLink`,className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2`})]}),(0,Y.jsx)($,{type:`submit`,size:`lg`,className:`sm:w-28`,"aria-busy":d,onClick:e=>{(e.metaKey||e.ctrlKey||e.shiftKey)&&m(e)},onAuxClick:e=>{e.button===1&&m(e)},children:d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Qg,{"aria-hidden":`true`,className:oL}),`Opening…`]}):`Review`})]}),(0,Y.jsx)(`div`,{id:`${u}-message`,role:`status`,className:`flex min-h-0 flex-wrap items-center gap-x-2 text-caption`,children:c===null?t?.state===`starting`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,Y.jsx)(Qg,{"aria-hidden":`true`,className:X(`size-3.5`,oL)}),t.message]}),(0,Y.jsx)($,{type:`button`,variant:`link`,className:TR,onClick:t.onCancel,children:`Cancel`})]}):t?.state===`failed`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`text-destructive`,children:[(0,Y.jsx)(M_,{"aria-hidden":`true`,className:`mr-1 inline size-3.5 align-[-2px]`}),t.message]}),(0,Y.jsx)($,{type:`button`,variant:`link`,className:TR,onClick:t.onRetry,children:`Try again`})]}):null:(0,Y.jsxs)(`span`,{className:`text-destructive`,children:[(0,Y.jsx)(M_,{"aria-hidden":`true`,className:`mr-1 inline size-3.5 align-[-2px]`}),c]})})]})})},OR=wc.options,kR=({now:e=Date.now})=>{let{client:t}=Pp(),{status:n,checks:r,reportListed:i,setOpen:a}=yL(),o=Rp(),s=zp(),[c,l]=(0,J.useState)(null),[u,d]=(0,J.useState)(``),f=(0,J.useRef)(0),p=(0,J.useRef)(null),m=(0,J.useRef)(null),{refresh:h}=o,{refresh:g}=s,_=(0,J.useCallback)(()=>{h(),g()},[h,g]),v=(0,J.useRef)(r);(0,J.useEffect)(()=>{r!==v.current&&(v.current=r,_())},[r,_]),(0,J.useEffect)(()=>{if(o.loading||(m.current=e(),o.pullRequests===null))return;let t=new Set(o.pullRequests.errors.map(e=>e.host)),r={};for(let e of OR)t.has(e)||n?.hosts[e].configured!==!0||(r[e]=o.pullRequests.items.filter(t=>t.ref.repo.host===e).length);i({counts:r,atMs:e()})},[o.loading,o.pullRequests,n,e,i]),(0,J.useEffect)(()=>{let t=()=>{document.visibilityState===`visible`&&m.current!==null&&e()-m.current>12e4&&_()};return document.addEventListener(`visibilitychange`,t),()=>document.removeEventListener(`visibilitychange`,t)},[e,_]),(0,J.useEffect)(()=>{let e=e=>{e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey||Zk(e.target)||(e.preventDefault(),p.current?.focus(),p.current?.select())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let y=async(e,n,r,i)=>{f.current+=1;let a=f.current;l({from:r,url:e,ref:n,role:i,state:`starting`}),r===`row`&&d(`Opening ${aL(n)}`);let o=await t.startAnalysis({url:e});f.current===a&&(o.ok?Y_(G_(o.value.analysisId)):l({from:r,url:e,ref:n,role:i,state:`failed`,error:o.error}))},b=(0,J.useCallback)(e=>{f.current+=1,l(null),e===`form`?p.current?.focus():d(`Cancelled`)},[]),x=c?.state===`starting`&&c.from===`row`;(0,J.useEffect)(()=>{if(!x)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||e.target instanceof Element&&e.target.closest(`[data-slot=popover-content]`)||b(`row`)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[x,b]);let S=e=>(0,Y.jsx)(xL,{pullRequest:e.ref,error:e.error}),C=c?.from===`form`?c.state===`starting`?{state:`starting`,message:`Fetching ${aL(c.ref)} from ${iL[c.ref.repo.host]}…`,onCancel:()=>b(`form`)}:{state:`failed`,message:S(c),onRetry:()=>void y(c.url,c.ref,`form`,null)}:null,w=e(),T=c?.state===`starting`&&c.from===`row`?c.url:null,E=c?.state===`failed`&&c.from===`row`&&c.role!==null?{role:c.role,message:S(c),onRetry:()=>void y(c.url,c.ref,`row`,c.role)}:null;return(0,Y.jsxs)(`div`,{className:`mx-auto flex max-w-[1240px] flex-col gap-4`,children:[(0,Y.jsx)(`h1`,{className:`sr-only`,children:`Pull requests`}),(0,Y.jsx)(DR,{inputRef:p,start:C,onSubmit:(e,t)=>void y(e,t,`form`,null),onSubmitInNewTab:e=>window.open(W_(e),`_blank`,`noopener`),onEdit:()=>{c?.from===`form`&&c.state===`failed`&&l(null)}}),(0,Y.jsx)(_L,{status:n,list:o.pullRequests,error:o.error,rowFailure:E,startingUrl:T,nowMs:w,onOpen:e=>void y(e.url,e.ref,`row`,e.role),onRetry:_,onOpenConnections:()=>a(!0),onFix:()=>a(!0,{focusCheckAgain:!0})}),(0,Y.jsx)(SR,{activity:s.activity,error:s.error,onRetry:g,now:e}),(0,Y.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:u})]})},AR=`megareviewer:`,jR=e=>{try{let t=window.localStorage.getItem(AR+e);return t===null?void 0:JSON.parse(t)}catch{return}},MR=(e,t)=>{try{window.localStorage.setItem(AR+e,JSON.stringify(t))}catch{}},NR=(e,t,n)=>{let[r,i]=(0,J.useState)(()=>({key:e,value:n(jR(e))??t}));return[r.key===e?r.value:n(jR(e))??t,(0,J.useCallback)(r=>i(i=>{let a=r(i.key===e?i.value:n(jR(e))??t);return MR(e,a),{key:e,value:a}}),[e,t,n])]},PR=e=>typeof e==`boolean`?e:void 0,FR=e=>{try{let t=window.sessionStorage.getItem(AR+e);return t===null?void 0:JSON.parse(t)}catch{return}},IR=(e,t)=>{try{window.sessionStorage.setItem(AR+e,JSON.stringify(t))}catch{}},LR=e=>typeof e==`string`?e:void 0,RR=e=>{let t=new Map;for(let n of e){let e=n.available?`${n.provider} ${n.via}`:n.provider,r=t.get(e)??[];r.push(n),t.set(e,r)}return[...t.values()].flatMap(e=>{let[t]=e;return t===void 0?[]:[[t,e]]})},zR=(e,t,n)=>{if(e.length<=6)return e;let r=e.filter(e=>e.id===t?.id||e.id===n);return r.length>0?r:e.slice(0,1)},BR=(e,t,n)=>{let r=n.toLowerCase().split(/\s+/).filter(e=>e!==``);return r.length===0?[]:e.filter(e=>!t.includes(e)&&r.every(t=>`${e.modelName} ${e.model}`.toLowerCase().includes(t)))},VR=e=>e.length===0?`No model is known to megareviewer`:e.some(e=>e.available)?null:RR(e).map(([e])=>e.reason??`${e.providerName} can't run`).join(`; or `),HR=e=>{let[t,n]=NR(`model-option`,null,LR),r=e?.options??[],i=r.find(e=>e.id===t&&e.available)??r.find(t=>t.id===e?.defaultId)??null,a=(0,J.useCallback)(e=>n(()=>e),[n]);return{options:r,chosen:i,defaultId:e?.defaultId??null,locked:e===null?null:VR(r),choose:a}},UR={github:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`,bitbucket:`M.778 1.213a.768.768 0 00-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 00.77-.646l3.27-20.03a.768.768 0 00-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z`},WR=({host:e,className:t})=>(0,Y.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-host":e,className:X(`size-[15px] shrink-0`,t),children:(0,Y.jsx)(`path`,{d:UR[e]})}),GR=J.createContext(void 0);function KR(e){let t=J.useContext(GR);if(t===void 0&&!e)throw Error(qv(33));return t}var qR=J.createContext(void 0);function JR(e){let t=J.useContext(qR);if(t===void 0&&!e)throw Error(qv(36));return t}var YR=J.createContext(void 0);function XR(e=!0){let t=J.useContext(YR);if(t===void 0&&!e)throw Error(qv(25));return t}var ZR=J.createContext(null);function QR(e=`root`){let t=J.useContext(ZR),n=J.useContext(qR);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var $R={visible:!0,ref:null};function ez(){return $R}function tz(e,t,n=`root`){let r=QR(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??ez)({label:e.label,children:e.children,render:e.render}),a=ny(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}var nz=J.createContext(void 0);function rz(){let e=J.useContext(nz);if(e===void 0)throw Error(qv(30));return e}function iz(e){e.preventDefault()}function az(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=JR(),u=XR(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return J.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?iz:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:nx})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!Yy&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Qv(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var oz={type:`regular-item`};function sz(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=J.useRef(null),{getButtonProps:d,buttonRef:f}=$v({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=az({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=J.useCallback(e=>Nv(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=ny(u,f);return J.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var cz=`data-checked`,lz=`data-unchecked`,uz={checked(e){return e?{[cz]:``}:{[lz]:``}},...bb},dz=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l=!1,onCheckedChange:u,style:d,...f}=e,{store:p}=JR(),m=sk({guess:!0,label:a}),h=FE(i),g=p.useState(`disabled`),_=p.useState(`isActive`,m.index),v=p.useState(`floatingNodeId`),y=p.useState(`itemProps`),b=s||g,{getItemProps:x,itemRef:S}=sz({closeOnClick:c,disabled:b,highlighted:_,id:h,store:p,nativeButton:o,nodeId:v,itemMetadata:oz}),C=J.useMemo(()=>({disabled:b,highlighted:_,checked:l}),[b,_,l]);function w(e){let t=Yb(nx,e.nativeEvent,void 0,{preventUnmountOnClose:dy});u?.(!l,t)}let T=_y(`div`,e,{state:C,stateAttributesMapping:uz,props:[y,{role:`menuitemcheckbox`,"aria-checked":l,onClick:w},f,x],ref:[S,t,m.ref]});return(0,Y.jsx)(nz.Provider,{value:C,children:T})}),fz=J.forwardRef(function(e,t){let{checked:n,defaultChecked:r,onCheckedChange:i,...a}=e,[o,s]=UO({controlled:n,default:r??!1,name:`MenuCheckboxItem`,state:`checked`}),c=tz(e,t);function l(e,t){i?.(e,t),t.isCanceled||s(e)}return c.visible?(0,Y.jsx)(dz,{...a,checked:o,onCheckedChange:l,ref:c.ref}):null}),pz=J.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=rz(),c=J.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=$C(s.checked);return iw({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),_y(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},ref:[t,c],stateAttributesMapping:uz,props:{"aria-hidden":!0,...o},enabled:a||u})}),mz=J.createContext(void 0);function hz(){let e=J.useContext(mz);if(e===void 0)throw Error(qv(31));return e}var gz=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=J.useState(void 0),c=_y(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,Y.jsx)(mz.Provider,{value:s,children:c})}),_z=J.forwardRef(function(e,t){let n=QR()?.Group??gz;return(0,Y.jsx)(n,{...e,ref:t})}),vz=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=FE(a),c=hz();return Q(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),_y(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),yz=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=JR(),f=sk({guess:!0,label:a}),p=FE(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=sz({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:oz});return _y(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),bz=J.forwardRef(function(e,t){let n=tz(e,t);return n.visible?(0,Y.jsx)(yz,{...e,ref:n.ref}):null}),xz=J.createContext(void 0);function Sz(){return J.useContext(xz)}function Cz(e,t){let n=xy(e.render);if(J.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function wz(e,t,n){let r=Cz(e,t),i=r===t?void 0:r;return[r,J.useCallback(e=>n?.(e?i:void 0),[i,n])]}function Tz(e,t,n){let r=xy(e.render),i=J.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Ez=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=JR(),m=Sz(),{side:h,align:g}=KR(),_=XM(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=wz(e,u,d),L=Tz(e,C,N),R=w.type===`menu`?m:void 0,ee=w.type===`context-menu`,z=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(z=()=>l.state.activeIndex===null&&P),iw({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){l.setOpen(!1,Yb(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),Qw(D,{enabled:A&&!j&&!ee&&w.type!==`menubar`,closeDelay:k});let B=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:V,handleFocus:te}=(J.useContext(ZR)?.useParentHandoff??Oz)(l,w,v,f),H=_y(`div`,e,{state:{transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},ref:[t,l.context.popupRef,B,I],stateAttributesMapping:Pb,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&Ck.has(e.key)&&e.stopPropagation()},onFocus:te},iD(y),c,{"data-rootownerid":E}]}),U=w.type===void 0||ee;(C||w.type===`menubar`&&T!==`outside-press`)&&(U=!0);let ne=R?.getReturnElement??V;return(0,Y.jsx)(MC,{context:D,openInteractionType:M,modal:ee,disabled:!x,returnFocus:a??ne??U,explicitReturnFocus:a===void 0&&ne?!1:void 0,initialFocus:z,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:H})}),Dz={parentVirtualFocusRef:void 0,handleFocus:void 0};function Oz(){return Dz}var kz=J.forwardRef(function(e,t){let n=QR()?.Popup??Ez;return(0,Y.jsx)(n,{...e,ref:t})}),Az=J.createContext(void 0);function jz(){let e=J.useContext(Az);if(e===void 0)throw Error(qv(32));return e}var Mz=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=JR();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Y.jsx)(Az.Provider,{value:n,children:(0,Y.jsx)(pC,{ref:t,...r,portalOwnerRole:o})})}),Nz=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=aC,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=JR(),x=jz(),S=XR(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=w.useState(`domReferenceElement`),ee=n,z=c,B=l,V=s,te=h;C.type===`context-menu`&&(ee=n??C.context?.anchor,V??=`start`,!o&&V!==`center`&&(B=e.alignOffset??2,z=e.sideOffset??-5));let H=o,U=V;C.type===`menu`?(H??=`inline-end`,U??=`start`,te=e.collisionAvoidance??oC):C.type===`menubar`&&(H??=C.context.orientation===`vertical`?`inline-end`:`bottom`,U??=`start`);let ne=C.type===`context-menu`,re=tD({anchor:ee,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:H,sideOffset:z,align:U,alignOffset:B,arrowPadding:ne?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:te,shift:ne?{crossAxis:!(`side`in te&&te.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});J.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,Yb(ux)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),J.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,Yb(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let ie=zy();J.useEffect(()=>{D||ie.clear()},[D,ie]),J.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?ie.isStarted()||ie.start(e,()=>{v.setOpen(!1,Yb(ux))}):v.setOpen(!1,Yb(ux))}else ie.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,ie]),J.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),EN({store:v,domReference:R,positionerElement:M,open:D});let ae={open:D,side:re.side,align:re.align,anchorHidden:re.anchorHidden,nested:C.type===`menu`,instant:N},oe=C.type===`menubar`&&C.context.modal;ON(D&&(oe||O&&F!==`trigger-hover`),k===`touch`,M,A);let W=aD(e,ae,{styles:re.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),se=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),ce=null;return C.type===`menubar`?ce=C.context.contentElement:C.type===void 0&&(ce=A),(0,Y.jsxs)(GR.Provider,{value:re,children:[se&&(0,Y.jsx)(Dj,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:cD(!D),cutout:ce}),(0,Y.jsx)(xC,{id:I,children:(0,Y.jsx)(KO,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:W})})]})}),Pz=J.createContext(void 0);function Fz(){let e=J.useContext(Pz);if(e===void 0)throw Error(qv(34));return e}var Iz=J.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=J.useState(void 0),[p,m]=UO({controlled:i,default:a,name:`MenuRadioGroup`}),h=Z((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=_y(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),_=J.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,Y.jsx)(mz.Provider,{value:f,children:(0,Y.jsx)(Pz.Provider,{value:_,children:g})})}),Lz=J.memo(J.forwardRef(function(e,t){let n=QR()?.RadioGroup??Iz;return(0,Y.jsx)(n,{...e,ref:t})})),Rz=J.createContext(void 0);function zz(){let e=J.useContext(Rz);if(e===void 0)throw Error(qv(35));return e}var Bz=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,{store:f}=JR(),{value:p,setValue:m,disabled:h}=Fz(),g=sk({guess:!0,label:a}),_=FE(i),v=f.useState(`isActive`,g.index),y=f.useState(`floatingNodeId`),b=f.useState(`itemProps`),x=f.useState(`disabled`),S=s||h||x,C=p===l,{getItemProps:w,itemRef:T}=sz({closeOnClick:c,disabled:S,highlighted:v,id:_,store:f,nativeButton:o,nodeId:y,itemMetadata:oz}),E=J.useMemo(()=>({disabled:S,highlighted:v,checked:C}),[S,v,C]);function D(e){let t=Yb(nx,e.nativeEvent,void 0,{preventUnmountOnClose:dy});m(l,t)}let O=_y(`div`,e,{state:E,stateAttributesMapping:uz,props:[b,{role:`menuitemradio`,"aria-checked":C,onClick:D},d,w],ref:[T,t,g.ref]});return(0,Y.jsx)(Rz.Provider,{value:E,children:O})}),Vz=J.forwardRef(function(e,t){let n=tz(e,t);return n.visible?(0,Y.jsx)(Bz,{...e,ref:n.ref}):null}),Hz=J.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=zz(),c=J.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=$C(s.checked);return iw({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),_y(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:uz,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||u})}),Uz=J.createContext(null);function Wz(e){let t=J.useContext(Uz);if(t===null&&!e)throw Error(qv(5));return t}function Gz(e){return e==null?Zb:e.type.startsWith(`key`)?sx:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?cx:Zb}var Kz={...Hw,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=Hw.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Zy&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!Hw.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},qz=class extends Nw{constructor(e,t,n=!1){let r=new bw,i=Yz(r,t,n,e);super(i,Jz(r),Kz),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Jz(e){return{positionerRef:J.createRef(),popupRef:J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:J.createRef(),beforeTriggerFocusGuardRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Yz(e,t,n=!1,r){return{...Iw(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:py,inputProps:py,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new hC,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:py,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Xz=J.createContext(null);function Zz(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Qz(e,t){return e===`list-navigation`||Zz(e,t)}var $z=Ny(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:x=!0}=e,S=XR(!0),C=JR(!0),w=Wz(!0),T=C?.store,E=C?.virtualFocus??!1,D=J.useMemo(()=>_&&T?{type:`menu`,store:T}:w?{type:`menubar`,context:w}:S&&!T?{type:`context-menu`,context:S}:{type:void 0},[S,T,w,_]),O=FE(),k=FE(),[A,j]=J.useState(void 0),M=(A??k)||void 0,N=vC(),P=D.type===`menu`?D.store:void 0,F=(n??o)&&P?.state.transitionStatus===`starting`,I=Ev(()=>F?P?.state.instantType:void 0).current,L=Ev(()=>{let e=new qz({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:O,instantType:I},M,N!=null);return e.context.virtualFocusRef=y,e}).current;L.useControlledProp(`openProp`,n),L.useControlledProp(`triggerIdProp`,m),L.useContextCallback(`onOpenChangeComplete`,i);let R=L.useState(`floatingTreeRoot`),ee=bC(R),z=L.useState(`open`),B=L.useState(`activeTriggerElement`),V=L.useState(`positionerElement`),te=L.useState(`hoverEnabled`),H=L.useState(`disabled`),U=L.useState(`lastOpenChangeReason`),ne=L.useState(`parent`),re=L.useState(`activeIndex`),ie=L.useState(`keyboardOpen`),ae=L.useState(`payload`),oe=L.useState(`floatingParentNodeId`),W=J.useRef(null),se=J.useRef(ne.type!==`context-menu`),ce=zy(),le=J.useRef(!0),ue=zy(),de=oe!=null,{openMethod:fe,triggerProps:pe}=Zj(z);L.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:ne.type===void 0?c:void 0,openMethod:fe,rootId:O}),gw(L);let{forceUnmount:me,transitionStatus:he}=_w(z,L,()=>{L.set(`allowMouseEnter`,!1)},F),ge=rw(L.context.popupRef);J.useEffect(()=>{if(I===void 0)return;let e=()=>{L.state.instantType===I&&L.set(`instantType`,void 0)};if(!z){e();return}if(he!==void 0)return;if(L.context.popupRef.current==null){e();return}let t=new AbortController;return ge(e,t.signal),()=>{t.abort()}},[I,z,he,ge,L]),Q(()=>{S&&!C?L.update({parent:{type:`context-menu`,context:S},floatingNodeId:ee,floatingParentNodeId:N}):(C||!L.select(`activeTriggerElement`))&&L.update({floatingNodeId:ee,floatingParentNodeId:N})},[S,C,ee,N,B,L]),J.useEffect(()=>{z||(W.current=null),ne.type===`context-menu`&&(z?ce.start(500,()=>{se.current=!0}):(ce.clear(),se.current=!1))},[ce,z,ne.type]),Q(()=>{!z&&!te&&L.set(`hoverEnabled`,!0)},[z,te,L]);let _e=Z((e,t)=>{let n=t.reason;if(!e&&!L.select(`open`)||z===e&&t.trigger===B&&U===n)return;let i=pw(t);if(!e&&t.trigger==null&&(t.trigger=B??void 0),r?.(e,t),t.isCanceled)return;L.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!le.current)return;e&&n===`trigger-focus`?(le.current=!1,ue.start(300,()=>{le.current=!0})):(le.current=!0,ue.clear());let o=!e&&(n===`escape-key`||n==null);W.current=t.event;let s=fw(L.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Qz(n,a),s.instantType=ne.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Zz(n,a)?`click`:o?`dismiss`:void 0,L.update(s)}),ve=QC({popupStore:L,floatingRootContext:L.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:_e}),ye=ve.context.events;Q(()=>{let e=({open:e,eventDetails:t})=>_e(e,t);return ye.on(`setOpen`,e),()=>{ye?.off(`setOpen`,e)}},[ye,_e]),Q(()=>L.subscribeToParentMenu(),[L]);let be=J.useCallback(()=>{L.setOpen(!1,Yb(mx))},[L]);J.useImperativeHandle(d,()=>({unmount:me,close:be}),[me,be]);let xe;ne.type===`context-menu`&&(xe=ne.context),J.useImperativeHandle(xe?.positionerRef,()=>V,[V]),J.useImperativeHandle(xe?.actionsRef,()=>({setOpen:_e}),[_e]);let Se=zC(ve,{enabled:!H,bubbles:{escapeKey:f&&ne.type===`menu`},outsidePress(){return ne.type!==`context-menu`||W.current?.type===`contextmenu`||se.current},externalTree:de?R:void 0}),Ce=VE(),we=sT(ve,{enabled:!H,listRef:L.context.itemDomElements,activeIndex:re,virtual:v,nested:ne.type===`menubar`||!v&&ne.type!==void 0,parentOrientation:ne.type===`menubar`?ne.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?ie:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:Ce===`rtl`,disabledIndices:fy,onNavigate(e,t){L.setActiveIndex(e,Gz(t),t?.nativeEvent)},openOnArrowKeyDown:ne.type!==`context-menu`&&!(v&&_),externalTree:!v&&de?R:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),Te=J.useCallback(e=>{L.context.typingRef.current=e},[L]),Ee=cT(ve,{enabled:!H&&!v,listRef:L.context.itemLabels,elementsRef:L.context.itemDomElements,activeIndex:re,resetMs:500,onMatch:(e,t)=>{z&&e!==re&&L.setActiveIndex(e,sx,t.nativeEvent)},onTyping:Te}),De=Z(a),Oe=J.useRef(-1),ke=Z(()=>{let e=L.state.activeIndex,t=e===null?void 0:L.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Oe.current===n&&L.context.reportedItem===t)return;Oe.current=n,L.context.reportedItem=t,v&&L.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=L.context;L.context.highlightReason=Zb,L.context.highlightEvent=void 0,a&&De(t,Xb(r,i,{label:t===void 0?void 0:L.context.itemLabels.current[n]??void 0}))});Q(()=>{ke()},[re,ke]);let Ae=J.useMemo(()=>{if(!v)return we.reference;if(!we.trigger)return py;let{onFocus:e,...t}=we.trigger;return t},[v,we.reference,we.trigger]);L.useSyncedValue(`inputProps`,v?we.reference??py:py);let je=J.useMemo(()=>{let e=Nv(Ee.reference,Ae,Se.reference,{onMouseMove(){L.set(`allowMouseEnter`,!0)}},pe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=z,e},[L,Ee.reference,Ae,Se.reference,pe,z]),Me=J.useMemo(()=>{let e=Nv(we.trigger,Se.trigger,pe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[we.trigger,Se.trigger,pe]);Ev(()=>(L.update({inactiveTriggerProps:Me}),null)),vw(L,{floatingRootContext:ve,activeTriggerProps:je,inactiveTriggerProps:Me,popupProps:J.useMemo(()=>Nv(ow,{onMouseMove(){L.set(`allowMouseEnter`,!0),ne.type===`menu`&&L.set(`hoverEnabled`,!1)},onClick(){L.select(`hoverEnabled`)&&L.set(`hoverEnabled`,!1)},onKeyDown(e){let t=L.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ee.floating,we.floating,Se.floating),[ne.type,L,Ee.floating,we.floating,Se.floating]),itemProps:we.item??py});let Ne=J.useMemo(()=>({store:L,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:k,setRenderedFloatingId:j,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:ke}),[L,D,u,l,b,k,v,E,ke]),Pe=typeof t==`function`?t({payload:ae}):t,Fe=(0,Y.jsxs)(qR.Provider,{value:Ne,children:[p&&(0,Y.jsx)(lw,{handle:p,store:L}),Pe]});return(ne.type===void 0||ne.type===`context-menu`)&&(Fe=(0,Y.jsx)(SC,{externalTree:R,children:Fe})),Fe});function eB(e){let t=J.useContext(Xz);if(t===null)return(0,Y.jsx)($z,{...e});let n=t.Root;return(0,Y.jsx)(Xz.Provider,{value:null,children:(0,Y.jsx)(n,{...t.options,...e})})}var tB=5;function nB(e,t){let n=rB(t);return e.clientX>=n.left-tB&&e.clientX<=n.right+tB&&e.clientY>=n.top-tB&&e.clientY<=n.bottom+tB}function rB(e){let t=e.getBoundingClientRect(),n=tv(e);if($y)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function iB(e){if(av(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!_v(e))return iB(bv(e))}function aB(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Zv(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:py,[t,n,r])}var oB=Py(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=JR(!0),h=Uw(d)??m?.store;if(!h)throw Error(qv(85));let g=FE(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=J.useRef(null),S=cB(),C=Yv(!0),w=yC(),T=J.useMemo(()=>w??new hC,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=hw(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:bC(T),floatingParentNodeId:vC(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=$v({disabled:A,native:o});J.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=J.useRef(null),P=zy(),F=Z(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;sb(N.current,t)||sb(h.select(`positionerElement`),t)||t===N.current||(t==null||iB(t)!==h.select(`rootId`))&&(nB(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:lx}))});J.useEffect(()=>{let e=Zv(N.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,F,{once:!0}),()=>{e.removeEventListener(`mouseup`,F)}},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=eT(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:gT({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=sB(y,h.select(`lastOpenChangeReason`)),ee=NC(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),z=Kw(v,{enabled:!A&&I}),B=aB({open:y,enabled:O,mouseDownAction:`open`}),V=J.useMemo(()=>Nv(z.reference,ee.reference),[z.reference,ee.reference]),te=h.useState(`triggerProps`,D),H=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:U,handleFocusTargetFocus:ne}=yN(h,x),re={disabled:A,open:y},ie=[N,t,M,E,x],ae=[V,L??py,te,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Zv(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},H,O?{role:`menuitem`}:{},B,p,j],oe=_y(`button`,e,{enabled:!O,stateAttributesMapping:Mb,state:re,ref:ie,props:ae});return O?(0,Y.jsx)(qM,{tag:`button`,render:n,className:r,style:i,state:re,refs:ie,props:ae,stateAttributesMapping:Mb}):y?(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsx)(jx,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:U},`${g}-pre-focus-guard`),(0,Y.jsx)(J.Fragment,{children:oe},g),(0,Y.jsx)(jx,{ref:h.context.triggerFocusTargetRef,onFocus:ne},`${g}-post-focus-guard`)]}):(0,Y.jsx)(J.Fragment,{children:oe},g)});function sB(e,t){let n=zy(),[r,i]=J.useState(!1);return Q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function cB(){let e=Wz(!0);return J.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var lB=J.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return _y(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function uB(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function dB(e){return uB(e?.[0])}function fB(e){return dB(e)?e.flatMap(e=>e.items):e}function pB(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(dB(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function mB(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return QP(e)}function hB(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?QP(e.value):QP(e)}function gB(e,t,n){function r(){return mB(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=fB(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function _B(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Y.jsx)(J.Fragment,{children:gB(r,t,n)},i)),e),[])}function vB({...e}){return(0,Y.jsx)(eB,{"data-slot":`dropdown-menu`,...e})}function yB({...e}){return(0,Y.jsx)(oB,{"data-slot":`dropdown-menu-trigger`,...e})}function bB({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,Y.jsx)(Mz,{children:(0,Y.jsx)(Nz,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,Y.jsx)(kz,{"data-slot":`dropdown-menu-content`,className:X(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-(--duration-fast) outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function xB({...e}){return(0,Y.jsx)(_z,{"data-slot":`dropdown-menu-group`,...e})}function SB({className:e,inset:t,...n}){return(0,Y.jsx)(vz,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:X(`px-1.5 py-1 text-caption font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function CB({className:e,inset:t,variant:n=`default`,...r}){return(0,Y.jsx)(bz,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:X(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-ui -outline-offset-2 select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function wB({className:e,children:t,checked:n,inset:r,...i}){return(0,Y.jsxs)(fz,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:X(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-ui -outline-offset-2 select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,Y.jsx)(pz,{children:(0,Y.jsx)(ng,{})})}),t]})}function TB({...e}){return(0,Y.jsx)(Lz,{"data-slot":`dropdown-menu-radio-group`,...e})}function EB({className:e,children:t,inset:n,...r}){return(0,Y.jsxs)(Vz,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:X(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-ui -outline-offset-2 select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,Y.jsx)(Hz,{children:(0,Y.jsx)(ng,{})})}),t]})}function DB({className:e,...t}){return(0,Y.jsx)(lB,{"data-slot":`dropdown-menu-separator`,className:X(`-mx-1 my-1 h-px bg-border`,e),...t})}var OB=({option:e,noteId:t})=>(0,Y.jsxs)(EB,{value:e.id,disabled:!e.available,"aria-describedby":e.available?void 0:t,children:[e.modelName,!e.measured&&(0,Y.jsx)(`span`,{className:`rounded-full border px-1.5 text-caption text-muted-foreground`,children:`unmeasured`})]}),kB=e=>{if(e.key===`Escape`||e.key===`Tab`||(e.stopPropagation(),e.key!==`ArrowDown`&&e.key!==`ArrowUp`))return;let t=[...e.currentTarget.closest(`[role="menu"]`)?.querySelectorAll(`[role="menuitemradio"]`)??[]],n=t.findIndex(t=>e.currentTarget.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING),r=e.key===`ArrowDown`?t[n]:t[(n===-1?t.length:n)-1];r!==void 0&&(e.preventDefault(),r.focus())},AB=({first:e,options:t,separated:n,noteId:r,choice:i})=>{let[a,o]=(0,J.useState)(``),s=zR(t,i.chosen,i.defaultId),c=t.length-s.length,l=BR(t,s,a);return(0,Y.jsxs)(xB,{children:[n&&(0,Y.jsx)(DB,{}),(0,Y.jsxs)(SB,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`text-foreground`,children:e.available?e.via:e.providerName}),!e.available&&(0,Y.jsx)(`span`,{id:r,className:`font-normal`,children:e.reason})]}),s.map(e=>(0,Y.jsx)(OB,{option:e,noteId:r},e.id)),c>0&&(0,Y.jsx)(`div`,{className:`px-1.5 py-1`,children:(0,Y.jsx)(jF,{value:a,onChange:e=>o(e.target.value),onKeyDown:kB,placeholder:`Filter ${c} more models`,"aria-label":`Filter ${c} more models through ${e.via}`,className:`h-7`})}),l.map(e=>(0,Y.jsx)(OB,{option:e,noteId:r},e.id)),c>0&&a.trim()!==``&&l.length===0&&(0,Y.jsx)(`p`,{className:`px-2 py-1.5 text-caption text-muted-foreground`,children:`No model matches`})]})},jB=({choice:e,disabled:t,variant:n,size:r=`sm`})=>{let i=(0,J.useId)();return(0,Y.jsxs)(vB,{children:[(0,Y.jsx)(yB,{render:(0,Y.jsx)($,{variant:n,size:r,"data-slot":`model-menu`,disabled:t,"aria-label":e.chosen===null?`Choose a model`:`Model: ${e.chosen.modelName}`,className:X(`rounded-l-none px-0`,r===`sm`?`w-6`:`w-7`,n==="default"&&`border-l-primary-foreground/30`,n===`outline`&&`border-l-0`,n.startsWith(`ai`)&&`border-l-primary/30`)}),children:(0,Y.jsx)(ig,{"aria-hidden":`true`})}),(0,Y.jsx)(bB,{align:`start`,className:`w-80`,children:(0,Y.jsx)(TB,{value:e.chosen?.id??null,onValueChange:t=>e.choose(t),children:RR(e.options).map(([t,n],r)=>(0,Y.jsx)(AB,{first:t,options:n,separated:r>0,noteId:`${i}-${r}`,choice:e},t.id))})})]})},MB={is:`idle`},NB=e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)}`,PB=(e,t)=>{let[n,r]=(0,J.useState)(t);return(0,J.useEffect)(()=>{if(e===null)return;r(t());let n=setInterval(()=>r(t()),1e3);return()=>clearInterval(n)},[e,t]),e===null?0:Math.max(0,Math.round((n-e)/1e3))},FB=async({choice:e,run:t,now:n=Date.now,onPhase:r})=>{r({is:`running`,since:n()});let i=await t(e.chosen?.id);r(i.ok?{is:`done`,said:i.said}:{is:`failed`,...i})},IB=({choice:e,what:t=`Runs`})=>e.locked??(e.chosen===null?null:`${t} ${e.chosen.modelName} through ${e.chosen.via}`),LB=e=>{let t=(0,J.useId)(),{label:n,icon:r,choice:i,phase:a}=e,o=a.is===`running`,s=IB(e);return(0,Y.jsxs)(`span`,{"data-slot":`model-action`,className:`flex shrink-0 items-center`,children:[(0,Y.jsxs)(YL,{disabled:s===null,children:[(0,Y.jsxs)(XL,{render:(0,Y.jsx)($,{variant:`ai-quiet`,disabled:o||i.locked!==null||i.chosen===null,focusableWhenDisabled:!0,"aria-busy":o,"aria-describedby":s===null?void 0:`${t}-note`,onClick:()=>void FB(e),className:`rounded-r-none`}),children:[o?(0,Y.jsx)(Qg,{"aria-hidden":`true`,className:oL}):i.locked===null?r:(0,Y.jsx)(e_,{"aria-hidden":`true`}),n]}),(0,Y.jsxs)(ZL,{side:`bottom`,align:`end`,children:[i.locked!==null&&(0,Y.jsx)(Wg,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),s]})]}),(0,Y.jsx)(jB,{choice:i,disabled:o||i.options.length===0,variant:`ai-quiet`,size:`default`}),s!==null&&(0,Y.jsx)(`span`,{id:`${t}-note`,hidden:!0,children:s})]})},RB=e=>{let{running:t,now:n=Date.now,phase:r,className:i}=e,a=PB(r.is===`running`?r.since:null,n);return r.is===`idle`?null:(0,Y.jsx)(`p`,{role:r.is===`failed`?`alert`:`status`,"data-slot":`model-action-status`,className:X(`flex min-w-0 flex-wrap items-center gap-x-2 text-caption`,r.is===`failed`?`text-destructive`:`text-muted-foreground`,i),children:r.is===`running`?(0,Y.jsxs)(Y.Fragment,{children:[t,` `,(0,Y.jsx)(`span`,{className:`tabular`,children:NB(a)})]}):r.is===`done`?r.said:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(M_,{"aria-hidden":`true`,className:`mr-1 inline size-3.5 align-[-2px]`}),r.message]}),(0,Y.jsx)($,{variant:`link`,className:`h-6 min-w-6 px-1 text-caption`,onClick:()=>void FB(e),children:`Try again`})]})})},zB={"look-for":{label:`Look for`,icon:g_},"dont-flag":{label:`Don't flag`,icon:Qh}},BB=({kind:e,className:t})=>{let{label:n,icon:r}=zB[e];return(0,Y.jsxs)(`span`,{"data-slot":`preference-kind`,"data-kind":e,className:X(`inline-flex h-[22px] shrink-0 items-center gap-[5px] rounded-md border bg-secondary pr-2 pl-[7px] text-caption font-medium whitespace-nowrap text-secondary-foreground`,t),children:[(0,Y.jsx)(r,{"aria-hidden":`true`,className:`size-3 text-muted-foreground`}),n]})},VB={kind:`global`},HB=({owner:e,repo:t})=>`${e}/${t}`,UB=({host:e,owner:t,repo:n})=>`${e}/${t}/${n}`,WB=e=>e.kind===`global`?`global`:UB(e.repo),GB=e=>[{key:WB(VB),label:`Everywhere`,scope:VB},...e.map(t=>{let n=e.some(e=>e!==t&&HB(e)===HB(t));return{key:UB(t),label:n?`${HB(t)} on ${iL[t.host]}`:HB(t),scope:{kind:`repo`,repo:t}}})],KB=({scope:e,className:t})=>e.kind===`global`?(0,Y.jsx)(Rg,{"aria-hidden":`true`,className:X(`size-[15px] shrink-0`,t)}):(0,Y.jsx)(WR,{host:e.repo.host,className:t}),qB=(e,t)=>({...e,preferences:e.preferences.some(e=>e.id===t.id)?e.preferences.map(e=>e.id===t.id?t:e):[...e.preferences,t]}),JB=(e,t)=>({...e,preferences:e.preferences.filter(e=>e.id!==t)}),YB=(e,t)=>({...e,proposals:[...e.proposals,...t.filter(t=>!e.proposals.some(e=>e.id===t.id))]}),XB=(e,t)=>({...e,proposals:e.proposals.filter(e=>e.id!==t)}),ZB=(e,t,n,r)=>({...e,repositories:e.repositories.map(e=>hu(e.repo,t)&&e.guidelineFiles!==null?{...e,guidelineFiles:e.guidelineFiles.map(e=>e.path===n?{...e,enabled:r}:e)}:e)}),QB=(e,t)=>e.preferences.filter(e=>gu(e.scope,t)),$B=(e,t)=>e.proposals.filter(e=>gu(e.scope,t)),eV=(e,t)=>t.kind===`repo`&&QB(e,t).length===0&&$B(e,t).length===0,tV=`suggestions`,nV=(e,t)=>{if(e===`suggestions`)return{kind:`suggestions`};let n=t.find(t=>t.key===e)??t.find(e=>e.key===WB(VB))??t[0];return n===void 0?{kind:`suggestions`}:{kind:`scope`,option:n}},rV=(e,t)=>t.map(t=>({option:t,proposals:$B(e,t.scope)})).filter(e=>e.proposals.length>0),iV=new Intl.ListFormat(`en`,{type:`conjunction`}),aV=(e,t)=>{let n=t.map(t=>({label:t.label,count:e.filter(e=>gu(e.scope,t.scope)).length})).filter(e=>e.count>0),[r]=n;return n.length===1&&r!==void 0?`for ${r.label}`:iV.format(n.map(({count:e,label:t})=>`${e} for ${t}`))},oV=(e,t,n)=>{let r=[...e.comments>0?[`${fV(e.comments,`comment`)} from ${fV(e.pullRequests,`pull request`)}`]:[],...e.signals>0?[`${fV(e.signals,`action`)} recorded here`]:[]];if(r.length===0)return e.pullRequests===0?`Found nothing to suggest from: no comment of yours on its pull requests, and nothing you did here.`:`Found no comment of yours on its last ${fV(e.pullRequests,`pull request`)}, and nothing you did here.`;let i=`Read ${iV.format(r)}`;return t===0?`${i}: nothing new to suggest.`:`${i}: ${fV(t,`suggestion`)}, ${n}.`},sV=(e,t)=>({owner:t.some(t=>t.repo===e.repo&&!hu(t,e))?e.owner:null,name:e.repo}),cV=e=>{let t=[...e.repositories];for(let{scope:n}of[...e.preferences,...e.proposals])n.kind!==`repo`||t.some(e=>hu(e.repo,n.repo))||t.push({repo:n.repo,guidelineFiles:null,guidelineNote:`No pull request of this repository has been analyzed yet`});return t},lV=e=>{if(e<1024)return`${e} B`;let t=e/1024;return`${t<10?t.toFixed(1):Math.round(t)} KB`},uV=e=>{let t=e.trim();return t===``||/[.!?]$/.test(t)?t:`${t}.`},dV=e=>e.code===`bad-request`?uV(e.message):Gp(e),fV=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,pV=`megareviewer looks for ${new Intl.ListFormat(`en`,{type:`disjunction`}).format(ou)}.`,mV=({file:e,onSwitch:t})=>{let[n,r]=(0,J.useState)(null);return(0,Y.jsxs)(`li`,{"data-slot":`guideline-file`,className:`flex min-h-11 flex-wrap items-center gap-x-2.5 gap-y-1 px-4 py-2`,children:[(0,Y.jsx)(Sg,{"aria-hidden":`true`,className:`size-[15px] shrink-0 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`min-w-0 font-mono text-code-compact break-all`,children:e.path}),(0,Y.jsx)(`span`,{className:`tabular shrink-0 text-caption text-muted-foreground`,children:lV(e.bytes)}),e.tooLarge?(0,Y.jsxs)(`span`,{className:`ml-auto text-caption text-muted-foreground`,children:[`Too large to send: a guideline file can be `,lV(cu)]}):(0,Y.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[(0,Y.jsx)(CF,{checked:e.enabled,"aria-label":`Use ${e.path} in AI reviews`,onCheckedChange:async n=>{r(null),r(await t(e.path,n))}}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`text-caption`,e.enabled?`text-foreground`:`text-muted-foreground`),children:e.enabled?`Followed by AI reviews`:`Ignored`})]}),n!==null&&(0,Y.jsxs)(`p`,{role:`alert`,className:`basis-full text-caption text-destructive`,children:[(0,Y.jsx)(M_,{"aria-hidden":`true`,className:`mr-1 inline size-3.5 align-[-2px]`}),n]})]})},hV=()=>{let e=(0,J.useId)();return(0,Y.jsxs)(`p`,{className:`flex items-center gap-1 text-ui text-muted-foreground`,children:[`None found at the repository's root.`,(0,Y.jsxs)(YL,{children:[(0,Y.jsx)(XL,{render:(0,Y.jsx)($,{variant:`ghost`,size:`icon-xs`,"aria-label":`Files megareviewer looks for`,"aria-describedby":e}),children:(0,Y.jsx)(Wg,{"aria-hidden":`true`,className:`size-3.5`})}),(0,Y.jsx)(ZL,{side:`right`,children:pV})]}),(0,Y.jsx)(`span`,{id:e,hidden:!0,children:pV})]})},gV=({files:e,note:t,onSwitch:n})=>e===null?(0,Y.jsx)(`p`,{className:`text-ui text-muted-foreground`,children:uV(t??`Couldn't look for them`)}):e.length===0?(0,Y.jsx)(hV,{}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`mb-2.5 max-w-[620px] text-ui text-muted-foreground`,children:`At the repository root, read at each pull request's base commit. When a file is on, AI reviews follow it the same way as your preferences; when off, it is ignored.`}),(0,Y.jsx)(`ul`,{"data-slot":`guideline-files`,className:`divide-y overflow-hidden rounded-lg border bg-card`,children:e.map(e=>(0,Y.jsx)(mV,{file:e,onSwitch:n},e.path))})]});function _V(e){let t=J.useRef(!0);t.current&&(t.current=!1,e())}var vV=J.createContext(void 0),yV=J.createContext(void 0);function bV(){let e=J.useContext(vV);if(e===void 0)throw Error(qv(60));return e}function xV(){let e=J.useContext(yV);if(e===void 0)throw Error(qv(61));return e}function SV(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var CV=(e,t)=>Object.is(e,t);function wV(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function TV(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!SV(e,t,(e,t)=>wV(e,t,n)):e!==t}function EV(e,t,n){return e?e.some(e=>e!==void 0&&wV(t,e,n)):!1}function DV(e,t,n){return e?e.findIndex(e=>e!==void 0&&wV(e,t,n)):-1}function OV(e,t){if(t!==CV)return n=>EV(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function kV(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(OV(t,n)):DV(e,t,n);return i===-1?null:i}function AV(e,t,n,r,i,a){return EV(r,t,i)?a!=null&&e>a&&EV(r,n[a],i)?a:e:e===a?kV(n,r,i,!0):a}function jV(e,t,n){return e.filter(e=>!wV(t,e,n))}var MV={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:hB(t,r)!==``},hasNullItemLabel:(e,t)=>t?pB(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>wV(t,e,n)):wV(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function NV(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=CV,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=rF(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=BP(),F=YP({id:t}),I=M||d,L=j??c,[R,ee]=UO({controlled:n,default:y?r??fy:r,name:`Select`,state:`value`}),[z,B]=UO({controlled:a,default:o,name:`Select`,state:`open`}),V=J.useRef([]),te=J.useRef([]),H=J.useRef(null),U=J.useRef(null),ne=J.useRef(0),re=J.useRef(null),ie=J.useRef([]),ae=J.useRef(!1),oe=J.useRef(null),W=J.useRef(null),se=J.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ce=J.useRef(!1),le=J.useRef(R),{openMethod:ue,triggerProps:de}=Zj(z),fe=Ev(()=>new Nw({id:F,labelId:void 0,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:z,mounted:z,transitionStatus:void 0,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:py,triggerProps:py,itemRoot:{props:py,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:dy,setOpen:dy,handleScrollArrowVisibility:dy,onOpenChangeComplete:dy,listRef:V,popupRef:H,scrollHandlerRef:U,scrollArrowsMountedCountRef:ne,valueRef:re,valuesRef:ie,labelsRef:te,typingRef:ae,selectionRef:se,firstItemTextRef:oe,selectedItemTextRef:W,alignItemWithTriggerActiveRef:ce,initialValueRef:le},MV)).current,[pe,me]=J.useState(!1),{mounted:he,transitionStatus:ge,forceUnmount:_e}=aw({open:z,ref:H,preventUnmountOnClose:pe,setPreventUnmountOnClose:me,onUnmount(){fe.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)}}),ve=fe.useState(`activeIndex`),ye=fe.useState(`selectedIndex`),be=fe.useState(`triggerElement`),xe=fe.useState(`positionerElement`),Se=lD(ue),Ce=ue??Se,we=J.useMemo(()=>y?``:hB(R,x),[y,R,x]),Te=J.useMemo(()=>y&&Array.isArray(R)?R.map(e=>hB(e,x)):hB(R,x),[y,R,x]);tF(Sx(be),F,R,Z(()=>Te),!I,c);let Ee=y?Array.isArray(R)&&R.length>0:R!=null&&we!==``;Q(()=>{A(Ee)},[Ee,A]),Q(function(){let e=kV(ie.current,R,S,y);e===null&&(W.current=null),!z&&fe.set(`selectedIndex`,e)},[y,z,R,S,fe]),Yj(R,()=>{T(L),E(TV(R,k.initialValue,S)),N.change(R)});let De=Z((e,t)=>{let n=t,r=pw(n);s?.(e,n),!t.isCanceled&&(e||me(r()),B(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),P===`onBlur`&&N.commit(R)))});J.useImperativeHandle(h,()=>({unmount:_e,close:()=>{fe.state.open&&De(!1,Yb(mx))}}),[_e,De,fe]);let Oe=Z((e,t)=>{i?.(e,t),!t.isCanceled&&ee(e)}),ke=Z(e=>{let t=nI(e.scrollHeight,e.clientHeight),n=rI(e.scrollTop,t),r=n>0,i=n<t;fe.set(`scrollUpArrowVisible`,r),fe.set(`scrollDownArrowVisible`,i)}),Ae=Ww({open:z,onOpenChange:De,elements:{reference:be,floating:xe}}),je=NC(Ae,{enabled:!I,event:`mousedown`}),Me=zC(Ae),Ne=sT(Ae,{enabled:!I,listRef:V,activeIndex:ve,selectedIndex:ye,disabledIndices:fy,onNavigate(e){(e!==null||z)&&fe.set(`activeIndex`,e)},focusItemOnHover:C}),Pe=cT(Ae,{enabled:!I&&(z||!f&&!y),listRef:te,activeIndex:ve,selectedIndex:ye,disabledIndices:e=>vk(V.current[e]),onMatch(e){z?fe.set(`activeIndex`,e):Oe(ie.current[e],Yb(Zb))},onTyping(e){ae.current=e}}),Fe=J.useMemo(()=>Nv(Pe.reference,Ne.reference,Me.reference,je.reference,de),[je.reference,Pe.reference,Ne.reference,Me.reference,de]),Ie=J.useMemo(()=>Nv(ow,Pe.floating,Ne.floating,Me.floating),[Pe.floating,Ne.floating,Me.floating]),Le=Ne.item??py,Re=J.useMemo(()=>({props:Le,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S}),[Le,y,I,f,S]);fe.useContextCallback(`setValue`,Oe),fe.useContextCallback(`setOpen`,De),fe.useContextCallback(`handleScrollArrowVisibility`,ke),fe.useContextCallback(`onOpenChangeComplete`,_),_V(()=>{fe.update({popupProps:Ie,triggerProps:Fe,itemRoot:Re})}),fe.useSyncedValues({id:F,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,value:R,open:z,mounted:he,transitionStatus:ge,popupProps:Ie,triggerProps:Fe,itemRoot:Re,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:Ce});let ze=ny(g,N.inputRef),Be=y?void 0:L,Ve=J.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=hB(e,x);return(0,Y.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,Y.jsxs)(vV.Provider,{value:fe,children:[(0,Y.jsx)(yV.Provider,{value:Ae,children:w}),(0,Y.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){fe.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=Yb(Zb,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=ie.current.findIndex(t=>hB(t,x).toLowerCase()===e||mB(t,b).toLowerCase()===e);r===-1&&(r=ie.current.findIndex((t,n)=>{let r=te.current[n];return r!=null&&r.toLowerCase()===e}));let i=ie.current[r];i!=null&&Oe(i,n)}fe.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&Be==null?`${F}-hidden-input`:void 0,form:l,name:Be,autoComplete:u,value:we,disabled:I,required:p&&!(y&&Ee),readOnly:f,ref:ze,style:L?Ax:kx,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ve]})}function PV(e,t){return e??t}var FV=`data-popup-side`,IV=400,LV={...Mb,...PP,popupSide:e=>e?{[FV]:e}:null,value:()=>null},RV=J.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:u,validation:d,state:f,disabled:p}=BP(),{labelId:m}=GP(),h=bV(),g=h.useState(`readOnly`),_=h.useState(`required`),v=h.useState(`disabled`),y=p||v||a,b=h.useState(`open`),x=h.useState(`mounted`),S=h.useState(`value`),C=h.useState(`triggerProps`),w=h.useState(`positionerElement`),T=h.useState(`listElement`),E=h.useState(`popupSide`),D=h.useState(`id`),O=h.useState(`labelId`),k=h.useState(`hasSelectedValue`),A=x&&w?E:null,j=i??D,M=PV(m,O);YP({id:i});let N=Sx(w),P=J.useRef(null),F=VP(y,P),{getButtonProps:I,buttonRef:L}=$v({disabled:y,native:o}),R=h.useStateSetter(`triggerElement`),ee=zy(),z=zy(),B=zy();J.useEffect(()=>{if(b)return B.start(IV,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{B.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},z.clear()},[b,h,z,B]);let V=Nv(C,{id:j,role:`combobox`,"aria-expanded":b,"aria-haspopup":`listbox`,"aria-controls":b?T?.id??Ub(w)?.id:void 0,"aria-labelledby":M,"aria-readonly":g||void 0,"aria-required":_||void 0,tabIndex:y?-1:0,onFocus(e){F(!0),b&&h.context.alignItemWithTriggerActiveRef.current&&h.context.setOpen(!1,Yb(Zb,e.nativeEvent)),ee.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){sb(w,e.relatedTarget)||(l(!0),F(!1),u===`onBlur`&&d.commit(S))},onMouseDown(e){if(b)return;let t=Zv(e.currentTarget);function n(e){if(!P.current)return;let t=e.target;sb(P.current,t)||sb(N.current,t)||nB(e,P.current)||h.context.setOpen(!1,Yb(lx,e))}z.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,I),te=d.getValidationProps(y,V);te.role=`combobox`;let H={...f,open:b,disabled:y,value:S,readOnly:g,popupSide:A,placeholder:!k};return _y(`button`,e,{ref:[t,P,L,R],state:H,stateAttributesMapping:LV,props:te})}),zV={value:()=>null},BV=J.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=bV(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?_B(l,u,d):gB(l,u,d)),_y(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:zV})}),VV=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return _y(`span`,e,{state:{open:bV().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:jb})}),HV=J.forwardRef(function(e,t){let n=bV(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Y.jsx)(pC,{ref:t,...e}):null}),UV=J.createContext(void 0);function WV(){let e=J.useContext(UV);if(!e)throw Error(qv(59));return e}function GV(e,t){e&&Object.assign(e.style,t)}var KV={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},qV={position:`fixed`},JV=J.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=aC,style:_,...v}=e,y=bV(),b=xV(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=J.useRef(null),j=J.useRef(null),[M,N]=J.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),J.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),ON((P||C)&&x,T===`touch`,E,D);let F=tD({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?qV:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};Q(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let ee=aD(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),z=J.useRef(0),B=Z(e=>{if(y.context.valuesRef.current.length===0)return;let t=z.current;z.current=e.size;let n=Yb(Zb);if(t!==0&&!y.state.multiple&&w!==null&&DV(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&DV(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>DV(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};GV(E,e),GV(y.context.popupRef.current,e)}}),V=J.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,Y.jsx)(KO,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:B,children:(0,Y.jsxs)(UV.Provider,{value:V,children:[S&&C&&(0,Y.jsx)(Dj,{inert:cD(!x),cutout:D}),ee]})})}),YV=`--transform-origin`,XV={...Nb,...bb},ZV=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=bV(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=xV(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=WV(),_=XM(!0)!=null,v=VE(),{nonce:y,disableStyleElements:b}=mk(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=J.useRef(!1),j=J.useRef(!1),M=J.useRef({}),N=Dx(),P=Z(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=eH(O),i=tH(O.getBoundingClientRect().height,`y`,r),a=Zv(O),o=tv(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=QV(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=$V(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=eI(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=eI(g,0,$V(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});J.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),iw({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let F={open:S,transitionStatus:E,side:f,align:p};Q(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),Q(()=>{S||m||(j.current=!1,A.current=!1,GV(O,M.current))},[S,m,O]),Q(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty(YV),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=iH(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=tv(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=Zv(D),c=eH(D),l=nH(D.getBoundingClientRect(),c),d=nH(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=QV(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,j=0;if(t&&n){let e=nH(n.getBoundingClientRect(),c);T=nH(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),F=S-_-y,I=N-P,L=C-5;O.style.left=`${eI(E,5,L-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=$V(p),ee=I>=R-1;ee&&(P=Math.min(S,d.height)-(I-R));let z=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),B=(r.visualViewport?.scale??1)!==1&&Zy;if(z||B){GV(O,M.current),g(!1);return}let V=Math.max(b,P);if(ee){let e=Math.max(0,S-N);O.style.top=d.height>=F?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=$V(p)}else O.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=eI(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(YV,`50% ${i}%`)}(V===S||P>=x)&&(A.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,O,D,m,g,N,k,u,v,h]),J.useEffect(()=>{if(!m||!O||!S)return;let e=tv(O);function t(e){s.context.setOpen(!1,Yb(hx,e))}return bx(e,`resize`,t)},[s,m,O,S]);let I={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&Ck.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:KV},className:!k&&m?IF.className:void 0},L=_y(`div`,e,{ref:[t,s.context.popupRef],state:F,stateAttributesMapping:XV,props:[T,I,iD(E),o]});return(0,Y.jsxs)(J.Fragment,{children:[!b&&IF.getElement(y),(0,Y.jsx)(MC,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:L})]})});function QV(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function $V(e){return nI(e.scrollHeight,e.clientHeight)}function eH(e){return $T.getScale(e)}function tH(e,t,n){return e/n[t]}function nH(e,t){return iS({x:tH(e.x,`x`,t),y:tH(e.y,`y`,t),width:tH(e.width,`x`,t),height:tH(e.height,`y`,t)})}var rH=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function iH(e){let{style:t}=e,n={};for(let[e,r]of rH)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of rH){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var aH=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=bV(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=WV(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:KV},className:u&&d!==`touch`?IF.className:void 0};return _y(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),oH=J.createContext(void 0);function sH(){let e=J.useContext(oH);if(!e)throw Error(qv(57));return e}var cH=J.memo(J.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=J.useRef(null),d=sk({guess:!0,label:o,textRef:u}),f=bV(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),S=f.useState(`isSelectedByFocus`,d.index),C=d.index,w=J.useRef(null);Q(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),Q(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=AV(C,a,f.context.valuesRef.current,e,_,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&wV(a,e,_),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,_,f,a]);let T=J.useRef(`mouse`),E=J.useRef(!1),{getButtonProps:D,buttonRef:O}=$v({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:v,selected:x,highlighted:y};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?jV(n,a,_):[...n,a];f.context.setValue(r,Yb(nx,e))}else f.context.setValue(a,Yb(nx,e)),f.context.setOpen(!1,Yb(nx,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&nb(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!E.current;E.current=!1,!(v||i)&&A(e.nativeEvent)},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),v||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=_y(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=J.useMemo(()=>({selected:x,index:C,textRef:u,selectedByFocus:S}),[x,C,u,S]);return(0,Y.jsx)(oH.Provider,{value:P,children:N})})),lH=J.memo(J.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=J.useRef(null),{transitionStatus:l,setMounted:u}=$C(o),d=_y(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:bb});return iw({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),uH=J.forwardRef(function(e,t){let{selected:n}=sH();return e.keepMounted||n?(0,Y.jsx)(lH,{...e,selected:n,ref:t}):null}),dH=J.memo(J.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=sH(),a=bV(),{render:o,className:s,style:c,...l}=e;return _y(`div`,e,{ref:[J.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),fH=J.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=bV(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=WV(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=zy(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=$C(g);Q(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),iw({open:g,ref:v,onComplete(){g||x(!1)}});let S=_y(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=nI(e.scrollHeight,e.clientHeight),r=rI(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=pH(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:bb});return y||o?S:null});function pH(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?rI(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?rI(l.offsetTop+l.offsetHeight-r+i,a):a}var mH=J.forwardRef(function(e,t){return(0,Y.jsx)(fH,{...e,ref:t,direction:`down`})}),hH=J.forwardRef(function(e,t){return(0,Y.jsx)(fH,{...e,ref:t,direction:`up`})}),gH=J.createContext(void 0);function _H(){let e=J.useContext(gH);if(e===void 0)throw Error(qv(56));return e}var vH=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=J.useState(),c=J.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=_y(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,Y.jsx)(gH.Provider,{value:c,children:l})}),yH=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=_H(),c=FE(a);return Q(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),_y(`div`,e,{ref:t,props:[{id:c,"aria-hidden":!0},o]})}),bH=NV;function xH({className:e,...t}){return(0,Y.jsx)(vH,{"data-slot":`select-group`,className:X(`scroll-my-1 p-1`,e),...t})}function SH({className:e,...t}){return(0,Y.jsx)(BV,{"data-slot":`select-value`,className:X(`flex flex-1 text-left`,e),...t})}function CH({className:e,size:t=`default`,children:n,...r}){return(0,Y.jsxs)(RV,{"data-slot":`select-trigger`,"data-size":t,className:X(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-ui whitespace-nowrap transition-colors select-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,Y.jsx)(VV,{render:(0,Y.jsx)(ig,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function wH({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,Y.jsx)(HV,{children:(0,Y.jsx)(JV,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,Y.jsxs)(ZV,{"data-slot":`select-content`,"data-align-trigger":o,className:X(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-(--duration-fast) data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,Y.jsx)(DH,{}),(0,Y.jsx)(aH,{children:t}),(0,Y.jsx)(OH,{})]})})})}function TH({className:e,...t}){return(0,Y.jsx)(yH,{"data-slot":`select-label`,className:X(`px-1.5 py-1 text-caption text-muted-foreground`,e),...t})}function EH({className:e,children:t,...n}){return(0,Y.jsxs)(cH,{"data-slot":`select-item`,className:X(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-ui -outline-offset-2 select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,Y.jsx)(dH,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,Y.jsx)(uH,{render:(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,Y.jsx)(ng,{className:`pointer-events-none`})})]})}function DH({className:e,...t}){return(0,Y.jsx)(hH,{"data-slot":`select-scroll-up-button`,className:X(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Y.jsx)(ug,{})})}function OH({className:e,...t}){return(0,Y.jsx)(mH,{"data-slot":`select-scroll-down-button`,className:X(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Y.jsx)(ig,{})})}var kH=e=>{let t=(0,J.useRef)(null),n=(0,J.useRef)(!1);return(0,J.useEffect)(()=>{e?n.current=!0:n.current&&(n.current=!1,t.current?.focus())},[e]),t},AH=`Write the rule first.`,jH=e=>`${e} ${e===1?`character`:`characters`} over the limit. Keep it to one rule; add another preference for the rest.`,MH=[`look-for`,`dont-flag`],NH={"look-for":{label:`What an AI review should look for`,example:`Tenant isolation: every query filters by tenant ID`},"dont-flag":{label:`What an AI review should not flag`,example:`Naming`}},PH=({option:e})=>(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(KB,{scope:e.scope,className:`size-3.5 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.label})]}),FH=({legend:e,initial:t,scopes:n,kindFixed:r=!1,inline:i=!1,submit:a,submitting:o,submitIcon:s,focus:c=!1,onSubmit:l,onCancel:u})=>{let d=(0,J.useId)(),[f,p]=(0,J.useState)(t.kind),[m,h]=(0,J.useState)(t.text),[g,_]=(0,J.useState)(WB(t.scope)),[v,y]=(0,J.useState)(!1),[b,x]=(0,J.useState)(null),S=(0,J.useRef)(null);(0,J.useEffect)(()=>{c&&S.current!==null&&(S.current.focus(),S.current.setSelectionRange(S.current.value.length,S.current.value.length))},[]);let C=i?{key:WB(t.scope),label:``,scope:t.scope}:n.find(e=>e.key===g)??n[0],w=m.trim().length,T=w-300,E=b??(T>0?jH(T):null),D=w>=250,O=async e=>{if(e.preventDefault(),v||C===void 0||T>0)return;if(w===0){x(AH),S.current?.focus();return}y(!0),x(null);let t=await l({kind:f,text:m.trim(),scope:C.scope});y(!1),x(t),t===null&&h(``)},k=r?(0,Y.jsx)(BB,{kind:f}):(0,Y.jsx)(lF,{"aria-label":`Kind`,value:f,onValueChange:e=>{(e===`look-for`||e===`dont-flag`)&&p(e)},className:`inline-flex w-auto shrink-0 gap-0.5 rounded-md border border-input p-px`,children:MH.map(e=>{let{label:t,icon:n}=zB[e];return(0,Y.jsxs)(uF,{value:e,children:[(0,Y.jsx)(n,{"aria-hidden":`true`}),t]},e)})}),A=(0,Y.jsx)(`label`,{htmlFor:`${d}-text`,className:i?`sr-only`:`text-ui font-medium`,children:NH[f].label}),j=(0,Y.jsx)(Vk,{ref:S,id:`${d}-text`,rows:1,className:X(`resize-none bg-card text-body aria-invalid:focus-visible:outline-destructive`,i?`min-h-8 min-w-0 flex-1 basis-60 py-1`:`min-h-[72px]`),placeholder:NH[f].example,value:m,onChange:e=>{h(e.target.value.replace(/\s*\n\s*/g,` `)),x(null)},onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),e.currentTarget.form?.requestSubmit())},"aria-invalid":E!==null,"aria-describedby":D?`${d}-count ${d}-problem`:`${d}-problem`}),M=(0,Y.jsx)(`p`,{id:`${d}-problem`,role:`status`,className:`flex min-w-0 flex-1 basis-60 items-start gap-1.5 text-caption text-destructive`,children:E!==null&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(fg,{"aria-hidden":`true`,className:`mt-px size-3.5 shrink-0`}),E]})}),N=D&&(0,Y.jsxs)(`span`,{id:`${d}-count`,"data-slot":`character-count`,className:X(`tabular shrink-0 text-caption`,T>0?`font-medium text-destructive`:`text-muted-foreground`),children:[w,`/`,300,(0,Y.jsx)(`span`,{className:`sr-only`,children:` characters`})]}),P=(0,Y.jsxs)(Y.Fragment,{children:[u!==void 0&&(0,Y.jsx)($,{type:`button`,variant:`ghost`,onClick:u,children:`Cancel`}),(0,Y.jsxs)($,{type:`submit`,className:`shrink-0`,disabled:v||T>0,focusableWhenDisabled:!0,"aria-busy":v,"aria-describedby":T>0?`${d}-problem`:void 0,children:[s,v?o:a]})]});return(0,Y.jsx)(`form`,{"aria-label":e,"data-slot":`preference-form`,className:X(`flex flex-col`,!i&&`gap-3`),onSubmit:e=>void O(e),noValidate:!0,children:i?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[k,A,j,P]}),(0,Y.jsxs)(`div`,{className:X(`flex items-start justify-end gap-3`,(E!==null||D)&&`mt-1.5`),children:[M,N]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2`,children:[k,(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{id:`${d}-scope`,className:`shrink-0 text-ui text-muted-foreground`,children:`Applies to`}),C===void 0?null:n.length>1?(0,Y.jsxs)(bH,{value:C.key,items:n.map(e=>({value:e.key,label:e.label})),onValueChange:e=>{typeof e==`string`&&_(e)},children:[(0,Y.jsx)(CH,{className:`max-w-80 min-w-0`,"aria-labelledby":`${d}-scope`,children:(0,Y.jsx)(SH,{children:()=>(0,Y.jsx)(PH,{option:C})})}),(0,Y.jsx)(wH,{alignItemWithTrigger:!1,align:`start`,children:n.map(e=>(0,Y.jsx)(EH,{value:e.key,label:e.label,children:(0,Y.jsx)(PH,{option:e})},e.key))})]}):(0,Y.jsx)(PH,{option:C})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[A,j]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-x-3 gap-y-2`,children:[M,N,P]})]})})},IH=({title:e,onClose:t,children:n,className:r,returnFocus:i=()=>!0})=>{let a=(0,J.useRef)(null);return(0,Y.jsx)(Qj,{open:!0,onOpenChange:e=>{e||t()},children:(0,Y.jsxs)(tM,{ref:a,className:X(`max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg`,r),initialFocus:()=>a.current?.querySelector(`[data-autofocus]`)??!0,finalFocus:()=>i(),children:[(0,Y.jsx)(nM,{className:`shrink-0 pr-8`,children:(0,Y.jsx)(rM,{children:e})}),n]})})},LH=({preference:e,onDelete:t,onClose:n})=>{let[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(null);return(0,Y.jsxs)(IH,{title:`Delete preference`,onClose:n,children:[(0,Y.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(BB,{kind:e.kind}),(0,Y.jsx)(`span`,{className:`min-w-0 break-words`,children:e.text})]}),(0,Y.jsx)(`p`,{className:`text-ui text-muted-foreground`,children:`AI reviews stop using it. A review already made keeps what it says of it.`}),a!==null&&(0,Y.jsxs)(`p`,{className:`rounded-lg border border-review-changes/25 bg-review-changes-bg px-3 py-2 text-review-changes`,role:`alert`,children:[`Couldn't delete it. `,a]}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Y.jsx)($,{variant:`outline`,"data-autofocus":!0,onClick:n,children:`Cancel`}),(0,Y.jsx)($,{variant:`destructive`,disabled:r,onClick:async()=>{i(!0);let e=await t();i(!1),o(e),e===null&&n()},children:r?`Deleting…`:`Delete`})]})]})},RH=({preference:e,scopes:t,actions:n})=>{let[r,i]=(0,J.useState)(`shown`),[a,o]=(0,J.useState)(null),s=kH(r===`editing`),{id:c,kind:l,text:u,source:d,enabled:f}=e;return r===`editing`?(0,Y.jsx)(`li`,{className:`px-4 py-3`,children:(0,Y.jsx)(FH,{legend:`Edit: ${u}`,initial:e,scopes:t,submit:`Save`,submitting:`Saving…`,focus:!0,onCancel:()=>i(`shown`),onSubmit:async e=>{let t=await n.onEdit(c,e);return t===null&&i(`shown`),t}})}):(0,Y.jsxs)(`li`,{"data-slot":`preference`,"data-enabled":f,className:`flex flex-wrap items-start gap-x-3 gap-y-1 px-4 py-2.5`,children:[(0,Y.jsx)(BB,{kind:l,className:`min-w-[98px]`}),(0,Y.jsx)(`span`,{className:X(`min-w-0 flex-1 basis-56 text-body break-words`,!f&&`text-muted-foreground`),children:u}),(0,Y.jsxs)(`span`,{className:`-my-[3px] ml-auto flex shrink-0 items-center gap-2`,children:[d!==`written`&&(0,Y.jsxs)(`span`,{className:`flex items-center gap-1 text-caption text-muted-foreground`,children:[(0,Y.jsx)(E_,{"aria-hidden":`true`,className:`size-3 text-primary`}),`From your reviews`]}),!f&&(0,Y.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:`off`}),(0,Y.jsx)(CF,{checked:f,"aria-label":`Use in AI reviews: ${u}`,onCheckedChange:async e=>{o(null),o(await n.onSwitch(c,e))}}),(0,Y.jsxs)(`span`,{className:`flex gap-0.5`,children:[(0,Y.jsx)($,{ref:s,variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":`Edit: ${u}`,onClick:()=>i(`editing`),children:(0,Y.jsx)(o_,{"aria-hidden":`true`,className:`size-3.5`})}),(0,Y.jsx)($,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":`Delete: ${u}`,onClick:()=>i(`deleting`),children:(0,Y.jsx)(A_,{"aria-hidden":`true`,className:`size-3.5`})})]})]}),a!==null&&(0,Y.jsxs)(`p`,{role:`alert`,className:`basis-full text-caption text-destructive`,children:[(0,Y.jsx)(M_,{"aria-hidden":`true`,className:`mr-1 inline size-3.5 align-[-2px]`}),a]}),r===`deleting`&&(0,Y.jsx)(LH,{preference:e,onDelete:()=>n.onDelete(c),onClose:()=>i(`shown`)})]})},zH=({preferences:e,scopes:t,actions:n,label:r})=>(0,Y.jsx)(`ul`,{"aria-label":r,className:`divide-y overflow-hidden rounded-lg border bg-card`,children:e.map(e=>(0,Y.jsx)(RH,{preference:e,scopes:t,actions:n},e.id))}),BH=({proposal:e,scopes:t,actions:n})=>{let{id:r,kind:i,text:a,evidence:o}=e,[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(null),[d,f]=(0,J.useState)(null),p=async e=>{if(l!==null)return;if(e===`accept`&&a.length>300)return c(!0);u(e),f(null);let t=await(e===`accept`?n.onAccept(r,null):n.onReject(r));u(null),f(t)};return s?(0,Y.jsx)(`li`,{className:`bg-card px-4 py-3`,children:(0,Y.jsx)(FH,{legend:`Cut the suggestion to fit: ${a}`,initial:e,scopes:t,submit:`Add`,submitting:`Adding…`,submitIcon:(0,Y.jsx)(ng,{"aria-hidden":`true`}),focus:!0,onCancel:()=>c(!1),onSubmit:e=>n.onAccept(r,e)})}):(0,Y.jsxs)(`li`,{"data-slot":`proposal`,className:`flex flex-wrap items-start gap-x-3 gap-y-2 px-4 py-2.5`,children:[(0,Y.jsx)(BB,{kind:i,className:`min-w-[98px]`}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 basis-56`,children:[(0,Y.jsx)(`p`,{className:`text-body break-words`,children:a}),o.length>0&&(0,Y.jsx)(`ul`,{"aria-label":`Based on`,className:`flex flex-col text-caption text-muted-foreground`,children:[...new Set(o)].map(e=>(0,Y.jsx)(`li`,{className:`break-words`,children:e},e))})]}),(0,Y.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,Y.jsxs)($,{variant:`ai-quiet`,size:`sm`,"aria-label":`Add suggestion: ${a}`,"aria-busy":l===`accept`,onClick:()=>void p(`accept`),children:[(0,Y.jsx)(ng,{"aria-hidden":`true`}),l===`accept`?`Adding…`:`Add`]}),(0,Y.jsx)($,{variant:`ghost`,size:`sm`,className:`text-muted-foreground`,"aria-label":`Dismiss suggestion: ${a}`,"aria-busy":l===`reject`,onClick:()=>void p(`reject`),children:l===`reject`?`Dismissing…`:`Dismiss`})]}),d!==null&&(0,Y.jsxs)(`p`,{role:`alert`,className:`basis-full text-caption text-destructive`,children:[(0,Y.jsx)(M_,{"aria-hidden":`true`,className:`mr-1 inline size-3.5 align-[-2px]`}),d]})]})},VH=({proposals:e,scopes:t,actions:n,label:r,fallbackFocus:i})=>{let a=(0,J.useRef)(null),o=()=>(e.length>1?a.current:i.current)?.focus(),s=e=>e.then(e=>(e===null&&o(),e)),c={onAccept:(e,t)=>s(n.onAccept(e,t)),onReject:e=>s(n.onReject(e))};return(0,Y.jsx)(`ul`,{ref:a,tabIndex:-1,"aria-label":r,"data-slot":`suggestions`,className:`divide-y divide-ai-soft-bd overflow-hidden rounded-lg border border-ai-soft-bd bg-ai-soft`,children:e.map(e=>(0,Y.jsx)(BH,{proposal:e,scopes:t,actions:c},e.id))})},HH=({context:e,title:t,host:n,word:r,actions:i})=>(0,Y.jsxs)(`header`,{className:`flex flex-wrap items-start gap-x-4 gap-y-3`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 basis-64`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,Y.jsx)(`h2`,{ref:e.heading,id:e.headingId,tabIndex:-1,className:`text-[1.125rem] leading-[1.625rem] font-semibold [overflow-wrap:anywhere]`,children:t}),n!==void 0&&(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-caption text-muted-foreground`,children:[(0,Y.jsx)(WR,{host:n,className:`size-3`}),iL[n]]})]}),(0,Y.jsx)(`p`,{className:`mt-1 text-ui text-muted-foreground`,children:r})]}),i]}),UH=({title:e,count:t=0,icon:n,children:r})=>{let i=(0,J.useId)();return(0,Y.jsxs)(`section`,{"aria-labelledby":i,className:`mt-7`,children:[(0,Y.jsxs)(`h3`,{id:i,className:`mb-2 flex items-center gap-1.5 text-caption font-semibold text-muted-foreground`,children:[n,e,t>0&&(0,Y.jsxs)(Y.Fragment,{children:[` `,(0,Y.jsx)(`span`,{className:`tabular font-medium`,children:t})]})]}),r]})},WH=({context:e,option:t,title:n=`Suggestions from your reviews`,icon:r})=>{let i=$B(e.view,t.scope);return i.length===0?null:(0,Y.jsx)(UH,{title:n,count:i.length,icon:r,children:(0,Y.jsx)(VH,{proposals:i,scopes:e.scopes,actions:e.proposals,label:`Suggestions for ${t.label}`,fallbackFocus:e.heading})})},GH=({context:e,option:t})=>{let n=QB(e.view,t.scope);return n.length===0?null:(0,Y.jsx)(UH,{title:`Preferences`,count:n.length,children:(0,Y.jsx)(zH,{preferences:n,scopes:e.scopes,actions:e.actions,label:`Preferences for ${t.label}`})})},KH=({context:e,option:t})=>(0,Y.jsx)(UH,{title:`Add a preference`,children:(0,Y.jsx)(FH,{legend:`Add a preference`,initial:{kind:`look-for`,text:``,scope:t.scope},scopes:e.scopes,inline:!0,submit:`Add preference`,submitting:`Adding…`,submitIcon:(0,Y.jsx)(c_,{"aria-hidden":`true`}),onSubmit:e.add},t.key)}),qH=({where:e})=>(0,Y.jsxs)(`p`,{className:`mt-5 text-ui text-muted-foreground`,children:[`No preferences for `,e,` yet.`]}),JH=({context:e,option:t})=>{let n=QB(e.view,t.scope).length===0&&$B(e.view,t.scope).length===0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(HH,{context:e,title:`Everywhere`,word:`Used on every pull request, in every repository.`}),(0,Y.jsx)(WH,{context:e,option:t}),(0,Y.jsx)(GH,{context:e,option:t}),n&&(0,Y.jsx)(qH,{where:`every repository`}),(0,Y.jsx)(KH,{context:e,option:t})]})},YH=({context:e,option:t,repository:n})=>{let{repo:r,guidelineFiles:i,guidelineNote:a}=n,o=e.suggest(r);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(HH,{context:e,title:HB(r),host:r.host,word:`Used on its pull requests, after the ones for Everywhere.`,actions:(0,Y.jsx)(LB,{...o})}),(0,Y.jsx)(RB,{...o,className:`mt-2`}),(0,Y.jsx)(WH,{context:e,option:t}),(0,Y.jsx)(GH,{context:e,option:t}),eV(e.view,t.scope)&&(0,Y.jsx)(qH,{where:`this repository`}),(0,Y.jsx)(KH,{context:e,option:t}),(0,Y.jsx)(UH,{title:`Guideline files`,children:(0,Y.jsx)(gV,{files:i,note:a,onSwitch:(t,n)=>e.switchGuideline(r,t,n)})})]})},XH=({context:e})=>{let t=rV(e.view,e.scopes);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(HH,{context:e,title:`Suggestions`,word:`From the points you raised or dismissed and the comments you posted. Add one to make it a preference where shown.`}),t.length===0?(0,Y.jsx)(`p`,{className:`mt-5 max-w-[620px] text-ui text-muted-foreground`,children:`No suggestions yet. Suggest from my reviews, on a repository's panel, proposes rules from what you did on its pull requests and your comments on them.`}):t.map(({option:t})=>(0,Y.jsx)(WH,{context:e,option:t,title:t.label,icon:(0,Y.jsx)(KB,{scope:t.scope,className:`size-3.5`})},t.key))]})},ZH=e=>fV(e,`preference`),QH=e=>`${e} waiting`,$H=({full:e,count:t,counted:n})=>t>0?`${e}, ${n}`:e,eU=({entry:e})=>{let t=(0,J.useRef)(null),[n,r]=(0,J.useState)(e.name);return(0,J.useLayoutEffect)(()=>{let n=t.current;if(n!==null&&e.repo)return OF(n,()=>{let t=n.firstElementChild,i=n.lastElementChild;if(n.clientWidth===0||i===null)return;let a=n.clientWidth-(t===null||t===i?0:DF(t,t.textContent??``)??0);r(kI(e.name,e=>(DF(i,e)??0)<=a+.5))})},[e.name,e.repo]),(0,Y.jsxs)(`span`,{ref:t,"aria-hidden":`true`,className:`min-w-0 flex-1 truncate text-left`,children:[e.owner!==null&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.owner,`/`]}),(0,Y.jsx)(`span`,{children:n})]})},tU=({entry:e})=>e.count>0?(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`tabular shrink-0 text-caption`,e.ai?`font-medium text-primary in-data-highlighted:text-accent-foreground`:`text-muted-foreground`),children:e.count}):null,nU=({entry:e,current:t,onSelect:n})=>{let r=(0,Y.jsxs)(`button`,{type:`button`,"aria-current":e.key===t?`page`:void 0,"aria-label":$H(e),onClick:()=>n(e.key),className:X(`relative flex h-[34px] w-full items-center gap-2 rounded-md px-2.5 text-ui hover:bg-surface-row [&_svg]:text-muted-foreground`,`aria-[current=page]:bg-secondary aria-[current=page]:font-medium aria-[current=page]:before:absolute aria-[current=page]:before:inset-y-[7px] aria-[current=page]:before:left-0 aria-[current=page]:before:w-0.5 aria-[current=page]:before:rounded-full aria-[current=page]:before:bg-primary`,e.ai&&`[&_svg]:text-primary`),children:[e.icon,(0,Y.jsx)(eU,{entry:e}),(0,Y.jsx)(tU,{entry:e})]});return(0,Y.jsx)(`li`,{children:e.repo?(0,Y.jsxs)(YL,{children:[(0,Y.jsx)(XL,{delay:500,render:r}),(0,Y.jsx)(ZL,{side:`right`,sideOffset:8,children:e.full})]}):r})},rU=({id:e,children:t})=>(0,Y.jsx)(`p`,{id:e,className:`mt-4 mb-1 px-2.5 text-caption font-medium text-muted-foreground`,children:t}),iU=({entries:e,current:t,onSelect:n,className:r})=>{let i=(0,J.useId)();return(0,Y.jsxs)(`nav`,{"aria-label":`Scopes`,className:r,children:[(0,Y.jsxs)(`ul`,{children:[(0,Y.jsx)(nU,{entry:e.suggestions,current:t,onSelect:n}),(0,Y.jsx)(nU,{entry:e.everywhere,current:t,onSelect:n})]}),e.repositories.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(rU,{id:`${i}-repositories`,children:`Repositories`}),(0,Y.jsx)(`ul`,{"aria-labelledby":`${i}-repositories`,children:e.repositories.map(e=>(0,Y.jsx)(nU,{entry:e,current:t,onSelect:n},e.key))})]})]})},aU=({entry:e})=>(0,Y.jsxs)(EH,{value:e.key,label:e.full,"aria-label":$H(e),className:`h-[34px] gap-2 pl-2.5 data-selected:font-medium [&_svg]:text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:X(`flex`,e.ai&&`[&_svg]:text-primary`),children:e.icon}),(0,Y.jsx)(eU,{entry:e}),(0,Y.jsx)(tU,{entry:e})]}),oU=({entries:e,current:t,onSelect:n,className:r})=>{let i=(0,J.useId)(),a=[e.suggestions,e.everywhere,...e.repositories],o=a.find(e=>e.key===t)??e.everywhere;return(0,Y.jsxs)(`div`,{className:X(`flex flex-col gap-1.5`,r),children:[(0,Y.jsx)(`span`,{id:`${i}-label`,className:`text-caption font-medium text-muted-foreground`,children:`Scope`}),(0,Y.jsxs)(bH,{value:o.key,items:a.map(e=>({value:e.key,label:e.full})),onValueChange:e=>{typeof e==`string`&&n(e)},children:[(0,Y.jsx)(CH,{"aria-labelledby":`${i}-label`,className:`h-10 w-full max-w-[440px] gap-2 rounded-lg px-3 text-body font-medium data-popup-open:border-ring data-popup-open:ring-3 data-popup-open:ring-ring/20 [&_svg]:text-muted-foreground`,children:(0,Y.jsx)(SH,{children:()=>(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:X(`flex`,o.ai&&`[&_svg]:text-primary`),children:o.icon}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o.full}),(0,Y.jsx)(tU,{entry:o})]})})}),(0,Y.jsxs)(wH,{alignItemWithTrigger:!1,align:`start`,sideOffset:6,children:[(0,Y.jsxs)(xH,{children:[(0,Y.jsx)(aU,{entry:e.suggestions}),(0,Y.jsx)(aU,{entry:e.everywhere})]}),e.repositories.length>0&&(0,Y.jsxs)(xH,{children:[(0,Y.jsx)(TH,{children:`Repositories`}),e.repositories.map(e=>(0,Y.jsx)(aU,{entry:e},e.key))]})]})]})]})},sU=()=>(0,Y.jsxs)(`div`,{role:`status`,"aria-busy":`true`,"aria-label":`Loading your preferences`,className:`lg:grid lg:grid-cols-[240px_minmax(0,1fr)] lg:items-start lg:gap-10`,children:[(0,Y.jsx)(`div`,{"aria-hidden":`true`,className:`hidden flex-col gap-2 lg:flex`,children:[28,20,32,24].map(e=>(0,Y.jsx)(pF,{className:`h-[34px] motion-reduce:animate-none`,style:{width:`${e*7}px`}},e))}),(0,Y.jsxs)(`div`,{"aria-hidden":`true`,className:`flex flex-col gap-3`,children:[(0,Y.jsx)(pF,{className:`h-10 w-full max-w-[440px] motion-reduce:animate-none lg:hidden`}),(0,Y.jsx)(pF,{className:`h-6 w-56 motion-reduce:animate-none`}),(0,Y.jsx)(pF,{className:`h-4 w-80 max-w-full motion-reduce:animate-none`}),(0,Y.jsx)(`div`,{className:`mt-5 flex flex-col gap-3 rounded-lg border bg-card px-4 py-3`,children:[1,2].map(e=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(pF,{className:`h-[22px] w-24 motion-reduce:animate-none`}),(0,Y.jsx)(pF,{className:`h-4 flex-1 motion-reduce:animate-none`})]},e))})]})]}),cU=({now:e=Date.now,startOn:t})=>{let{client:n}=Pp(),r=HR(yL().status?.model??null),i=Bp(),[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(null);i.preferences!==a&&(o(i.preferences),c(i.preferences));let[l,u]=(0,J.useState)(new Map),[d,f]=(0,J.useState)(``),p=(0,J.useRef)(null),m=(0,J.useId)(),h=B_(J_()),[g,_]=(0,J.useState)(t??null),v=t===void 0?h:g,y=(0,J.useRef)(!1);(0,J.useEffect)(()=>{y.current&&(y.current=!1,p.current?.focus())},[v]);let b=e=>{y.current=!0,t===void 0?Y_(z_(e===WB(VB)?null:e)):_(e)},x=e=>c(t=>t===null?t:e(t)),S=(e,t,n)=>e.ok?(x(n=>t(n,e.value)),f(n),null):dV(e.error),C=async e=>S(await n.addPreference(e),qB,`Added: ${e.text}`),w={onSwitch:async(e,t)=>S(await n.updatePreference(e,{enabled:t}),qB,t?`Switched on`:`Switched off`),onEdit:async(e,t)=>S(await n.updatePreference(e,t),qB,`Saved: ${t.text}`),onDelete:async e=>S(await n.deletePreference(e),t=>JB(t,e),`Deleted`)},T={onAccept:async(e,t)=>S(await n.decideProposal(e,{decision:`accept`,...t}),(t,{preference:n})=>{let r=XB(t,e);return n===null?r:qB(r,n)},`Added to your preferences`),onReject:async e=>S(await n.decideProposal(e,{decision:`reject`}),t=>XB(t,e),`Dismissed`)},E=async(e,t,r)=>S(await n.setGuidelineSwitch({repo:e,path:t,enabled:r}),n=>ZB(n,e,t,r),r?`${t} switched on`:`${t} switched off`),D=t=>({phase:l.get(t)??MB,onPhase:e=>u(n=>new Map(n).set(t,e)),choice:r,now:e});return(0,Y.jsxs)(`div`,{"data-slot":`preferences-page`,className:`mx-auto w-full max-w-[1088px] pb-12 lg:pt-5`,children:[(0,Y.jsxs)(`header`,{className:`mb-6 flex flex-col gap-1`,children:[(0,Y.jsx)(`h1`,{className:`text-[1.5rem] leading-8 font-semibold tracking-[-0.018em]`,children:`Preferences`}),(0,Y.jsx)(`p`,{className:`text-body text-muted-foreground`,children:`What you want an AI review to look for and to leave out. Used by Request AI review.`})]}),(()=>{if(s===null)return i.loading||i.error===null?(0,Y.jsx)(sU,{}):(0,Y.jsxs)(`div`,{className:X(dF,`flex flex-wrap items-center justify-between gap-2`),role:`alert`,children:[(0,Y.jsxs)(`p`,{children:[`Couldn't read your preferences. `,Gp(i.error)]}),(0,Y.jsx)($,{variant:`outline`,size:`sm`,onClick:i.refresh,children:`Try again`})]});let e=cV(s),t=e.map(e=>e.repo),r=GB(t),a=e=>aV(e,GB(cV(YB(s,e)).map(e=>e.repo))),o={view:s,scopes:r,actions:w,proposals:T,add:C,switchGuideline:E,suggest:e=>({...D(UB(e)),label:`Suggest from my reviews`,running:`Reading your reviews of ${HB(e)}…`,icon:(0,Y.jsx)(E_,{"aria-hidden":`true`}),what:`Reads what you did on its pull requests here and your comments on ${iL[e.host]}, then runs`,run:async t=>{let r=await n.suggestPreferences({repo:e,...t===void 0?{}:{optionId:t}});if(!r.ok)return{ok:!1,message:dV(r.error)};let{proposals:i,...o}=r.value;return x(e=>YB(e,i)),{ok:!0,said:oV(o,i.length,a(i))}}}),heading:p,headingId:m},c=nV(v,r),l=c.kind===`suggestions`?tV:c.option.key,u={suggestions:{key:tV,icon:(0,Y.jsx)(E_,{"aria-hidden":`true`,className:`size-[15px] shrink-0`}),full:`Suggestions`,name:`Suggestions`,owner:null,count:s.proposals.length,counted:QH(s.proposals.length),ai:!0},everywhere:{key:WB(VB),icon:(0,Y.jsx)(Rg,{"aria-hidden":`true`,className:`size-[15px] shrink-0`}),full:`Everywhere`,name:`Everywhere`,owner:null,count:QB(s,VB).length,counted:ZH(QB(s,VB).length)},repositories:r.flatMap(e=>{if(e.scope.kind!==`repo`)return[];let n=QB(s,e.scope).length;return[{key:e.key,icon:(0,Y.jsx)(WR,{host:e.scope.repo.host}),full:e.label,...sV(e.scope.repo,t),count:n,counted:ZH(n),repo:!0}]})},d=(()=>{if(c.kind===`suggestions`)return(0,Y.jsx)(XH,{context:o});let{option:t}=c;if(t.scope.kind===`global`)return(0,Y.jsx)(JH,{context:o,option:t});let n=e.find(e=>UB(e.repo)===t.key);return n===void 0?null:(0,Y.jsx)(YH,{context:o,option:t,repository:n})})();return(0,Y.jsxs)(`div`,{className:`lg:grid lg:grid-cols-[240px_minmax(0,1fr)] lg:items-start lg:gap-10`,children:[(0,Y.jsx)(iU,{entries:u,current:l,onSelect:b,className:`hidden lg:sticky lg:top-4 lg:block`}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(oU,{entries:u,current:l,onSelect:b,className:`mb-5 lg:hidden`}),(0,Y.jsx)(`section`,{"aria-labelledby":m,"data-slot":`scope-panel`,children:d})]})]})})(),(0,Y.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:d})]})},lU=[`import`,`call`,`type`,`request`],uU=e=>e.slice(e.lastIndexOf(`/`)+1),dU=(e,t)=>e<t?-1:+(e>t),fU=e=>/\.(md|mdx|rst|adoc)$/i.test(e),pU=/(^|[/_.-])(fakes?|mocks?|stubs?|fixtures?|testing|test[_-]?(utils?|helpers?|support))([/_.-]|$)/i,mU=e=>PI(e).split(`/`).slice(0,3).join(`/`),hU=e=>e===``?`.`:PI(MI(`${e}/x`)),gU=e=>`group:${e}`,_U=e=>{let t=new Map(e.map(e=>[e,e.split(`/`)])),n=(e,n)=>(t.get(e)??[]).slice(-n).join(`/`),r=new Map;for(let i of e){let a=t.get(i)?.length??1,o=1;for(;o<a&&e.some(e=>e!==i&&n(e,o)===n(i,o));)o+=1;r.set(i,n(i,o))}return r},vU=`\0routes`,yU=e=>`${e.method} ${e.path}`,bU=e=>{let[t]=e;return e.length===1&&t!==void 0?`${t.method} ${t.path}`:`${e.length} routes`},xU=(e,t)=>{let n=il(e.parts),r=new Map(e.files.flatMap(e=>al(e,n).map(({id:t,hunk:n})=>[t,{file:e,hunk:n}]))),i=new Map,a=(e,t)=>{let n=i.get(e)??[];n.includes(t)||i.set(e,[...n,t])},o=new Map;for(let e of t){let t=new Map;for(let n of e.entries){let e=r.get(n)?.file.path;e!==void 0&&t.set(e,[...t.get(e)??[],n])}for(let[n,i]of t){let t=i.flatMap(e=>{let t=r.get(e),n=t===void 0?null:cd(t.file,t.hunk,[]);return n?.kind===`route`?n.routes:[]});if(t.length>0&&(a(n,vU),o.set(n,[...o.get(n)??[],...t])),!(new Set(t.map(yU)).size===i.length&&t.length>0))for(let t of e.title.split(`; `)){t.startsWith(`Page: `)&&a(n,t);let e=/^Command: (\S+) in (.+)$/.exec(t);e!==null&&e[2]===uU(n)&&a(n,`Command: ${e[1]}`)}}}return new Map([...i].map(([e,t])=>{let n=[...new Map((o.get(e)??[]).map(e=>[yU(e),e])).values()];return[e,t.map(e=>e===vU?bU(n):e)]}))},SU=(e,t)=>{let n=new Map,r=new Map,i=[],a=new Set,o=[],s=0,c=e=>{n.set(e,s),r.set(e,s),s+=1,i.push(e),a.add(e);for(let i of t(e))n.has(i)?a.has(i)&&r.set(e,Math.min(r.get(e)??0,n.get(i)??0)):(c(i),r.set(e,Math.min(r.get(e)??0,r.get(i)??0)));if(r.get(e)!==n.get(e))return;let l=[];for(let t=i.pop();t!==void 0&&(a.delete(t),l.push(t),t!==e);t=i.pop());l.length>1&&o.push(l)};for(let t of e)n.has(t)||c(t);return o},CU=()=>({uses:new Set,symbols:new Set,pairs:0}),wU=e=>{let t=new Set(e.proofs.flatMap(e=>e.hunkId??[])),n=e.files.filter(e=>e.hunks.some(e=>!t.has(e.id))),r=new Map(n.flatMap(e=>e.hunks.map(t=>[t.id,e.path]))),i=new Set(n.map(e=>e.path)),a=new Map,o=(e,t,n,r)=>{if(e===t||!i.has(e)||!i.has(t))return;let o=a.get(e)??new Map,s=o.get(t)??{...CU(),pairs:1};s.uses.add(n),r!==void 0&&s.symbols.add(r),o.set(t,s),a.set(e,o)};for(let{from:t,to:n}of e.fileLinks)o(t,n,`import`);for(let t of e.callGraph){let e=r.get(nl(t.fromPartId)),n=r.get(nl(t.toPartId));e!==void 0&&n!==void 0&&o(e,n,t.use,t.symbol)}return{mechanical:t,files:n,pathOfHunk:r,links:a}},TU=(e,t=new Set)=>{let{mechanical:n,files:r,pathOfHunk:i,links:a}=wU(e),o=e.flows??[],s=new Set(o.flatMap(e=>e.partIds)),c=[...r].sort((e,t)=>NI(e.path,t.path)).flatMap(t=>al(t,il(e.parts)).map(e=>e.id)).filter(e=>!n.has(nl(e))&&!s.has(e)),l=[...new Set([...s,...c])],u=new Map(l.map((e,t)=>[e,t])),d=e=>u.get(e)??l.length,f=new Set(e.generated),p=new Map(r.map(t=>{let r=t.hunks.flatMap(e=>e.lines),i=al(t,il(e.parts)).map(e=>e.id).filter(e=>!n.has(nl(e))).sort((e,t)=>d(e)-d(t)),a=t.hunks.every(e=>n.has(e.id))?`mechanical`:`logic`;return[t.path,{added:r.filter(e=>e.kind===`add`).length,deleted:r.filter(e=>e.kind===`del`).length,partIds:i,risk:a,rank:i.reduce((e,t)=>Math.min(e,d(t)),1/0)}]})),m=e=>p.get(e)?.rank??1/0,h=(e,t)=>m(e)-m(t)||dU(e,t),g=r.map(e=>e.path).sort(h),_=e=>[...a.get(e)?.keys()??[]],v=e=>g.filter(t=>a.get(t)?.has(e)===!0),y=new Set(g.filter(ll));for(let e=!0;e;){e=!1;for(let t of g){let n=v(t);!y.has(t)&&pU.test(t)&&n.length>0&&n.every(e=>y.has(e))&&(y.add(t),e=!0)}}let b=g.filter(e=>!y.has(e)&&fU(e)),x=g.filter(e=>!y.has(e)&&!fU(e)),S=new Set(x),C=new Map;for(let e of[...y].sort(h)){let t=[],n=new Set([e]),r=e=>{for(let i of _(e))n.has(i)||(n.add(i),S.has(i)?t.push(i):r(i))};r(e),C.set(e,t)}let w=new Map;for(let[e,t]of C)for(let n of t)w.set(n,[...w.get(n)??[],e]);let T=[...y].filter(e=>(C.get(e)??[]).length===0),E=new Map;for(let e of[...x,...b,...T].sort(NI)){let n=gU(PI(e)),r=t.has(n)?e:n;E.set(r,[...E.get(r)??[],e])}let D=new Map;for(let[e,t]of E)for(let n of t)D.set(n,e);let O=e=>Math.min(...(E.get(e)??[e]).map(m)),k=(e,t)=>O(e)-O(t)||dU(e,t),A=[...E.keys()].sort(k),j=new Map;for(let[e,t]of a)for(let[n,r]of t){let t=D.get(e),i=D.get(n);if(t===void 0||i===void 0||t===i)continue;let a=j.get(t)??new Map,o=a.get(i)??CU();for(let e of r.uses)o.uses.add(e);for(let e of r.symbols)o.symbols.add(e);o.pairs+=r.pairs,a.set(i,o),j.set(t,a)}let M=new Map;for(let{partId:t,symbol:n,uses:r}of e.unchangedCallers??[]){let e=i.get(nl(t)),a=e===void 0?void 0:D.get(e);if(a!==void 0)for(let e of r){let r=M.get(e.path)??{targets:new Map,uses:0,partIds:new Set},i=r.targets.get(a)??CU();i.uses.add(e.use),i.symbols.add(n),r.targets.set(a,i),r.uses+=1,r.partIds.add(t),M.set(e.path,r)}}let N=[...M.keys()].sort((e,t)=>Number(ll(e))-Number(ll(t))||dU(e,t)),P=new Map;for(let e of N){let t=N.length>10?`outside:${mU(e)}/`:`outside:${e}`;P.set(t,[...P.get(t)??[],e])}for(let[e,t]of[...P]){let[n]=t;e.endsWith(`/`)&&t.length===1&&n!==void 0&&(P.delete(e),P.set(`outside:${n}`,[n]))}let F=new Map;for(let[e,t]of P){let n=new Map;for(let e of t)for(let[t,r]of M.get(e)?.targets??[]){let e=n.get(t)??CU();for(let t of r.uses)e.uses.add(t);for(let t of r.symbols)e.symbols.add(t);n.set(t,e)}F.set(e,n)}let I=new Set([...[...j].flatMap(([e,t])=>t.size>0?[e,...t.keys()]:[]),...[...F.values()].flatMap(e=>[...e.keys()])]),L=A.filter(e=>I.has(e)),R=new Set,ee=(e,t)=>`${e}\u0000${t}`,z=e=>[...j.get(e)?.keys()??[]].filter(t=>!R.has(ee(e,t))),B=(e,t)=>j.get(e)?.get(t)?.pairs??0;for(let e=SU(L,z);e.length>0;e=SU(L,z))for(let t of e){let[e,n,r]=t;if(e!==void 0&&n!==void 0&&r===void 0&&B(e,n)!==B(n,e)){R.add(B(e,n)<B(n,e)?ee(e,n):ee(n,e));continue}let[i]=[...t].sort(k);for(let e of t)i!==void 0&&z(e).includes(i)&&R.add(ee(e,i))}let V=new Map(L.map(e=>[e,[]]));for(let e of L)for(let t of z(e))V.get(t)?.push(e);let te=new Map,H=e=>{let t=te.get(e);if(t!==void 0)return t;let n=Math.max(-1,...(V.get(e)??[]).map(H))+1;return te.set(e,n),n},U=[],ne=(e,t)=>{for(;U.length<=t;)U.push([]);U[t]?.push(e)};for(let e of L)ne(e,H(e));for(let[e,t]of F){let n=[...t.keys()];V.set(e,n),te.set(e,Math.max(...n.map(H))+1),ne(e,te.get(e)??0)}let re=()=>new Map(U.flatMap(e=>e.map((t,n)=>[t,n-(e.length-1)/2]))),ie=e=>z(e),ae=(e,t)=>{for(let n of e){let e=re(),r=n=>{let r=t(n).map(t=>e.get(t)??0);return r.length===0?e.get(n)??0:r.reduce((e,t)=>e+t,0)/r.length},i=new Map(n.map(e=>[e,r(e)]));n.sort((e,t)=>(i.get(e)??0)-(i.get(t)??0)||k(e,t))}},oe=e=>V.get(e)??[];ae(U.slice(1),oe),ae(U.slice(0,-1).reverse(),ie),ae(U.slice(1),oe);let W=_U(g),se=xU(e,o),ce=new Map;for(let e of o)if(e.kind===`flow`)for(let t of new Set(e.partIds.flatMap(e=>i.get(nl(e))??[])))ce.set(t,[...ce.get(t)??[],e.title]);let le=e=>[...new Set(e)],ue=_U(N),de=(e,t)=>{let n=P.get(e)??[],[r]=n;return{key:e,kind:`outside`,paths:n,label:e.endsWith(`/`)||r===void 0?e.slice(8):ue.get(r)??r,added:0,deleted:0,risk:`logic`,generated:!1,entries:[],flows:[],partIds:[...new Set(n.flatMap(e=>[...M.get(e)?.partIds??[]]))],uses:n.reduce((e,t)=>e+(M.get(t)?.uses??0),0),badges:[],row:t}},fe=(e,t)=>{if(P.has(e))return de(e,t);let n=E.get(e)??[e],r=n.flatMap(e=>p.get(e)??[]),i=e.startsWith(`group:`);return{key:e,kind:i?`group`:`file`,paths:n,label:i?`${hU(e.slice(6))}/`:W.get(e)??e,added:r.reduce((e,t)=>e+t.added,0),deleted:r.reduce((e,t)=>e+t.deleted,0),risk:r.every(e=>e.risk===`mechanical`)?`mechanical`:`logic`,generated:n.every(e=>f.has(e)),entries:le(n.flatMap(e=>se.get(e)??[])),flows:le(n.flatMap(e=>ce.get(e)??[])),partIds:r.flatMap(e=>e.partIds).sort((e,t)=>d(e)-d(t)),badges:le(n.flatMap(e=>w.get(e)??[])).sort(h),uses:0,row:t}},pe=U.map((e,t)=>e.map(e=>fe(e,t))),me=A.filter(e=>!I.has(e)).map(e=>fe(e,-1)),he=new Map;for(let e of[...pe.flat(),...me])if(e.kind!==`outside`)for(let t of e.paths)he.set(t,e.key);for(let[e,t]of C){let[n]=t,r=n===void 0?void 0:D.get(n);r!==void 0&&he.set(e,r)}return{rows:pe,edges:[...[...j].map(e=>[e,!1]),...[...F].map(e=>[e,!0])].flatMap(([[e,t],n])=>[...t].map(([t,r])=>({from:e,to:t,uses:lU.filter(e=>r.uses.has(e)),symbols:[...r.symbols].sort(dU),back:R.has(ee(e,t)),outside:n}))),strip:me,placeOf:he}},EU=e=>e.kind!==`outside`&&!e.generated&&e.risk!==`mechanical`,DU=e=>e.kind===`group`?e.key.slice(6)||`.`:e.key,OU=e=>{let t=e.rows.map(e=>e.filter(EU)).filter(e=>e.length>0),n=e.strip.filter(EU),r=t.length>0,i=r?t:[n],a=i.flat();if(a.length===0)return null;let o=_U(a.map(DU)),s=8,c=i.map(e=>e.flatMap(e=>s===0?[]:(--s,[{label:o.get(DU(e))??DU(e),entries:e.entries}]))).filter(e=>e.length>0);return{rows:c,linked:r,more:a.length-c.flat().length+(r?n.length:0)}},kU=(e,t)=>{let n=e.flatMap(e=>{let n=t(e.partId);if(n===void 0||ll(n))return[];let r=e.uses.filter(e=>!ll(e.path)).length,i=e.uses.length>r?0:e.more;return r+i===0?[]:[{symbol:e.symbol,uses:r+i}]});return n.length===0?null:{symbols:[...new Set(n.map(e=>e.symbol))],uses:n.reduce((e,t)=>e+t.uses,0)}},AU=e=>e.split(/`([^`\n]+)`/).map((e,t)=>({text:e,code:t%2==1})).filter(e=>e.text!==``),jU={finding:[`finding`,`findings`],risk:[`risk`,`risks`],decision:[`decision`,`decisions`]},MU=({kind:e,count:t,words:n,at:r,pressed:i,onPressed:a,label:o})=>{let[s,c]=n,l=e===`thread`?n_:DD[e];return(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`point-chip`,"data-kind":e,"data-land":`rise`,"aria-pressed":i,"aria-label":o,style:Ph({"--landing-i":r}),onClick:()=>a(!i),className:X(`flex min-h-6 shrink-0 items-center gap-1.5 rounded-full border px-2 text-caption font-medium aria-pressed:border-current aria-pressed:ring-1 aria-pressed:ring-current`,e===`thread`?`border-border bg-background text-foreground`:ED[e].className),children:[(0,Y.jsx)(l,{"aria-hidden":`true`,className:`size-3.5`}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{"data-slot":`count-up`,"aria-hidden":`true`,className:`tabular`,style:Ph({"--count":t})}),(0,Y.jsx)(`span`,{className:`sr-only`,children:t}),` `,(0,Y.jsx)(`span`,{className:`max-xl:sr-only`,children:t===1?s:c})]})]})},NU=({choice:e,variant:t,compact:n,icon:r,label:i,note:a,locked:o=!1,disabled:s=!1,busy:c=null,slot:l,onClick:u})=>{let d=(0,J.useId)(),f=n?`sm`:`default`,p=(0,Y.jsx)($,{variant:t,size:f,"data-slot":l,disabled:s||c!==null,focusableWhenDisabled:!0,"aria-describedby":a===null?void 0:d,onClick:u,className:X(`rounded-r-none border-r-0`,c!==null&&`aria-disabled:cursor-progress aria-disabled:opacity-100`)});return(0,Y.jsxs)(`span`,{role:`group`,"aria-label":`AI review`,className:`flex shrink-0 items-center`,children:[(0,Y.jsxs)(YL,{disabled:a===null,children:[(0,Y.jsxs)(XL,{render:p,children:[(0,Y.jsx)(r,{"aria-hidden":`true`,className:X(c!==null&&`animate-spin motion-reduce:animate-none`)}),i]}),(0,Y.jsxs)(ZL,{side:`bottom`,align:`start`,children:[o&&(0,Y.jsx)(Wg,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),a]})]}),a!==null&&(0,Y.jsx)(`span`,{id:d,hidden:!0,children:a}),(0,Y.jsx)(jB,{choice:e,disabled:c!==null||s||e.options.length===0,variant:t,size:f}),c!==null&&(0,Y.jsx)(`span`,{role:`status`,className:`sr-only`,children:c})]})},PU=e=>{let t=Zu.filter(t=>e.stages[t]!==`done`);return t.length===0||e.modelError===null?null:`${t.join(`, `)} missing: ${e.modelError.message}`},FU=({analysis:e,choice:t,running:n,starting:r,error:i,points:a,leftOut:o=0,threads:s=null,narrowed:c,onNarrow:l,onRun:u,onRerun:d,reanalyze:f=null,filesChanged:p=null,children:m})=>{let h=Bl(e.modelOption??t.chosen),g=m!=null&&m!==!1,{chosen:_,locked:v}=t,y=v??(_===null?null:`Runs ${_.modelName} through ${_.via}`),b=r||v!==null||_===null,x=id(e),S=rd(e),C=e.modelError,w=[`finding`,`risk`,`decision`].map(e=>[e,a.filter(t=>t.kind===e).length]).filter(([,e])=>e>0),T=!n&&a.length>0,E=T?w.length+(s===null?0:1):0,D=e=>T?{"data-land":`rise`,style:Ph({"--landing-i":E+e})}:{},O=ed(e),k=O.filter(t=>e.stages[t]===`done`).length,A=n?(0,Y.jsx)(NU,{choice:t,variant:`ai-quiet`,compact:!0,icon:Qg,label:`Reviewing · ${k} of ${O.length}`,note:null,busy:`${h} is reading this PR, ${k} of ${O.length} passes done`,slot:`claude-running`}):f===null?S?(0,Y.jsx)(NU,{choice:t,variant:C===null?`ai`:`ai-quiet`,compact:a.length>0,icon:v===null?C===null?E_:u_:e_,label:r?`Starting…`:C===null?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`max-sm:sr-only`,children:`Request AI review`}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`sm:hidden`,children:`AI review`})]}):`Try again`,note:y,locked:v!==null,disabled:b,slot:`request-review`,onClick:u}):d!==void 0&&(0,Y.jsx)(NU,{choice:t,variant:`ai-quiet`,compact:!0,icon:u_,label:r?`Starting…`:`Re-run`,note:v??(_===null?null:`Runs ${_.modelName} through ${_.via} again`),locked:v!==null,disabled:b,slot:`rerun`,onClick:d}):(0,Y.jsx)(NU,{choice:t,variant:`ai-strong`,compact:x,icon:u_,label:f.starting?`Starting…`:`Re-analyze · new commits`,note:`Reads the PR's new commits as a new analysis`,disabled:f.starting,slot:`reanalyze`,onClick:f.onReanalyze}),j=!n&&f===null&&!x&&(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 whitespace-nowrap text-muted-foreground max-lg:hidden`,children:[(0,Y.jsx)(E_,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,Y.jsx)(`span`,{className:`font-semibold text-foreground`,children:`No AI review yet`}),p!==null&&p>0&&(0,Y.jsxs)(`span`,{className:`truncate max-xl:hidden`,children:[`Find bugs, risks and decisions across `,p,` `,p===1?`file`:`files`]})]}),M=i??(a.length>0?PU(e):null)??(C===null||a.length>0?null:`${h} couldn't finish: ${C.message}`),N=!n&&!S&&a.length===0&&e.stages.findings===`done`&&(0,Y.jsxs)(`span`,{"data-slot":`claude-receipt`,"data-land":`fade`,className:`shrink-0 whitespace-nowrap text-muted-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`✓ `}),h,` found nothing to raise`,o>0&&`, and left out ${o} by your preferences`]}),P=T?(0,Y.jsxs)(`span`,{"data-slot":`claude-receipt`,className:`flex min-w-0 items-center gap-1.5`,children:[w.map(([e,t],n)=>(0,Y.jsx)(MU,{kind:e,count:t,words:jU[e],at:n,pressed:c===e,onPressed:t=>l(t?e:null)},e)),s!==null&&(0,Y.jsx)(MU,{kind:`thread`,count:s.count,words:s.words,label:s.label,at:w.length,pressed:c===`thread`,onPressed:e=>l(e?`thread`:null)}),g&&(0,Y.jsx)(`span`,{...D(0),className:`ml-1 flex min-w-0 items-center`,children:m})]}):(N!==!1||g)&&(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[N,g&&(0,Y.jsx)(`span`,{className:`flex min-w-0 items-center`,children:m})]});return(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[P,(0,Y.jsxs)(`span`,{...D(1),className:X(`flex min-w-0 shrink-0 items-center gap-2`,P!==!1&&`border-l pl-2`),children:[j,A]}),M!==null&&(0,Y.jsx)(`span`,{...D(2),role:`alert`,title:M,className:`min-w-0 truncate text-caption text-destructive`,children:M})]})},IU=e=>`call-${e.partId}-${e.line}-${e.column}`,LU=(e,t,n)=>{let r=new Map;for(let i of e){let e=t.items(i.toPartIds).map(({id:e,hunk:t,file:n})=>({id:e,hunk:t,file:n}));if(e.length===0||!t.parts.has(i.partId))continue;let a={symbol:i.symbol,targets:e},o=IU(i),s=r.get(i.partId)??new Map,c=s.get(i.line)??[];c.some(e=>e.start===i.column)||(c.push({start:i.column,end:i.column+i.length,render:e=>(0,Y.jsx)(BM,{handle:n,payload:a,id:o,children:e})}),s.set(i.line,c),r.set(i.partId,s))}return r},RU=(e,t)=>{let n=e.checkedBy;if(n===void 0)return null;let{hunkId:r,startLine:i}=n.lines,a=t.items(t.partsOf(r)),o=a.filter(({hunk:e})=>e.lines.some(e=>e.kind!==`del`&&e.newLine===i)),s=(o.length>0?o:a).map(({id:e,hunk:t,file:n})=>({id:e,hunk:t,file:n}));return s.length===0?null:{symbol:n.test,targets:s,label:`Test ${n.test}`}},zU=({children:e})=>(0,Y.jsx)(`code`,{className:`font-mono text-code-compact text-foreground`,children:e}),BU=e=>{let t=Xl[e];return`${/^[aeiou]/i.test(t)?`an`:`a`} ${t}`},VU=e=>{switch(e.is){case`rule`:return`A check could catch this next time: \`${e.rule}\` in ${Yl[e.tool]}.`;case`suggested`:return`A check could catch this next time: ${BU(e.kind)} in ${e.engine}. ${e.does}`}},HU=`flex items-start gap-1.5 text-caption text-muted-foreground`,UU=({guardrail:e,family:t,className:n,children:r})=>{switch(e.is){case`rule`:return(0,Y.jsxs)(`p`,{"data-slot":`guardrail`,"data-guardrail":`rule`,className:X(HU,n),children:[(0,Y.jsx)(v_,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`min-w-0`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:`A check could catch this:`}),` `,(0,Y.jsx)(zU,{children:e.rule}),` in `,Yl[e.tool],`, which`,` `,(0,Y.jsx)(zU,{children:e.configPath}),` doesn't turn on.`,r]})]});case`suggested`:return(0,Y.jsxs)(`p`,{"data-slot":`guardrail`,"data-guardrail":`suggested`,className:X(HU,n),children:[(0,Y.jsx)(b_,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`min-w-0`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:`This looks checkable:`}),` `,BU(e.kind),` in `,e.engine,`. `,e.does,` `,(0,Y.jsxs)(`span`,{className:`italic`,children:[`Suggested by `,t,`, not checked.`]}),r]})]})}},WU=({guardrail:e,family:t,body:n,onEdit:r})=>{let i=VU(e);return(0,Y.jsx)(`div`,{"data-slot":`draft-guardrail`,className:`border-t pt-2`,children:(0,Y.jsx)(UU,{guardrail:e,family:t,children:n.includes(i)?(0,Y.jsxs)(`span`,{className:`ml-1 inline-flex items-center gap-1 text-foreground`,children:[(0,Y.jsx)(ng,{"aria-hidden":`true`,className:`size-3.5`}),`Added to the comment`]}):(0,Y.jsxs)(Y.Fragment,{children:[` `,(0,Y.jsx)($,{variant:`outline`,size:`sm`,className:`ml-1`,onClick:()=>r(`${n.trimEnd()}\n\n${i}`),children:`Add to comment`})]})})})},GU=e=>`hunk-${e}`,KU=e=>e===void 0?{}:{marks:e},qU=({id:e,deps:t})=>{let[n]=t.index.items([e]);if(n===void 0)return null;let{hunk:r,file:i,risk:a,proofs:o=[]}=n;return o.length>0?(0,Y.jsx)(`div`,{className:AM,children:(0,Y.jsx)(rN,{hunk:r,file:i,risk:a,proofs:o,onFocus:t.onFocusHunk})}):(0,Y.jsx)(LM,{id:e,hunk:r,file:i,risk:a,highlighted:t.highlighted.has(e),onFocus:t.onFocusHunk,unchanged:t.unchangedOf(e),inFile:!0,comments:t.commentsOf(e),openComment:t.openComment?.partId===e?t.openComment.place:null,onOpenComment:t.onOpenComment,...t.onCancelComment===void 0?{}:{onCancelComment:t.onCancelComment},onComment:t.onComment,...t.onCommentNow===void 0?{}:{onCommentNow:t.onCommentNow},...t.draftNote===void 0?{}:{draftNote:(n,r)=>t.draftNote?.(e,n,r)},afterHeader:t.pointsOn(e),...t.pointLinesOf(e)===void 0?{}:{pointLines:t.pointLinesOf(e)},threadsAt:n=>t.threadsAt(e,n),pointsAt:n=>t.pointsAt(e,n),pointsAtEnd:n=>t.pointsAtEnd(e,n),...t.flaggedOf(e)===void 0?{}:{flagged:t.flaggedOf(e)},...t.rangeNote===void 0?{}:{rangeNote:t.rangeNote},...KU(t.marksOf(e))})},JU=`You opened this pull request, and its author can't approve it.`,YU=`The PR has new commits since the analysis: re-analyze to approve them.`,XU=({aiDone:e,running:t,pending:n,isAuthor:r,stale:i,verdict:a})=>{let o=a===`approved`,s=o?null:r?JU:i?YU:null,c={filled:n>0,count:n};if(o)return{approve:{filled:!1,disabledReason:s,revoke:!0},publish:c,order:n>0?[`approve`,`publish`]:[`approve`]};let l=n===0&&e&&!t&&s===null&&a!==`changes-requested`;return{approve:{filled:l,disabledReason:s,revoke:!1},publish:c,order:l?[`publish`,`approve`]:[`approve`,`publish`]}},ZU=(e,t,n)=>{let r=n?.url??null;return t?e===null?null:{kind:e,url:r}:n===null?null:{kind:`published`,url:r}},QU=(e,t)=>e===`approve`?`approved`:e===`request_changes`?`changes-requested`:t??`commented`,$U=1,eW=240,tW=6,nW=()=>{},rW=e=>{let t=e.left+e.width/2;for(let e=$U;e<Math.min(window.innerHeight,eW);e+=tW){let n=document.elementFromPoint(t,e);if(n===null||n.closest(`[data-slot=file-card-header]`)!==null)continue;let r=n.closest(`[role=row][data-line]`);if(r!==null&&r.getBoundingClientRect().top>=0)return r}return null},iW=e=>{let t=document.querySelector(e)?.getBoundingClientRect();if(window.scrollY<=$U||t===void 0||t.top>=0||typeof document.elementFromPoint!=`function`)return nW;let n=rW(t);if(n===null)return nW;let r=n.getBoundingClientRect().top;return()=>{if(!n.isConnected)return;let e=n.getBoundingClientRect().top-r;e!==0&&window.scrollBy({top:e,behavior:`instant`})}},aW=2e3,oW=[`wheel`,`touchmove`,`keydown`,`pointerdown`],sW=(e,t)=>{let n=document.querySelector(e);if(n===null||typeof ResizeObserver!=`function`)return nW;let r=new ResizeObserver(t),i=()=>{r.disconnect(),window.clearTimeout(a);for(let e of oW)window.removeEventListener(e,i)},a=window.setTimeout(i,aW);for(let e of oW)window.addEventListener(e,i,{passive:!0});return r.observe(n),i},cW=(e,t)=>sW(t,()=>document.getElementById(e)?.scrollIntoView({block:`start`,behavior:`instant`})),lW=/^#{1,6}\s+/,uW=e=>e.replace(/!?(\[([^\]]+)\])\([^)]*\)/g,`$2`).replace(/(`+)(.*?)\1/g,`$2`).replace(/(\*\*|__|~~)(.*?)\1/g,`$2`).replace(/(^|\s)[*_]([^*_]+)[*_](?=\s|[.,!?]|$)/g,`$1$2`).replace(/^\s*(?:>\s*|[-*+]\s+|\d+[.)]\s+)/,``).replace(/\\([\\`*_{}[\]()#+.!>-])/g,`$1`),dW=e=>{let t=e.split(`
|
|
86
|
+
`).map(e=>e.trim()).filter(e=>e!==``);return uW(t.find(e=>!lW.test(e))??t[0]?.replace(lW,``)??``)},fW=/^(.+?[.!?])\s+(?=[A-Z0-9"'(`[])/,pW=e=>{let t=dW(e);return fW.exec(t)?.[1]??t},mW=`font-semibold text-foreground`,hW=({text:e})=>(0,Y.jsx)(`span`,{"data-slot":`model-text`,className:`whitespace-pre-line`,children:AU(e).map((e,t)=>e.code?(0,Y.jsx)(`code`,{className:`font-mono text-code-compact`,children:e.text},t):(0,Y.jsx)(`span`,{children:uW(e.text)},t))}),gW=({through:e})=>(0,Y.jsxs)(`span`,{"data-slot":`through`,children:[e.rows.map((e,t)=>(0,Y.jsxs)(`span`,{children:[t>0&&` → `,e.map((e,t)=>(0,Y.jsxs)(`span`,{children:[t>0&&`, `,(0,Y.jsx)(`code`,{className:`font-mono text-code-compact`,children:e.label}),e.entries.length>0&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` (`,e.entries.join(`, `),`)`]})]},e.label))]},t)),e.more>0&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· `,e.more,` more `,e.more===1?`directory`:`directories`]})]}),_W=({reach:e})=>{let t=e.symbols.slice(0,3),n=e.symbols.length-t.length,r=t.map((e,r)=>(0,Y.jsxs)(`span`,{children:[r>0&&(r===t.length-1&&n===0?` and `:`, `),(0,Y.jsx)(`code`,{className:`font-mono text-code-compact`,children:e})]},e));return(0,Y.jsxs)(`span`,{"data-slot":`reach`,children:[`Changes `,r,n>0&&` and ${n} more`,`, used in `,e.uses,` `,e.uses===1?`place`:`places`,` the PR doesn't change.`]})},vW=({lead:e,children:t})=>(0,Y.jsxs)(`p`,{className:`min-w-0`,children:[(0,Y.jsx)(`span`,{className:mW,children:e}),` `,t]}),yW=e=>e.modelOption===null?null:`${e.modelOption.modelName} through ${e.modelOption.providerName}`,bW=({analysis:e,running:t,stale:n,tour:r})=>{if(!t&&!id(e))return null;let i=yW(e),a=ed(e),o=a.filter(t=>e.stages[t]===`done`).length;return(0,Y.jsxs)(`div`,{"data-slot":`ai-status`,className:`mb-1.5 flex flex-wrap items-center gap-x-1.5 text-caption text-muted-foreground`,children:[t?(0,Y.jsx)(Qg,{"aria-hidden":`true`,className:`size-3.5 animate-spin text-primary motion-reduce:animate-none`}):(0,Y.jsx)(E_,{"aria-hidden":`true`,className:`size-3.5 text-primary`}),(0,Y.jsx)(`span`,{className:`font-semibold text-foreground`,children:t?`AI review running`:`AI review`}),i!==null&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),` `,(0,Y.jsx)(`span`,{children:i})]}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),` `,t?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{children:[o,` of `,a.length,` passes`]}),(0,Y.jsx)(`span`,{role:`progressbar`,"aria-label":`AI review progress`,"aria-valuemin":0,"aria-valuemax":a.length,"aria-valuenow":o,className:`ml-1 h-1 w-30 overflow-hidden rounded-full bg-secondary`,children:(0,Y.jsx)(`span`,{className:`block h-full bg-primary transition-[width] motion-reduce:transition-none`,style:{width:`${o/a.length*100}%`}})})]}):(0,Y.jsx)(`span`,{children:n?`new commits since`:`latest commit`}),r!==null&&!t&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),` `,(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`tour-link`,onClick:r.onOpen,className:`inline-flex cursor-pointer items-center gap-1 font-medium text-primary underline-offset-2 hover:underline`,children:[(0,Y.jsx)(f_,{"aria-hidden":`true`,className:`size-3.5`}),`Tour · `,r.steps,` steps`]})]})]})},xW=({analysis:e,through:t,running:n,stale:r=!1,tour:i=null,onDetails:a})=>{let{intent:o,pullRequest:s}=e,c=o?.mismatches??[],l=s===null?``:pW(s.description),[u,d]=(0,J.useState)(o!==null),[f,p]=(0,J.useState)(!1);o!==null!==u&&(d(o!==null),p(o!==null&&n)),f&&!n&&p(!1);let m=(o!==null||s!==null)&&(0,Y.jsx)($,{variant:`ghost`,size:`icon-xs`,"aria-label":`Details`,title:`Details`,onClick:a,className:`ml-1 rounded-full align-middle text-muted-foreground`,children:(0,Y.jsx)(Wg,{"aria-hidden":`true`})}),h=new Map(e.files.flatMap(e=>e.hunks.map(t=>[t.id,e.path]))),g=kU(e.unchangedCallers,e=>h.get(nl(e))),_=t!==null&&(0,Y.jsx)(vW,{lead:t.linked?`Through:`:`In:`,children:(0,Y.jsx)(gW,{through:t})}),v=g!==null&&(0,Y.jsx)(vW,{lead:`Watch:`,children:(0,Y.jsx)(_W,{reach:g})}),y=s!==null&&(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,Y.jsxs)(`p`,{className:`min-w-0`,children:[l===``?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`The pull request has no description.`}):(0,Y.jsx)(`span`,{children:l}),!f&&m]}),_,v]}),b=o!==null&&(0,Y.jsxs)(`div`,{"data-arriving":f||void 0,className:`flex min-w-0 flex-col gap-0.5`,children:[(0,Y.jsxs)(`p`,{className:`min-w-0`,children:[(0,Y.jsx)(`span`,{className:mW,children:c.length>0||o.stated===null?`From the code:`:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ng,{"aria-hidden":`true`,className:`mr-1 inline size-3.5 align-[-0.125em] text-review-approved`}),`Does what was asked:`]})}),` `,(0,Y.jsx)(hW,{text:o.inferred.summary}),m]}),o.inferred.shape===``?_:(0,Y.jsx)(vW,{lead:`Through:`,children:(0,Y.jsx)(hW,{text:o.inferred.shape})}),o.inferred.watch.length===0?v:(0,Y.jsx)(vW,{lead:`Watch:`,children:o.inferred.watch.map((e,t)=>(0,Y.jsxs)(`span`,{children:[t>0&&` · `,(0,Y.jsx)(hW,{text:e})]},t))})]});return(0,Y.jsxs)(`div`,{"data-slot":`intent-brief`,className:`flex min-w-0 flex-col gap-1 text-body`,children:[(0,Y.jsx)(bW,{analysis:e,running:n,stale:r,tour:i}),b===!1?y:f?(0,Y.jsxs)(`div`,{"data-slot":`intent-swap`,className:`min-w-0`,children:[(0,Y.jsx)(`div`,{"data-leaving":!0,"aria-hidden":`true`,children:y}),b]}):b]})},SW=`rounded-full border bg-muted px-2 py-0.5 text-caption`,CW=({pullRequest:e,tickets:t,missingTicketKeys:n})=>{let r=e.description.trim();return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[r===``?(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`The pull request has no description.`}):(0,Y.jsx)(`p`,{className:`text-body whitespace-pre-line`,children:r}),(t.length>0||n.length>0)&&(0,Y.jsxs)(`ul`,{className:`flex flex-wrap gap-2`,"aria-label":`Tickets`,children:[t.map(e=>(0,Y.jsx)(`li`,{className:`rounded-full border bg-muted px-2 py-0.5 text-caption`,children:(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:[e.key,` · `,e.summary]})},e.key)),n.map(e=>(0,Y.jsxs)(`li`,{className:`rounded-full border bg-muted px-2 py-0.5 text-caption`,title:`Jira didn't return this ticket, or Jira isn't configured`,children:[e,` · not fetched`]},e))]}),e.commits.length>0&&(0,Y.jsxs)(`details`,{className:`group`,children:[(0,Y.jsxs)(`summary`,{className:`min-h-6 cursor-pointer font-medium`,children:[`Commits (`,e.commits.length,`)`]}),(0,Y.jsx)(`ol`,{className:`mt-1 flex flex-col gap-1`,children:e.commits.map(e=>(0,Y.jsxs)(`li`,{children:[(0,Y.jsx)(`code`,{className:`font-mono text-code-compact text-muted-foreground`,children:e.sha.slice(0,7)}),` `,e.message.split(`
|
|
87
|
+
`)[0]]},e.sha))})]})]})},wW={description:`Description`,commits:`Commits`,branch:`Branch name`},TW={unrequested:`Unrequested`,missing:`Missing`,contradicts:`Contradicts`},EW={contradicts:`text-review-changes bg-review-changes-bg border-review-changes/25`,missing:`text-review-pending bg-review-pending-bg border-review-pending/25`,unrequested:`text-review-pending bg-review-pending-bg border-review-pending/25`},DW=`whitespace-pre-line`,OW=`text-caption font-medium text-muted-foreground`,kW=({ticketKey:e,ticket:t})=>t===void 0?(0,Y.jsxs)(`li`,{className:SW,title:`Jira didn't return this ticket, or Jira isn't configured`,children:[e,` · not fetched`]}):(0,Y.jsx)(`li`,{className:SW,children:(0,Y.jsxs)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,title:t.summary,children:[t.key,` · `,t.status]})}),AW=({stated:e,ticketOf:t,unfetched:n})=>(0,Y.jsxs)(Y.Fragment,{children:[e!==null&&(0,Y.jsx)(`ul`,{className:`flex flex-wrap gap-2`,"aria-label":`Sources`,children:e.sources.map(e=>e.kind===`ticket`&&e.ref!==null?(0,Y.jsx)(kW,{ticketKey:e.ref,ticket:t.get(e.ref)},`ticket:${e.ref}`):e.kind===`ticket`?null:(0,Y.jsx)(`li`,{className:`rounded-full border bg-muted px-2 py-0.5 text-caption`,children:wW[e.kind]},e.kind))}),n.length>0&&(0,Y.jsx)(`ul`,{className:`flex flex-wrap gap-2`,"aria-label":`Tickets mentioned but not fetched`,children:n.map(e=>(0,Y.jsx)(kW,{ticketKey:e,ticket:void 0},e))})]}),jW=`No stated intent: the PR has no description or linked tickets.`,MW=({intent:e,tickets:t,missingTicketKeys:n,onSelectMismatch:r})=>{let{stated:i,inferred:a,mismatches:o}=e,s=new Map(t.map(e=>[e.key,e])),c=new Set(i?.sources.flatMap(e=>e.ref??[])??[]),l=n.filter(e=>!c.has(e)),u=(0,Y.jsx)(AW,{stated:i,ticketOf:s,unfetched:l}),d=o.length===0?i:null,{behaviorChanges:f}=a;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 text-body`,children:[o.length===0?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`p`,{children:[i===null?(0,Y.jsx)(`span`,{className:`font-medium`,children:`From the code:`}):(0,Y.jsx)(`span`,{className:`font-medium text-review-approved`,children:`✓ Does what was asked:`}),` `,(0,Y.jsx)(`span`,{className:DW,children:a.summary})]}),i===null&&(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:jW}),u]}):(0,Y.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`h3`,{className:OW,children:`Stated`}),i===null?(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:jW}):(0,Y.jsx)(`p`,{className:DW,children:i.summary}),u]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`h3`,{className:OW,children:`Inferred from the code`}),(0,Y.jsx)(`p`,{className:DW,children:a.summary})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`h3`,{className:OW,children:`Mismatches`}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:o.map((e,t)=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,className:`flex w-full flex-col items-start gap-1 rounded-md border p-2 text-left hover:bg-accent`,onClick:()=>r(t),children:[(0,Y.jsxs)(`span`,{className:X(`rounded-full border px-2 text-caption font-medium`,EW[e.kind]),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),TW[e.kind]]}),(0,Y.jsx)(`span`,{className:DW,children:e.description})]})},t))})]})]}),(d!==null||f.length>0)&&(0,Y.jsxs)(`details`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`summary`,{className:`min-h-6 cursor-pointer font-medium`,children:[`Details`,f.length>0&&` (${f.length})`]}),d!==null&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`h3`,{className:X(OW,`mt-2`),children:`Asked`}),(0,Y.jsx)(`p`,{className:DW,children:d.summary})]}),f.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`h3`,{className:X(OW,`mt-2`),children:`Behavior changes`}),(0,Y.jsx)(`ul`,{className:`list-disc pl-5`,children:f.map((e,t)=>(0,Y.jsx)(`li`,{className:DW,children:e},t))})]})]})]})},NW=3,PW=(e,t)=>{let n=e.end??t;return n===null?null:Math.max(0,n-e.start+1)},FW=e=>({head:e.newLines===0?e.newStart+1:e.newStart+e.newLines,base:e.oldLines===0?e.oldStart+1:e.oldStart+e.oldLines}),IW=e=>e.newLines===0?e.newStart+1:e.newStart,LW=e=>{let t=e.lines.at(-1);if(t===void 0||t.noNewlineAtEnd)return!0;let n=0;for(let t=e.lines.length-1;t>=0&&e.lines[t]?.kind===`context`;t--)n++;return n<NW},RW=e=>!e.binary&&e.status!==`added`&&e.status!==`deleted`,zW=(e,t)=>{let n=e.flatMap(e=>{let n=t.parts.get(e);return n===void 0?[]:[{id:e,hunk:n.hunk}]}),r=[],i=n[0];if(i===void 0)return r;let a=IW(i.hunk)-1;a>0&&r.push({before:i.id,after:null,start:1,end:a,offset:0});for(let[e,{id:t,hunk:i}]of n.entries()){let a=FW(i),o=n[e+1],s=a.base-a.head;if(o===void 0){LW(i)||r.push({before:null,after:t,start:a.head,end:null,offset:s});continue}let c=IW(o.hunk)-1;c>=a.head&&r.push({before:o.id,after:t,start:a.head,end:c,offset:s})}return r},BW=(e,t)=>Array.from({length:PW(e,t)??0},(t,n)=>e.start+n),VW=e=>{let t=e.split(`
|
|
88
|
+
`);return t.at(-1)===``&&t.pop(),t.map(e=>e.endsWith(`\r`)?e.slice(0,-1):e)},HW=(e,t)=>{let{client:n}=Pp(),[r,i]=(0,J.useState)({status:`idle`}),a=(0,J.useRef)(`idle`);return{text:r,load:(0,J.useCallback)(()=>{if(a.current===`loading`||a.current===`ready`)return;let r=e=>{a.current=e.status,i(e)};r({status:`loading`}),n.getFileContent(e,`head`,t).then(e=>r(e.ok?e.value.content===null?{status:`error`,message:`The file isn't at the pull request's head commit.`}:{status:`ready`,lines:VW(e.value.content)}:{status:`error`,message:Gp(e.error)}))},[n,e,t])}},UW=()=>(0,Y.jsx)(`svg`,{"data-slot":`unfold-icon`,className:`shrink-0`,viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,focusable:`false`,children:(0,Y.jsx)(`path`,{d:`M8 1.5v4M5.5 3.5 8 1l2.5 2.5M8 14.5v-4M5.5 12.5 8 15l2.5-2.5M2 8h12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),WW=e=>`${e} ${e===1?`line`:`lines`}`,GW=(e,t,n,r)=>e.map(e=>({oldNo:e+t.offset,newNo:e,text:n[e-1]??``,tokens:r?.[e-1]??null})),KW=({fold:e,file:t,hunkId:n,opened:r,text:i,onOpen:a,above:o,below:s})=>{let c=i.status===`ready`?i.lines:null,l=uj(c,t),u=PW(e,c?.length??null);if(u===0)return null;if(r&&c!==null)return(0,Y.jsx)(`div`,{"data-slot":`file-fold`,children:(0,Y.jsx)(cN,{hunkId:n,lines:GW(BW(e,c.length),e,c,l)})});let d=r&&i.status===`loading`,f=u===null?`Unchanged lines below`:`${WW(u)} unchanged`;return(0,Y.jsxs)(`div`,{"data-slot":`file-gap`,className:X(`flex flex-wrap items-center bg-surface-subtle text-muted-foreground`,AM,o&&`border-t`,s?`border-b`:`rounded-b-lg`),children:[(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`fold-open`,"aria-busy":d||void 0,disabled:d,onClick:a,className:X(`flex min-h-8 flex-1 items-center gap-2 px-3 cursor-pointer text-left -outline-offset-2 hover:bg-accent hover:text-foreground disabled:cursor-wait disabled:hover:bg-transparent`,!s&&`rounded-b-lg`),children:[(0,Y.jsx)(UW,{}),d?(0,Y.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`size-3 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),`Opening `,u===null?`unchanged lines below`:f]}):(0,Y.jsx)(`span`,{children:f})]}),r&&i.status===`error`&&(0,Y.jsx)(`span`,{role:`alert`,className:`px-3 text-destructive`,children:i.message})]})},qW=e=>e===`map`?`map`:e===`overview`||e===`tree`?`overview`:void 0,JW=`Not classified yet.`,YW=e=>{let t=il(e.parts),n=new Map,r=new Map;for(let i of e.files){for(let e of i.hunks){let n=t.get(e.id)??[],i=n.map(e=>e.id);r.set(e.id,n.length>0?i:[e.id])}for(let e of al(i,t)){let r=t.get(e.hunk.id)??[],a=r.findIndex(t=>t.id===e.id),o=r[a];n.set(e.id,{hunk:e.hunk,file:i,place:o===void 0?null:{n:a+1,of:r.length,definitions:o.definitions,siblings:r.map(e=>e.id)}})}}let i=new Map(e.risk.map(e=>[e.hunkId,e])),a=new Map;for(let t of e.proofs)t.hunkId!==null&&a.set(t.hunkId,[...a.get(t.hunkId)??[],t]);let o=new Set(a.keys()),s=e=>{let t=nl(e);return i.get(t)??{hunkId:t,riskClass:`logic`,reason:JW,source:`fallback`,lines:null,guidance:null}},c=e=>e.flatMap(e=>{let t=n.get(e);return t===void 0?[]:[{...t,id:e,hunkId:nl(e),risk:s(e),proofs:a.get(e)??[]}]}),l=e=>r.get(e)??[];return{parts:n,mechanical:o,items:c,partsOf:l,partsInFile:e=>e.hunks.flatMap(e=>l(e.id))}},XW=(e,t)=>[...e.files].sort((e,t)=>NI(e.path,t.path)).flatMap(e=>{let n=t.partsInFile(e);return n.every(e=>t.mechanical.has(e))?[]:[{file:e,partIds:n}]}),ZW=(e,t,n)=>{let r=n.parts.get(e),i=n.parts.get(t);if(r===void 0||i===void 0||r.file!==i.file)return null;let a=r.file.status===`deleted`?`old`:`new`,o=e=>a===`old`?{start:e.oldStart,count:e.oldLines}:{start:e.newStart,count:e.newLines},s=o(r.hunk),c=o(i.hunk),l=s.count===0?s.start:s.start+s.count-1,u=c.count===0?c.start+1:c.start;return Math.max(u-l-1,0)},QW=(e,t,n)=>{let r=new Map(t.map((e,t)=>[e,t])),i=new Map,a=new Map,o=new Map,s=[],c=(e,t,n)=>e.set(t,[...e.get(t)??[],n]);for(let t of e){let e=[...new Set(t.hunkIds)].flatMap(n.partsOf).filter(e=>r.has(e)&&!n.mechanical.has(e)).sort((e,t)=>(r.get(e)??0)-(r.get(t)??0)),l=t.lines===null?void 0:$W(t.lines,e,n),[u=l,...d]=l===void 0?e:[l,...e.filter(e=>e!==l)];if(u===void 0){s.push(t);continue}c(i,u,t),o.set(t.id,u);let f=l===void 0?null:nl(u);for(let e of d)nl(e)!==f&&c(a,e,t)}return{cards:i,mentions:a,cardPart:o,unplaced:s}},$W=(e,t,n)=>t.find(t=>n.parts.get(t)?.hunk.lines.some(t=>{let n=kM(t);return n!==null&&n.side===e.side&&n.line===e.startLine})),eG=e=>{let t=new Set,n=0;for(let r of e)r.hunkId===null?n+=1:t.add(r.hunkId);return t.size+n},tG=(e,t)=>{let n=new Set([...t.parts].flatMap(([e,{file:n}])=>t.mechanical.has(e)?[]:[n.path]));return e.proofs.filter(e=>e.hunkId===null||!n.has(e.path))},nG=(e,t)=>{let n=new Map;for(let r of e){let e=t.partsOf(r.hunkId).find(e=>t.parts.get(e)?.hunk.lines.some(e=>{let t=kM(e);return t!==null&&t.side===r.side&&t.line===r.line}));e!==void 0&&n.set(e,[...n.get(e)??[],r])}return n},rG=e=>({files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}),iG=`mechanical-changes`,aG=e=>`file-${e}`,oG=(0,J.memo)(function({render:e}){return e()},(e,t)=>e.signature===t.signature),sG=({id:e,joined:t,deps:n,signatureOf:r})=>(0,Y.jsx)(`div`,{id:GU(e),className:X(`scroll-mt-24`,!t&&`border-t first:border-t-0`),"data-hunk-id":e,children:(0,Y.jsx)(oG,{signature:r(e),render:()=>(0,Y.jsx)(qU,{id:e,deps:n})})}),cG=({lines:e})=>e===0?null:(0,Y.jsx)(`div`,{"data-slot":`file-gap`,className:X(`flex h-8 items-center gap-2 border-t bg-surface-subtle px-3 text-muted-foreground`,AM),children:(0,Y.jsxs)(`span`,{children:[e,` `,e===1?`line`:`lines`,` unchanged`]})}),lG=({analysisId:e,group:t,deps:n,signatureOf:r})=>{let i=n.index.items(t.partIds),a=i.reduce((e,t)=>e+WA(t.hunk).added,0),o=i.reduce((e,t)=>e+WA(t.hunk).deleted,0),s=n.openThreads(t.file.path),c=n.earlierThreads(t.file.path),{text:l,load:u}=HW(e,t.file.path),[d,f]=(0,J.useState)(new Set),p=(0,J.useMemo)(()=>RW(t.file)?zW(t.partIds,n.index):[],[t,n.index]),m=e=>`${e.after??``}>${e.before??``}`,h=e=>{let r=m(e),i=e.before??e.after,a=i===null?void 0:n.index.parts.get(i);return a===void 0?null:(0,Y.jsx)(KW,{fold:e,file:t.file,hunkId:a.hunk.id,opened:d.has(r),text:l,above:e.after!==null,below:e.before!==null,onOpen:()=>{u(),f(e=>new Set(e).add(r))}},r)};return(0,Y.jsxs)(`section`,{id:aG(t.file.path),"data-slot":`file-card`,className:`scroll-mt-2 rounded-lg border bg-card -outline-offset-2`,"aria-label":t.file.path,"data-path":t.file.path,tabIndex:-1,children:[(0,Y.jsxs)(`header`,{"data-slot":`file-card-header`,className:`sticky top-[var(--review-bar-h,0px)] z-10 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-t-lg border-b bg-card px-3 py-2`,children:[(0,Y.jsx)(FO,{file:t.file,status:t.file.status,className:`min-w-0 flex-1`}),(0,Y.jsx)(IO,{status:t.file.status}),(0,Y.jsxs)(`span`,{className:`tabular flex flex-wrap items-center gap-x-1.5 text-caption`,children:[s>0&&(0,Y.jsxs)(`span`,{"data-slot":`count-threads`,className:`inline-flex items-center gap-1.5 font-medium`,children:[(0,Y.jsx)(QI,{count:s}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`·`})]}),(0,Y.jsxs)(`span`,{className:`font-mono text-code-compact`,children:[(0,Y.jsxs)(`span`,{className:`text-diff-add-fg`,children:[`+`,a]}),` `,(0,Y.jsxs)(`span`,{className:`text-diff-del-fg`,children:[`−`,o]})]})]})]}),(0,Y.jsx)(`div`,{"data-slot":`file-lines`,className:`@container overflow-x-auto rounded-b-lg`,children:(0,Y.jsxs)(`div`,{className:`w-max min-w-full`,children:[t.partIds.map((e,i)=>{let a=t.partIds[i-1],o=a===void 0?null:ZW(a,e,n.index),s=p.find(t=>t.before===e);return(0,Y.jsxs)(J.Fragment,{children:[s===void 0?o!==null&&(0,Y.jsx)(cG,{lines:o}):h(s),(0,Y.jsx)(sG,{id:e,joined:o===0||s!==void 0,deps:n,signatureOf:r})]},e)}),p.filter(e=>e.before===null).map(h)]})}),c!==null&&(0,Y.jsxs)(`section`,{"data-slot":`earlier-comments`,"aria-label":`Earlier comments on ${t.file.path}`,className:`flex flex-col gap-2 border-t bg-surface-subtle px-3 py-2`,children:[(0,Y.jsx)(`h3`,{className:`text-caption font-medium text-muted-foreground`,children:`Earlier comments`}),c]})]})},uG=({analysis:e,files:t,deps:n,before:r,after:i,trailingProofs:a,mechanicalCount:o,scrollRequest:s,signatureOf:c})=>((0,J.useEffect)(()=>{if(s===null)return;let e=document.getElementById(s.id);if(e===null)return;let t=(e.dataset.hunkId===void 0?null:e.querySelector(`[data-slot=hunk-card], [data-slot=mechanical-toggle]`))??e,n=e.dataset.slot===`decision`;e.scrollIntoView({block:n?`center`:`start`}),t.focus({preventScroll:!0})},[s]),(0,Y.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-4`,"aria-label":`Changes`,children:[r,t.map(t=>(0,Y.jsx)(lG,{analysisId:e.id,group:t,deps:n,signatureOf:c},t.file.path)),i,(0,Y.jsxs)(`div`,{id:iG,className:`flex scroll-mt-2 flex-col gap-4 -outline-offset-2`,tabIndex:-1,children:[o===0&&e.stages.prep===`done`&&(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`No mechanical changes in this pull request.`}),(0,Y.jsx)(iN,{files:e.files,proofs:a,risk:e.risk}),(0,Y.jsx)(sN,{files:e.files})]})]})),dG={intent:`Intent`,findings:`Findings`,risk:`Risk`,decisions:`Decisions`,guardrails:`Guardrails`,steps:`Tour`},fG=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:`${e}`,pG=e=>`$${e.toFixed(2)}`,mG=e=>e===void 0?`—`:`${(e/1e3).toFixed(1)} s`,hG=e=>e===null?null:`${e.modelName} through ${e.providerName}`,gG=new Intl.ListFormat(`en`,{type:`conjunction`}),_G=e=>{if(e===null)return null;let t=e.preferences.length,n=[...t===0?[]:[`${t} ${t===1?`preference`:`preferences`}`],...e.guidelines.map(e=>e.path)];return n.length===0?null:gG.format(n)},vG=(e,t)=>{let n=hG(e),r=_G(t);return r===null?n:n===null?`With ${r}`:`${n} with ${r}`},yG=e=>e===null?`—`:pG(e),bG=(e,t,n=`Claude`)=>{let r=e.filter(e=>e!==null),i=e.length-r.length,a=t?`on your ${n} plan`:null;if(r.length===0)return a??`cost unknown`;let o=pG(r.reduce((e,t)=>e+t,0)),s=i===0?``:`, cost unknown for ${i} ${i===1?`call`:`calls`}`;return a===null?`${o}${s}`:`≈ ${o} at API prices${s}, ${a}`},xG=e=>e.inputTokens+e.cacheWriteTokens,SG=({usage:e,option:t=null,guidance:n=null})=>{let r=(0,J.useId)();if(e.length===0)return null;let i=t=>e.reduce((e,n)=>e+t(n),0),a=e.some(e=>e.billing===`plan`),o=e.some(e=>e.durationMs!==void 0);return(0,Y.jsxs)(`div`,{className:`group relative flex justify-end`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`peer tabular min-h-6 rounded-sm text-caption text-muted-foreground hover:text-foreground`,"aria-describedby":`${r}-breakdown`,children:[vG(t,n)===null?``:`${vG(t,n)} · `,`Usage: `,fG(i(xG)),` tokens in ·`,` `,fG(i(e=>e.cacheReadTokens)),` cache read ·`,` `,fG(i(e=>e.outputTokens)),` out ·`,` `,bG(e.map(e=>e.costUsd),a,Il(t))]}),(0,Y.jsxs)(`table`,{id:`${r}-breakdown`,role:`tooltip`,className:`tabular absolute right-0 bottom-full mb-2 hidden rounded-xl bg-popover p-3 text-caption text-popover-foreground shadow-md ring-1 ring-foreground/10 group-hover:table peer-focus-visible:table [&_td]:px-2 [&_td]:text-right [&_th]:px-2 [&_th]:text-left [&_thead_th]:font-medium [&_thead_th]:text-muted-foreground`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{scope:`col`,children:`Pass`}),(0,Y.jsx)(`th`,{scope:`col`,children:`In`}),(0,Y.jsx)(`th`,{scope:`col`,children:`Cache read`}),(0,Y.jsx)(`th`,{scope:`col`,children:`Out`}),(0,Y.jsx)(`th`,{scope:`col`,children:a?`At API prices`:`Cost`}),o&&(0,Y.jsx)(`th`,{scope:`col`,children:`Time`})]})}),(0,Y.jsx)(`tbody`,{children:e.map(e=>(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{scope:`row`,children:dG[e.pass]}),(0,Y.jsx)(`td`,{children:fG(xG(e))}),(0,Y.jsx)(`td`,{children:fG(e.cacheReadTokens)}),(0,Y.jsx)(`td`,{children:fG(e.outputTokens)}),(0,Y.jsx)(`td`,{children:yG(e.costUsd)}),o&&(0,Y.jsx)(`td`,{children:mG(e.durationMs)})]},e.pass))})]})]})},CG={intent:`Intent`,findings:`Findings`,risk:`Risk`,decisions:`Decisions`,guardrails:`Guardrails`,steps:`Tour`},wG=e=>{let t=Math.round(e/1e3);return`+${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`},TG=e=>{if(e.outcome===`ok`)return`✓ Answered`;if(e.outcome===`failed`)return`✕ Failed: ${e.error?.kind??`unknown`}`;let t=e.problems.length;return`⚠ ${t} ${t===1?`problem`:`problems`}`},EG=e=>[...e].sort((e,t)=>Date.parse(e.startedAt)-Date.parse(t.startedAt)||e.attempt-t.attempt),DG=({guidance:e,leftOut:t})=>{let n=_G(e);return n===null?null:(0,Y.jsxs)(`section`,{"aria-label":`What the run read beside the code`,className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`h3`,{className:`font-medium`,children:`Read beside the code`}),(0,Y.jsxs)(`p`,{className:`text-ui text-muted-foreground`,children:[n,`, as they were when the run started.`,` `,t===0?`No point was left out by them.`:`${t} ${t===1?`point was`:`points were`} left out by them, folded where ${t===1?`its card`:`their cards`} would be.`,` `,(0,Y.jsx)(Q_,{to:R_,className:`underline`,children:`Preferences`})]}),(0,Y.jsxs)(`ul`,{className:`flex flex-col gap-1 text-ui`,children:[e.preferences.map(e=>(0,Y.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,Y.jsx)(BB,{kind:e.kind}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 basis-56 break-words`,children:e.text}),(0,Y.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:e.scope.kind===`global`?`Everywhere`:HB(e.scope.repo)})]},e.ref)),e.guidelines.map(e=>(0,Y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(Sg,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`font-mono text-code-compact break-all`,children:e.path}),(0,Y.jsx)(`span`,{className:`tabular text-caption text-muted-foreground`,children:lV(e.bytes)})]},e.ref))]})]})},OG=({calls:e,option:t,guidance:n=null,leftOut:r=0})=>{let[i,a]=(0,J.useState)(!1),o=EG(e),s=o[0];if(s===void 0)return null;let c=Date.parse(s.startedAt),l=Math.max(...o.map(e=>Date.parse(e.startedAt)+e.durationMs));return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)($,{variant:`ghost`,size:`xs`,onClick:()=>a(!0),children:`Run details…`}),i&&(0,Y.jsxs)(IH,{title:`${Bl(t)}'s calls`,onClose:()=>a(!1),className:`sm:max-w-3xl`,children:[(0,Y.jsxs)(`p`,{className:`text-ui text-muted-foreground`,children:[hG(t)===null?``:`On ${hG(t)}. `,mG(l-c),` from the first call to the end of the last. A call whose answer has problems runs once more, told what they are.`]}),(0,Y.jsxs)(`table`,{className:`tabular w-full text-ui [&_td]:px-2 [&_td]:py-1 [&_td]:align-top [&_th]:px-2 [&_th]:py-1 [&_th]:text-left [&_th]:align-top [&_th]:font-normal [&_thead_th]:font-medium [&_thead_th]:text-muted-foreground`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{scope:`col`,children:`Pass`}),(0,Y.jsx)(`th`,{scope:`col`,children:`Started`}),(0,Y.jsx)(`th`,{scope:`col`,children:`Time`}),(0,Y.jsx)(`th`,{scope:`col`,children:`Outcome`})]})}),(0,Y.jsx)(`tbody`,{children:o.map(e=>{let t=e.error===null?e.problems:[e.error.message];return(0,Y.jsxs)(`tr`,{children:[(0,Y.jsxs)(`th`,{scope:`row`,children:[CG[e.pass],e.attempt>1&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:` · again`})]}),(0,Y.jsx)(`td`,{children:wG(Date.parse(e.startedAt)-c)}),(0,Y.jsx)(`td`,{children:mG(e.durationMs)}),(0,Y.jsxs)(`td`,{children:[(0,Y.jsx)(`span`,{className:e.outcome===`failed`?`text-destructive`:void 0,children:TG(e)}),t.length>0&&(0,Y.jsx)(`ul`,{className:`mt-1 list-disc pl-4 text-muted-foreground`,children:t.map(e=>(0,Y.jsx)(`li`,{children:e},e))})]})]},`${e.pass}/${e.attempt}/${e.startedAt}`)})})]}),n!==null&&(0,Y.jsx)(DG,{guidance:n,leftOut:r})]})]})},kG={logic:`border-risk-logic-solid bg-risk-logic-bg text-risk-logic`,mechanical:`border-risk-mechanical-solid bg-risk-mechanical-bg text-risk-mechanical`},AG=`border-dashed border-input bg-surface-subtle text-muted-foreground`,jG={call:``,import:`[stroke-dasharray:6_4]`,request:`stroke-muted-foreground [stroke-dasharray:12_4_3_4] [stroke-width:2.5]`,type:`[stroke-dasharray:1.5_3] [stroke-linecap:round]`,outside:`[stroke-dasharray:4_4] opacity-60`},MG=56,NG=24,PG=16,FG=120,IG=300,LG=7.2,RG=6.6,zG=6.7,BG=32,VG=24,HG=20,UG=380,WG=e=>e.slice(e.lastIndexOf(`/`)+1),GG=e=>e===1?`1 use`:`${e} uses`,KG=e=>e===1?`1 file`:`${e} files`,qG=e=>e.kind===`outside`?`${e.paths.length>1?`${KG(e.paths.length)} · `:``}outside the PR · ${GG(e.uses)}`:[e.kind===`group`?KG(e.paths.length):`+${e.added} −${e.deleted}`,...e.entries].join(` · `),JG=e=>BG+(e.kind===`group`&&e.paths.length>1?VG:0),YG=e=>{let t=t=>t.length*LG+JG(e)<=UG,n=e.label.endsWith(`/`)?`/`:``,r=AI(e.label.slice(0,e.label.length-n.length),e=>t(e+n));if(n!==``||t(r))return r+n;let i=r.lastIndexOf(`/`)+1,[a,o]=jI(r.slice(i)),s=r.slice(0,i);return s+OI(a,e=>t(s+e+o))+o},XG=e=>{let t=e.badges.reduce((e,t)=>e+WG(t).length*zG+14,0),n=Math.min(Math.max(YG(e).length*LG+JG(e),qG(e).length*RG+HG,t+HG),UG),r=FG+Math.sqrt(e.added+e.deleted)*9;return Math.round(Math.max(n,Math.min(r,IG)))},ZG=72,QG=(e,t)=>{let n=e.map(e=>e.reduce((e,t,n)=>e+XG(t)+(n>0?NG:0),0)),r=Math.max(0,...n)+32,i=r+(t?ZG:0),a=new Map;return e.forEach((e,t)=>{let i=(r-(n[t]??0))/2;for(let n of e){let e=XG(n);a.set(n.key,{x:i,y:PG+t*120,width:e}),i+=e+NG}}),{boxes:a,width:i,height:e.length===0?0:32+e.length*64+(e.length-1)*MG}},$G=e=>e.outside?`outside`:e.uses.includes(`request`)?`request`:e.uses.includes(`call`)?`call`:e.uses.every(e=>e===`import`)?`import`:`type`,eK=(e,t)=>{let n=e=>{let n=t.get(e);return n===void 0?0:n.x+n.width/2},r=(e,r,i)=>{let a=t.get(r),o=[...e].sort((e,t)=>n(i(e))-n(i(t)));return new Map(o.map((e,t)=>[e,a===void 0?0:a.x+a.width*(.5+(o.length===1?0:(t/(o.length-1)-.5)*.5))]))},i=e.filter(e=>!e.back&&!e.outside),a=new Map,o=new Map;for(let e of t.keys()){for(let[t,n]of r(i.filter(t=>t.from===e),e,e=>e.to))a.set(t,n);for(let[t,n]of r(i.filter(t=>t.to===e),e,e=>e.from))o.set(t,n)}return{out:a,into:o}},tK=(e,t,n,r,i=e.x+e.width/2,a=t.x+t.width/2)=>{if(n){let n=e.x+e.width,i=t.x+t.width,a=e.y+32,o=t.y+32,s=r-ZG/2;return`M ${n} ${a} C ${s} ${a} ${s} ${o} ${i} ${o}`}if(e.y>t.y){let n=e.y,r=t.y+64,o=Math.max(MG/2,(n-r)/2);return`M ${i} ${n} C ${i} ${n-o} ${a} ${r+o} ${a} ${r}`}let o=e.y+64,s=t.y,c=Math.max(MG/2,(s-o)/2);return`M ${i} ${o} C ${i} ${o+c} ${a} ${s-c} ${a} ${s}`},nK={import:`imports`,call:`calls`,type:`uses types from`,request:`sends requests to`},rK=(e,t)=>{let n=e.uses.map(e=>nK[e]).join(`, `),r=e.symbols.length>0?`: ${e.symbols.join(`, `)}`:``;return`${t(e.from)} ${n} ${t(e.to)}${r}`},iK=({node:e,box:t,active:n,current:r,onOpen:i,onExpand:a,onFocus:o})=>{let s=e.kind===`group`,c=s&&e.paths.length>1,l=e.kind===`outside`,u=(l?[e.label,qG(e)]:[e.label,s?KG(e.paths.length):null,...e.entries,e.risk,e.generated?`generated`:null,r?`in view in the code`:null]).filter(e=>e!==null).join(`, `);return(0,Y.jsxs)(`div`,{"data-slot":`overview-node-box`,className:X(`grid`,t===void 0?`relative`:`absolute`),style:t===void 0?{width:XG(e)}:{left:t.x,top:t.y,width:t.width,height:64},children:[(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`overview-node`,"data-risk":l?`outside`:e.risk,"data-generated":e.generated||void 0,"data-active":n||void 0,"data-current":r||void 0,className:X(`grid h-full w-full content-start gap-0.5 overflow-hidden rounded-md border px-2 py-1 text-left text-caption`,l?AG:kG[e.risk],e.generated&&`border-dashed`,n&&`border-primary`,r&&`shadow-[0_0_0_2px_var(--background),0_0_0_4px_var(--primary)]`),"data-key":e.key,"aria-label":u,"aria-current":r?`location`:void 0,title:s?`${e.key.slice(6)}/`:e.paths.length===1?e.paths[0]:void 0,onClick:()=>i(e),onFocus:()=>o(e),onMouseEnter:()=>o(e),onMouseLeave:()=>o(null),children:[(0,Y.jsx)(`span`,{className:X(`flex min-w-0 items-baseline gap-2`,c&&`pr-6`),children:(0,Y.jsx)(`span`,{"data-slot":`overview-label`,className:`min-w-0 truncate font-mono text-code-compact font-semibold`,children:YG(e)})}),(0,Y.jsx)(`span`,{className:`truncate`,children:qG(e)}),e.badges.length>0&&(0,Y.jsx)(`span`,{className:`flex gap-1 overflow-hidden`,children:e.badges.map(e=>(0,Y.jsx)(`span`,{className:`shrink-0 rounded-sm border border-current px-1 font-mono text-kbd`,children:WG(e)},e))})]}),c&&(0,Y.jsx)($,{variant:`ghost`,size:`icon-xs`,className:`absolute top-1 right-1 text-current`,"aria-label":`Show the files of ${e.label}`,title:`Show its files`,onClick:()=>a(e),children:(0,Y.jsx)(Jg,{"aria-hidden":`true`})})]})},aK=({overview:e,focusKey:t,currentPath:n,onOpen:r,onExpand:i,onCollapse:a,expandedGroups:o,onFocusNode:s})=>{let c=(0,J.useId)(),l=(0,J.useRef)(null),[u,d]=(0,J.useState)(null),{boxes:f,width:p,height:m}=(0,J.useMemo)(()=>QG(e.rows,e.edges.some(e=>e.back)),[e]),h=(0,J.useMemo)(()=>eK(e.edges,f),[e.edges,f]),g=(0,J.useMemo)(()=>new Map([...e.rows.flat(),...e.strip].map(e=>[e.key,e.label])),[e]),_=e=>g.get(e)??e,v=(0,J.useMemo)(()=>[...e.rows,e.strip].filter(e=>e.length>0),[e]);(0,J.useEffect)(()=>d(null),[e]);let y=(0,J.useRef)(-1);(0,J.useEffect)(()=>{if(t===null||y.current===t.n)return;let n=e.placeOf.get(t.key)??t.key,r=l.current?.querySelector(`[data-key="${CSS.escape(n)}"]`);r!=null&&(y.current=t.n,r.focus(),r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))},[t,e]);let b=e=>l.current?.querySelector(`[data-key="${CSS.escape(e)}"]`)?.focus(),x=e=>{let t=e.target.dataset.key;if(t===void 0)return;let n=v.findIndex(e=>e.some(e=>e.key===t)),r=v[n]?.findIndex(e=>e.key===t)??-1,i=e=>{let t=l.current?.querySelector(`[data-key="${CSS.escape(e.key)}"]`)?.getBoundingClientRect();return t===void 0?0:t.left+t.width/2},a;if(e.key===`ArrowRight`)a=v[n]?.[r+1];else if(e.key===`ArrowLeft`)a=v[n]?.[r-1];else if(e.key===`ArrowDown`||e.key===`ArrowUp`){let t=v[n+(e.key===`ArrowDown`?1:-1)]??[],o=v[n]?.[r],s=o===void 0?0:i(o);a=[...t].sort((e,t)=>Math.abs(i(e)-s)-Math.abs(i(t)-s))[0]}else return;e.preventDefault(),a!==void 0&&b(a.key)},S=u?.kind===`node`?u.node.key:null,C=e=>e.from===S||e.to===S,w=e=>{e!==null&&s(e.key),d(e===null?null:{kind:`node`,node:e})},T=n===null?null:e.placeOf.get(n)??null,E=e=>({node:e,active:S===e.key,current:T===e.key,onOpen:r,onExpand:e=>i(e.key),onFocus:w});return(0,Y.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3`,"aria-label":`Overview of the changed files`,ref:l,onKeyDown:x,children:[(0,Y.jsxs)(`p`,{"data-slot":`overview-legend`,className:`text-muted-foreground`,children:[`Each box is a directory. Directories that nothing in the pull request calls are on top; each sits below its callers. Solid lines are calls, dash-dot ones HTTP requests to a route, dashed ones imports, dotted ones types. Tests show on the directories they call. The outlined box holds the file last in view in the code.`,e.edges.some(e=>e.outside)&&` Faded files are outside the pull request, under the code whose changes they use.`]}),o.length>0&&(0,Y.jsx)(`p`,{className:`flex flex-wrap gap-2`,children:o.map(e=>(0,Y.jsxs)($,{variant:`outline`,size:`sm`,onClick:()=>a(e),children:[`Collapse `,e.slice(6),`/`]},e))}),e.rows.length>0?(0,Y.jsx)(`div`,{"data-slot":`overview-scroll`,className:`overflow-x-auto rounded-lg border bg-surface-subtle`,children:(0,Y.jsxs)(`div`,{"data-slot":`overview-diagram`,className:`relative mx-auto`,style:{width:p,height:m},children:[(0,Y.jsxs)(`svg`,{className:`absolute inset-0 overflow-visible`,width:p,height:m,"aria-hidden":`true`,children:[(0,Y.jsx)(`defs`,{children:(0,Y.jsx)(`marker`,{id:`${c}-arrow`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`,children:(0,Y.jsx)(`path`,{d:`M 0 0 L 8 4 L 0 8 z`,className:`fill-input`})})}),e.edges.map(e=>{let t=f.get(e.from),n=f.get(e.to);if(t===void 0||n===void 0)return null;let r=tK(t,n,e.back,p,h.out.get(e),h.into.get(e)),i=C(e)||u?.kind===`edge`&&u.edge===e,a=u!==null&&!i;return(0,Y.jsxs)(`g`,{"data-slot":`overview-edge`,"data-style":$G(e),"data-lit":i||void 0,"data-dim":a||void 0,className:X(a&&`opacity-30`),onMouseEnter:()=>d({kind:`edge`,edge:e}),onMouseLeave:()=>d(null),children:[(0,Y.jsx)(`path`,{d:r,className:`fill-none stroke-transparent [stroke-width:10]`}),(0,Y.jsx)(`path`,{d:r,className:X(`fill-none stroke-input [stroke-width:1.5]`,jG[$G(e)],i&&`stroke-primary [stroke-width:2]`),markerEnd:`url(#${c}-arrow)`}),(0,Y.jsx)(`title`,{children:rK(e,_)})]},`${e.from}>${e.to}`)})]}),e.rows.flat().map(e=>(0,Y.jsx)(iK,{box:f.get(e.key),...E(e)},e.key))]})}):(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`No changed file calls or imports another.`}),e.strip.length>0&&(0,Y.jsxs)(`section`,{"aria-label":`Not linked`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`h3`,{className:`text-caption font-medium text-muted-foreground`,children:`Not linked`}),(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.strip.map(e=>(0,Y.jsx)(iK,{...E(e)},e.key))})]}),(0,Y.jsx)(`p`,{"data-slot":`overview-detail`,className:`min-h-5 text-muted-foreground`,"aria-live":`polite`,children:u===null?`Hover or focus a directory to see its files, flows and tests.`:u.kind===`edge`?rK(u.edge,_):oK(u.node,e.edges,_)})]})},oK=(e,t,n)=>{let r=t.filter(t=>t.from===e.key).map(e=>{let t=e.symbols.length>0?` (${e.symbols.join(`, `)})`:``;return`${n(e.to)}${t}`});return e.kind===`outside`?`${e.paths.length>1?`${e.label}: ${e.paths.length} files`:e.paths[0]} · outside the pull request · uses ${r.join(`, `)}.`:`${[e.kind===`group`?`${e.label}: ${e.paths.map(WG).join(`, `)}`:e.paths[0],e.flows.length>0?`read in ${e.flows.join(`; `)}`:`in no flow`,...r.length>0?[`reaches ${r.join(`, `)}`]:[],...e.badges.length>0?[`tested in ${e.badges.map(WG).join(`, `)}`]:[]].join(` · `)}.`},sK=e=>`point-${e}`,cK={contradicts:`Contradicts what was asked`,missing:`Asked for, not done`,unrequested:`Done, not asked for`},lK={finding:`text-review-changes`,risk:`text-risk-contract`,decision:`text-muted-foreground`},uK=({kind:e})=>{let t=DD[e];return(0,Y.jsxs)(`span`,{className:X(`inline-flex items-center gap-1 font-medium`,lK[e]),children:[(0,Y.jsx)(t,{"aria-hidden":`true`,className:`size-3.5`}),ED[e].label]})},dK=({point:e,state:t,current:n,note:r,action:i,className:a,leftOut:o=!1})=>{let s=DD[e.kind];return(0,Y.jsxs)(`article`,{id:sK(e.id),"data-slot":`point`,"data-kind":e.kind,"data-state":t,"data-left-out":o||void 0,"data-current":n||void 0,"aria-label":e.title,className:X(`flex scroll-mt-24 flex-wrap items-center gap-x-2 gap-y-0.5 text-muted-foreground`,a,n&&CK),children:[(0,Y.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`sr-only`,children:[ED[e.kind].label,`: `]}),(0,Y.jsx)(`span`,{className:X(`min-w-0 flex-1 basis-40 truncate`,t===`dismissed`&&`line-through`),children:e.title}),(0,Y.jsx)(`span`,{className:`max-w-full min-w-0 truncate text-caption`,children:r}),i]})},fK=({effect:e,preferenceId:t})=>{let n=t===null?``:` your preference:`;return e===`raised`?`From${n}`:`Left out by${n}`},pK=({guidance:e,className:t})=>{let n=e.preferenceId===null?Sg:w_;return(0,Y.jsxs)(`p`,{"data-slot":`point-guidance`,"data-effect":e.effect,className:X(`flex items-start gap-1.5 text-caption text-muted-foreground`,t),children:[(0,Y.jsx)(n,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`min-w-0`,children:[fK(e),` `,(0,Y.jsx)(Q_,{to:R_,className:X(`underline`,e.preferenceId===null&&`font-mono text-code-compact`),children:e.label})]})]})},mK=({point:e,guidance:t,state:n,current:r,onShow:i})=>(0,Y.jsx)(dK,{point:e,state:n,current:r,leftOut:!0,note:`${fK(t)} ${t.label}`,className:EK,action:(0,Y.jsx)($,{variant:`ghost`,size:`xs`,"aria-label":`Show: ${e.title}`,onClick:i,children:`Show`})}),hK=(e,t,n)=>{let r=(0,J.useRef)(null),i=(0,J.useRef)(!1);return(0,J.useEffect)(()=>{!e&&i.current&&(i.current=!1,r.current?.focus())},[e]),{card:r,show:()=>{i.current=!0,t(n)}}},gK=({point:e,size:t,disabled:n,onDismiss:r,onRule:i})=>(0,Y.jsxs)(`span`,{className:`flex items-center`,children:[(0,Y.jsxs)($,{variant:`ghost`,size:t,disabled:n,"aria-label":`Dismiss: ${e.title}`,className:`rounded-r-none`,onClick:r,children:[t===`sm`&&(0,Y.jsx)(I_,{"aria-hidden":`true`}),`Dismiss`]}),(0,Y.jsxs)(vB,{children:[(0,Y.jsx)(yB,{render:(0,Y.jsx)($,{variant:`ghost`,size:t,"data-slot":`dismiss-menu`,disabled:n,"aria-label":`More ways to dismiss: ${e.title}`,className:`w-6 rounded-l-none px-0`}),children:(0,Y.jsx)(ig,{"aria-hidden":`true`})}),(0,Y.jsx)(bB,{align:`end`,className:`w-64`,children:(0,Y.jsxs)(CB,{onClick:i,children:[(0,Y.jsx)(wg,{"aria-hidden":`true`}),`Don't flag things like this…`]})})]})]}),_K=({point:e,scopes:t,onSave:n,onCancel:r})=>{let[i]=t;return i===void 0?null:(0,Y.jsxs)(`div`,{"data-slot":`point-rule`,className:`flex flex-col gap-2 rounded-md border bg-card p-3`,children:[(0,Y.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:`Word it as a rule. It's saved to your preferences, and AI reviews leave out what it describes, folded to a line you can open.`}),(0,Y.jsx)(FH,{legend:`Don't flag things like: ${e.title}`,initial:{kind:`dont-flag`,text:e.title,scope:i.scope},scopes:t,kindFixed:!0,submit:`Save and dismiss`,submitting:`Saving…`,focus:!0,onCancel:r,onSubmit:n})]})},vK=(e,t)=>{let[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(!1);return{writing:n,setWriting:r,saved:i,save:async n=>{let i=await t(e,n);return i===null&&(a(!0),r(!1)),i}}},yK=e=>e?(0,Y.jsxs)(Y.Fragment,{children:[`Dismissed, and saved to your`,` `,(0,Y.jsx)(Q_,{to:R_,className:`underline`,children:`preferences`})]}):`Dismissed`,bK={blocking:{glyph:`■`,className:`text-severity-blocker bg-review-changes-bg border-severity-blocker/25`},major:{glyph:`▲`,className:`text-severity-major bg-severity-major-bg border-severity-major/25`},minor:{glyph:`●`,className:`text-severity-minor bg-review-pending-bg border-severity-minor/25`}},xK=({severity:e})=>(0,Y.jsxs)(`span`,{"data-slot":`severity`,className:X(gM,bK[e].className),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:bK[e].glyph}),e]}),SK=`animate-in duration-(--duration-slow) fade-in-0 slide-in-from-top-1`,CK=`shadow-[inset_0_0_0_2px_var(--ring)]`,wK=`relative max-w-3xl rounded-lg border bg-thread-bg`,TK=`scroll-mt-[calc(6rem+var(--lines-above)*var(--text-code--line-height))] -outline-offset-2`,EK=X(wK,`px-3 py-1.5`),DK={finding:`bg-review-changes`,risk:`bg-risk-contract-solid`},OK=({kind:e})=>(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`absolute top-2 bottom-2 left-1.5 w-[3px] rounded-full`,DK[e])}),kK=(0,J.memo)(function({point:e,state:t,saving:n,readOnly:r,current:i,onRaise:a,onState:o,leftOut:s,onShow:c,ruleScopes:l,onRule:u,inReview:d,removed:f,language:p,linesAbove:m=0,family:h=`Claude`}){let g=(0,J.useId)(),{card:_,show:v}=hK(s,c,e.id),y=vK(e,u);if(t===`dismissed`)return(0,Y.jsx)(dK,{point:e,state:t,current:i,note:yK(y.saved),className:EK,action:(0,Y.jsx)($,{variant:`ghost`,size:`xs`,disabled:r,onClick:()=>o(e.id,`open`),children:`Undo`})});if(t===`raised`&&d)return(0,Y.jsx)(dK,{point:e,state:t,current:i,note:`In your review, below`,className:`max-w-3xl px-1`,action:(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`✓`})});if(s&&e.guidance!==void 0)return(0,Y.jsx)(mK,{point:e,guidance:e.guidance,state:t,current:i,onShow:v});let b=r||n;return(0,Y.jsxs)(`article`,{ref:_,id:sK(e.id),"data-slot":`point`,"data-kind":`finding`,"data-state":t,"data-current":i||void 0,"aria-labelledby":`${g}-title`,tabIndex:-1,style:Ph({"--lines-above":m}),className:X(wK,TK,`flex flex-col gap-2 py-2.5 pr-4 pl-5`,i&&CK),children:[(0,Y.jsx)(OK,{kind:`finding`}),(0,Y.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(uK,{kind:`finding`}),e.severity!==null&&(0,Y.jsx)(xK,{severity:e.severity}),(0,Y.jsx)(`span`,{className:X(gM,`border-review-pending/25 bg-review-pending-bg text-review-pending`),children:`Draft`}),e.lines!==null&&(0,Y.jsxs)(`span`,{className:`flex items-center gap-1 text-caption text-muted-foreground`,children:[`on`,` `,(0,Y.jsx)(xA,{children:bA(e.lines.side,e.lines.startLine,e.lines.line)})]}),(0,Y.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-caption text-muted-foreground`,children:[(0,Y.jsx)(bg,{"aria-hidden":`true`,className:`size-3.5`}),`Only you see this`]})]}),(0,Y.jsx)(`h3`,{id:`${g}-title`,className:`font-semibold`,children:e.title}),e.explanation!==``&&(0,Y.jsx)(hM,{blocks:rf(e.explanation).blocks,suggestion:()=>null}),e.mismatch!==null&&(0,Y.jsxs)(`p`,{className:`text-caption text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{className:`font-medium text-foreground`,children:[cK[e.mismatch.kind],`:`]}),` `,e.mismatch.description]}),e.guidance!==void 0&&(0,Y.jsx)(pK,{guidance:e.guidance}),e.guardrail!==void 0&&(0,Y.jsx)(UU,{guardrail:e.guardrail,family:h}),e.suggestion!==null&&(0,Y.jsx)(hj,{title:`Suggested change`,removed:f,added:e.suggestion,language:p}),y.writing?(0,Y.jsx)(_K,{point:e,scopes:l,onSave:y.save,onCancel:()=>{y.setWriting(!1),_.current?.focus()}}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,Y.jsx)(gK,{point:e,size:`sm`,disabled:b,onDismiss:()=>o(e.id,`dismissed`),onRule:()=>y.setWriting(!0)}),e.lines!==null&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)($,{variant:`outline`,size:`sm`,disabled:b,"aria-label":`Edit: ${e.title}`,onClick:()=>a(e,!1),children:[(0,Y.jsx)(o_,{"aria-hidden":`true`}),`Edit`]}),(0,Y.jsx)($,{size:`sm`,disabled:b,"aria-label":`Add to review: ${e.title}`,onClick:()=>a(e,!0),children:`Add to review`})]})]})]})}),AK=e=>e.slice(e.lastIndexOf(`/`)+1),jK=({checkedBy:e,peek:t,id:n})=>{let r=(0,Y.jsx)(`span`,{className:`font-code text-code-compact`,children:e.test});return(0,Y.jsxs)(`p`,{"data-slot":`checked-by`,className:`flex items-start gap-1.5 pb-0.5 text-muted-foreground`,children:[(0,Y.jsx)(Eg,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`min-w-0`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:`Checked by`}),` `,t===null?r:(0,Y.jsx)(BM,{handle:t.handle,payload:t.payload,id:n,render:(0,Y.jsx)(`button`,{type:`button`,className:`text-left text-foreground`}),children:r}),` `,`in `,AK(e.path),`, which asserts: `,e.checks]})]})},MK=(0,J.memo)(function({point:e,state:t,saving:n,readOnly:r,current:i,onRaise:a,onState:o,leftOut:s,onShow:c,ruleScopes:l,onRule:u,linesAbove:d=0,test:f=null,family:p=`Claude`}){let m=(0,J.useId)(),{card:h,show:g}=hK(s,c,e.id),_=vK(e,u);if(t===`dismissed`)return(0,Y.jsx)(dK,{point:e,state:t,current:i,note:yK(_.saved),className:EK,action:(0,Y.jsx)($,{variant:`ghost`,size:`xs`,disabled:r,onClick:()=>o(e.id,`open`),children:`Undo`})});if(s&&e.guidance!==void 0)return(0,Y.jsx)(mK,{point:e,guidance:e.guidance,state:t,current:i,onShow:g});let v=r||n;return(0,Y.jsxs)(`article`,{ref:h,id:sK(e.id),"data-slot":`point`,"data-kind":`risk`,"data-state":t,"data-current":i||void 0,"aria-labelledby":`${m}-title`,tabIndex:-1,style:Ph({"--lines-above":d}),className:X(wK,TK,`flex flex-col gap-0.5 py-1.5 pr-2 pl-5`,i&&CK),children:[(0,Y.jsx)(OK,{kind:`risk`}),(0,Y.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(uK,{kind:`risk`}),e.lines!==null&&(0,Y.jsx)(xA,{children:bA(e.lines.side,e.lines.startLine,e.lines.line)}),t===`raised`&&(0,Y.jsxs)(`span`,{className:`text-caption text-muted-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`✓ `}),`Commented`]}),(0,Y.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,Y.jsx)($,{variant:`ghost`,size:`xs`,disabled:v||e.lines===null,"aria-label":`Comment: ${e.title}`,onClick:()=>a(e,!1),children:`Comment`}),(0,Y.jsx)(gK,{point:e,size:`xs`,disabled:v,onDismiss:()=>o(e.id,`dismissed`),onRule:()=>_.setWriting(!0)})]})]}),(0,Y.jsx)(`h3`,{id:`${m}-title`,className:`pb-0.5 font-normal`,children:e.title}),e.checkedBy!==void 0&&(0,Y.jsx)(jK,{checkedBy:e.checkedBy,peek:f,id:`${sK(e.id)}-test`}),e.guidance!==void 0&&(0,Y.jsx)(pK,{guidance:e.guidance,className:`pb-0.5`}),e.guardrail!==void 0&&(0,Y.jsx)(UU,{guardrail:e.guardrail,family:p,className:`pb-0.5`}),_.writing&&(0,Y.jsx)(`div`,{className:`py-1.5 pr-2`,children:(0,Y.jsx)(_K,{point:e,scopes:l,onSave:_.save,onCancel:()=>{_.setWriting(!1),h.current?.focus()}})})]})}),NK=({point:e,state:t,open:n,current:r,onToggle:i})=>{let a=DD.decision;return(0,Y.jsxs)(`button`,{type:`button`,id:sK(e.id),"data-slot":`decision-chip`,"data-inline-target":!0,"data-state":t,"data-current":r||void 0,"aria-expanded":n,"aria-label":`Decision: ${e.title}`,className:X(`mt-px ml-3 inline-flex min-h-5 scroll-mt-24 items-center gap-1 rounded-full border bg-background px-2 align-top font-sans text-caption text-muted-foreground hover:text-foreground`,t===`dismissed`&&`line-through`,r&&CK),onClick:t=>{t.stopPropagation(),i(e.id)},children:[(0,Y.jsx)(a,{"aria-hidden":`true`,className:`size-3`}),e.title]})},PK=({point:e,state:t,saving:n,readOnly:r,onRaise:i,onState:a})=>{let o=r||n;return(0,Y.jsxs)(`article`,{"data-slot":`decision-note`,"data-state":t,"aria-label":e.title,className:X(`flex max-w-3xl flex-wrap items-baseline gap-x-2 border-l pl-3 text-caption`,SK),children:[(0,Y.jsxs)(`p`,{className:`min-w-0 flex-1 basis-80 text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.title,`.`]}),` `,e.explanation]}),(0,Y.jsx)(`span`,{className:`flex items-center gap-1`,children:t===`dismissed`?(0,Y.jsx)($,{variant:`ghost`,size:`xs`,disabled:r,onClick:()=>a(e.id,`open`),children:`Show again`}):(0,Y.jsxs)(Y.Fragment,{children:[t===`raised`&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`✓ `}),`Commented`]}),(0,Y.jsx)($,{variant:`ghost`,size:`xs`,disabled:o||e.lines===null,"aria-label":`Comment: ${e.title}`,onClick:()=>i(e,!1),children:`Comment`}),(0,Y.jsx)($,{variant:`ghost`,size:`xs`,disabled:o,"aria-label":`Hide: ${e.title}`,onClick:()=>a(e.id,`dismissed`),children:`Hide`})]})})]})},FK=({point:e,onGo:t})=>{let n=DD[e.kind];return(0,Y.jsxs)(`p`,{"data-slot":`point-mention`,className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,Y.jsx)(n,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),ED[e.kind].label,`:`,` `,(0,Y.jsx)(`button`,{type:`button`,className:`min-h-6 rounded-sm text-left whitespace-pre-line text-primary underline-offset-2 hover:underline`,onClick:()=>t(e.id),children:e.title})]})},IK=({pointId:e,fresh:t,at:n,row:r=!1,className:i,bodyClassName:a,children:o})=>(0,Y.jsx)(`div`,{role:r?`row`:void 0,"data-slot":`point-fold`,"data-point-id":e,"data-fresh":t||void 0,"data-unfold":n!==void 0||void 0,style:n===void 0?void 0:Ph({"--landing-i":n}),className:i,children:(0,Y.jsx)(`div`,{role:r?`cell`:void 0,children:(0,Y.jsx)(`div`,{className:a,children:o})})}),LK={finding:[`finding`,`findings`],risk:[`risk`,`risks`],decision:[`decision`,`decisions`]},RK=({points:e,kind:t,stateOf:n,onGo:r,onClose:i,family:a=`Claude`})=>{let o=t===null?e:e.filter(e=>e.kind===t),s=(0,J.useRef)(!1),[c,l]=t===null?[`point`,`points`]:LK[t];return(0,Y.jsx)(IH,{title:`${o.length} ${o.length===1?c:l} from ${a}`,onClose:i,returnFocus:()=>!s.current,className:`sm:max-w-2xl`,children:(0,Y.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-1`,"aria-label":`Points`,children:o.map(e=>{let{label:t}=ED[e.kind],i=DD[e.kind],a=n(e.id);return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`point-row`,"data-kind":e.kind,className:`flex min-h-7 w-full items-center gap-2 rounded-md px-2 py-1 text-left hover:bg-accent`,onClick:()=>{s.current=!0,r(e.id)},children:[(0,Y.jsx)(i,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`sr-only`,children:[t,`: `]}),(0,Y.jsx)(`span`,{className:X(`min-w-0 flex-1 truncate`,a===`dismissed`&&`line-through`),children:e.title}),a!==`open`&&(0,Y.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:a===`raised`?`Raised`:`Dismissed`}),e.path!==null&&(0,Y.jsx)(`span`,{className:`truncate font-mono text-code-compact text-muted-foreground`,children:e.path})]})},e.id)})})})},zK=(e,t,n)=>{let r=t===null?e:e.filter(e=>e.kind===t),i=r.findIndex(e=>e.id===n);return{steps:r,at:i===-1?null:i}},BK=(e,t)=>{let{steps:n,at:r}=e;return n.length===0?null:n[r===null?t===1?0:n.length-1:(r+t+n.length)%n.length]?.id??null},VK=(e,t,n)=>{if(t===null)return null;let r=zK(e,t,n);return r.at===null?r.steps[0]?.id??null:null},HK={finding:`findings`,risk:`risks`,decision:`decisions`},UK={finding:`text-review-changes`,risk:`text-risk-contract`,decision:`text-muted-foreground`},WK=({kind:e})=>{let t=DD[e];return(0,Y.jsx)(t,{"aria-hidden":`true`,className:X(`size-3.5 shrink-0`,UK[e])})},GK=({slot:e,noun:t,total:n,at:r,count:i,title:a,status:o,onStep:s,onOpenList:c})=>{let l=r===null?i:`${r+1} of ${n}`,u=`${t.charAt(0).toUpperCase()}${t.slice(1)}`;return(0,Y.jsxs)(`span`,{"data-slot":e,className:`flex min-w-0 items-center gap-0.5`,children:[(0,Y.jsx)($,{variant:`ghost`,size:`icon-xs`,"aria-label":`Previous ${t}`,disabled:n===0,onClick:()=>s(-1),children:(0,Y.jsx)(og,{"aria-hidden":`true`})}),(0,Y.jsx)($,{variant:`ghost`,size:`xs`,className:`tabular`,"aria-label":r===null?`${i}, show all`:`${u} ${l}, show all`,onClick:c,children:l}),(0,Y.jsx)($,{variant:`ghost`,size:`icon-xs`,"aria-label":`Next ${t}`,disabled:n===0,onClick:()=>s(1),children:(0,Y.jsx)(cg,{"aria-hidden":`true`})}),a,(0,Y.jsx)(`span`,{role:`status`,className:`sr-only`,children:o})]})},KK=({points:e,current:t,stateOf:n,kind:r,onGo:i,onOpenList:a})=>{let o=zK(e,r,t),{steps:s,at:c}=o,l=c===null?void 0:s[c],u=r===null||s.length===1?`${s.length} ${s.length===1?`point`:`points`}`:`${s.length} ${HK[r]}`,d=l!==void 0&&n(l.id)===`dismissed`;return(0,Y.jsx)(GK,{slot:`point-stepper`,noun:`point`,total:s.length,at:c,count:u,onStep:e=>{let t=BK(o,e);t!==null&&i(t)},onOpenList:a,title:l!==void 0&&(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`stepper-title`,"data-kind":l.kind,className:`ml-1 flex h-6 min-w-0 items-center gap-1.5 rounded-md px-1 text-left max-sm:hidden hover:bg-muted`,"aria-label":`Go to ${ED[l.kind].label.toLowerCase()}: ${l.title}`,onClick:()=>i(l.id),children:[(0,Y.jsx)(WK,{kind:l.kind}),(0,Y.jsx)(`span`,{className:X(`min-w-0 truncate`,d&&`text-muted-foreground line-through`),children:l.title})]}),status:l===void 0||c===null?``:`${ED[l.kind].label} ${c+1} of ${s.length}: ${l.title}${d?` (dismissed)`:``}`})},qK={collect:`Collect`,prep:`Prepare`,intent:`Intent`,findings:`Findings`,risk:`Risk`,decisions:`Decisions`,steps:`Tour`},JK={pending:`waiting`,running:`running`,done:`done`,failed:`failed`,skipped:`skipped`},YK={pending:`text-muted-foreground`,running:`text-primary font-medium`,done:`text-review-approved`,failed:`text-destructive font-medium`,skipped:`text-muted-foreground`},XK={pending:`○`,running:`◐`,done:`●`,failed:`✗`,skipped:`–`},ZK=({stages:e,shown:t,filesFetched:n})=>(0,Y.jsx)(`ol`,{className:`flex flex-wrap gap-x-4 gap-y-1 rounded-lg border bg-surface-subtle px-3 py-2`,"aria-label":`Analysis progress`,children:t.map(t=>{let r=e[t];return(0,Y.jsxs)(`li`,{"data-status":r,className:YK[r],children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:XK[r]}),` `,qK[t],(0,Y.jsxs)(`span`,{className:`sr-only`,children:[`: `,JK[r]]}),t===`collect`&&r===`running`&&n!==null&&(0,Y.jsxs)(`span`,{className:`tabular text-muted-foreground`,children:[` `,`· `,n.done,` of `,n.total,` files`]})]},t)})}),QK=e=>qK[e],$K=Mu.options.filter(e=>!Zu.includes(e)&&e!==`steps`),eq=({legend:e,options:t,value:n,onChange:r})=>(0,Y.jsxs)(`fieldset`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`legend`,{className:`sr-only`,children:e}),t.map(e=>(0,Y.jsx)(QM,{variant:`outline`,size:`sm`,pressed:n===e.value,disabled:e.disabled===!0,onPressedChange:t=>{t&&r(e.value)},children:e.label},e.value))]}),tq=[{value:`comment`,label:`Comment`},{value:`approve`,label:`Approve`},{value:`request_changes`,label:`Request changes`}],nq=`whitespace-pre-wrap wrap-anywhere`,rq=(e,t)=>{let n=t===0?``:` ${t} ${t===1?`comment`:`comments`}`;return e===`comment`?n===``?`Publish the summary`:`Publish${n}`:`Publish${n} and ${e===`approve`?`approve`:`request changes`}`},iq=({analysisId:e,hunkComments:t,isAuthor:n,published:r,onClose:i,onPublished:a})=>{let{client:o}=Pp(),s=(0,J.useId)(),[c,l]=(0,J.useState)(``),[u,d]=(0,J.useState)(`comment`),[f,p]=(0,J.useState)(null),[m,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(!1),[v,y]=(0,J.useState)(!1),[b]=(0,J.useState)(()=>uf.parse(crypto.randomUUID())),x=Hp(o.publish);(0,J.useEffect)(()=>{let n=!0;return o.previewPublication(e,{summary:``,hunkComments:t}).then(e=>{n&&(p(e.ok?e.value:null),h(e.ok?null:e.error))}),()=>{n=!1}},[e,o,t]);let S=n?`comment`:u,C=rq(S,f?.comments.length??t.length),w=f!==null&&df({...f,verdict:S,summary:c}),T=async n=>{y(n),_(!1);let r=await x.run(e,{publicationId:b,summary:c,allowStale:n,hunkComments:t,verdict:S});r.ok?a(r.value,S):r.error.code===`stale-analysis`&&(x.reset(),_(!0))};return(0,Y.jsxs)(IH,{title:`Publish review`,onClose:i,className:`flex flex-col sm:max-w-2xl`,children:[r&&(0,Y.jsx)(`p`,{className:`shrink-0 text-muted-foreground`,children:`Your earlier review is on the pull request. This one posts as another, with its own verdict.`}),m===null?f===null?(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Reading the comments…`}):f.comments.length>0&&(0,Y.jsx)(`section`,{"data-slot":`publish-comments`,"aria-label":`Comments to post`,tabIndex:0,className:`-mx-4 min-h-12 overflow-y-auto overscroll-contain border-y px-4 py-3 -outline-offset-2`,children:(0,Y.jsx)(`ul`,{"aria-label":`Comments`,className:`flex flex-col gap-1.5`,children:f.comments.map(e=>(0,Y.jsxs)(`li`,{className:`min-w-0 border-l-2 border-l-review-pending py-0.5 pl-2.5`,children:[(0,Y.jsxs)(`code`,{className:`font-mono text-code-compact text-muted-foreground`,children:[e.path,`:`,e.startLine===void 0?e.line:`${e.startLine}–${e.line}`,e.side===`old`?` (old side)`:``]}),(0,Y.jsx)(`p`,{className:nq,children:e.body})]},e.key))})}):(0,Y.jsxs)(`p`,{className:dF,role:`alert`,children:[`Couldn't read what will be posted. `,Gp(m)]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:`Verdict`}),(0,Y.jsx)(eq,{legend:`Verdict`,options:tq.map(e=>({...e,disabled:n&&e.value!==`comment`})),value:S,onChange:d})]}),n&&(0,Y.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:`You opened this pull request, and its author can't approve it or request changes, so your review comments.`})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`label`,{htmlFor:`${s}-summary`,className:`sr-only`,children:`Summary`}),(0,Y.jsx)(Vk,{id:`${s}-summary`,rows:2,"data-autofocus":!0,placeholder:`Summary (optional)`,value:c,onChange:e=>l(e.target.value)})]}),g?(0,Y.jsxs)(`div`,{className:X(fF,`flex flex-col gap-2`),role:`alert`,children:[(0,Y.jsx)(`p`,{children:`This PR changed since the analysis. Publish anyway?`}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Y.jsx)($,{variant:`outline`,onClick:()=>_(!1),children:`Cancel`}),(0,Y.jsx)($,{onClick:()=>void T(!0),children:`Publish anyway`})]})]}):(0,Y.jsxs)(Y.Fragment,{children:[x.error!==null&&(0,Y.jsxs)(`div`,{className:`rounded-lg border border-review-changes/25 bg-review-changes-bg px-3 py-2 text-review-changes`,role:`alert`,children:[(0,Y.jsxs)(`p`,{children:[`Couldn't publish. `,Gp(x.error)]}),(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Retrying is safe: comments that were already posted aren't posted again.`})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[w&&(0,Y.jsx)(`p`,{id:`${s}-nothing`,className:`mr-auto text-caption text-muted-foreground`,children:`Nothing to post yet: write a summary, or approve or request changes.`}),(0,Y.jsx)($,{variant:`outline`,onClick:i,children:`Cancel`}),(0,Y.jsx)($,{disabled:x.pending||f===null||w,"aria-describedby":w?`${s}-nothing`:void 0,onClick:()=>void T(v),children:x.pending?`Publishing…`:x.error===null?C:`Retry`})]})]})]})]})},aq=({children:e})=>(0,Y.jsx)(`aside`,{id:`review-tree-rail`,"aria-label":`Files`,className:`sticky top-[var(--review-bar-h,0px)] -ml-1 flex h-[calc(100vh-var(--review-bar-h,0px))] min-h-0 flex-col gap-2 self-start overflow-hidden p-1`,children:e}),oq=({analysisId:e,family:t,onRemoved:n})=>{let{client:r}=Pp(),i=Hp(r.removeModelRun),[a,o]=(0,J.useState)(!1);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)($,{variant:`ghost`,size:`xs`,onClick:()=>o(!0),children:`Remove AI review…`}),a&&(0,Y.jsxs)(IH,{title:`Remove AI review`,onClose:()=>{o(!1),i.reset()},children:[(0,Y.jsxs)(`p`,{className:`text-ui`,children:[t,`'s intent, findings, risks and decisions go, with what you did with them, and the code's analysis is back as it was. Your comments stay. Request AI review runs a model again, the same or another.`]}),i.error!==null&&(0,Y.jsxs)(`p`,{className:`rounded-lg border border-review-changes/25 bg-review-changes-bg px-3 py-2 text-review-changes`,role:`alert`,children:[`Couldn't remove it. `,Gp(i.error)]}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Y.jsx)($,{variant:`outline`,"data-autofocus":!0,onClick:()=>o(!1),children:`Cancel`}),(0,Y.jsx)($,{variant:`destructive`,disabled:i.pending,onClick:async()=>{let t=await i.run(e);t.ok&&(o(!1),n(t.value))},children:i.pending?`Removing…`:`Remove`})]})]})]})},sq=({analysisId:e,view:t,family:n,chosen:r,tour:i,onClose:a,onRestart:o})=>{let{client:s}=Pp(),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(null),[f,p]=(0,J.useState)(null),m=async()=>{l(!0),d(null);let n=f;if(n===null){let t=await s.removeModelRun(e);if(!t.ok)return l(!1),d({error:t.error,removed:!1});n=t.value,p(n)}let a=await s.runModel(e,{optionId:r.id,...i?{tour:!0}:{}});if(!a.ok)return l(!1),d({error:a.error,removed:!0});let c=await s.getAnalysis(e);o(c.ok?c.value:{...t,...n})},h=()=>{f===null?a():o({...t,...f})};return(0,Y.jsxs)(IH,{title:`Re-run AI review`,onClose:h,children:[(0,Y.jsxs)(`p`,{className:`text-ui`,children:[n,`'s intent, findings, risks and decisions go, with what you did with them, and`,` `,r.modelName,` through `,r.via,` reads the PR again. Your comments stay.`]}),u!==null&&(0,Y.jsxs)(`p`,{className:`rounded-lg border border-review-changes/25 bg-review-changes-bg px-3 py-2 text-review-changes`,role:`alert`,children:[u.removed?`The old run is gone, but the new one couldn't start.`:`Couldn't remove the old run.`,` `,Gp(u.error)]}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Y.jsx)($,{variant:`outline`,"data-autofocus":!0,onClick:h,children:f===null?`Cancel`:`Close`}),(0,Y.jsx)($,{variant:`ai`,disabled:c,onClick:()=>void m(),children:c?`Starting…`:u?.removed?`Try again`:`Re-run`})]})]})},cq=()=>{let e=(0,J.useRef)(null),[t,n]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{let t=e.current;if(t===null||typeof IntersectionObserver>`u`)return;let r=new IntersectionObserver(([e])=>{e!==void 0&&n(e.intersectionRatio<1&&e.boundingClientRect.top<=0)},{rootMargin:`-1px 0px 0px 0px`,threshold:1});return r.observe(t),()=>r.disconnect()},[]),{bar:e,stuck:t}},lq=({title:e,claude:t,tools:n,publish:r,verdict:i,hairline:a,stuck:o})=>{let s=cq(),c=o??s.stuck;return(0,Y.jsxs)(`div`,{ref:s.bar,"data-slot":`review-bar`,"data-stuck":c||void 0,className:`sticky top-0 z-20 flex h-(--review-bar-row,var(--review-bar-h)) min-w-0 items-center gap-3 border-y bg-background`,children:[a!==null&&(0,Y.jsx)(`span`,{"data-slot":`model-hairline`,"data-state":a,"aria-hidden":`true`,children:(0,Y.jsx)(`span`,{})}),c&&e!==null&&(0,Y.jsxs)(`span`,{"aria-hidden":`true`,className:`flex max-w-96 shrink items-center gap-3 max-xl:hidden`,children:[(0,Y.jsx)(`span`,{className:`truncate font-semibold motion-safe:animate-in motion-safe:fade-in`,title:e,children:e}),(0,Y.jsx)(`span`,{className:`h-4.5 w-px shrink-0 bg-border`})]}),(0,Y.jsx)(`div`,{"data-slot":`claude-slot`,className:`flex min-w-0 flex-1 items-center`,children:t}),(0,Y.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:n}),i!==null&&(0,Y.jsxs)(`p`,{role:`status`,"data-slot":`your-verdict`,className:X(`flex shrink-0 items-center gap-1 font-medium`,uq[i.kind].className),children:[(0,Y.jsx)(dq,{kind:i.kind}),i.url===null?uq[i.kind].label:(0,Y.jsx)(`a`,{href:i.url,target:`_blank`,rel:`noreferrer`,className:`text-inherit`,children:uq[i.kind].label})]}),(0,Y.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:r})]})},uq={approved:{label:`Approved`,className:`text-review-approved`},"changes-requested":{label:`Changes requested`,className:`text-review-changes`},commented:{label:`Commented`,className:`text-muted-foreground`},published:{label:`Published`,className:`text-review-approved`}},dq=({kind:e})=>(0,Y.jsx)(e===`changes-requested`?I_:e===`commented`?n_:ng,{"aria-hidden":`true`,className:`size-4`}),fq=2,pq=()=>(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-px shrink-0 bg-border`}),mq=({error:e,onRetry:t})=>(0,Y.jsxs)(PN,{children:[(0,Y.jsx)(FN,{render:(0,Y.jsx)($,{variant:`ghost`,size:`xs`,className:`h-6 px-1.5 font-normal text-muted-foreground`,"data-slot":`status-unavailable`,children:`Status unavailable`})}),(0,Y.jsxs)(IN,{align:`end`,children:[(0,Y.jsx)(LN,{children:`The PR's status couldn't be read`}),(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:Gp(e)}),(0,Y.jsx)($,{variant:`outline`,size:`sm`,className:`self-start`,onClick:t,children:`Try again`})]})]}),hq={github:`GitHub`,bitbucket:`Bitbucket`},gq=({name:e})=>(0,Y.jsx)(`code`,{className:`rounded-sm bg-secondary px-1 font-mono text-code-compact text-foreground`,children:e}),_q=({view:e,intent:t,totals:n,status:r,statusError:i,onRetryStatus:a,now:o})=>{let{analysis:s}=e,{pullRequest:c,warnings:l}=s,{ref:u}=s.key,d=[r===null&&i!==null&&(0,Y.jsx)(mq,{error:i,onRetry:a},`unavailable`),r!==null&&(r.checks===null||r.checks.length>0)&&(0,Y.jsx)(GN,{checks:r.checks,unreadable:r.checksUnreadable,head:s.key.headSha},`ci`),r!==null&&r.reviewers.length>0&&(0,Y.jsx)(ZN,{reviewers:r.reviewers},`reviewers`)].filter(e=>e!==!1).flatMap((e,t)=>t===0?[e]:[(0,Y.jsx)(pq,{},`before-${e.key}`),e]);return(0,Y.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,Y.jsx)(`h1`,{className:`min-w-0 text-title font-semibold tracking-[-0.01em] whitespace-pre-line`,children:c?.title??`Collecting the pull request…`}),(0,Y.jsxs)(`a`,{className:`-ml-1.5 text-title text-muted-foreground no-underline hover:underline`,href:c?.url??jf(u),target:`_blank`,rel:`noreferrer`,title:`Open on ${hq[u.repo.host]}`,children:[`#`,u.number]}),r!==null&&(0,Y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(zN,{state:r.state}),(0,Y.jsx)(BN,{status:r.reviewStatus})]}),d.length>0&&(0,Y.jsx)(`div`,{"data-slot":`pr-standing`,className:`ml-auto flex flex-wrap items-center gap-x-3 gap-y-1`,children:d})]}),(0,Y.jsxs)(`p`,{"data-slot":`pr-byline`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-muted-foreground`,children:[(0,Y.jsx)(`span`,{children:u.repo.repo}),c!==null&&(0,Y.jsxs)(Y.Fragment,{children:[` `,(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),` `,(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:c.author.name}),` wants to merge `,(0,Y.jsx)(gq,{name:c.sourceBranch}),` `,(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`→`}),` `,(0,Y.jsx)(`span`,{className:`sr-only`,children:`into`}),` `,(0,Y.jsx)(gq,{name:c.targetBranch})]}),` `,(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),` `,(0,Y.jsxs)(`span`,{children:[`updated `,vA(c.updatedAt,o)]})]}),s.stages.prep===`done`&&n.additions+n.deletions>0&&(0,Y.jsxs)(Y.Fragment,{children:[` `,(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),` `,(0,Y.jsxs)(`span`,{className:`tabular font-mono text-code-compact`,children:[(0,Y.jsxs)(`span`,{"aria-hidden":`true`,children:[n.additions>0&&(0,Y.jsxs)(`span`,{className:`text-diff-add-fg`,children:[`+`,n.additions]}),n.additions>0&&n.deletions>0&&` `,n.deletions>0&&(0,Y.jsxs)(`span`,{className:`text-diff-del-fg`,children:[`−`,n.deletions]})]}),(0,Y.jsxs)(`span`,{className:`sr-only`,children:[n.additions,` lines added, `,n.deletions,` removed`]})]})]})]}),(0,Y.jsx)(`div`,{className:`mt-3 max-w-[980px]`,children:t}),l.length>0&&l.length<=fq&&(0,Y.jsx)(`ul`,{className:`flex flex-col gap-2`,"aria-label":`Warnings`,children:l.map(e=>(0,Y.jsxs)(`li`,{className:`rounded-lg border border-review-pending/25 bg-review-pending-bg px-3 py-2 text-review-pending`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),e]},e))}),l.length>fq&&(0,Y.jsxs)(`details`,{className:`rounded-lg border border-review-pending/25 bg-review-pending-bg px-3 py-2 text-review-pending`,children:[(0,Y.jsxs)(`summary`,{className:`cursor-pointer`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),l.length,` warnings`]}),(0,Y.jsx)(`ul`,{className:`mt-1 list-disc pl-5`,children:l.map(e=>(0,Y.jsx)(`li`,{children:e},e))})]})]})},vq=e=>`thread-${e}`,yq=e=>`${e.side}:${e.line}`,bq={onLine:new Map,earlier:new Map,elsewhere:[],open:new Map},xq=(e,t,n)=>e.set(t,[...e.get(t)??[],n]),Sq=(e,t,n)=>{if(e===null||e.length===0)return bq;let r=new Map(t.map(e=>[e.file.path,e])),i=new Map,a=new Map,o=[],s=new Map;for(let t of e){t.resolved||s.set(t.path,(s.get(t.path)??0)+1);let e=r.get(t.path);if(e===void 0){o.push(t);continue}let{line:c}=t,l=t.outdated||c===null?void 0:e.partIds.find(e=>n.parts.get(e)?.hunk.lines.some(e=>{let n=kM(e);return n!==null&&n.side===t.side&&n.line===c}));if(l===void 0||c===null){xq(a,t.path,t);continue}let u=i.get(l)??new Map;xq(u,yq({side:t.side,line:c}),t),i.set(l,u)}return{onLine:i,earlier:a,elsewhere:o,open:s}},Cq=(e,t,n)=>{let r=new Map(e.lines.flatMap(e=>e.kind!==`del`&&e.newLine!==null?[[e.newLine,e.text]]:[])),i=[];for(let e=t;e<=n;e+=1){let t=r.get(e);if(t===void 0)return null;i.push(t)}return i},wq=(e,t,n)=>{let r=[];for(let i of t){for(let t of i.partIds){let i=e.onLine.get(t),a=n.parts.get(t)?.hunk;if(i===void 0||a===void 0)continue;let o=new Set;for(let e of a.lines){let t=kM(e);if(t===null)continue;let n=yq(t);o.has(n)||(o.add(n),r.push(...i.get(n)??[]))}}r.push(...e.earlier.get(i.file.path)??[])}return r.push(...e.elsewhere),r},Tq=(e,t,n)=>t===`all`?e:e.filter(e=>!e.resolved||n.has(e.id)),Eq=(e,t,n)=>e===null?Tq(t,`unresolved`,n).length>0?`unresolved`:`all`:e,Dq=(e,t,n,r)=>{if(t.length===0)return null;let i=new Set(t.map(e=>e.id)),a=n===null?-1:e.findIndex(e=>e.id===n);if(a===-1)return(r===1?t[0]:t.at(-1))?.id??null;for(let t=1;t<=e.length;t+=1){let n=e[(a+r*t+e.length*t)%e.length];if(n!==void 0&&i.has(n.id))return n.id}return null},Oq=(e,t,n)=>`${e} ${e===1?t:n}`,kq=e=>(e.line??e.originalLine)===null?`the file`:yM(e.outdated?{...e,line:null}:e),Aq=e=>{let[t]=e.comments;if(t===void 0)return kq(e);let n=Vd(t.body);return`${t.author.name}: ${n===``?`Suggested change`:n}`},jq=(e,t)=>e===`unresolved`?`${t} unresolved`:Oq(t,`thread`,`threads`),Mq=(e,t,n)=>{if(e.length===0)return null;let r=Tq(e,t,n).length;return t===`unresolved`?{count:r,words:[`unresolved`,`unresolved`],label:Oq(r,`unresolved thread`,`unresolved threads`)}:{count:r,words:[`thread`,`threads`],label:Oq(r,`thread`,`threads`)}},Nq=({resolved:e})=>e?(0,Y.jsx)(ng,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-review-approved`}):(0,Y.jsx)(n_,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),Pq=({ordered:e,scope:t,resolvedHere:n,current:r,onGo:i,onOpenList:a})=>{let o=Tq(e,t,n),s=o.findIndex(e=>e.id===r),c=s===-1?null:s,l=c===null?void 0:o[c],u=l===void 0?``:Aq(l);return(0,Y.jsx)(GK,{slot:`thread-stepper`,noun:`thread`,total:o.length,at:c,count:jq(t,o.length),onStep:t=>{let n=Dq(e,o,r,t);n!==null&&i(n)},onOpenList:a,title:l!==void 0&&(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`stepper-title`,"data-kind":`thread`,className:`ml-1 flex h-6 min-w-0 items-center gap-1.5 rounded-md px-1 text-left max-sm:hidden hover:bg-muted`,title:`${l.path}, ${kq(l)}`,"aria-label":`Go to thread: ${u}`,onClick:()=>i(l.id),children:[(0,Y.jsx)(Nq,{resolved:l.resolved}),(0,Y.jsx)(`span`,{className:X(`min-w-0 truncate`,l.resolved&&`text-muted-foreground`),children:u})]}),status:l===void 0||c===null?``:`Thread ${c+1} of ${o.length}, ${l.path} ${kq(l)}${l.resolved?`, resolved`:l.outdated?`, outdated`:``}: ${u}`})},Fq=({ordered:e,scope:t,onScope:n,onGo:r,onClose:i})=>{let a=e.filter(e=>!e.resolved).length,o=(0,J.useRef)(!1),s=[];for(let t of e){let e=s.at(-1);e?.path===t.path?e.threads.push(t):s.push({path:t.path,threads:[t]})}return(0,Y.jsxs)(IH,{title:`${Oq(e.length,`thread`,`threads`)}, ${a} unresolved`,onClose:i,returnFocus:()=>!o.current,className:`sm:max-w-2xl`,children:[a>0&&a<e.length&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-caption text-muted-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`Previous and Next go round`}),(0,Y.jsx)(eq,{legend:`Previous and Next go round`,options:[{value:`unresolved`,label:`Unresolved (${a})`},{value:`all`,label:`All (${e.length})`}],value:t,onChange:n})]}),(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:s.map(({path:e,threads:t})=>(0,Y.jsxs)(`section`,{"aria-label":e,className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`h3`,{className:`truncate px-2 font-mono text-code-compact text-muted-foreground`,children:e}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`thread-row`,"data-resolved":e.resolved||void 0,className:`flex min-h-7 w-full items-center gap-2 rounded-md px-2 py-1 text-left hover:bg-accent`,onClick:()=>{o.current=!0,r(e.id)},children:[(0,Y.jsx)(Nq,{resolved:e.resolved}),(0,Y.jsx)(`span`,{className:X(`min-w-0 flex-1 truncate`,e.resolved&&`text-muted-foreground`),children:Aq(e)}),(e.resolved||e.outdated)&&(0,Y.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:e.resolved?`Resolved`:`Outdated`}),(0,Y.jsx)(`span`,{className:`shrink-0 text-caption text-muted-foreground`,children:kq(e)})]})},e.id))})]},t[0]?.id??e))})]})},Iq={steps:`The rest of the steps' files`,tests:`Tests`,generated:`Generated and mechanical`,other:`Other files`},Lq=(e,t=0,n=e.lines.length)=>e.lines.slice(t,n).filter(e=>e.kind!==`context`).length,Rq=(e,t)=>{let n=n=>{let r=e.lines[n];return t.side===`new`?r?.newLine:r?.oldLine},r=e.lines.flatMap((e,r)=>{let i=n(r);return i!=null&&i>=t.startLine&&i<=t.line?[r]:[]}),i=r[0],a=r.at(-1);return i===void 0||a===void 0?null:{start:i,end:a+1}},zq=(e,t)=>e.start<t.end&&t.start<e.end,Bq=(e,t,n,r=()=>`open`)=>{if(e.steps===null||e.steps.length<3)return null;let i=new Map(e.files.flatMap(e=>e.hunks.map(e=>[e.id,e]))),a=new Map(e.files.flatMap(e=>e.hunks.map(t=>[t.id,e]))),o=il(e.parts),s=new Map([...t.rows.flat(),...t.strip].map(e=>[e.key,e])),c=e=>t.placeOf.get(e)??gU(PI(e)),l=e=>s.get(e)?.label??(e.startsWith(`group:`)?e.slice(6):e),u=new Set,d=e.steps.map((e,t)=>{let r=e.excerpts.flatMap((t,n)=>{let r=i.get(t.hunkId),s=a.get(t.hunkId),c=r===void 0?null:Rq(r,t);if(r===void 0||s===void 0||c===null)return[];for(let e=c.start;e<c.end;e+=1)r.lines[e]?.kind!==`context`&&u.add(`${r.id}:${e}`);let l=o.get(r.id)?.find(e=>c.start>=e.start&&c.start<e.end)?.id??r.id;return[{key:`${e.id}:${n}`,path:s.path,hunkId:r.id,partId:l,lines:t,...c,shown:Lq(r,c.start,c.end),fileChanged:s.hunks.reduce((e,t)=>e+Lq(t),0)}]}),s=n.filter(e=>{if(e.guidance?.effect===`left-out`||e.lines===null)return!1;let{lines:t}=e,n=i.get(t.hunkId),a=n===void 0?null:Rq(n,t);return a!==null&&r.some(e=>e.hunkId===t.hunkId&&zq(e,a))});return{id:e.id,number:t+1,sentence:e.sentence,boxes:[...new Set(r.map(e=>c(e.path)))],excerpts:r,points:[`finding`,`risk`,`decision`].flatMap(e=>s.filter(t=>t.kind===e))}}),f=[],p=[],m=(e,t)=>({key:`${e}#${t}`,directory:e,label:l(e),steps:[t]});for(let e of d){let[t,n]=e.boxes;if(t===void 0)continue;if(n!==void 0){let r=[m(t,e.number),m(n,e.number)];f.push(...r),p.push({step:e.number,keys:[r[0].key,r[1].key]});continue}let r=f.at(-1),i=r!==void 0&&p.some(e=>e.keys.includes(r.key));r!==void 0&&r.directory===t&&!i?f[f.length-1]={...r,steps:[...r.steps,e.number]}:f.push(m(t,e.number))}let h=new Set(f.map(e=>e.directory)),g=new Set(d.flatMap(e=>e.excerpts.map(e=>e.path))),_=new Set(e.proofs.flatMap(e=>e.hunkId??[])),v=new Set(e.generated),y=(e,t)=>g.has(e)?`steps`:ll(e)?`tests`:v.has(e)||t.length>0&&t.every(e=>_.has(e.id))?`generated`:`other`,b=(e,t)=>e.lines.filter((n,r)=>n.kind===t&&!u.has(`${e.id}:${r}`)).length,x=e.files.flatMap(e=>{let t=e.hunks.reduce((e,t)=>e+b(t,`add`),0),n=e.hunks.reduce((e,t)=>e+b(t,`del`),0),r=y(e.path,e.hunks);return r===`steps`&&t+n===0?[]:[{group:r,file:{path:e.path,added:t,deleted:n}}]}),S=[`steps`,`tests`,`generated`,`other`].flatMap(e=>{let t=x.filter(t=>t.group===e).map(e=>e.file);return t.length===0?[]:[{id:e,label:Iq[e],files:t}]}),C=new Map(x.map(e=>[e.file.path,e.group])),w=[...t.rows.flat(),...t.strip].filter(e=>e.kind===`group`&&!h.has(e.key)).map(e=>({key:e.key,directory:e.key,label:e.label,steps:[],group:e.paths.map(e=>C.get(e)).find(e=>e!==void 0)??null})),T=new Set(d.flatMap(e=>e.points.map(e=>e.id))),E=n.filter(e=>(e.kind===`finding`||e.kind===`risk`)&&e.guidance?.effect!==`left-out`&&!T.has(e.id)),D=e=>r(e)!==`dismissed`,O=d.filter(e=>e.points.some(e=>D(e)&&(e.kind===`finding`||e.kind===`risk`&&e.checkedBy===void 0))).map(e=>e.number),k=e.files.reduce((e,t)=>e+t.hunks.reduce((e,t)=>e+Lq(t),0),0);return{steps:d,boxes:f,spans:p,others:w,ledger:S,outside:E,depth:{read:O,findingsOutside:E.filter(e=>e.kind===`finding`&&D(e)).length,risksOutside:E.filter(e=>e.kind===`risk`&&D(e)).length},shown:u.size,total:k}},Vq=e=>{let t=e.stages.steps;return t===`running`||t===`pending`?{kind:`writing`}:t===`failed`?{kind:`failed`,message:e.stepsError?.message??`The tour pass failed`}:t===`done`?(e.steps??[]).length<3?{kind:`too-small`}:null:id(e)?{kind:`without-tour`}:{kind:`no-review`}},Hq=(e,t)=>`${e} ${e===1?t:`${t}s`}`,Uq=e=>e.length<2?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`,Wq=e=>{let{read:t,findingsOutside:n,risksOutside:r}=e,i=t.length===0?`No step has an open finding or a risk no test checks.`:`Read ${t.length===1?`step`:`steps`} ${Uq(t)} in the code: ${t.length===1?`it has`:`each has`} an open finding or a risk no test checks.`,a=[...n>0?[Hq(n,`finding`)]:[],...r>0?[Hq(r,`risk`)]:[]];if(a.length===0)return i;let o=a.length>1||n+r>1;return`${i} ${a.join(` and `)} ${o?`are`:`is`} outside the steps.`},Gq=36,Kq=28,qq=e=>e.endsWith(`/`)?e.slice(0,-1):e,Jq=e=>t=>t.length<=e,Yq=e=>{let t=qq(e),n=t.lastIndexOf(`/`);return n===-1?{prefix:``,name:t||e}:{prefix:`${AI(t.slice(0,n),Jq(29))}/`,name:t.slice(n+1)}},Xq=e=>{let t=e.map(e=>AI(qq(e),Jq(Gq)));return t.map((n,r)=>t.some((e,t)=>t!==r&&e===n)?qq(e[r]??n):n)},Zq=e=>{let t=e=>e.includes(`/`)?e.slice(0,e.indexOf(`/`)):``,n=[...new Set(e.map(t).filter(e=>e.includes(`.`)))],[r,...i]=n.map(e=>e.split(`.`));if(r===void 0||i.length===0)return[...e];let a=0;for(;[r,...i].every(e=>e.length>a+1&&e[a]===r[a]);)a+=1;return e.map(e=>{let r=t(e);return n.includes(r)?r.split(`.`).slice(a).join(`.`)+e.slice(r.length):e})},Qq=e=>{let t=e.map(e=>qq(e).split(`/`));return Zq(t.map(e=>{let n=e.join(`/`);for(let r=1;r<e.length;r+=1){let i=e.slice(-r).join(`/`);if(!t.some(e=>e.join(`/`)!==n&&e.slice(-r).join(`/`)===i))return i}return n})).map(e=>AI(e,Jq(Kq)))},$q=e=>`tour-step-${e}`,eJ=e=>`tour-ledger-${e}`,tJ=`tour-end-title`,nJ=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,rJ=e=>{let{startLine:t,line:n,side:r}=e.lines,i=t===n?`line ${n}`:`lines ${t}–${n}`;return r===`old`?`base ${i}`:i},iJ=({number:e,current:t})=>(0,Y.jsx)(`span`,{className:X(`inline-flex size-5 shrink-0 items-center justify-center rounded-full border-[1.5px] border-primary font-semibold text-caption tabular-nums`,t?`bg-primary text-primary-foreground`:`text-primary`),children:e}),aJ=({box:e,current:t,compactName:n,focusable:r,onGo:i})=>{let a=n!==void 0,o=t!==null&&e.steps.includes(t),{prefix:s,name:c}=Yq(e.label);return(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`tour-box`,"aria-label":`${e.label}, ${e.steps.length===1?`step`:`steps`} ${Uq(e.steps)}${o?`, current step`:``}`,title:e.label,...o?{"aria-current":`step`}:{},...r?{}:{tabIndex:-1},onClick:i,className:X(`relative flex min-w-0 shrink-0 cursor-pointer rounded-lg text-left`,a?`max-w-md items-center gap-1.5 px-2 py-1`:`max-w-60 min-w-36 flex-col items-stretch gap-0.5 px-2.5 py-2`,o?`border-2 border-primary bg-background`:`border border-primary bg-ai-soft`),children:[!a&&s!==``&&(0,Y.jsx)(`span`,{className:`truncate font-mono text-caption text-muted-foreground`,children:s}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono font-semibold text-ui`,children:n??c}),(0,Y.jsx)(`span`,{className:`flex shrink-0 gap-1`,children:e.steps.map(e=>(0,Y.jsx)(iJ,{number:e,current:e===t},e))})]}),o&&(0,Y.jsx)(`span`,{className:X(`shrink-0 rounded-full bg-primary px-1.5 font-semibold text-caption text-primary-foreground`,!a&&`absolute -bottom-2.5 left-2`),children:`Current step`})]})},oJ=({tour:e,current:t,compact:n,focusable:r,onGoToStep:i})=>{let a=n?Qq(e.boxes.map(e=>e.label)):null,o=n=>{let o=e.boxes[n];if(o===void 0)return null;let s=a?.[n];return(0,Y.jsx)(aJ,{box:o,current:t,...s===void 0?{}:{compactName:s},focusable:r,onGo:()=>i(Math.min(...o.steps))},o.key)},s=[];for(let t=0;t<e.boxes.length;t+=1){let r=e.boxes[t];if(r===void 0)continue;let i=e.spans.find(e=>e.keys[0]===r.key);t>0&&s.push((0,Y.jsx)(cg,{"aria-hidden":`true`,className:`size-4 shrink-0 text-primary`},`arrow-${r.key}`)),i!==void 0&&e.boxes[t+1]!==void 0?(s.push((0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Step ${i.step} spans both`,className:X(`flex min-w-0 items-center gap-1 rounded-xl border-[1.5px] border-dashed border-primary`,n?`px-1.5 py-1`:`flex-col items-start px-1.5 pt-1 pb-1.5`),children:[(0,Y.jsxs)(`span`,{className:`text-caption font-medium text-primary`,children:[`Step `,i.step,` spans both`]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[o(t),(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`text-primary`,children:`+`}),o(t+1)]})]},`span-${r.key}`)),t+=1):s.push(o(t))}return s},sJ=({tour:e,current:t,onGoToStep:n,onGoToGroup:r})=>{let i=Xq(e.others.map(e=>e.label));return(0,Y.jsxs)(`div`,{"data-slot":`tour-strip`,role:`group`,"aria-label":`Directories on the tour`,className:`flex flex-col gap-3 border-b pt-3 pb-4`,children:[(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-4`,children:(0,Y.jsx)(oJ,{tour:e,current:t,compact:!1,focusable:!0,onGoToStep:n})}),e.others.length>0&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`mr-1 text-caption text-muted-foreground`,children:`Not on the tour`}),e.others.map((e,t)=>(0,Y.jsx)(`button`,{type:`button`,"data-slot":`tour-box`,"aria-label":`${e.label}, no step, see Not in the tour`,title:e.label,onClick:()=>{e.group!==null&&r(e.group)},className:`max-w-full cursor-pointer truncate rounded-md border border-dashed border-input bg-background px-2 py-1 font-mono text-caption hover:bg-surface-row`,children:i[t]},e.key))]})]})},cJ=({tour:e,current:t,overlay:n,shown:r,onGoToStep:i,onGoToEnd:a})=>(0,Y.jsx)(`div`,{"data-slot":`tour-strip-compact`,...n?{"aria-hidden":!0}:{},className:X(`sticky top-(--review-bar-h) z-10`,n&&`h-0`),children:(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Directories on the tour`,className:X(`flex flex-wrap items-center gap-1.5 border-b bg-background px-1 py-2`,n?`absolute -inset-x-1 top-0`:`-mx-1`,n&&!r&&`invisible`),children:[(0,Y.jsx)(oJ,{tour:e,current:t,compact:!0,focusable:!n,onGoToStep:i}),e.others.length>0&&(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`tour-off`,...n?{tabIndex:-1}:{},onClick:a,className:`ml-1 cursor-pointer rounded-md border border-dashed border-input bg-background px-2 py-1 text-caption text-muted-foreground hover:bg-surface-row`,children:[nJ(e.others.length,`directory`,`directories`),` not on the tour`]})]})}),lJ=({point:e,state:t,onOpen:n,wide:r=!1,after:i})=>{let a=ED[e.kind],o=DD[e.kind],s=t===`dismissed`;return(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`tour-point`,onClick:n,className:X(`flex cursor-pointer items-start gap-2 rounded-md border px-2.5 py-1.5 text-left text-body`,r?`w-full max-w-4xl`:`w-fit max-w-full`,a.className),children:[(0,Y.jsx)(o,{"aria-hidden":`true`,className:`mt-1 size-3.5 shrink-0`}),(0,Y.jsx)(`span`,{className:`font-semibold`,children:a.label}),(0,Y.jsxs)(`span`,{className:X(`min-w-0`,s&&`line-through`),children:[(0,Y.jsx)(hW,{text:e.title}),s&&(0,Y.jsx)(`span`,{className:`sr-only`,children:`, dismissed`}),i]})]})},uJ=({step:e,current:t,stateOf:n,renderExcerpt:r,onOpenPoint:i,onOpenInCode:a})=>{let o=`${$q(e.number)}-title`;return(0,Y.jsxs)(`section`,{id:$q(e.number),"data-slot":`tour-step`,"aria-labelledby":o,...t?{"aria-current":`step`}:{},className:`grid grid-cols-[1.5rem_1fr] gap-x-2.5 border-b py-5 lg:grid-cols-[1.875rem_1fr]`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:X(`text-right font-semibold text-heading tabular-nums`,t?`text-primary`:`text-muted-foreground`),children:e.number}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2.5`,children:[(0,Y.jsxs)(`h2`,{id:o,tabIndex:-1,className:`font-semibold text-heading outline-none`,children:[(0,Y.jsxs)(`span`,{className:`sr-only`,children:[`Step `,e.number,`: `]}),(0,Y.jsx)(hW,{text:e.sentence})]}),e.points.length>0&&(0,Y.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.points.map(e=>(0,Y.jsx)(lJ,{point:e,state:n(e),onOpen:()=>i(e)},e.id))}),e.excerpts.map(t=>{let n=t.path.lastIndexOf(`/`)+1;return(0,Y.jsxs)(`div`,{"data-slot":`tour-card`,className:`mt-1 min-w-0 overflow-hidden rounded-lg border bg-card`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 border-b px-3 py-2`,children:[(0,Y.jsxs)(`span`,{className:`min-w-0 font-mono text-code-compact`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:t.path.slice(0,n)}),(0,Y.jsx)(`span`,{className:`font-medium`,children:t.path.slice(n)})]}),(0,Y.jsxs)(`span`,{className:`text-caption text-muted-foreground`,children:[rJ(t),` · `,t.shown,` of`,` `,nJ(t.fileChanged,`changed line`)]}),(0,Y.jsxs)($,{variant:`ghost`,size:`sm`,className:`ml-auto text-primary`,"aria-label":`Open ${t.path} ${rJ(t)} in code`,onClick:()=>a(e,t),children:[(0,Y.jsx)(vg,{"aria-hidden":`true`}),`Open in code`]})]}),r(t)]},t.key)})]})]})},dJ=({added:e,deleted:t})=>(0,Y.jsxs)(`span`,{className:`font-mono text-code-compact`,children:[e>0&&(0,Y.jsxs)(`span`,{className:`text-stat-add`,children:[`+`,e]}),e>0&&t>0&&` `,t>0&&(0,Y.jsxs)(`span`,{className:`text-stat-del`,children:[`−`,t]})]}),fJ=({tour:e,stateOf:t,openGroups:n,onToggleGroup:r,flashed:i,onOpenFile:a,onOpenPoint:o})=>{let s=e.ledger.reduce((e,t)=>e+t.files.length,0);return(0,Y.jsxs)(`section`,{"aria-labelledby":tJ,"data-slot":`tour-end`,className:`flex flex-col gap-5 py-6 lg:pl-10`,children:[(0,Y.jsx)(`h2`,{id:tJ,tabIndex:-1,className:`font-semibold text-heading outline-none`,children:`After the tour`}),e.ledger.length>0&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`h3`,{className:`font-semibold text-body`,children:[`Not in the tour`,` `,(0,Y.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,nJ(s,`file`)]})]}),e.ledger.map(e=>{let t=e.files.reduce((e,t)=>e+t.added,0),o=e.files.reduce((e,t)=>e+t.deleted,0);return(0,Y.jsxs)(`details`,{id:eJ(e.id),open:n.has(e.id),onToggle:t=>r(e.id,t.currentTarget.open),className:X(`group max-w-3xl rounded-lg border bg-card`,i===e.id&&`border-primary ring-2 ring-ai-soft-bd`),children:[(0,Y.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 px-3 py-2 text-body [&::-webkit-details-marker]:hidden`,children:[(0,Y.jsx)(cg,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground group-open:rotate-90`}),(0,Y.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,Y.jsxs)(`span`,{className:`ml-auto text-ui text-muted-foreground`,children:[nJ(e.files.length,`file`),` ·`,` `,(0,Y.jsx)(dJ,{added:t,deleted:o})]})]}),(0,Y.jsx)(`ul`,{className:`flex flex-col border-t py-1`,children:e.files.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>a(e.path),className:`flex w-full cursor-pointer items-center gap-3 px-3 py-1 text-left hover:bg-surface-row`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-code-compact`,children:e.path}),(0,Y.jsx)(dJ,{added:e.added,deleted:e.deleted})]})},e.path))})]},e.id)})]}),e.outside.length>0&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold text-body`,children:`Findings and risks outside the steps`}),e.outside.map(e=>(0,Y.jsx)(lJ,{point:e,state:t(e),wide:!0,onOpen:()=>o(e),after:e.path===null?null:(0,Y.jsxs)(`span`,{className:`font-mono text-code-compact`,children:[` `,`· `,e.path.slice(e.path.lastIndexOf(`/`)+1)]})},e.id))]}),(0,Y.jsxs)(`div`,{"data-slot":`tour-depth`,className:`flex max-w-4xl items-start gap-2 rounded-lg border border-ai-soft-bd bg-ai-soft px-4 py-3 text-body`,children:[(0,Y.jsx)(E_,{"aria-hidden":`true`,className:`mt-1 size-4 shrink-0 text-primary`}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`font-semibold`,children:`Suggested depth`}),(0,Y.jsx)(`p`,{children:Wq(e.depth)})]})]})]})},pJ=e=>({top:e===null?0:Number.parseFloat(getComputedStyle(e).top)||0,height:e?.firstElementChild?.getBoundingClientRect().height??0}),mJ=(e,t,n)=>{let[r,i]=(0,J.useState)(n>0?1:null),[a,o]=(0,J.useState)(!1),s=(0,J.useRef)(null),c=(0,J.useCallback)(e=>{s.current=e,i(e)},[]);return(0,J.useEffect)(()=>{let e=()=>{s.current=null},t=[`wheel`,`touchmove`,`keydown`,`pointerdown`];for(let n of t)window.addEventListener(n,e,{passive:!0});return()=>{for(let n of t)window.removeEventListener(n,e)}},[]),(0,J.useEffect)(()=>{let n=0,r=()=>{n=0;let r=e.current,a=t();if(r===null||a===null)return;let{top:c,height:l}=pJ(a),u=a.getBoundingClientRect().top,d=u+l+8,f=[...r.querySelectorAll(`[data-slot=tour-step]`)],p=f.length>0?1:null;f.forEach((e,t)=>{e.getBoundingClientRect().top<=d&&(p=t+1)}),s.current===null&&i(p),o(window.scrollY>0&&Math.abs(u-c)<=1)},a=()=>{n===0&&(n=window.requestAnimationFrame(r))};return r(),window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a),()=>{window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a),n!==0&&window.cancelAnimationFrame(n)}},[e,t]),{current:r,stuck:a,pin:c}},hJ=()=>{let e=`(max-width: 1179px)`,[t,n]=(0,J.useState)(()=>typeof window.matchMedia==`function`&&window.matchMedia(e).matches);return(0,J.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[]),t},gJ=({tour:e,stateOf:t,renderExcerpt:n,onOpenPoint:r,onOpenFile:i,onOpenInCode:a,onCurrentStep:o,landOn:s=null})=>{let c=(0,J.useRef)(null),l=(0,J.useCallback)(()=>c.current?.querySelector(`[data-slot=tour-strip-compact]`)??null,[]),{current:u,stuck:d,pin:f}=mJ(c,l,e.steps.length),p=hJ(),[m,h]=(0,J.useState)(new Set),[g,_]=(0,J.useState)(null),v=(0,J.useRef)(o);v.current=o,(0,J.useEffect)(()=>v.current?.(u),[u]);let y=(0,J.useCallback)(e=>{let{top:t,height:n}=pJ(l()),r=window.scrollY+e.getBoundingClientRect().top-t-n-4;window.scrollTo({top:Math.max(0,r),behavior:`instant`})},[l]),[b,x]=(0,J.useState)(null),S=(0,J.useCallback)(e=>{x(t=>({step:e,n:(t?.n??0)+1}))},[]);(0,J.useLayoutEffect)(()=>{if(b===null)return;let e=document.getElementById($q(b.step));if(e!==null)return y(e),e.querySelector(`h2`)?.focus({preventScroll:!0}),f(b.step),sW(`[data-slot=understand]`,()=>y(e))},[b,y,f]);let C=()=>{let e=document.getElementById(tJ);e!==null&&(y(e),e.focus({preventScroll:!0}))},w=e=>{h(t=>new Set([...t,e])),_(e),window.setTimeout(()=>_(t=>t===e?null:t),1600);let t=document.getElementById(eJ(e));t!==null&&(y(t),t.querySelector(`summary`)?.focus({preventScroll:!0}))},T=(0,J.useRef)(null);return(0,J.useEffect)(()=>{if(s===null||T.current===s.n)return;if(T.current=s.n,s.step>0)return S(s.step);let e=c.current;if(e===null)return;let t=document.querySelector(`[data-slot=review-bar]`)?.getBoundingClientRect().height??0,n=window.scrollY+e.getBoundingClientRect().top-t-8;window.scrollTo({top:Math.max(0,n),behavior:`instant`})},[s,S]),(0,Y.jsxs)(`div`,{ref:c,"data-slot":`understand`,className:`flex min-w-0 flex-col`,children:[!p&&(0,Y.jsx)(sJ,{tour:e,current:u,onGoToStep:S,onGoToGroup:w}),(0,Y.jsx)(cJ,{tour:e,current:u,overlay:!p,shown:d,onGoToStep:S,onGoToEnd:C}),(0,Y.jsxs)(`section`,{className:`max-w-[73.75rem]`,"aria-label":`Tour steps`,children:[e.steps.map(e=>(0,Y.jsx)(uJ,{step:e,current:e.number===u,stateOf:t,renderExcerpt:n,onOpenPoint:r,onOpenInCode:a},e.id)),(0,Y.jsx)(fJ,{tour:e,stateOf:t,openGroups:m,onToggleGroup:(e,t)=>h(n=>{if(n.has(e)===t)return n;let r=new Set(n);return t?r.add(e):r.delete(e),r}),flashed:g,onOpenFile:i,onOpenPoint:r})]})]})},_J=({children:e,busy:t})=>(0,Y.jsxs)(`p`,{"data-slot":`no-tour`,...t?{role:`status`}:{},className:`flex items-center gap-2 text-ui text-muted-foreground`,children:[(0,Y.jsx)(E_,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),e]}),vJ=`tour-landing`,yJ=({step:e,excerpt:t})=>(0,Y.jsxs)(`p`,{id:vJ,"data-slot":`tour-landing`,className:`scroll-mt-24 flex flex-wrap items-center gap-x-1.5 border-b bg-ai-soft px-3 py-1.5 text-ui text-primary`,children:[(0,Y.jsx)(f_,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`font-semibold`,children:[`Tour step `,e.number]}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Y.jsx)(`span`,{children:rJ(t)}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Y.jsx)(`span`,{className:`text-foreground`,children:(0,Y.jsx)(hW,{text:e.sentence})})]}),bJ=({step:e,onBack:t,onDismiss:n})=>(0,Y.jsxs)(`div`,{"data-slot":`back-to-tour`,className:`sticky top-(--review-bar-row) z-20 -mt-px flex h-9 items-center gap-2 border-b bg-background`,children:[(0,Y.jsxs)($,{variant:`outline`,size:`sm`,className:`border-ai-soft-bd bg-ai-soft text-primary hover:bg-ai-soft-hover`,onClick:t,children:[(0,Y.jsx)(Xh,{"aria-hidden":`true`}),`Back to tour · Step `,e]}),(0,Y.jsx)($,{variant:`ghost`,size:`icon-sm`,"aria-label":`Hide Back to tour`,onClick:n,children:(0,Y.jsx)(I_,{"aria-hidden":`true`})})]}),xJ=.25,SJ=(e,t,n)=>{let r=n?t-1:t*xJ;return(e.findLast(e=>e.top<=r)??e[0])?.path??null},CJ=()=>{let e=[...document.querySelectorAll(`[aria-label=Changes] [data-slot=file-card][data-path]`)],t=e.map(e=>e.getBoundingClientRect());return t.every(e=>e.height===0)?null:e.map((e,n)=>({path:e.dataset.path??``,top:t[n]?.top??0}))},wJ=(e,t)=>{let[n,r]=(0,J.useState)(null),i=e.join(`\0`);return(0,J.useEffect)(()=>{if(!t)return;let e=0,n=()=>{e=0;let t=document.documentElement,n=window.scrollY+window.innerHeight>=t.scrollHeight-2,i=CJ();if(i===null)return;let a=SJ(i,window.innerHeight,n&&window.scrollY>0);a!==null&&r(a)},i=()=>{e===0&&(e=requestAnimationFrame(n))};return n(),window.addEventListener(`scroll`,i,{passive:!0}),window.addEventListener(`resize`,i),()=>{window.removeEventListener(`scroll`,i),window.removeEventListener(`resize`,i),e!==0&&cancelAnimationFrame(e)}},[i,t]),n},TJ=`[aria-label=Changes]`,EJ=e=>{let t=getComputedStyle(document.documentElement).getPropertyValue(e).trim(),n=Number.parseFloat(t);return Number.isFinite(n)?t.endsWith(`ms`)?n:t.endsWith(`s`)?n*1e3:n:0},DJ=e=>`✓ ${e} is done`,OJ=new Set,kJ=new Map,AJ=(e,t,n=`Claude`)=>{let[r,i]=(0,J.useState)({running:e,before:OJ}),[a,o]=(0,J.useState)(`done`),[s,c]=(0,J.useState)(kJ),[l,u]=(0,J.useState)(0);e!==r.running&&(i({running:e,before:e?new Set(t):r.before}),o(e?`done`:`measure`),c(kJ),e||u(l+1)),(0,J.useEffect)(()=>{if(l===0||!document.hidden)return;let e=document.title;document.title=`${DJ(n)} · ${e}`;let t=()=>{document.hidden||(document.title=e)};return document.addEventListener(`visibilitychange`,t),()=>{document.removeEventListener(`visibilitychange`,t),document.title=e}},[l,n]);let d=(0,J.useRef)(null);(0,J.useLayoutEffect)(()=>{if(a!==`measure`)return;if(d.current=iW(TJ),EJ(`--landing-total`)===0){o(`done`);return}let e=new Map;for(let t of document.querySelectorAll(`[data-slot=point-fold][data-fresh]`)){let{top:n}=t.getBoundingClientRect(),r=Su.safeParse(t.dataset.pointId);r.success&&n>=0&&n<window.innerHeight&&e.set(r.data,e.size)}c(e),o(`landing`)},[a]),(0,J.useLayoutEffect)(()=>{a!==`measure`&&d.current!==null&&(d.current(),d.current=null)},[a]),(0,J.useEffect)(()=>{if(a!==`landing`)return;let e=Math.max(0,s.size-1)*EJ(`--landing-step-code`),t=setTimeout(()=>o(`done`),EJ(`--landing-total`)+e);return()=>clearTimeout(t)},[a,s]);let{before:f}=r,p=(0,J.useCallback)(e=>a!==`done`&&!f.has(e),[a,f]);return{phase:a,running:e||a===`measure`,fresh:p,inView:a===`landing`?s:kJ}},jJ=`[aria-label=Changes]`,MJ=(e,t)=>e.id===t.id&&e.guardrails===`running`&&t.guardrails!==`running`,NJ=e=>{let[t,n]=(0,J.useState)(e),r=(0,J.useRef)(null),i=t!==e&&MJ(t,e);return(0,J.useLayoutEffect)(()=>{t===e?(r.current?.(),r.current=null):(MJ(t,e)&&(r.current=iW(jJ)),n(e))},[e,t]),i?t:e},PJ=(e,t)=>{let{client:n}=Pp(),[r,i]=(0,J.useState)(new Map),[a,o]=(0,J.useState)(new Set),[s,c]=(0,J.useState)(null),l=(0,J.useRef)(new Map),u=(0,J.useMemo)(()=>{let e=new Map(t.map(e=>[e.pointId,e.state]));for(let[t,n]of r)e.set(t,n);return e},[t,r]);return{stateOf:(0,J.useCallback)(e=>u.get(e)??`open`,[u]),setState:(0,J.useCallback)(async(t,r)=>{i(e=>new Map(e).set(t,r)),o(e=>new Set(e).add(t));let a=(l.current.get(t)??0)+1;l.current.set(t,a);let s=await n.putPointState(e,t,{state:r});l.current.get(t)===a&&(o(e=>{let n=new Set(e);return n.delete(t),n}),s.ok?c(e=>e?.pointId===t?null:e):(i(e=>{let n=new Map(e);return n.delete(t),n}),c({pointId:t,message:Gp(s.error)})))},[e,n]),isSaving:e=>a.has(e),failure:s,dismissFailure:()=>c(null)}},FJ=6e4,IJ=e=>{let{client:t}=Pp(),[n,r]=(0,J.useState)(null),[i,a]=(0,J.useState)(null),o=(0,J.useRef)(0),s=(0,J.useCallback)(()=>{o.current+=1;let n=o.current;t.getPullRequestStatus(e).then(e=>{n===o.current&&(e.ok?(r(e.value),a(null)):a(e.error))})},[t,e]);(0,J.useEffect)(()=>(s(),window.addEventListener(`focus`,s),()=>window.removeEventListener(`focus`,s)),[s]);let c=n?.checks?.some(e=>e.state===`running`)===!0;return(0,J.useEffect)(()=>{if(!c)return;let e=setInterval(()=>{document.visibilityState===`visible`&&s()},FJ);return()=>clearInterval(e)},[c,s]),{status:n,error:i,reload:s}},LJ=(e,t)=>{let{client:n}=Pp(),[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(null),s=(0,J.useRef)(0),c=(0,J.useCallback)(()=>{s.current+=1;let t=s.current;n.getThreads(e).then(e=>{t===s.current&&(e.ok?(i(e.value),o(null)):o(e.error))})},[n,e]);return(0,J.useEffect)(()=>{t&&c()},[t,c]),{list:r,error:a,reload:c,reply:(0,J.useCallback)(async(t,r)=>{let i=await n.replyToThread(e,t,{body:r});return i.ok?(c(),null):Gp(i.error)},[n,e,c]),resolve:(0,J.useCallback)(async(t,r)=>{let i=await n.resolveThread(e,t,{resolved:r});return i.ok?(c(),null):Gp(i.error)},[n,e,c]),post:(0,J.useCallback)(async t=>{let r=await n.postComment(e,t);return r.ok?(c(),null):Gp(r.error)},[n,e,c])}},RJ=[],zJ=e=>sf.array().safeParse(e).data,BJ=({analysisId:e})=>{let[t,n]=(0,J.useState)({count:0,seed:null}),r=(0,J.useCallback)((e=null)=>n(({count:t})=>({count:t+1,seed:e})),[]);return(0,Y.jsx)(VJ,{analysisId:e,seed:t.seed,restart:r},`${e}/${t.count}`)},VJ=({analysisId:e,seed:t,restart:n})=>{let{view:r,error:i,refetch:a,follow:o}=Vp(e,t);return r===null?i?.code===`not-found`?(0,Y.jsxs)(`div`,{className:`mx-auto flex max-w-2xl flex-col gap-3 py-12`,children:[(0,Y.jsx)(`h1`,{className:`text-title font-semibold tracking-[-0.01em]`,children:`Analysis not found`}),(0,Y.jsx)(`p`,{className:`text-body`,children:Gp(i)}),(0,Y.jsx)(`p`,{children:(0,Y.jsx)(Q_,{to:`/`,children:`Pick a pull request to review`})})]}):i===null?(0,Y.jsx)(HJ,{}):(0,Y.jsxs)(`div`,{className:`mx-auto flex max-w-2xl flex-col items-start gap-3 py-12`,children:[(0,Y.jsxs)(`p`,{className:dF,role:`alert`,children:[`Couldn't load the analysis. `,Gp(i)]}),(0,Y.jsx)($,{variant:`outline`,onClick:()=>void a(),children:`Try again`})]}):(0,Y.jsx)(rY,{view:r,refetch:a,follow:o,restart:n})},HJ=()=>(0,Y.jsxs)(`div`,{className:`mx-auto flex max-w-[1600px] flex-col gap-4`,role:`status`,"aria-busy":`true`,"aria-label":`Loading the analysis`,children:[(0,Y.jsx)(pF,{className:`h-7 w-2/3`}),(0,Y.jsx)(pF,{className:`h-4 w-1/2`}),(0,Y.jsxs)(`div`,{className:UJ,children:[(0,Y.jsx)(hF,{}),(0,Y.jsx)(mF,{})]})]}),UJ=`grid items-start gap-5 lg:grid-cols-[17rem_minmax(0,1fr)]`,WJ=[],GJ=[{value:`map`,label:`Map`},{value:`overview`,label:`Overview`}],KJ=[{value:`map`,label:`Map`},{value:`overview`,label:`Understand`}],qJ=e=>{switch(e.kind){case`no-review`:return`No AI review yet. The tour through these directories is written with one: Request AI review above.`;case`without-tour`:return`This AI review ran without the tour. Re-run it to get one.`;case`writing`:return`The tour is being written.`;case`too-small`:return`The change is too small for a tour: it has fewer than 3 steps to make.`;case`failed`:return`The tour couldn't be written: ${e.message}`}},JJ=[`nextFile`,`previousFile`,`comment`,`openCall`,`moveFile`,`openFile`,`toggleLayout`,`openReview`,`close`,`help`],YJ=({analysis:e})=>{let{checkout:t,pullRequest:n}=e;if(t===`read`||n===null)return null;let{ref:r,headSha:i}=n;return(0,Y.jsxs)(`p`,{"data-slot":`checkout-note`,className:`text-muted-foreground`,children:[`Code outside the pull request that calls what it changes isn't shown:`,` `,t===`missing-commit`?(0,Y.jsxs)(Y.Fragment,{children:[`the local checkout doesn't have the head commit`,` `,(0,Y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 font-mono text-code-compact`,children:i.slice(0,7)}),`. Run`,` `,(0,Y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 font-mono text-code-compact`,children:`git fetch`}),` in it`,r.repo.host===`github`&&(0,Y.jsxs)(Y.Fragment,{children:[`, or`,` `,(0,Y.jsxs)(`code`,{className:`rounded-sm bg-muted px-1 font-mono text-code-compact`,children:[`git fetch origin pull/`,r.number,`/head`]}),` `,`for a pull request from a fork`]}),`, then open the pull request again.`]}):(0,Y.jsxs)(Y.Fragment,{children:[`megareviewer didn't run in a checkout of `,r.repo.owner,`/`,r.repo.repo,`. Start it in one, or pass`,` `,(0,Y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 font-mono text-code-compact`,children:`--checkout <dir>`}),`, then open the pull request again.`]})]})},XJ=[],ZJ=(e,t)=>{let[n,r]=(0,J.useState)(e);return!t&&n!==e&&r(e),t?n:e},QJ=(e,t)=>{let{lines:n}=e;if(n===null)return null;let r=null,i=null;for(let[e,a]of t.lines.entries()){let t=kM(a);t!==null&&t.side===n.side&&(t.line<n.startLine||t.line>n.line||(r??=e,(i===null||t.line>i.line)&&(i={line:t.line,at:e})))}return r===null||i===null?null:{key:`${n.side}:${i.line}`,rows:i.at-r+1}},$J={github:void 0,bitbucket:`Bitbucket can't anchor a range, so the comment goes on the last line and names them.`},eY=new WeakMap,tY=0,nY=e=>{let t=eY.get(e);return t===void 0?(tY+=1,eY.set(e,tY),tY):t},rY=({view:e,refetch:t,follow:n,restart:r})=>{let{client:i}=Pp(),a=HR(Lp().status?.model??null),{analysis:o,publication:s}=e,c=o.id,l=o.status===`complete`,u=l&&td(o),d=NJ(ZJ(o,u)),f=Hp(i.runModel),p=s!==null||!l,m=(0,J.useMemo)(()=>YW(d),[d]),h=(0,J.useMemo)(()=>XW(d,m),[d,m]),g=(0,J.useMemo)(()=>h.flatMap(e=>e.partIds),[h]),_=(0,J.useMemo)(()=>tG(d,m),[d,m]),v=eG(_),[y,b]=NR(`decisions`,!1,PR),[x,S]=NR(`tour`,!1,PR),C=(0,J.useMemo)(()=>Du(d).filter(e=>y||e.kind!==`decision`),[d,y]),w=(0,J.useMemo)(()=>C.map(e=>e.id),[C]),T=PJ(c,e.pointReviews),[E,D]=(0,J.useState)(new Set),{stateOf:O}=T,k=(0,J.useMemo)(()=>new Set(C.filter(e=>e.guidance?.effect===`left-out`&&O(e.id)===`open`&&!E.has(e.id)).map(e=>e.id)),[C,O,E]),A=(0,J.useMemo)(()=>C.filter(e=>!k.has(e.id)),[C,k]),j=(0,J.useCallback)(e=>D(t=>new Set(t).add(e)),[]),M=Bl(o.modelOption??a.chosen),N=AJ(u,w,M),P=(0,J.useMemo)(()=>QW(C,g,m),[C,g,m]),F=(0,J.useMemo)(()=>{let e=new Map,t=new Map,n=new Map,r=new Map,i=(e,t,n,r)=>{let i=e.get(t)??new Map;i.set(n,[...i.get(n)??[],r]),e.set(t,i)};for(let[a,o]of P.cards){let s=m.parts.get(a);for(let c of o){let o=s===void 0?null:QJ(c,s.hunk);o===null?n.set(a,[...n.get(a)??[],c]):c.kind===`decision`?i(t,a,o.key,c):(i(e,a,o.key,c),r.set(c.id,o.rows))}}for(let t of e.values())for(let[e,n]of t)t.set(e,[...n.filter(e=>e.kind===`finding`),...n.filter(e=>e.kind!==`finding`)]);return{underLine:e,atLineEnd:t,underHeader:n,rowsAbove:r}},[P,m]),I=(0,J.useMemo)(()=>{let e=new Map,t=t=>{let[n]=t;for(let r of t)n!==void 0&&e.set(r.id,n.id)};for(let e of F.underLine.values())for(let n of e.values())t(n);for(let[e,n]of F.underHeader)t([...n,...P.mentions.get(e)??WJ]);for(let[e,n]of P.mentions)F.underHeader.has(e)||t(n);return t(P.unplaced),e},[F,P]),{inView:L}=N,R=(0,J.useCallback)(e=>L.get(I.get(e)??e),[L,I]),ee=(0,J.useMemo)(()=>{let e=new Map;for(let[t,n]of P.cards){let r=m.parts.get(t)?.file.path;if(r===void 0)continue;let i=n.filter(e=>!k.has(e.id));if(i.length===0)continue;let a=e.get(r)??{};for(let e of i)a[e.kind]=(a[e.kind]??0)+1;e.set(r,a)}return e},[P,m,k]),z=(0,J.useMemo)(()=>h.map(({file:e})=>({path:e.path,status:e.status,oldPath:e.oldPath,additions:e.additions,deletions:e.deletions,...ee.has(e.path)?{points:ee.get(e.path)}:{}})),[h,ee]),[B,V]=(0,J.useState)([]),te=(0,J.useMemo)(()=>TU(d,new Set(B)),[d,B]),H=(0,J.useMemo)(()=>TU(d),[d]),U=(0,J.useMemo)(()=>Du(d),[d]),ne=x?Vq(o):null,re=(0,J.useMemo)(()=>x?Bq(d,H,U,e=>O(e.id)):null,[x,d,H,U,O]),ie=(0,J.useMemo)(()=>d.stages.prep===`done`?OU(TU(d)):null,[d]),[ae,oe]=NR(`review-layout`,`map`,qW),W=ae===`overview`&&ne===null&&re!==null,se=wJ((0,J.useMemo)(()=>h.map(e=>e.file.path),[h]),ae===`map`&&d.stages.prep===`done`),[ce,le]=(0,J.useState)(!1),ue=(0,J.useMemo)(()=>{let e=new Map;for(let t of d.unchangedCallers)e.set(t.partId,[...e.get(t.partId)??[],t]);return e},[d.unchangedCallers]),de=(0,J.useCallback)(e=>ue.get(e)??XJ,[ue]),[fe]=(0,J.useState)(zM),pe=(0,J.useMemo)(()=>LU(d.callSites,m,fe),[d.callSites,m,fe]),me=(0,J.useCallback)(e=>pe.get(e),[pe]),he=(0,J.useMemo)(()=>new Map(C.flatMap(e=>{let t=RU(e,m);return t===null?[]:[[e.id,{handle:fe,payload:t}]]})),[C,m,fe]),[ge,_e]=(0,J.useState)(null),[ve,ye]=(0,J.useState)(null),be=(0,J.useRef)(null),[xe,Se]=(0,J.useState)(null),[Ce,we]=(0,J.useState)(null),[Te,Ee]=(0,J.useState)(null),[De,Oe]=(0,J.useState)(null),[ke,Ae]=(0,J.useState)(null),[je,Me]=(0,J.useState)(new Set),[Ne,Pe]=(0,J.useState)(!1),Fe=Te===`thread`||A.length===0,Ie=Fe?null:Ce,[Le,Re]=(0,J.useState)(!1),[ze,Be]=(0,J.useState)(new Set),Ve=(0,J.useCallback)(e=>Be(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),[]),[G,He]=(0,J.useState)(!1),[Ue,We]=(0,J.useState)(new Set),[Ge,Ke]=(0,J.useState)(null),[qe,Je]=(0,J.useState)(!1),[Ye,Xe]=(0,J.useState)(!1),Ze=(0,J.useRef)(!0),[Qe,$e]=(0,J.useState)(!1),[et,tt]=NR(`hunk-comments:${c}`,RJ,zJ),[nt,rt]=(0,J.useState)(null),it=(0,J.useRef)(null),at=(0,J.useMemo)(()=>nG(et,m),[et,m]),ot=(0,J.useCallback)(e=>at.get(e)??RJ,[at]),st=(0,J.useCallback)((e,t)=>tt(n=>{let r=nl(e),i=e=>e.hunkId===r&&e.side===t.side&&e.line===t.line,a={hunkId:r,...t},o=t.body===``&&t.suggestion===void 0;return n.some(i)?o?n.filter(e=>!i(e)):n.map(e=>i(e)?a:e):o?n:[...n,a]}),[tt]),ct=(0,J.useCallback)((e,t)=>{it.current=null,rt(n=>{if(t?.startLine!==void 0&&n!==null&&n.partId===e){let r=nl(e),i=n.place;tt(e=>e.map(e=>e.hunkId===r&&e.side===i.side&&e.line===i.line?{...e,line:t.line,startLine:t.startLine}:e))}return t===null?null:{partId:e,place:t}})},[tt]),{setState:lt}=T,ut=(0,J.useCallback)((e,t)=>{let n=it.current;it.current=null,n!==null&&n.partId===e&&n.place.side===t.side&&n.place.line===t.line&&(st(e,n.before??{...n.place,body:``}),n.state!==`raised`&<(n.pointId,n.state))},[st,lt]),dt=LJ(c,d.stages.prep===`done`),ft=IJ(c),{post:pt}=dt,mt=(0,J.useCallback)((e,t)=>pt({hunkId:nl(e),...t}),[pt]),ht=(0,J.useMemo)(()=>Sq(dt.list?.threads??null,h,m),[dt.list,h,m]),gt=(0,J.useMemo)(()=>wq(ht,h,m),[ht,h,m]),_t=Eq(ke,gt,je),vt=Fe?De:null,{resolve:yt}=dt,bt=(0,J.useCallback)(async(e,t)=>{let n=await yt(e,t);return n===null&&t&&Me(t=>new Set(t).add(e)),n},[yt]),xt=d.pullRequest?.author.id??null,St=(e,t)=>(0,Y.jsx)(xM,{thread:e,authorId:xt,now:Date.now(),language:NA({path:e.path,language:null}),covered:t,mediaUrl:e=>i.attachmentUrl(c,e),onReply:t=>dt.reply(e.id,t),onResolve:t=>bt(e.id,t),current:vt===e.id,anchorId:vq(e.id),linesAbove:t?.length??0},e.id),Ct=(e,t)=>{let n=ht.onLine.get(e)?.get(yq(t));if(n===void 0)return null;let r=m.parts.get(e)?.hunk;return n.map(e=>{let n=e.startLine??t.line;return St(e,r===void 0?null:Cq(r,Math.min(n,t.line),t.line))})},wt=e=>{let t=ht.earlier.get(e);return t===void 0?null:t.map(e=>(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:e.outdated?`Was on ${e.side===`old`?`old `:``}line ${e.originalLine??`?`}; the code has changed since`:`On ${yM(e)}, which the diff doesn't show`}),St(e,null)]},e.id))},Tt=e=>ht.open.get(e)??0,Et=(0,J.useMemo)(()=>z.map(e=>({...e,threads:ht.open.get(e.path)??0})),[z,ht]),Dt=e=>Ke(t=>({id:e,n:(t?.n??0)+1})),Ot=()=>ae===`overview`?null:ge,kt=(0,J.useCallback)(e=>_e(e),[]),At=e=>{te.placeOf.has(e)&&ye(t=>({key:e,n:(t?.n??0)+1}))},jt=(e,t=ae)=>{if(t===`overview`){let t=m.parts.get(e)?.file.path;t!==void 0&&At(t)}else Dt(g.includes(e)?GU(e):iG)},Mt=e=>{let t=C.find(t=>t.id===e),n=P.cardPart.get(e);t?.kind===`decision`&&Be(t=>new Set([...t,e])),k.has(e)&&j(e),Te===`thread`&&Ee(null),We(new Set((t?.hunkIds??[]).flatMap(m.partsOf))),ae===`overview`&&!W?n!==void 0&&jt(n):(ae===`overview`&&(oe(()=>`map`),Se(null)),Dt(sK(e))),we(e)},[Nt,Pt]=(0,J.useState)(null),[Ft,It]=(0,J.useState)(null),[Lt,Rt]=(0,J.useState)(0);(0,J.useEffect)(()=>{if(Lt!==0&&ae===`map`)return cW(vJ,`[aria-label=Changes]`)},[Lt,ae]);let zt=`tour-step:${c}`,Bt=()=>{let e=FR(zt);return typeof e==`number`?e:0},Vt=x&&ne===null&&re!==null,Ht=e=>{oe(()=>`overview`),Se(null),Pt(null),We(new Set),It(t=>({step:e,n:(t?.n??0)+1}))},Ut=()=>Ht(Nt?.step.number??Bt()),Wt=(e,t)=>{oe(()=>`map`),Se(null),Pt({step:e,excerpt:t}),_e(t.partId),IR(zt,e.number),Dt(vJ),Rt(e=>e+1)},Gt=e=>{oe(()=>`map`),Se(null),_e(e),We(new Set([e])),Dt(g.includes(e)?GU(e):iG)},Kt=e=>{if(e.kind!==`decision`||y)return Mt(e.id);let t=P.cardPart.get(e.id)??e.hunkIds.flatMap(m.partsOf)[0];t!==void 0&&Gt(t)},qt=e=>{oe(()=>`map`),Se(null),Dt(h.some(t=>t.file.path===e)?aG(e):iG)},Jt=e=>{Ee(`thread`),Oe(e),We(new Set),ae===`overview`&&oe(()=>`map`),Dt(vq(e))},Yt=e=>{if(Ee(e),e===`thread`){let e=Tq(gt,_t,je),[t]=e;t!==void 0&&!e.some(e=>e.id===De)&&Jt(t.id);return}let t=VK(A,e,Ce);t!==null&&Mt(t)},Xt=e=>{let t=Su.parse(`m${e+1}`),n=d.findings.find(t=>t.mismatch===`m${e+1}`);Mt(C.some(e=>e.id===t)||n===void 0?t:Su.parse(n.id))},Zt=()=>{let e=(document.activeElement?.closest(`[aria-label=Changes] [data-slot=file-card]`))?.dataset.path??se;oe(()=>`overview`),Se(null),e!==null&&At(e)},Qt=e=>{let[t]=e.kind===`outside`?[]:e.paths,n=t===void 0?e.partIds[0]:h.find(e=>e.file.path===t)?.partIds[0];n!==void 0&&(oe(()=>`map`),Se(e.key),_e(n),t===void 0?jt(n,`map`):Dt(aG(t)))},$t=()=>{if(ae===`map`)return Vt?Ht(Nt?.step.number??Bt()):Zt();if(W){let e=re?.steps.find(e=>e.number===Bt()),[t]=e?.excerpts??[];return e!==void 0&&t!==void 0?Wt(e,t):oe(()=>`map`)}let e=[...te.rows.flat(),...te.strip].find(e=>e.key===be.current);if(e!==void 0&&e.kind!==`outside`)return Qt(e);oe(()=>`map`)};Zp({label:`Layout`,options:x?KJ:GJ,value:ae,onChange:e=>{e!==ae&&$t()},toggles:[{label:`Decisions`,checked:y,onChange:e=>b(()=>e)},{label:`Tour (preview)`,checked:x,onChange:e=>S(()=>e)}]});let en=e=>{let t=[...document.querySelectorAll(`[aria-label=Changes] [data-slot=file-card]`)],n=t.findIndex(e=>e.contains(document.activeElement)),r=n===-1?e===1?t.find(e=>e.getBoundingClientRect().top>1):t.findLast(e=>e.getBoundingClientRect().top<-1):t[n+e];r!==void 0&&Dt(r.id)},tn=(e,t=!1)=>{let n=P.cardPart.get(e.id),r=n===void 0?void 0:m.parts.get(n);if(p||n===void 0||r===void 0)return;let i=e.lines===null?null:{side:e.lines.side,line:e.lines.line,...e.lines.startLine===e.lines.line?{}:{startLine:e.lines.startLine}},a=r.hunk.lines.find(e=>e.kind!==`context`),o=i??(a===void 0?null:kM(a));if(o===null)return;let s=e.explanation===``?e.title:`${e.title}\n\n${e.explanation}`,c=nl(n),l=et.find(e=>e.hunkId===c&&e.side===o.side&&e.line===o.line),u={...e.suggestion===null?{}:{suggestion:e.suggestion}};l===void 0?st(n,{...o,body:s,...u}):T.stateOf(e.id)!==`raised`&&!l.body.includes(s)&&st(n,{...u,...l,body:l.body===``?s:`${l.body}\n\n${s}`}),we(e.id);let d=T.stateOf(e.id);if(T.setState(e.id,`raised`),t)return;let{startLine:f}=l??o,h={side:o.side,line:o.line,...f===void 0?{}:{startLine:f}};rt({partId:n,place:h}),it.current={partId:n,place:h,before:l,pointId:e.id,state:d},Dt(GU(n))},nn=()=>{let e=Ot(),t=e===null?void 0:m.parts.get(e),n=t?.hunk.lines.find(e=>e.kind!==`context`);if(!l||t===void 0||n===void 0)return;let r=kM(n);r!==null&&e!==null&&(it.current=null,rt({partId:e,place:r}))},rn=()=>{let e=document.activeElement;if(!(e instanceof HTMLElement))return;let t=[...(e.closest(`[role=row]`)??e.closest(`[data-slot=hunk-card]`)??e.closest(`[data-slot=file-card]`))?.querySelectorAll(`[data-slot=call]`)??[]],n=t[(t.findIndex(e=>e.hasAttribute(`data-popup-open`))+1)%t.length];n!==void 0&&fe.open(n.id)},an=()=>{if(Ue.size>0)return We(new Set);if(ae===`map`&&Nt!==null)return Ut();ae===`map`&&xe!==null&&(oe(()=>`overview`),ye(e=>({key:xe,n:(e?.n??0)+1})),Se(null))},on=l;aA({...ae===`map`?{nextFile:()=>en(1),previousFile:()=>en(-1),comment:nn,openCall:rn,close:an}:{},toggleLayout:()=>$t(),openReview:()=>{on&&dn()},help:()=>Xe(!0)},!qe&&!Ye&&!Qe);let sn=d.pullRequest?.url??jf(d.key.ref),cn=Hp(i.startAnalysis),ln=Hp(i.retryAnalysis),un=e=>{e===c?r():Y_(G_(e))},dn=()=>Je(!0),[fn,pn]=(0,J.useState)(null),mn=(0,J.useRef)(ft.status);mn.current=ft.status;let hn=e.currentUserId===null?null:ft.status?.reviewers.find(t=>t.id===e.currentUserId)?.verdict??null,gn=fn!==null&&fn.over===ft.status,_n=gn?fn.verdict:hn,vn=gn||ft.status!==null&&e.currentUserId!==null,yn=e=>{pn({verdict:e,over:mn.current}),ft.reload()},bn=Hp(i.publish),xn=(0,J.useRef)(null),Sn=async()=>{xn.current??=uf.parse(crypto.randomUUID()),(await bn.run(c,{publicationId:xn.current,summary:``,allowStale:!1,hunkComments:[],verdict:`approve`})).ok&&(xn.current=null,yn(`approved`),dt.reload(),t())},Cn=Hp(i.revokeApproval),wn=async()=>{(await Cn.run(c)).ok&&yn(null)},Tn=et.length,En=XU({aiDone:Zu.every(e=>o.stages[e]===`done`),running:u,pending:Tn,isAuthor:e.isAuthor,stale:e.stale,verdict:_n}),Dn=(0,J.useMemo)(()=>rG(d.files),[d.files]),On=T.failure===null?``:C.find(e=>e.id===T.failure?.pointId)?.title??``,kn=async(e,t)=>{let n=await i.addPreference({...t,source:`learned`});return n.ok?(T.setState(e.id,`dismissed`),null):dV(n.error)},An=e=>({state:T.stateOf(e.id),saving:T.isSaving(e.id),readOnly:p,current:Ie===e.id,onRaise:Kn.raisePoint,onState:Kn.setPointState,leftOut:k.has(e.id),onShow:j,ruleScopes:Jn,onRule:Kn.saveRule}),jn=(e,t)=>{let n=t===null?void 0:m.parts.get(t),r=e.lines,i=t!==null&&r!==null&&ot(t).some(e=>e.side===r.side&&e.line===r.line);return(0,Y.jsx)(kK,{point:e,...An(e),family:M,linesAbove:F.rowsAbove.get(e.id)??0,inReview:i,removed:n===void 0||r===null||r.side===`old`?null:Cq(n.hunk,r.startLine,r.line),language:n===void 0?null:NA(n.file)},e.id)},Mn=e=>(0,Y.jsx)(MK,{point:e,...An(e),family:M,linesAbove:F.rowsAbove.get(e.id)??0,test:he.get(e.id)??null},e.id),Nn=e=>(0,Y.jsx)(PK,{point:e,...An(e)},e.id),Pn=(e,t=null)=>e.kind===`finding`?jn(e,t):e.kind===`risk`?Mn(e):Nn(e),Fn=(0,J.useMemo)(()=>{let e={finding:0,risk:1,decision:2,step:3},t=new Map;for(let[n,r]of P.cards){let i=new Map;for(let t of r){if(t.lines===null||t.kind===`decision`||k.has(t.id))continue;let{side:n,startLine:r,line:a}=t.lines,o=R(t.id);for(let s=r;s<=a;s+=1){let c=`${n}:${s}`,l=i.get(c);l!==void 0&&e[t.kind]>=e[l.kind]||i.set(c,{kind:t.kind,...o===void 0?{}:{landing:{at:o,line:s-r,lines:a-r+1}}})}}i.size>0&&t.set(n,i)}return t},[P,R,k]),In=(0,J.useMemo)(()=>new Map(d.files.flatMap(e=>e.hunks.map(t=>[t.id,{hunk:t,file:e}]))),[d.files]),Ln=(0,J.useMemo)(()=>{if(Nt===null)return null;let e=In.get(Nt.excerpt.hunkId)?.hunk;if(e===void 0)return null;let t=e.lines.slice(Nt.excerpt.start,Nt.excerpt.end).flatMap(e=>{let t=kM(e);return t===null?[]:[`${t.side}:${t.line}`]});return{hunkId:Nt.excerpt.hunkId,keys:t}},[Nt,In]),Rn=(0,J.useCallback)(e=>{let t=Fn.get(e);if(Ln===null||nl(e)!==Ln.hunkId)return t;let n=new Map(t??[]);for(let e of Ln.keys)n.has(e)||n.set(e,{kind:`step`});return n},[Fn,Ln]),zn=(e,t,n)=>{let[r]=e;return r===void 0?null:(0,Y.jsx)(IK,{pointId:r.id,fresh:e.some(e=>N.fresh(e.id)),at:R(r.id),...t,children:n},r.id)},Bn=e=>{let t=F.underHeader.get(e)??WJ,n=P.mentions.get(e)??WJ,r=Nt!==null&&Nt.excerpt.partId===e?(0,Y.jsx)(yJ,{step:Nt.step,excerpt:Nt.excerpt}):null;return r===null?Vn(t,n,e):(0,Y.jsxs)(Y.Fragment,{children:[r,Vn(t,n,e)]})},Vn=(e,t,n)=>zn([...e,...t],{bodyClassName:`flex flex-col gap-2 border-b bg-surface-subtle p-3`},(0,Y.jsxs)(Y.Fragment,{children:[e.map(e=>Pn(e,n)),t.map(e=>(0,Y.jsx)(FK,{point:e,onGo:Kn.goToPoint},e.id))]})),Hn=(e,t)=>{let n=yq(t),r=F.underLine.get(e)?.get(n)??WJ,i=(F.atLineEnd.get(e)?.get(n)??WJ).filter(e=>ze.has(e.id));return(0,Y.jsxs)(Y.Fragment,{children:[zn(r,{row:!0,className:AM,bodyClassName:`flex max-w-3xl flex-col gap-2 py-2 pr-3 pl-29 font-sans`},r.map(t=>Pn(t,e))),i.length>0&&(0,Y.jsx)(MM,{inset:!0,children:(0,Y.jsx)(`div`,{className:`flex flex-col gap-1`,children:i.map(Nn)})})]})},Un=(e,t)=>{let n=F.atLineEnd.get(e)?.get(yq(t));return n===void 0?null:n.map(e=>(0,Y.jsx)(NK,{point:e,state:T.stateOf(e.id),open:ze.has(e.id),current:Ie===e.id,onToggle:Ve},e.id))},Wn=(0,J.useCallback)(e=>{let t=F.underLine.get(e);if(t===void 0)return;let n=[...t].filter(([,e])=>e.some(e=>e.kind===`finding`&&!k.has(e.id)));return new Set(n.map(([e])=>e))},[F,k]),Gn=(0,J.useRef)({goToPoint:Mt,raisePoint:tn,saveRule:kn});Gn.current={goToPoint:Mt,raisePoint:tn,saveRule:kn};let Kn=(0,J.useMemo)(()=>({goToPoint:e=>Gn.current.goToPoint(e),raisePoint:(e,t)=>Gn.current.raisePoint(e,t),saveRule:(e,t)=>Gn.current.saveRule(e,t),setPointState:T.setState}),[T.setState]),qn=d.key.ref.repo,Jn=(0,J.useMemo)(()=>GB([qn]).reverse(),[qn]),Yn=(e,t)=>{let n=m.parts.get(e);if(n===void 0)return;let r=n.hunk.lines.find(e=>e.kind!==`context`),i=r===void 0?null:kM(r);return C.find(n=>{if(n.guardrail===void 0||P.cardPart.get(n.id)!==e||T.stateOf(n.id)!==`raised`)return!1;let r=n.lines===null?i:n.lines;return r!==null&&r.side===t.side&&r.line===t.line})},Xn=e=>{let t=[nY(d),p,Ue.has(e),nt?.partId===e?`${nt.place.side}${nt.place.line}`:``,...ot(e).map(e=>JSON.stringify(e))];ht.onLine.has(e)&&t.push(nY(ht),vt??``);let n=P.cards.get(e)??WJ,r=P.mentions.get(e)??WJ;for(let e of n)t.push(e.id,T.stateOf(e.id),T.isSaving(e.id)),t.push(Ie===e.id,k.has(e.id)),e.kind===`decision`&&t.push(ze.has(e.id));for(let e of r)t.push(e.id);for(let e of[...n,...r])t.push(N.fresh(e.id),R(e.id)??``);return Ln!==null&&nl(e)===Ln.hunkId&&t.push(Nt?.excerpt.key),t.join(`\0`)},Zn=e=>{let t=In.get(e.hunkId);if(t===void 0)return null;let n=rl(t.hunk,e),r=t=>t.hunkId===e.hunkId&&n.lines.some(e=>{let n=kM(e);return n!==null&&n.side===t.side&&n.line===t.line}),i=nt?.partId===e.partId?nt.place:null;return(0,Y.jsx)(LM,{id:e.partId,hunk:n,file:t.file,risk:m.items([e.partId])[0]?.risk??null,inFile:!0,comments:et.filter(r),openComment:i!==null&&n.lines.some(e=>kM(e)?.line===i.line)?i:null,onOpenComment:ct,onCancelComment:ut,...l?{onComment:st,onCommentNow:mt}:{},threadsAt:t=>Ct(e.partId,t),...$J[d.key.ref.repo.host]===void 0?{}:{rangeNote:$J[d.key.ref.repo.host]}})},Qn={index:m,unchangedOf:de,highlighted:Ue,commentsOf:ot,openComment:nt,onOpenComment:ct,onCancelComment:ut,onComment:l?st:void 0,...l?{onCommentNow:mt}:{},draftNote:(e,t,n)=>{let r=Yn(e,t);return r?.guardrail===void 0?null:(0,Y.jsx)(WU,{guardrail:r.guardrail,family:M,body:t.body,onEdit:n})},onFocusHunk:kt,marksOf:me,pointsOn:Bn,pointsAt:Hn,pointsAtEnd:Un,flaggedOf:Wn,pointLinesOf:Rn,threadsAt:Ct,earlierThreads:wt,openThreads:Tt,...$J[d.key.ref.repo.host]===void 0?{}:{rangeNote:$J[d.key.ref.repo.host]}},$n=(0,Y.jsx)(Y.Fragment,{children:P.unplaced.length>0&&(0,Y.jsx)(`section`,{"aria-label":`Points on no change shown here`,children:zn(P.unplaced,{bodyClassName:`flex flex-col gap-2`},P.unplaced.map(e=>Pn(e)))})});return(0,Y.jsxs)(`div`,{"data-slot":`review-page`,"data-layout":ae,"data-landing":N.phase,className:`mx-auto flex max-w-[1600px] flex-col gap-4`,children:[(0,Y.jsx)(_q,{view:e,intent:(0,Y.jsx)(xW,{analysis:o,through:ie,running:N.running,stale:e.stale,tour:Vt&&re!==null?{steps:re.steps.length,onOpen:()=>Ht(0)}:null,onDetails:()=>{Ze.current=!0,$e(!0)}}),totals:Dn,status:ft.status,statusError:ft.error,onRetryStatus:ft.reload,now:Date.now()}),(0,Y.jsx)(lq,{title:o.pullRequest?.title??null,claude:(0,Y.jsx)(FU,{analysis:o,choice:a,running:N.running,starting:f.pending,error:f.error===null?cn.error===null?null:Gp(cn.error):Gp(f.error),filesChanged:d.stages.prep===`done`?Dn.files:null,reanalyze:e.stale?{starting:cn.pending,onReanalyze:async()=>{let e=await cn.run({url:sn});e.ok&&un(e.value.analysisId)}}:null,onRerun:()=>He(!0),points:A,leftOut:k.size,threads:Mq(gt,_t,je),narrowed:Te,onNarrow:Yt,onRun:async()=>{let e=a.chosen?.id;(await f.run(c,{...e===void 0?{}:{optionId:e},...x?{tour:!0}:{}})).ok&&n()},children:Fe?gt.length>0&&(0,Y.jsx)(Pq,{ordered:gt,scope:_t,resolvedHere:je,current:De,onGo:Jt,onOpenList:()=>Pe(!0)}):(0,Y.jsx)(KK,{points:A,current:Ce,stateOf:T.stateOf,kind:Te,onGo:Mt,onOpenList:()=>Re(!0)})}),tools:ae===`map`&&(0,Y.jsx)($,{variant:`outline`,size:`sm`,className:`lg:hidden`,"aria-expanded":ce,"aria-controls":`review-tree-rail`,onClick:()=>le(!ce),children:ce?`Hide files`:`Show files`}),publish:on&&(0,Y.jsxs)(Y.Fragment,{children:[En.order.map(e=>e===`approve`&&En.approve.revoke?(0,Y.jsxs)($,{variant:`outline`,"data-slot":`revoke-approval-button`,disabled:Cn.pending,onClick:()=>void wn(),children:[(0,Y.jsx)(P_,{"aria-hidden":`true`}),(0,Y.jsx)(`span`,{className:`max-sm:sr-only`,children:Cn.pending?`Revoking…`:`Revoke approval`})]},`approve`):e===`approve`?(0,Y.jsxs)(YL,{disabled:En.approve.disabledReason===null,children:[(0,Y.jsxs)(XL,{render:(0,Y.jsx)($,{variant:En.approve.filled?`approve`:`outline`,"data-slot":`approve-button`,disabled:bn.pending||En.approve.disabledReason!==null,focusableWhenDisabled:!0,"aria-describedby":En.approve.disabledReason===null?void 0:`approve-reason`,onClick:()=>void Sn()}),children:[(0,Y.jsx)(mg,{"aria-hidden":`true`,className:X(!En.approve.filled&&`text-review-approved`)}),(0,Y.jsx)(`span`,{className:`max-sm:sr-only`,children:bn.pending?`Approving…`:`Approve`})]}),(0,Y.jsx)(ZL,{side:`bottom`,align:`end`,children:En.approve.disabledReason})]},`approve`):(0,Y.jsxs)($,{variant:En.publish.filled?`default`:`outline`,"data-slot":`publish-button`,"aria-haspopup":`dialog`,onClick:()=>void dn(),children:[(0,Y.jsx)(`span`,{className:`max-sm:sr-only`,children:`Publish review…`}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`sm:hidden`,children:`Publish…`}),En.publish.count>0&&(0,Y.jsxs)(`span`,{className:`tabular rounded-full bg-primary-foreground px-1.5 text-caption text-primary`,children:[En.publish.count,(0,Y.jsx)(`span`,{className:`sr-only`,children:` to post`})]})]},`publish`)),En.approve.disabledReason!==null&&(0,Y.jsx)(`span`,{id:`approve-reason`,hidden:!0,children:En.approve.disabledReason})]}),verdict:ZU(_n,vn,s),hairline:N.running?`running`:N.phase===`landing`?`finishing`:null}),ae===`map`&&Nt!==null&&(0,Y.jsx)(bJ,{step:Nt.step.number,onBack:Ut,onDismiss:()=>Pt(null)}),!l&&(0,Y.jsx)(ZK,{stages:o.stages,shown:$K,filesFetched:o.filesFetched}),o.error!==null&&(0,Y.jsxs)(`div`,{className:X(`rounded-lg border border-review-changes/25 bg-review-changes-bg px-3 py-2 text-review-changes`,`flex flex-col items-start gap-2`),role:`alert`,children:[(0,Y.jsxs)(`p`,{children:[`The analysis failed at the `,QK(o.error.stage).toLowerCase(),` stage:`,` `,o.error.message]}),ln.error!==null&&(0,Y.jsxs)(`p`,{children:[`Couldn't retry. `,Gp(ln.error)]}),(0,Y.jsx)($,{variant:`outline`,size:`sm`,disabled:ln.pending,onClick:async()=>{let e=await ln.run(c);e.ok&&un(e.value.analysisId)},children:ln.pending?`Retrying…`:`Retry`})]}),bn.error!==null&&(0,Y.jsxs)(`div`,{className:X(`rounded-lg border border-review-changes/25 bg-review-changes-bg px-3 py-2 text-review-changes`,`flex flex-wrap items-center justify-between gap-2`),role:`alert`,children:[(0,Y.jsxs)(`p`,{children:[`Couldn't approve. `,Gp(bn.error)]}),(0,Y.jsx)($,{variant:`ghost`,size:`sm`,onClick:bn.reset,children:`Dismiss`})]}),Cn.error!==null&&(0,Y.jsxs)(`div`,{className:X(`rounded-lg border border-review-changes/25 bg-review-changes-bg px-3 py-2 text-review-changes`,`flex flex-wrap items-center justify-between gap-2`),role:`alert`,children:[(0,Y.jsxs)(`p`,{children:[`Couldn't revoke the approval. `,Gp(Cn.error)]}),(0,Y.jsx)($,{variant:`ghost`,size:`sm`,onClick:Cn.reset,children:`Dismiss`})]}),T.failure!==null&&(0,Y.jsxs)(`div`,{className:X(`rounded-lg border border-review-changes/25 bg-review-changes-bg px-3 py-2 text-review-changes`,`flex flex-wrap items-center justify-between gap-2`),role:`alert`,children:[(0,Y.jsxs)(`p`,{children:[`Couldn't save what you did with “`,On,`”. `,T.failure.message]}),(0,Y.jsx)($,{variant:`ghost`,size:`sm`,onClick:T.dismissFailure,children:`Dismiss`})]}),dt.error!==null&&(0,Y.jsxs)(`div`,{role:`status`,className:X(`rounded-lg border border-review-pending/25 bg-review-pending-bg px-3 py-2 text-review-pending`,`flex flex-wrap items-center gap-3`),children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),`Couldn't read the comments on the pull request. `,Gp(dt.error)]}),(0,Y.jsx)($,{variant:`outline`,size:`sm`,onClick:dt.reload,children:`Try again`})]}),d.stages.prep===`done`?ae===`map`?(0,Y.jsxs)(`div`,{className:X(UJ,`[&>aside]:hidden lg:[&>aside]:flex`,ce&&`[&>aside]:flex`),children:[(0,Y.jsx)(aq,{children:(0,Y.jsx)(UI,{files:Et,activePath:se,onSelect:e=>Dt(aG(e)),className:`min-h-0 flex-1`})}),(0,Y.jsx)(uG,{analysis:d,files:h,deps:Qn,before:$n,after:ht.elsewhere.length>0&&(0,Y.jsxs)(`section`,{"aria-label":`Comments on other files`,className:`flex flex-col gap-2 rounded-lg border bg-surface-subtle p-3`,children:[(0,Y.jsx)(`h2`,{className:`text-caption font-medium text-muted-foreground`,children:`Comments on files without a card here`}),ht.elsewhere.map(e=>(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-code-compact`,children:e.path}),St(e,null)]},e.id))]}),trailingProofs:_,mechanicalCount:v,scrollRequest:Ge,signatureOf:Xn})]}):W&&re!==null?(0,Y.jsx)(gJ,{tour:re,stateOf:e=>O(e.id),renderExcerpt:Zn,onOpenPoint:Kt,onOpenFile:qt,onOpenInCode:Wt,onCurrentStep:e=>{e!==null&&IR(zt,e)},landOn:Ft}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[ne!==null&&(0,Y.jsx)(_J,{busy:ne.kind===`writing`,children:qJ(ne)}),(0,Y.jsx)(aK,{overview:te,focusKey:ve,currentPath:se,onOpen:Qt,onExpand:e=>V(t=>[...t,e]),expandedGroups:B,onCollapse:e=>V(t=>t.filter(t=>t!==e)),onFocusNode:e=>{be.current=e}})]}):(0,Y.jsx)(`section`,{"aria-busy":d.status===`running`,children:(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:d.status===`running`?`Reading the diff…`:`The diff couldn't be read, so there are no changes to show.`})}),(0,Y.jsxs)(`footer`,{className:`flex items-center justify-end gap-3`,children:[(0,Y.jsx)(OG,{calls:o.modelCalls,option:o.modelOption,guidance:o.guidance,leftOut:C.filter(e=>e.guidance?.effect===`left-out`).length}),l&&!u&&id(o)&&(0,Y.jsx)(oq,{analysisId:c,family:M,onRemoved:t=>r({...e,...t})}),(0,Y.jsx)(SG,{usage:o.usage,option:o.modelOption,guidance:o.guidance})]}),G&&a.chosen!==null&&(0,Y.jsx)(sq,{analysisId:c,view:e,family:M,chosen:a.chosen,tour:x,onClose:()=>He(!1),onRestart:e=>r(e)}),qe&&(0,Y.jsx)(iq,{analysisId:c,hunkComments:et,isAuthor:e.isAuthor,published:s!==null,onClose:()=>Je(!1),onPublished:(e,n)=>{Je(!1),tt(()=>[]),dt.reload(),yn(QU(n,_n)),t()}}),Ne&&(0,Y.jsx)(Fq,{ordered:gt,scope:_t,onScope:Ae,onGo:e=>{Pe(!1),Jt(e)},onClose:()=>Pe(!1)}),Le&&(0,Y.jsx)(RK,{points:A,family:M,kind:Te===`thread`?null:Te,stateOf:T.stateOf,onGo:e=>{Re(!1),Mt(e)},onClose:()=>Re(!1)}),(0,Y.jsx)(TF,{open:Ye,onOpenChange:Xe,ids:JJ}),(0,Y.jsx)(VM,{handle:fe,onGoTo:e=>Dt(GU(e))}),Qe&&(0,Y.jsxs)(IH,{title:d.intent===null?`What was asked`:`Intent`,onClose:()=>$e(!1),className:`sm:max-w-4xl`,returnFocus:()=>Ze.current,children:[d.intent===null?d.pullRequest!==null&&(0,Y.jsx)(CW,{pullRequest:d.pullRequest,tickets:d.tickets,missingTicketKeys:d.missingTicketKeys}):(0,Y.jsx)(MW,{intent:d.intent,tickets:d.tickets,missingTicketKeys:d.missingTicketKeys,onSelectMismatch:e=>{Ze.current=!1,$e(!1),Xt(e)}}),(0,Y.jsx)(YJ,{analysis:d})]}),(0,Y.jsxs)(`p`,{className:`flex items-center gap-1.5 text-caption text-muted-foreground`,children:[`Press `,(0,Y.jsx)(cA,{id:`help`}),` for keyboard shortcuts.`]})]})},iY={theme:`megareviewer:theme`,diffPalette:`megareviewer:diffPalette`},aY=`(prefers-color-scheme: dark)`,oY=e=>e===`light`||e===`dark`?e:`system`,sY=e=>e===`cb`?`cb`:`default`,cY=(e,t)=>e===`system`?t?`dark`:`light`:e,lY=(e,t,n)=>{e.classList.toggle(`dark`,t===`dark`),n===`cb`?e.dataset.diffPalette=`cb`:delete e.dataset.diffPalette},uY=e=>{try{let t=window.localStorage.getItem(e);return t===null?void 0:JSON.parse(t)}catch{return}},dY=(e,t)=>{try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}},fY=new Set,pY=()=>{for(let e of fY)e()},mY=e=>{fY.add(e);let t=window.matchMedia(aY);return t.addEventListener(`change`,e),window.addEventListener(`storage`,e),()=>{fY.delete(e),t.removeEventListener(`change`,e),window.removeEventListener(`storage`,e)}},hY=()=>`${oY(uY(iY.theme))} ${sY(uY(iY.diffPalette))} ${window.matchMedia(aY).matches}`,gY=()=>{let[e=`system`,t=`default`,n]=(0,J.useSyncExternalStore)(mY,hY).split(` `),r=oY(e),i=sY(t),a=cY(r,n===`true`);return(0,J.useEffect)(()=>{lY(document.documentElement,a,i)},[a,i]),{theme:r,resolvedTheme:a,diffPalette:i,setTheme:(0,J.useCallback)(e=>{dY(iY.theme,e),pY()},[]),setDiffPalette:(0,J.useCallback)(e=>{dY(iY.diffPalette,e),pY()},[])}},_Y={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius-xl)`},vY=({...e})=>{let{resolvedTheme:t}=gY();return(0,Y.jsx)(OP,{theme:t,className:`toaster group`,icons:{success:(0,Y.jsx)(mg,{className:`size-4`}),info:(0,Y.jsx)(Wg,{className:`size-4`}),warning:(0,Y.jsx)(M_,{className:`size-4`}),error:(0,Y.jsx)(i_,{className:`size-4`}),loading:(0,Y.jsx)(Qg,{className:`size-4 animate-spin`})},style:_Y,toastOptions:{classNames:{toast:`cn-toast`}},...e})},yY={github:`GitHub`,bitbucket:`Bitbucket`},bY=`then restart megareviewer.`,xY={github:{connect:`Set GITHUB_TOKEN or run \`gh auth login\`, ${bY}`,adds:`Lists and opens GitHub pull requests.`},bitbucket:{connect:`Set BITBUCKET_EMAIL and BITBUCKET_API_TOKEN, and BITBUCKET_WORKSPACE to list its pull requests, ${bY}`,adds:`Lists and opens Bitbucket pull requests.`}},SY=e=>e===1?`1 pull request`:`${e} pull requests`,CY=(e,t,n,r,i)=>{let a=yY[e],{connect:o,adds:s}=xY[e];if(!t.configured)return n.configured?{kind:e,name:a,state:`optional`,detail:s,fix:o}:{kind:e,name:a,state:`not-connected`,detail:`${a} isn't configured.`,fix:o};if(t.user===null)return{kind:e,name:a,state:`failing`,detail:t.error??`Couldn't read the signed-in ${a} user.`,fix:`Check the token, ${bY} A network failure needs only Check again.`};let c=r?.counts[e];return{kind:e,name:a,state:`working`,detail:c===void 0||r===null?t.user.name:`${t.user.name} · ${SY(c)} listed ${nL(new Date(r.atMs).toISOString(),i)}`,fix:null}},wY={claude:{name:`Claude`,providers:[`claude-code`,`anthropic-api`],adds:`Adds intent, findings, risks and decisions with Request AI review.`,connect:"Run `claude` and sign in, or set ANTHROPIC_API_KEY."},codex:{name:`Codex`,providers:[`codex`],adds:`Adds OpenAI's GPT models to Request AI review, on your ChatGPT plan.`,connect:"Install the Codex CLI and run `codex login`."},opencode:{name:`opencode`,providers:[`opencode`],adds:`Adds the models of the providers you connected in opencode to Request AI review.`,connect:"Install opencode (https://opencode.ai) and connect a provider with `opencode auth login`."}},TY=e=>e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e.at(-1)??``}`,EY=(e,t,n)=>{if(e===`claude`){let e=t.find(e=>e.id===n)??t[0];return e===void 0?``:`${e.modelName} through ${e.via}`}if(e===`codex`)return`${TY(t.map(e=>e.modelName))} through ${t[0]?.via??`Codex`}`;let r=[...new Set(t.map(e=>e.via.replace(/^opencode, on /,``)))];return`${t.length===1?`1 model`:`${t.length} models`} through ${TY(r)}`},DY=(e,{options:t,defaultId:n})=>{let{name:r,providers:i,adds:a,connect:o}=wY[e],s=t.filter(e=>i.includes(e.provider)),c=s.filter(e=>e.available);if(c.length>0)return{kind:e,name:r,state:`working`,detail:EY(e,c,n),fix:null};let l=[...new Set(s.flatMap(e=>e.reason??[]))];return{kind:e,name:r,state:`optional`,detail:a,fix:l.length>0?l.join(`; or `):`${o.slice(0,-1)}, ${bY}`}},OY=e=>e?{kind:`jira`,name:`Jira`,state:`working`,detail:`Links tickets`,fix:null}:{kind:`jira`,name:`Jira`,state:`optional`,detail:`Reads the tickets a pull request names.`,fix:`Set JIRA_BASE_URL, JIRA_EMAIL and JIRA_API_TOKEN, ${bY}`},kY={failing:0,"not-connected":1,working:2,optional:2,checking:2},AY=(e,t)=>e===1?`1 ${t}`:`${e} ${t}s`,jY=[[`github`,`GitHub`],[`bitbucket`,`Bitbucket`],[`claude`,`Claude`],[`codex`,`Codex`],[`opencode`,`opencode`],[`jira`,`Jira`]],MY=e=>{let{status:t,error:n,checking:r,checkedAtMs:i,listed:a,nowMs:o}=e;if(n!==null&&!r)return{rows:[],button:{label:`Disconnected`,tone:`danger`,name:`Connections: megareviewer's server isn't answering. Open for details.`},summary:`megareviewer's server isn't answering`,disconnected:Gp(n)};if(t===null)return{rows:jY.map(([e,t])=>({kind:e,name:t,state:`checking`,detail:``,fix:null})),button:{label:`Checking…`,tone:`checking`,name:`Connections: checking. Open for details.`},summary:`Checking ${jY.length} connections…`,disconnected:null};let{github:s,bitbucket:c}=t.hosts,l=[CY(`github`,s,c,a,o),CY(`bitbucket`,c,s,a,o),DY(`claude`,t.model),DY(`codex`,t.model),DY(`opencode`,t.model),OY(t.jira.configured)].sort((e,t)=>kY[e.state]-kY[t.state]),u=e=>l.filter(t=>t.state===e).length,d=u(`failing`),f=u(`not-connected`),p=u(`working`),m=u(`optional`),h=d+f,g=[...d>0?[`${d} failing`]:[],...f>0?[`${f} not connected`]:[],...p>0?[`${p} working`]:[],...m>0&&h===0?[`${m} optional`]:[]],_=i===null?``:` · checked ${nL(new Date(i).toISOString(),o)}`,v=h>0?g.join(` · `):p===l.length?`All ${p} working${_}`:`${g.join(` · `)}${_}`,y=`Connections: ${g.join(` · `)}. ${h>0?`Open to fix.`:`Open for details.`}`;return r?{rows:l.map(e=>({...e,state:`checking`})),button:{label:`Checking…`,tone:`checking`,name:`Connections: checking. Open for details.`},summary:`Checking ${l.length} connections…`,disconnected:null}:{rows:l,button:{...h>0?{label:AY(h,`issue`),tone:d>0?`danger`:`warning`}:p===l.length?{label:`All connected`,tone:`ok`}:{label:`${p} of ${l.length} connected`,tone:`ok`},name:y},summary:v,disconnected:null}},NY={checking:`text-muted-foreground`,ok:``,warning:`border-review-pending bg-review-pending-bg text-review-pending hover:bg-review-pending-bg hover:text-review-pending aria-expanded:bg-review-pending-bg aria-expanded:text-review-pending`,danger:`border-destructive bg-review-changes-bg text-destructive hover:bg-review-changes-bg hover:text-destructive aria-expanded:bg-review-changes-bg aria-expanded:text-destructive`},PY={github:Ig,bitbucket:Ig,claude:E_,codex:E_,opencode:E_,jira:O_},FY={working:{label:`Connected`,icon:ng,tone:`text-ci-success`,row:``},failing:{label:`Failing`,icon:M_,tone:`text-destructive`,row:`border-l-3 border-l-destructive bg-review-changes-bg`},"not-connected":{label:`Not connected`,icon:gg,tone:`text-review-pending`,row:`border-l-3 border-l-review-pending bg-review-pending-bg`},optional:{label:`Not connected · Optional`,icon:gg,tone:`text-muted-foreground`,row:``},checking:{label:`Checking…`,icon:Qg,tone:`text-muted-foreground`,row:``}},IY=new Set([`claude`,`codex`,`opencode`]),LY=({className:e})=>(0,Y.jsx)(Qg,{"aria-hidden":`true`,className:X(`animate-spin motion-reduce:animate-[spin_3s_linear_infinite]`,e)}),RY=({tone:e})=>e===`checking`?(0,Y.jsx)(LY,{}):e===`ok`?(0,Y.jsx)(ng,{"aria-hidden":`true`,className:`text-ci-success`}):(0,Y.jsx)(M_,{"aria-hidden":`true`}),zY=({row:e})=>{let t=FY[e.state],n=e.state===`optional`&&IY.has(e.kind)?`Not connected`:t.label,r=PY[e.kind],i=t.icon;return(0,Y.jsxs)(`li`,{"data-state":e.state,className:X(`flex flex-col gap-0.5 rounded-md px-2.5 py-2`,t.row,e.state===`optional`&&`text-muted-foreground`),children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(r,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Y.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,Y.jsxs)(`span`,{className:X(`ml-auto flex items-center gap-1 text-caption`,t.tone),children:[(0,Y.jsx)(i,{"aria-hidden":`true`,className:X(`size-3.5`,e.state===`checking`&&`animate-spin motion-reduce:animate-[spin_3s_linear_infinite]`)}),n]})]}),e.detail!==``&&(0,Y.jsx)(`p`,{className:`text-caption`,children:e.detail}),e.fix!==null&&(0,Y.jsx)(`p`,{className:`text-caption`,children:e.fix})]})},BY=({connections:e,version:t,checking:n,onCheckAgain:r,checkAgainRef:i})=>(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-1`,children:[(0,Y.jsx)(LN,{className:`text-heading font-semibold`,children:`Connections`}),(0,Y.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:e.summary})]}),e.disconnected===null?(0,Y.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.rows.map(e=>(0,Y.jsx)(zY,{row:e},e.kind))}):(0,Y.jsx)(`p`,{className:`rounded-md border-l-3 border-l-destructive bg-review-changes-bg px-2.5 py-2 text-caption`,children:e.disconnected}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-t px-1 pt-2`,children:[(0,Y.jsxs)($,{ref:i,variant:`outline`,size:`sm`,onClick:r,"aria-busy":n,"aria-disabled":n,children:[n&&(0,Y.jsx)(LY,{}),`Check again`]}),t!==null&&(0,Y.jsxs)(`span`,{className:`text-caption text-muted-foreground`,children:[`megareviewer `,t]})]})]}),VY=({connections:e,version:t,checking:n,open:r,onOpenChange:i,onCheckAgain:a,focusCheckAgain:o=!1})=>{let s=(0,J.useCallback)(e=>{e!==null&&o&&e.focus()},[o]),{label:c,tone:l,name:u}=e.button;return(0,Y.jsxs)(PN,{...r===void 0?{}:{open:r},...i===void 0?{}:{onOpenChange:e=>i(e)},children:[(0,Y.jsxs)(FN,{render:(0,Y.jsx)($,{variant:`outline`,size:`sm`,className:NY[l],"data-tone":l,"aria-label":u}),children:[(0,Y.jsx)(RY,{tone:l}),c]}),(0,Y.jsx)(IN,{align:`end`,className:`w-[min(340px,calc(100vw-24px))] p-2`,initialFocus:!1,children:(0,Y.jsx)(BY,{connections:e,version:t,checking:n,onCheckAgain:()=>{n||a()},checkAgainRef:s})})]})},HY=({now:e=Date.now})=>{let t=yL(),{status:n,error:r,checking:i,checkedAtMs:a,listed:o,open:s,setOpen:c,focusCheckAgain:l}=t,u=MY({status:n,error:r,checking:i,checkedAtMs:a,listed:o,nowMs:e()}),{label:d,tone:f}=u.button,[p,m]=(0,J.useState)(``),h=(0,J.useRef)(!0);return(0,J.useEffect)(()=>{f!==`checking`&&(h.current?h.current=!1:m(`Connections: ${d}`))},[d,f]),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(VY,{connections:u,version:n?.version??null,checking:i,open:s,onOpenChange:e=>c(e),onCheckAgain:t.checkAgain,focusCheckAgain:l}),(0,Y.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:p})]})},UY=[{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`system`,label:`System`}],WY=()=>{let{theme:e,diffPalette:t,setTheme:n,setDiffPalette:r}=gY(),i=Xp(),a=(0,J.useRef)(!1);return(0,Y.jsxs)(vB,{children:[(0,Y.jsx)(yB,{render:(0,Y.jsx)($,{variant:`ghost`,size:`sm`,className:`max-sm:px-1.5`}),children:`Display`}),(0,Y.jsxs)(bB,{align:`end`,className:`w-56`,finalFocus:()=>{let e=a.current;return a.current=!1,!e},children:[i!==null&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(xB,{children:[(0,Y.jsx)(SB,{children:i.label}),(0,Y.jsx)(TB,{value:i.value,onValueChange:e=>{a.current=!0,i.onChange(e)},children:i.options.map(e=>(0,Y.jsx)(EB,{value:e.value,closeOnClick:!0,children:e.label},e.value))})]}),(0,Y.jsx)(DB,{}),i.toggles!==void 0&&(0,Y.jsxs)(Y.Fragment,{children:[i.toggles.map(e=>(0,Y.jsx)(wB,{checked:e.checked,onCheckedChange:e.onChange,children:e.label},e.label)),(0,Y.jsx)(DB,{})]})]}),(0,Y.jsxs)(xB,{children:[(0,Y.jsx)(SB,{children:`Theme`}),(0,Y.jsx)(TB,{value:e,onValueChange:e=>{let t=UY.find(t=>t.value===e);t!==void 0&&n(t.value)},children:UY.map(e=>(0,Y.jsx)(EB,{value:e.value,children:e.label},e.value))})]}),(0,Y.jsx)(DB,{}),(0,Y.jsx)(wB,{checked:t===`cb`,onCheckedChange:e=>r(e?`cb`:`default`),children:`Color-blind safe diff`})]})]})},GY=({current:e})=>(0,Y.jsxs)(Q_,{to:R_,"aria-current":e?`page`:void 0,className:X(Oy({variant:`ghost`,size:`sm`}),`min-w-7 text-foreground hover:no-underline aria-[current=page]:bg-muted max-sm:px-0`),children:[(0,Y.jsx)(w_,{"aria-hidden":`true`,className:`sm:hidden`}),(0,Y.jsx)(`span`,{className:`max-sm:sr-only`,children:`Preferences`})]}),KY=()=>{let e=U_(q_());return(0,Y.jsxs)(`header`,{className:`flex h-12 items-center justify-between gap-4 border-b bg-background px-4 max-sm:gap-2 sm:px-6`,children:[(0,Y.jsx)(Q_,{to:`/`,className:`text-heading font-semibold text-foreground hover:no-underline`,children:`megareviewer`}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 max-sm:gap-1`,children:[(0,Y.jsx)(HY,{}),(0,Y.jsx)(GY,{current:e.page===`preferences`}),(0,Y.jsx)(WY,{})]})]})},qY=()=>(0,Y.jsxs)(`div`,{className:`mx-auto flex max-w-2xl flex-col gap-3 py-12`,children:[(0,Y.jsx)(`h1`,{className:`text-title font-semibold tracking-[-0.01em]`,children:`Page not found`}),(0,Y.jsxs)(`p`,{className:`text-body`,children:[`There's nothing at this address. `,(0,Y.jsx)(Q_,{to:`/`,children:`Go to your pull requests`}),`.`]})]}),JY=({reason:e})=>(0,Y.jsxs)(`main`,{className:`mx-auto flex max-w-2xl flex-col gap-3 px-4 py-12`,children:[(0,Y.jsx)(`h1`,{className:`text-title font-semibold tracking-[-0.01em]`,children:`Open megareviewer from your terminal`}),e===`missing`?(0,Y.jsxs)(`p`,{className:`text-body`,children:[`This page needs the link megareviewer printed when it started. It looks like`,` `,(0,Y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 font-mono text-code-compact`,children:`http://127.0.0.1:4823/?token=…`}),`. Copy it from your terminal and open it once; other tabs in this browser then work without it.`]}):(0,Y.jsx)(`p`,{className:`text-body`,children:`This page's session has ended, usually because megareviewer was restarted. Open the new link printed in your terminal.`}),(0,Y.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Not running? Start it with`,` `,(0,Y.jsx)(`code`,{className:`rounded-sm bg-muted px-1 font-mono text-code-compact`,children:`npx megareviewer`}),`.`]})]}),YY=({token:e,fetch:t,openEventStream:n})=>{let[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(e.value),s=(0,J.useMemo)(()=>a===null?null:{client:Ap({fetch:t,token:a,onUnauthorized:()=>{let t=e.reject(a);t===null?i(!0):o(t)}}),subscribe:(e,t)=>Mp(e,a,t,n)},[t,n,e,a]);return r?(0,Y.jsx)(JY,{reason:`ended`}):s===null?(0,Y.jsx)(JY,{reason:`missing`}):(0,Y.jsx)(Np.Provider,{value:s,children:(0,Y.jsx)(XY,{},a)})},XY=()=>{let e=U_(q_());return(0,Y.jsx)(JL,{children:(0,Y.jsx)(Yp,{children:(0,Y.jsxs)(bL,{children:[(0,Y.jsx)(KY,{}),(0,Y.jsx)(`main`,{className:X(`px-4 py-5 sm:px-6`,e.page===`picker`&&`min-h-[calc(100dvh-3rem)] bg-surface-subtle`),children:e.page===`picker`?(0,Y.jsx)(kR,{}):e.page===`preferences`?(0,Y.jsx)(cU,{}):e.page===`review`?(0,Y.jsx)(BJ,{analysisId:e.analysisId}):e.page===`open`?(0,Y.jsx)(SL,{pullRequest:e.ref},W_(e.ref)):(0,Y.jsx)(qY,{})}),(0,Y.jsx)(vY,{})]})})})},ZY=class extends J.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}render(){let{error:e}=this.state;if(e===null)return this.props.children;let t=this.props.onReload??(()=>window.location.reload());return(0,Y.jsxs)(`main`,{className:`mx-auto flex max-w-2xl flex-col items-start gap-3 px-4 py-12`,role:`alert`,children:[(0,Y.jsx)(`h1`,{className:`text-title font-semibold tracking-[-0.01em]`,children:`Something went wrong`}),(0,Y.jsx)(`p`,{className:`text-body`,children:`megareviewer hit a bug while showing this page.`}),(0,Y.jsx)(`pre`,{className:`w-full overflow-x-auto rounded-md border bg-muted p-3 font-mono text-code-compact whitespace-pre-wrap`,children:String(e)}),(0,Y.jsx)($,{onClick:t,children:`Reload`})]})}},QY=`token`,$Y=`megareviewer.token`,eX=e=>{let t=(()=>{try{return e.localStorage}catch{return null}})(),n=e=>{try{return t===null?null:e(t)}catch{return null}},r=new URL(e.location.href),i=r.searchParams.get(QY),a;return i!==null&&i!==``?(a=i,n(e=>e.setItem($Y,i))):a=n(e=>e.getItem($Y)),r.searchParams.has(QY)&&(r.searchParams.delete(QY),e.history.replaceState(e.history.state,``,`${r.pathname}${r.search}${r.hash}`)),{get value(){return a},reject(e){let t=n(e=>e.getItem($Y));return t===e&&n(e=>e.removeItem($Y)),a=t!==null&&t!==e?t:null,a}}},tX=document.getElementById(`root`);if(tX===null)throw Error(`index.html has no #root`);(0,bc.createRoot)(tX).render((0,Y.jsx)(J.StrictMode,{children:(0,Y.jsx)(ZY,{children:(0,Y.jsx)(YY,{token:eX(window),fetch:window.fetch.bind(window)})})}));export{s as t};
|