better-review 0.6.0 → 0.6.2
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.
|
@@ -49,7 +49,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
49
49
|
Error generating stack: `+e.message+`
|
|
50
50
|
`+e.stack}}var Oe=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,Ae=t.unstable_cancelCallback,je=t.unstable_shouldYield,Me=t.unstable_requestPaint,Ne=t.unstable_now,Pe=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,Re=t.unstable_LowPriority,ze=t.unstable_IdlePriority,Be=t.log,Ve=t.unstable_setDisableYieldValue,He=null,Ue=null;function We(e){if(typeof Be==`function`&&Ve(e),Ue&&typeof Ue.setStrictMode==`function`)try{Ue.setStrictMode(He,e)}catch{}}var Ge=Math.clz32?Math.clz32:Je,Ke=Math.log,qe=Math.LN2;function Je(e){return e>>>=0,e===0?32:31-(Ke(e)/qe|0)|0}var Ye=256,Xe=262144,Ze=4194304;function Qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-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=B.p;return e===0?(e=window.event,e===void 0?32:wh(e.type)):e}function pt(e,t){var n=B.p;try{return B.p=e,t()}finally{B.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,St=`__reactResources$`+mt,Ct=`__reactMarker$`+mt,wt=`__reactLoad$`+mt;function Tt(e){delete e[ht],delete e[gt],delete e[yt],delete e[bt]}function Et(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=pm(e);e!==null;){if(n=e[ht])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function Dt(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 Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[Ct]=!0}function jt(e){e[wt]=void 0}var Mt=new Set,Nt={};function W(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Nt[e]=t,e=0;e<t.length;e++)Mt.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 Oe.call(Lt,e)?!0:Oe.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(le(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=Dt(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)&&(Rd(),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 T(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),G=T({},Mn,{view:0,detail:0}),Pn=jn(G),Fn,In,Ln,Rn=T({},G,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yn,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!==Ln&&(Ln&&e.type===`mousemove`?(Fn=e.screenX-Ln.screenX,In=e.screenY-Ln.screenY):In=Fn=0,Ln=e),Fn)},movementY:function(e){return`movementY`in e?e.movementY:In}}),zn=jn(Rn),Bn=jn(T({},Rn,{dataTransfer:0})),Vn=jn(T({},G,{relatedTarget:0})),Hn=jn(T({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0})),Un=jn(T({},Mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Wn=jn(T({},Mn,{data:0})),Gn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Kn={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`},qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qn[e])?!!t[e]:!1}function Yn(){return Jn}var Xn=jn(T({},G,{key:function(e){if(e.key){var t=Gn[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`?Kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yn,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}})),K=jn(T({},Rn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Zn=jn(T({},Mn,{submitter:0})),Qn=jn(T({},G,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yn})),$n=jn(T({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),er=jn(T({},Rn,{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})),tr=jn(T({},Mn,{newState:0,oldState:0,source:0})),nr=[9,13,27,32],rr=xn&&`CompositionEvent`in window,ir=null;xn&&`documentMode`in document&&(ir=document.documentMode);var ar=xn&&`TextEvent`in window&&!ir,or=xn&&(!rr||ir&&8<ir&&11>=ir),sr=` `,cr=!1;function lr(e,t){switch(e){case`keyup`:return nr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ur(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var dr=!1;function fr(e,t){switch(e){case`compositionend`:return ur(t);case`keypress`:return t.which===32?(cr=!0,sr):null;case`textInput`:return e=t.data,e===sr&&cr?null:e;default:return null}}function q(e,t){if(dr)return e===`compositionend`||!rr&&lr(e,t)?(e=Dn(),En=Tn=wn=null,dr=!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 or&&t.locale!==`ko`?null:t.data;default:return null}}var pr={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 mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!pr[e.type]:t===`textarea`}function hr(e,t,n,r){hn?gn?gn.push(r):gn=[r]:hn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Nn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var gr=null,_r=null;function vr(e){Bf(e,0)}function yr(e){if(Jt(Ot(e)))return e}function br(e,t){if(e===`change`)return t}var xr=!1;if(xn){var Sr;if(xn){var Cr=`oninput`in document;if(!Cr){var wr=document.createElement(`div`);wr.setAttribute(`oninput`,`return;`),Cr=typeof wr.oninput==`function`}Sr=Cr}else Sr=!1;xr=Sr&&(!document.documentMode||9<document.documentMode)}function Tr(){gr&&(gr.detachEvent(`onpropertychange`,Er),_r=gr=null)}function Er(e){if(e.propertyName===`value`&&yr(_r)){var t=[];hr(t,_r,e,mn(e)),yn(vr,t)}}function Dr(e,t,n){e===`focusin`?(Tr(),gr=t,_r=n,gr.attachEvent(`onpropertychange`,Er)):e===`focusout`&&Tr()}function Or(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return yr(_r)}function kr(e,t){if(e===`click`)return yr(t)}function Ar(e,t){if(e===`input`||e===`change`)return yr(t)}function jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Mr=typeof Object.is==`function`?Object.is:jr;function Nr(e,t){if(Mr(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(!Oe.call(t,i)||!Mr(e[i],t[i]))return!1}return!0}function Pr(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 Fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ir(e,t){var n=Fr(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=Fr(n)}}function Lr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pr(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=Pr(e.document)}return t}function zr(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 Br=xn&&`documentMode`in document&&11>=document.documentMode,Vr=null,Hr=null,Ur=null,Wr=!1;function Gr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wr||Vr==null||Vr!==Pr(r)||(r=Vr,`selectionStart`in r&&zr(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}),Ur&&Nr(Ur,r)||(Ur=r,r=Jf(Hr,`onSelect`),0<r.length&&(t=new Nn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Vr)))}function Kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var qr={animationend:Kr(`Animation`,`AnimationEnd`),animationiteration:Kr(`Animation`,`AnimationIteration`),animationstart:Kr(`Animation`,`AnimationStart`),transitionrun:Kr(`Transition`,`TransitionRun`),transitionstart:Kr(`Transition`,`TransitionStart`),transitioncancel:Kr(`Transition`,`TransitionCancel`),transitionend:Kr(`Transition`,`TransitionEnd`)},J={},Jr={};xn&&(Jr=document.createElement(`div`).style,`AnimationEvent`in window||(delete qr.animationend.animation,delete qr.animationiteration.animation,delete qr.animationstart.animation),`TransitionEvent`in window||delete qr.transitionend.transition);function Yr(e){if(J[e])return J[e];if(!qr[e])return e;var t=qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Jr)return J[e]=t[n];return e}var Xr=Yr(`animationend`),Zr=Yr(`animationiteration`),Qr=Yr(`animationstart`),$r=Yr(`transitionrun`),ei=Yr(`transitionstart`),ti=Yr(`transitioncancel`),Y=Yr(`transitionend`),ni=new Map,ri=`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(` `);ri.push(`scrollEnd`);function ii(e,t){ni.set(e,t),W(t,[e])}var ai=0;function oi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=ai++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function si(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;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 ci(e,t){return e=si(e),t=si(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var li=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)},ui=[],di=0,fi=0;function pi(){for(var e=di,t=fi=di=0;t<e;){var n=ui[t];ui[t++]=null;var r=ui[t];ui[t++]=null;var i=ui[t];ui[t++]=null;var a=ui[t];if(ui[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&&_i(n,i,a)}}function mi(e,t,n,r){ui[di++]=e,ui[di++]=t,ui[di++]=n,ui[di++]=r,fi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function hi(e,t,n,r){return mi(e,t,n,r),vi(e)}function gi(e,t){return mi(e,null,null,t),vi(e)}function _i(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 vi(e){if(50<Od)throw Od=0,kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var yi={};function bi(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 xi(e,t,n,r){return new bi(e,t,n,r)}function Si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ci(e,t){var n=e.alternate;return n===null?(n=xi(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 wi(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 Ti(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Si(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case R:return e=xi(31,n,t,a),e.elementType=R,e.lanes=o,e;case k:return Ei(n.children,a,o,t);case A:s=8,a|=24;break;case j:return e=xi(12,n,t,a|2),e.elementType=j,e.lanes=o,e;case P:return e=xi(13,n,t,a),e.elementType=P,e.lanes=o,e;case F:return e=xi(19,n,t,a),e.elementType=F,e.lanes=o,e;case te:case re:return e=a|32,e=xi(30,n,t,e),e.elementType=re,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case M:s=9;break a;case ee:s=11;break a;case I:s=14;break a;case L:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=xi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ei(e,t,n,r){return e=xi(7,e,r,t),e.lanes=n,e}function Di(e,t,n){return e=xi(6,e,null,t),e.lanes=n,e}function Oi(e){var t=xi(18,null,null,0);return t.stateNode=e,t}function ki(e,t,n){return t=xi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ai=new WeakMap;function ji(e,t){if(typeof e==`object`&&e){var n=Ai.get(e);return n===void 0?(t={value:e,source:t,stack:De(t)},Ai.set(e,t),t):n}return{value:e,source:t,stack:De(t)}}var Mi=[],Ni=0,Pi=null,Fi=0,Ii=[],Li=0,Ri=null,zi=1,Bi=``;function Vi(e,t){Mi[Ni++]=Fi,Mi[Ni++]=Pi,Pi=e,Fi=t}function Hi(e,t,n){Ii[Li++]=zi,Ii[Li++]=Bi,Ii[Li++]=Ri,Ri=e;var r=zi;e=Bi;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,zi=1<<32-Ge(t)+i|n<<i|r,Bi=a+e}else zi=1<<a|n<<i|r,Bi=e}function Ui(e){e.return!==null&&(Vi(e,1),Hi(e,1,0))}function Wi(e){for(;e===Pi;)Pi=Mi[--Ni],Mi[Ni]=null,Fi=Mi[--Ni],Mi[Ni]=null;for(;e===Ri;)Ri=Ii[--Li],Ii[Li]=null,Bi=Ii[--Li],Ii[Li]=null,zi=Ii[--Li],Ii[Li]=null}function Gi(e,t){Ii[Li++]=zi,Ii[Li++]=Bi,Ii[Li++]=Ri,zi=t.id,Bi=t.overflow,Ri=e}var Ki=null,qi=null,Ji=!1,Yi=null,Xi=!1,Zi=Error(i(519));function Qi(e){throw ia(ji(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Zi}function $i(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ht]=e,t[gt]=r,n){case`dialog`:Vf(`cancel`,t),Vf(`close`,t);break;case`iframe`:case`object`:case`embed`:Vf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)Vf(Rf[n],t);break;case`source`:Vf(`error`,t);break;case`img`:case`image`:case`link`:Vf(`error`,t),Vf(`load`,t);break;case`details`:Vf(`toggle`,t);break;case`input`:Vf(`invalid`,t),Qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Vf(`invalid`,t);break;case`textarea`:Vf(`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||ep(t.textContent,n)?(r.popover!=null&&(Vf(`beforetoggle`,t),Vf(`toggle`,t)),r.onScroll!=null&&Vf(`scroll`,t),r.onScrollEnd!=null&&Vf(`scrollend`,t),r.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||Qi(e,!0)}function ea(e){for(Ki=e.return;Ki;)switch(Ki.tag){case 5:case 31:case 13:Xi=!1;return;case 27:case 3:Xi=!0;return;default:Ki=Ki.return}}function ta(e){if(e!==Ki)return!1;if(!Ji)return ea(e),Ji=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&qi&&Qi(e),ea(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));qi=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));qi=fm(e)}else t===27?(t=qi,Cp(e.type)?(e=dm,dm=null,qi=e):qi=t):qi=Ki?um(e.stateNode.nextSibling):null;return!0}function na(){qi=Ki=null,Ji=!1}function ra(){var e=Yi;return e!==null&&(dd===null?dd=e:dd.push.apply(dd,e),Yi=null),e}function ia(e){Yi===null?Yi=[e]:Yi.push(e)}var aa=de(null),oa=null,sa=null;function ca(e,t,n){pe(aa,t._currentValue),t._currentValue=n}function la(e){e._currentValue=aa.current,fe(aa)}function ua(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 da(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),ua(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),ua(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),ua(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 fa(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;Mr(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=[ch]:e.push(ch))}a=a.return}return e!==null&&da(t,e,n,r),t.flags|=262144,e!==null}function pa(e){for(e=e.firstContext;e!==null;){if(!Mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ma(e){oa=e,sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ha(e){return _a(oa,e)}function ga(e,t){return oa===null&&ma(e),_a(e,t)}function _a(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sa===null){if(e===null)throw Error(i(308));sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sa=sa.next=t;return n}var va=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()})}},ya=t.unstable_scheduleCallback,ba=t.unstable_NormalPriority,xa={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sa(){return{controller:new va,data:new Map,refCount:0}}function Ca(e){e.refCount--,e.refCount===0&&ya(ba,function(){e.controller.abort()})}function wa(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 Ta=null;function Ea(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Da=null,Oa=0,ka=0,Aa=null;function ja(e,t){if(Da===null){var n=Da=[];Oa=0,ka=Nf(),Aa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Oa++,t.then(Ma,Ma),t}function Ma(){if(--Oa===0&&(Ta=null,Da!==null)){Aa!==null&&(Aa.status=`fulfilled`);var e=Da;Da=null,ka=0,Aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Na(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 Pa=z.S;z.S=function(e,t){if(md=Ne(),typeof t==`object`&&t&&typeof t.then==`function`&&ja(e,t),Ta!==null)for(var n=yf;n!==null;)wa(n,Ta),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)wa(r,n),r=r.next;if(ka!==0){r=Ta,r===null&&(r=Ta=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Pa!==null&&Pa(e,t)};var Fa=de(null);function Ia(){var e=Fa.current;return e===null?Yu.pooledCache:e}function La(e,t){t===null?pe(Fa,Fa.current):pe(Fa,t.pool)}function Ra(){var e=Ia();return e===null?null:{parent:xa._currentValue,pool:e}}var za=Error(i(460)),Ba=Error(i(474)),Va=Error(i(542)),Ha={then:function(){}};function Ua(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Wa(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,Ja(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(fn,fn);else{if(e=Yu,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,Ja(e),e}throw Ka=t,za}}function Ga(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ka=e,za):e}}var Ka=null;function qa(){if(Ka===null)throw Error(i(459));var e=Ka;return Ka=null,e}function Ja(e){if(e===za||e===Va)throw Error(i(483))}var Ya=null,Xa=0;function Za(e){var t=Xa;return Xa+=1,Ya===null&&(Ya=[]),Wa(Ya,e,t)}function Qa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function $a(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function eo(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=Ci(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=Di(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===k?(e=d(e,t,n.props.children,r,n.key),Qa(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===L&&Ga(i)===t.type)?(t=a(t,n.props),Qa(t,n),t.return=e,t):(t=Ti(n.type,n.key,n.props,null,e.mode,r),Qa(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=ki(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=Ei(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=Di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Ti(t.type,t.key,t.props,null,e.mode,n),Qa(n,t),n.return=e,n;case O:return t=ki(t,e.mode,n),t.return=e,t;case L:return t=Ga(t),f(e,t,n)}if(le(t)||oe(t))return t=Ei(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Za(t),n);if(t.$$typeof===N)return f(e,ga(e,t),n);$a(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 D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case L:return n=Ga(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Za(n),r);if(n.$$typeof===N)return p(e,t,ga(e,n),r);$a(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 D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case L:return r=Ga(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Za(r),i);if(r.$$typeof===N)return m(e,t,n,ga(t,r),i);$a(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),Ji&&Vi(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 Ji&&Vi(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)}),Ji&&Vi(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),Ji&&Vi(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 Ji&&Vi(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)}),Ji&&Vi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),Qa(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===L&&Ga(l)===r.type){n(e,r.sibling),c=a(r,o.props),Qa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ei(o.props.children,e.mode,c,o.key),Qa(c,o),c.return=e,e=c):(c=Ti(o.type,o.key,o.props,null,e.mode,c),Qa(c,o),c.return=e,e=c)}return s(e);case O: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=ki(o,e.mode,c),c.return=e,e=c}return s(e);case L:return o=Ga(o),_(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(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,Za(o),c);if(o.$$typeof===N)return _(e,r,ga(e,o),c);$a(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=Di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Xa=0;var i=_(e,t,n,r);return Ya=null,i}catch(t){if(t===za||t===Va)throw t;var a=xi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var to=eo(!0),no=eo(!1),ro=!1;function io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ao(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 oo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function so(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ju&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=vi(e),_i(e,null,n),t}return mi(e,r,t,n),vi(e)}function co(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 lo(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 uo=!1;function fo(){if(uo){var e=Aa;if(e!==null)throw e}}function po(e,t,n,r){uo=!1;var i=e.updateQueue;ro=!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?(Zu&f)===f:(r&f)===f){f!==0&&f===ka&&(uo=!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=T({},d,f);break a;case 2:ro=!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),ad|=o,e.lanes=o,e.memoizedState=d}}function mo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ho(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)mo(n[e],t)}var go=de(null),_o=de(0);function vo(e,t){e=rd,pe(_o,e),pe(go,t),rd=e|t.baseLanes}function yo(){pe(_o,rd),pe(go,go.current)}function bo(){rd=_o.current,fe(go),fe(_o)}var xo=de(null),So=null;function Co(e){var t=e.alternate;pe(Oo,Oo.current&1),pe(xo,e),So===null&&(t===null||go.current!==null||t.memoizedState!==null)&&(So=e)}function wo(e){pe(Oo,Oo.current),pe(xo,e),So===null&&(So=e)}function To(e){e.tag===22?(pe(Oo,Oo.current),pe(xo,e),So===null&&(So=e)):Eo()}function Eo(){pe(Oo,Oo.current),pe(xo,xo.current)}function Do(e){fe(xo),So===e&&(So=null),fe(Oo)}var Oo=de(0);function ko(e,t){pe(xo,xo.current),pe(Oo,t)}function Ao(e){fe(Oo),fe(xo),So===e&&(So=null)}function jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(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 Mo=0,No=null,Po=null,Fo=null,Io=!1,Lo=!1,Ro=!1,zo=0,Bo=0,Vo=null,Ho=0;function Uo(){throw Error(i(321))}function Wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Mr(e[n],t[n]))return!1;return!0}function Go(e,t,n,r,i,a){return Mo=a,No=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?cc:lc,Ro=!1,a=n(r,i),Ro=!1,Lo&&(a=qo(t,n,r,i)),Ko(e),a}function Ko(e){z.H=sc;var t=Po!==null&&Po.next!==null;if(Mo=0,Fo=Po=No=null,Io=!1,Bo=0,Vo=null,t)throw Error(i(300));e===null||Ec||(e=e.dependencies,e!==null&&pa(e)&&(Ec=!0))}function qo(e,t,n,r){No=e;var a=0;do{if(Lo&&(Vo=null),Bo=0,Lo=!1,25<=a)throw Error(i(301));if(a+=1,Fo=Po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}z.H=uc,o=t(n,r)}while(Lo);return o}function Jo(){var e=z.H,t=e.useState()[0];return t=typeof t.then==`function`?ts(t):t,e=e.useState()[0],(Po===null?null:Po.memoizedState)!==e&&(No.flags|=1024),t}function Yo(){var e=zo!==0;return zo=0,e}function Xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Zo(e){if(Io){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Io=!1}Mo=0,Fo=Po=No=null,Lo=!1,Bo=zo=0,Vo=null}function Qo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e,Fo}function $o(){if(Po===null){var e=No.alternate;e=e===null?null:e.memoizedState}else e=Po.next;var t=Fo===null?No.memoizedState:Fo.next;if(t!==null)Fo=t,Po=e;else{if(e===null)throw No.alternate===null?Error(i(467)):Error(i(310));Po=e,e={memoizedState:Po.memoizedState,baseState:Po.baseState,baseQueue:Po.baseQueue,queue:Po.queue,next:null},Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e}return Fo}function es(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ts(e){var t=Bo;return Bo+=1,Vo===null&&(Vo=[]),e=Wa(Vo,e,t),t=No,(Fo===null?t.memoizedState:Fo.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?cc:lc),e}function ns(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ts(e);if(e.$$typeof===ie)return;if(e.$$typeof===N)return ha(e)}throw Error(i(438,String(e)))}function rs(e){var t=null,n=No.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=No.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=es(),No.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ne;return t.index++,n}function is(e,t){return typeof t==`function`?t(e):t}function as(e){return os($o(),Po,e)}function os(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Mo&f)===f:(Zu&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===ka&&(d=!0);else if((Mo&p)===p){u=u.next,p===ka&&(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,No.lanes|=p,ad|=p;f=u.action,Ro&&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,No.lanes|=f,ad|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Mr(o,e.memoizedState)&&(Ec=!0,d&&(n=Aa,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 ss(e){var t=$o(),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);Mr(o,t.memoizedState)||(Ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function cs(e,t,n){var r=No,a=$o(),o=Ji;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Mr((Po||a).memoizedState,n);if(s&&(a.memoizedState=n,Ec=!0),a=a.queue,Ns(ds.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Fo!==null&&!!(Fo.memoizedState.tag&1),Os(e?9:8,{destroy:void 0},us.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Yu===null)throw Error(i(349));o||Mo&127||ls(r,t,n)}return n}function ls(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=No.updateQueue,t===null?(t=es(),No.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function us(e,t,n,r){t.value=n,t.getSnapshot=r,fs(t)&&ps(e)}function ds(e,t,n){return n(function(){fs(t)&&ps(e)})}function fs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Mr(e,n)}catch{return!0}}function ps(e){var t=gi(e,2);t!==null&&Nd(t,e,2)}function ms(e){var t=Qo();if(typeof e==`function`){var n=e;if(e=n(),Ro){We(!0);try{n()}finally{We(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:e},t}function hs(e,t,n,r){return e.baseState=n,os(e,Po,typeof r==`function`?r:is)}function gs(e,t,n,r,a){if(ic(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)}};z.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,_s(t,o)):(o.next=n.next,t.pending=n.next=o)}}function _s(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=z.T,o={};o.types=a===null?null:a.types,z.T=o;try{var s=n(i,r),c=z.S;c!==null&&c(o,s),vs(e,t,s)}catch(n){bs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),z.T=a}}else try{a=n(i,r),vs(e,t,a)}catch(n){bs(e,t,n)}}function vs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ys(e,t,n)},function(n){return bs(e,t,n)}):ys(e,t,n)}function ys(e,t,n){t.status=`fulfilled`,t.value=n,xs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,_s(e,n)))}function bs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,xs(t),t=t.next;while(t!==r)}e.action=null}function xs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ss(e,t){return t}function Cs(e,t){if(Ji){var n=Yu.formState;if(n!==null){a:{var r=No;if(Ji){if(qi){b:{for(var i=qi,a=Xi;i.nodeType!==8;)if(!a||(i=um(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){qi=um(i.nextSibling),r=i.data===`F!`;break a}}Qi(r)}r=!1}r&&(t=n[0])}}return n=Qo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:t},n.queue=r,n=tc.bind(null,No,r),r.dispatch=n,r=ms(!1),a=rc.bind(null,No,!1,r.queue),r=Qo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=gs.bind(null,No,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ws(e){return Ts($o(),Po,e)}function Ts(e,t,n){if(t=os(e,t,Ss)[0],e=as(is)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ts(t)}catch(e){throw e===za?Va:e}else r=t;t=$o();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(No.flags|=2048,Os(9,{destroy:void 0},Es.bind(null,i,n),null)),[r,a,e]}function Es(e,t){e.action=t}function Ds(e){var t=$o(),n=Po;if(n!==null)return Ts(t,n,e);$o(),t=t.memoizedState,n=$o();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=No.updateQueue,t===null&&(t=es(),No.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 ks(){return $o().memoizedState}function As(e,t,n,r){var i=Qo();No.flags|=e,i.memoizedState=Os(1|t,{destroy:void 0},n,r===void 0?null:r)}function js(e,t,n,r){var i=$o();r=r===void 0?null:r;var a=i.memoizedState.inst;Po!==null&&r!==null&&Wo(r,Po.memoizedState.deps)?i.memoizedState=Os(t,a,n,r):(No.flags|=e,i.memoizedState=Os(1|t,a,n,r))}function Ms(e,t){As(8390656,8,e,t)}function Ns(e,t){js(2048,8,e,t)}function Ps(e){No.flags|=4;var t=No.updateQueue;if(t===null)t=es(),No.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Fs(e){var t=$o().memoizedState;return Ps({ref:t,nextImpl:e}),function(){if(Ju&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Is(e,t){return js(4,2,e,t)}function Ls(e,t){return js(4,4,e,t)}function Rs(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 zs(e,t,n){n=n==null?null:n.concat([e]),js(4,4,Rs.bind(null,t,e),n)}function Bs(){}function Vs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Wo(t,r[1]))return r[0];if(r=e(),Ro){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r}function Us(e,t,n){return n===void 0||Mo&1073741824&&!(Zu&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),No.lanes|=e,ad|=e,n)}function Ws(e,t,n,r){return Mr(n,t)?n:go.current===null?!(Mo&106)||Mo&1073741824&&!(Zu&261930)?(Ec=!0,e.memoizedState=n):(e=jd(),No.lanes|=e,ad|=e,t):(e=Us(e,n,r),Mr(e,t)||(Ec=!0),e)}function Gs(e,t,n,r,i){var a=B.p;B.p=a!==0&&8>a?a:8;var o=z.T,s={};s.types=o===null?null:o.types,z.T=s,rc(e,!1,t,n);try{var c=i(),l=z.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?nc(e,t,Na(c,r),Ad(e)):nc(e,t,r,Ad(e))}catch(n){nc(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{B.p=a,o!==null&&s.types!==null&&(o.types=s.types),z.T=o}}function Ks(){}function qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Js(e).queue;Gs(e,a,t,V,n===null?Ks:function(){return Ys(e),n(r)})}function Js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:V},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ys(e){var t=Js(e);t.next===null&&(t=e.alternate.memoizedState),nc(e,t.next.queue,{},Ad())}function Xs(){return ha(ch)}function Zs(){return $o().memoizedState}function Qs(){return $o().memoizedState}function $s(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=oo(n);var r=so(t,e,n);r!==null&&(Nd(r,t,n),co(r,t,n)),t={cache:Sa()},e.payload=t;return}t=t.return}}function ec(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ic(e)?ac(t,n):(n=hi(e,t,n,r),n!==null&&(Nd(n,e,r),oc(n,t,r)))}function tc(e,t,n){nc(e,t,n,Ad())}function nc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ic(e))ac(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,Mr(s,o))return mi(e,t,i,0),Yu===null&&pi(),!1}catch{}if(n=hi(e,t,i,r),n!==null)return Nd(n,e,r),oc(n,t,r),!0}return!1}function rc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ic(e)){if(t)throw Error(i(479))}else t=hi(e,n,r,2),t!==null&&Nd(t,e,2)}function ic(e){var t=e.alternate;return e===No||t!==null&&t===No}function ac(e,t){Lo=Io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var sc={readContext:ha,use:ns,useCallback:Uo,useContext:Uo,useEffect:Uo,useImperativeHandle:Uo,useLayoutEffect:Uo,useInsertionEffect:Uo,useMemo:Uo,useReducer:Uo,useRef:Uo,useState:Uo,useDebugValue:Uo,useDeferredValue:Uo,useTransition:Uo,useSyncExternalStore:Uo,useId:Uo,useHostTransitionStatus:Uo,useFormState:Uo,useActionState:Uo,useOptimistic:Uo,useMemoCache:Uo,useCacheRefresh:Uo,useEffectEvent:Uo},cc={readContext:ha,use:ns,useCallback:function(e,t){return Qo().memoizedState=[e,t===void 0?null:t],e},useContext:ha,useEffect:Ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),As(4194308,4,Rs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return As(4194308,4,e,t)},useInsertionEffect:function(e,t){As(4,2,e,t)},useMemo:function(e,t){var n=Qo();t=t===void 0?null:t;var r=e();if(Ro){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Qo();if(n!==void 0){var i=n(t);if(Ro){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=ec.bind(null,No,e),[r.memoizedState,e]},useRef:function(e){var t=Qo();return e={current:e},t.memoizedState=e},useState:function(e){e=ms(e);var t=e.queue,n=tc.bind(null,No,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Bs,useDeferredValue:function(e,t){return Us(Qo(),e,t)},useTransition:function(){var e=ms(!1);return e=Gs.bind(null,No,e.queue,!0,!1),Qo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=No,a=Qo();if(Ji){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Yu===null)throw Error(i(349));Zu&127||ls(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ms(ds.bind(null,r,o,e),[e]),r.flags|=2048,Os(9,{destroy:void 0},us.bind(null,r,o,n,t),null),n},useId:function(){var e=Qo(),t=Yu.identifierPrefix;if(Ji){var n=Bi,r=zi;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=zo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ho++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Xs,useFormState:Cs,useActionState:Cs,useOptimistic:function(e){var t=Qo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=rc.bind(null,No,!0,n),n.dispatch=t,[e,t]},useMemoCache:rs,useCacheRefresh:function(){return Qo().memoizedState=$s.bind(null,No)},useEffectEvent:function(e){var t=Qo(),n={impl:e};return t.memoizedState=n,function(){if(Ju&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},lc={readContext:ha,use:ns,useCallback:Vs,useContext:ha,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:as,useRef:ks,useState:function(){return as(is)},useDebugValue:Bs,useDeferredValue:function(e,t){return Ws($o(),Po.memoizedState,e,t)},useTransition:function(){var e=as(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:ws,useActionState:ws,useOptimistic:function(e,t){return hs($o(),Po,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs},uc={readContext:ha,use:ns,useCallback:Vs,useContext:ha,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:ss,useRef:ks,useState:function(){return ss(is)},useDebugValue:Bs,useDeferredValue:function(e,t){var n=$o();return Po===null?Us(n,e,t):Ws(n,Po.memoizedState,e,t)},useTransition:function(){var e=ss(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:Ds,useActionState:Ds,useOptimistic:function(e,t){var n=$o();return Po===null?(n.baseState=e,[e,n.queue.dispatch]):hs(n,Po,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs};function dc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=oo(r);i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(Nd(t,e,r),co(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=oo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(Nd(t,e,r),co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=oo(n);r.tag=2,t!=null&&(r.callback=t),t=so(e,r,n),t!==null&&(Nd(t,e,n),co(t,e,n))}};function pc(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?!Nr(n,r)||!Nr(i,a):!0}function mc(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&&fc.enqueueReplaceState(t,t.state,null)}function hc(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=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function gc(e){li(e)}function _c(e){console.error(e)}function vc(e){li(e)}function yc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function bc(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 xc(e,t,n){return n=oo(n),n.tag=3,n.payload={element:null},n.callback=function(){yc(e,t)},n}function Sc(e){return e=oo(e),e.tag=3,e}function Cc(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(){bc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){bc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function wc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&fa(t,n,a,!0),n=xo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return So===null?Gd():n.alternate===null&&id===0&&(id=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ha?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ha?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)),pf(e,r,a)),!1}throw Error(i(435,n.tag))}return pf(e,r,a),Gd(),!1}if(Ji)return t=xo.current,t===null?(r!==Zi&&(t=Error(i(423),{cause:r}),ia(ji(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ji(r,n),a=xc(e.stateNode,r,a),lo(e,a),id!==4&&(id=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Zi&&(e=Error(i(422),{cause:r}),ia(ji(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ji(o,n),ud===null?ud=[o]:ud.push(o),id!==4&&(id=2),t===null)return!0;r=ji(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=xc(n.stateNode,r,e),lo(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`&&(_d===null||!_d.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Sc(a),Cc(a,e,n,r),lo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Tc=Error(i(461)),Ec=!1;function Dc(e,t,n,r){t.child=e===null?no(t,null,n,r):to(t,e.child,n,r)}function Oc(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 ma(t),r=Go(e,t,n,o,a,i),s=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(Ji&&s&&Ui(t),t.flags|=1,Dc(e,t,r,i),t.child)}function kc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Si(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ac(e,t,a,r,i)):(e=Ti(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!rl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Nr:n,n(o,r)&&e.ref===t.ref)return nl(e,t,i)}return t.flags|=1,e=Ci(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Nr(a,r)&&e.ref===t.ref){if(Ec=!1,t.pendingProps=r=a,rl(e,i))e.flags&131072&&(Ec=!0);else return t.lanes=e.lanes,nl(e,t,i)}}return Rc(e,t,n,r,i)}function jc(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 Nc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&La(t,a===null?null:a.cachePool),a===null?yo():vo(t,a),To(t);else return r=t.lanes=536870912,Nc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&La(t,null),yo(),Eo()):(La(t,a.cachePool),vo(t,a),Eo(),t.memoizedState=null);return Dc(e,t,i,n),t.child}function Mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Nc(e,t,n,r,i){var a=Ia();return a=a===null?null:{parent:xa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&La(t,null),yo(),To(t),e!==null&&fa(e,t,r,!0),t.childLanes=i,null}function Pc(e,t){return t=qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fc(e,t,n){return to(t,e.child,null,n),e=Pc(t,t.pendingProps),e.flags|=2,Do(t),t.memoizedState=null,e}function Ic(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ji){if(r.mode===`hidden`)return e=Pc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Mc(null,e);if(wo(t),(e=qi)?(e=om(e,Xi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri===null?null:{id:zi,overflow:Bi},retryLane:536870912,hydrationErrors:null},n=Oi(e),n.return=t,t.child=n,Ki=t,qi=null)):e=null,e===null)throw Qi(t);return t.lanes=536870912,null}return Pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(wo(t),a){if(t.flags&256)t.flags&=-257,t=Fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ec||fa(e,t,n,!1),a=(n&e.childLanes)!==0,Ec||a){if(go.current===null){if(r=Yu,r!==null&&(s=lt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,gi(e,s),Nd(r,e,s),Tc;Gd()}t=Fc(e,t,n)}else e=o.treeContext,qi=um(s.nextSibling),Ki=t,Ji=!0,Yi=null,Xi=!1,e!==null&&Gi(t,e),t=Pc(t,r),t.flags|=134221824;return t}return e=Ci(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Lc(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 Rc(e,t,n,r,i){return ma(t),n=Go(e,t,n,r,void 0,i),r=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(Ji&&r&&Ui(t),t.flags|=1,Dc(e,t,n,i),t.child)}function zc(e,t,n,r,i,a){return ma(t),t.updateQueue=null,n=qo(t,r,n,i),Ko(e),r=Yo(),e!==null&&!Ec?(Xo(e,t,a),nl(e,t,a)):(Ji&&r&&Ui(t),t.flags|=1,Dc(e,t,n,a),t.child)}function Bc(e,t,n,r,i){if(ma(t),t.stateNode===null){var a=yi,o=n.contextType;typeof o==`object`&&o&&(a=ha(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=fc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},io(t),o=n.contextType,a.context=typeof o==`object`&&o?ha(o):yi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(dc(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&&fc.enqueueReplaceState(a,a.state,null),po(t,r,a,i),fo(),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=hc(n,s);a.props=c;var l=a.context,u=n.contextType;o=yi,typeof u==`object`&&u&&(o=ha(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)&&mc(t,a,r,o),ro=!1;var f=t.memoizedState;a.state=f,po(t,r,a,i),fo(),l=t.memoizedState,s||f!==l||ro?(typeof d==`function`&&(dc(t,n,d,r),l=t.memoizedState),(c=ro||pc(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,ao(e,t),o=t.memoizedProps,u=hc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=yi,typeof l==`object`&&l&&(c=ha(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)&&mc(t,a,r,c),ro=!1,f=t.memoizedState,a.state=f,po(t,r,a,i),fo();var p=t.memoizedState;o!==d||f!==p||ro||e!==null&&e.dependencies!==null&&pa(e.dependencies)?(typeof s==`function`&&(dc(t,n,s,r),p=t.memoizedState),(u=ro||pc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&pa(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,Lc(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=to(t,e.child,null,i),t.child=to(t,null,n,i)):Dc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=nl(e,t,i),e}function Vc(e,t,n,r){return na(),t.flags|=256,Dc(e,t,n,r),t.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uc(e){return{baseLanes:e,cachePool:Ra()}}function Wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cd),e}function Gc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Oo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Ji){if(i?Co(t):Eo(),(e=qi)?(e=om(e,Xi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri===null?null:{id:zi,overflow:Bi},retryLane:536870912,hydrationErrors:null},n=Oi(e),n.return=t,t.child=n,Ki=t,qi=null)):e=null,e===null)throw Qi(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Eo(),i=t.mode,a=qc({mode:`hidden`,children:a},i),r=Ei(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Uc(n),r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(null,r)):(Co(t),Kc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Yc(e,t,a,o,r,c,s,n)}return i?(Eo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ci(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ei(i,a,n,null),i.flags|=2):i=Ci(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Mc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Uc(n):(a=i.cachePool,a===null?a=Ra():(s=xa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(e.child,r)):(Co(t),n=e.child,e=n.sibling,n=Ci(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 Kc(e,t){return t=qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function qc(e,t){return e=xi(22,e,null,t),e.lanes=0,e}function Jc(e,t,n){return to(t,e.child,null,n),e=Kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Co(t),t.flags&=-257,Jc(e,t,c)):t.memoizedState===null?(Eo(),o=a.fallback,s=t.mode,a=qc({mode:`visible`,children:a.children},s),o=Ei(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,to(t,e.child,null,c),a=t.child,a.memoizedState=Uc(c),a.childLanes=Wc(e,r,c),t.memoizedState=Hc,Mc(null,a)):(Eo(),t.child=e.child,t.flags|=128,null);if(Co(t),cm(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,ia({value:a,source:null,stack:null})),Jc(e,t,c)}if(Ec||fa(e,t,c,!1),r=(c&e.childLanes)!==0,Ec||r){if(go.current!==null)return Jc(e,t,c);if(r=Yu,r!==null&&(a=lt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,gi(e,a),Nd(r,e,a),Tc;return sm(o)||Gd(),Jc(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,qi=um(o.nextSibling),Ki=t,Ji=!0,Yi=null,Xi=!1,e!==null&&Gi(t,e),t=Kc(t,a.children),t.flags|=134221824,t)}function Xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ua(e.return,t,n)}function Zc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&jo(n)===null&&(t=e),e=e.sibling}return t}function Qc(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 $c(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 el(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Oo.current;if(t.flags&128)return ko(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,ko(t,o),i===`backwards`&&e!==null?($c(e),Dc(e,t,r,n),$c(e)):Dc(e,t,r,n),r=Ji?Fi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xc(e,n,t);else if(e.tag===19)Xc(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=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,$c(t)),Qc(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&&jo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Qc(t,!0,n,null,a,r);break;case`together`:Qc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Qc(t,!1,i,n,a,r)}return t.child}function tl(e,t,n){var r=t.pendingProps;return ca(t,t.type,r.value),Dc(e,t,r.children,n),t.child}function nl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ad|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(fa(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=Ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&pa(e)))}function il(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),ca(t,xa,e.memoizedState.cache),na();break;case 27:case 5:U(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Co(t),t.flags|=128,null;r=fa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Gc(e,t,n):(Co(t),e=nl(e,t,n),e===null?null:e.sibling)}Co(t);break;case 19:if(t.flags&128)return el(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(fa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return el(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ko(t,Oo.current),r)break;return null;case 22:return t.lanes=0,jc(e,t,n,t.pendingProps);case 24:ca(t,xa,e.memoizedState.cache)}return nl(e,t,n)}function al(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ec=!0;else{if(!rl(e,n)&&!(t.flags&128))return Ec=!1,il(e,t,n);Ec=!!(e.flags&131072)}}else Ec=!1,Ji&&t.flags&1048576&&Hi(t,Fi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ga(t.elementType),t.type=e,typeof e==`function`)Si(e)?(r=hc(e,r),t.tag=1,t=Bc(null,t,e,r,n)):(t.tag=0,t=Rc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ee){t.tag=11,t=Oc(null,t,e,r,n);break a}if(a===I){t.tag=14,t=kc(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=tl(null,t,n);break a}}throw t=ce(e)||e,Error(i(306,t,``))}}return t;case 0:return Rc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=hc(r,t.pendingProps),Bc(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,ao(e,t),po(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ca(t,xa,r),r!==o.cache&&da(t,[xa],n,!0),fo(),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=Vc(e,t,r,n);break a}if(r!==a){a=ji(Error(i(424)),t),ia(a),t=Vc(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=um(e.firstChild),Ki=t,Ji=!0,Yi=null,Xi=!0,n=no(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(na(),r===a){t=nl(e,t,n);break a}Dc(e,t,r,n)}t=t.child}return t;case 26:return Lc(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ji||(t.stateNode=pp(t.type,t.pendingProps,ge.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return U(t),e===null&&Ji&&(r=t.stateNode=gm(t.type,t.pendingProps,ge.current),Ki=t,Xi=!0,a=qi,Cp(t.type)?(dm=a,qi=um(r.firstChild)):qi=a),Dc(e,t,t.pendingProps.children,n),Lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ji&&((a=r=qi)&&(r=im(r,t.type,t.pendingProps,Xi),r===null?a=!1:(t.stateNode=r,Ki=t,qi=um(r.firstChild),Xi=!1,a=!0)),a||Qi(t)),U(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(a,o)?r=null:s!==null&&mp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Go(e,t,Jo,null,null,n),ch._currentValue=a),Lc(e,t),Dc(e,t,r,n),t.child;case 6:return e===null&&Ji&&((e=n=qi)&&(n=am(n,t.pendingProps,Xi),n===null?e=!1:(t.stateNode=n,Ki=t,qi=null,e=!0)),e||Qi(t)),null;case 13:return Gc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=to(t,null,r,n):Dc(e,t,r,n),t.child;case 11:return Oc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Lc(e,t),Dc(e,t,r,n),t.child;case 8:return Dc(e,t,t.pendingProps.children,n),t.child;case 12:return Dc(e,t,t.pendingProps.children,n),t.child;case 10:return tl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ma(t),a=ha(a),r=r(a),t.flags|=1,Dc(e,t,r,n),t.child;case 14:return kc(e,t,t.type,t.pendingProps,n);case 15:return Ac(e,t,t.type,t.pendingProps,n);case 19:return el(e,t,n);case 31:return Ic(e,t,n);case 22:return jc(e,t,n,t.pendingProps);case 24:return ma(t),r=ha(xa),e===null?(a=Ia(),a===null&&(a=Yu,o=Sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},io(t),ca(t,xa,a)):((e.lanes&n)!==0&&(ao(e,t),po(t,null,null,n),fo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ca(t,xa,r),r!==a.cache&&da(t,[xa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ca(t,xa,r))),Dc(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:Ji&&Ui(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Lc(e,t),Dc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ol(e){e.flags|=4}function sl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Ym(t,r):Ym(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(Hd())e.flags|=8192;else throw Ka=Ha,Ba}}else e.flags&=-16777217}function cl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Hd())e.flags|=8192;else throw Ka=Ha,Ba}}function ll(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:rt(),e.lanes|=t,ld|=t)}function ul(e,t){if(!Ji)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 dl(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 fl(e,t,n){var r=t.pendingProps;switch(Wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dl(t),null;case 1:return dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),la(xa),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ta(t)?ol(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ra())),dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ol(t),o===null?(dl(t),sl(t,a,null,r,n)):(dl(t),cl(t,o))):o?o===e.memoizedState?(dl(t),t.flags&=-16777217):(ol(t),dl(t),cl(t,o)):(e=e.memoizedProps,e!==r&&ol(t),dl(t),sl(t,a,e,r,n)),null;case 27:if(be(t),n=ge.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}e=me.current,ta(t)?$i(t,e):(e=gm(a,r,n),t.stateNode=e,ol(t))}return dl(t),t.subtreeFlags&=-33554433,null;case 5:if(be(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}if(o=me.current,ta(t))$i(t,o);else{var s=up(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(rp(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&&ol(t)}}return dl(t),t.subtreeFlags&=-33554433,sl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,ta(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||Qi(t,!0)}else e=up(e).createTextNode(r),e[ht]=t,t.stateNode=e}return dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ta(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 na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),e=!1}else n=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Do(t),t):(Do(t),null);if(t.flags&128)throw Error(i(558))}return dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ta(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 na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),a=!1}else a=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Do(t),t):(Do(t),null)}return Do(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),ll(t,t.updateQueue),dl(t),null);case 4:return ye(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,dl(t),null;case 10:return la(t.type),dl(t),null;case 19:if(Ao(t),r=t.memoizedState,r===null)return dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ul(r,!1);else{if(id!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jo(e),o!==null){for(t.flags|=128,ul(r,!1),e=o.updateQueue,t.updateQueue=e,ll(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)wi(n,e),n=n.sibling;return ko(t,Oo.current&1|2),Ji&&Vi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ne()>hd&&(t.flags|=128,a=!0,ul(r,!1),t.lanes=4194304)}}else{if(!a){if(e=jo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ll(t,e),ul(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Ji)return dl(t),null}else 2*Ne()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,ul(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=Ne(),e.sibling=null,o=Oo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Ji?ko(t,o):(n=o,pe(xo,t),pe(Oo,n),So===null&&(So=t)),Ji&&Vi(t,r.treeForkCount),e}return dl(t),null;case 22:case 23:return Do(t),bo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(dl(t),t.subtreeFlags&6&&(t.flags|=8192)):dl(t),n=t.updateQueue,n!==null&&ll(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(Fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),la(xa),dl(t),null;case 25:return null;case 30:return t.flags|=33554432,dl(t),null}throw Error(i(156,t.tag))}function pl(e,t){switch(Wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return la(xa),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(Do(t),t.alternate===null)throw Error(i(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Do(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ao(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 la(t.type),null;case 22:case 23:return Do(t),bo(),e!==null&&fe(Fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return la(xa),null;case 25:return null;default:return null}}function ml(e,t){switch(Wi(t),t.tag){case 3:la(xa),ye();break;case 26:case 27:case 5:be(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&Do(t);break;case 13:Do(t);break;case 19:Ao(t);break;case 10:la(t.type);break;case 22:case 23:Do(t),bo(),e!==null&&fe(Fa);break;case 24:la(xa)}}function hl(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){ff(t,t.return,e)}}function gl(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){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function _l(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ho(t,n)}catch(t){ff(e,e.return,t)}}}function vl(e,t,n){n.props=hc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function yl(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=oi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);f(e.child,!1,$p,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){ff(e,t,n)}}function bl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(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){ff(e,t,n)}else n.current=null}}function xl(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++)tm(e.stateNode,t[n])}function Sl(e){for(var t=e.return;t!==null&&(Tl(t)&&tm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function Cl(e){for(var t=e.return;t!==null&&(Tl(t)&&nm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function wl(e){return e.tag===5||e.tag===3||e.tag===27}function Tl(e){return e&&e.tag===7&&e.stateNode!==null}function El(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){ff(e,e.return,t)}}function Dl(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[gt]=t}catch(t){ff(e,e.return,t)}}function Ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function kl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ol(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&&Cp(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 Al(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)),xl(e,r),zt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),xl(e,r),zt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[ht]=e,t[gt]=n}catch(t){ff(e,e.return,t)}}var Nl=!1,Pl=null;function Fl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Nl=!0)}var Il=null;function Ll(){var e=Il;return Il=null,e}var Rl=0;function zl(e,t,n,r,i){return Rl=0,Bl(e.child,t,n,r,i)}function Bl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=kp(o);r.push(s),s.view&&(a=!0)}else a||kp(o).view&&(a=!0);Nl=!0,Ep(o,Rl===0?t:t+`_`+Rl,n),Rl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Bl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Vl(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Vl(e.child,t)),e=e.sibling}function Hl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Hl(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=ci(t.default,t.share),t!==`none`&&(zl(e,n,t,null,!1)||Vl(e.child,!1))}e=e.sibling}}function Ul(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=oi(r,n),a=ci(r.default,n.paired?r.share:r.enter);a===`none`?Hl(e):zl(e,i,a,null,!1)?(Hl(e),n.paired||t||Md(e,r.onEnter)):Vl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e,t),e=e.sibling;else Hl(e)}function X(e){if(Pl!==null&&Pl.size!==0){var t=Pl;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=ci(n.default,n.share);if(a!==`none`&&(zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Vl(e.child,!1)),t.delete(r),t.size===0)break}}}X(e)}e=e.sibling}}}function Wl(e){if(e.tag===30){var t=e.memoizedProps,n=oi(t,e.stateNode),r=Pl===null?void 0:Pl.get(n),i=ci(t.default,r===void 0?t.exit:t.share);i!==`none`&&(zl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Pl.delete(n),Md(e,t.onShare)):Vl(e.child,!1)),Pl!==null&&X(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e),e=e.sibling;else Pl!==null&&X(e)}function Gl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=oi(t,e.stateNode);t=ci(t.default,t.update),e.flags&=-5,t!==`none`&&zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Gl(e);e=e.sibling}}function Kl(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,Vl(e.child,!1))}Kl(e)}e=e.sibling}}function ql(e){if(e.tag===30)e.stateNode.paired=null,Vl(e.child,!1),Kl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Kl(e)}function Jl(e){for(e=e.child;e!==null;)e.tag===30?Vl(e.child,!1):e.subtreeFlags&33554432&&Jl(e),e=e.sibling}function Yl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Rl<a.length){var l=a[Rl],u=kp(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&&Ep(c,Rl===0?n:n+`_`+Rl,i),s&&e.flags&4||(Il===null&&(Il=[]),Il.push(c,Rl===0?r:r+`_`+Rl,t.memoizedProps)),Rl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Yl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Xl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=oi(n,r),a=ci(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Rl=0,i=Yl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&Xl(e,t);e=e.sibling}}var Zl=!1,Ql=!1,$l=!1,eu=!1,tu=typeof WeakSet==`function`?WeakSet:Set,nu=null,ru=!1,iu=!1,au=!1,ou=!1;function su(e,t,n){if(e=e.containerInfo,cp=_h,e=Rr(e),zr(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(lp={focusedElem:e,selectionRange:r},_h=!1,n=(n&335544064)===n,nu=t,t=n?9270:1024;nu!==null;){if(e=nu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Wl(r[a]);if(e.alternate===null&&e.flags&2)n&&Fl(e),cu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Wl(r),cu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Fl(e),cu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,nu=r):(n&&Gl(e),cu(n))}}Pl=null}function cu(e){for(;nu!==null;){var t=nu,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=hc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(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=oi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=ci(a.default,a.update),a!==`none`&&zl(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,nu=r;break}nu=t.return}}function lu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ku(e,n),r&4&&hl(5,n);break;case 1:if(ku(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=hc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&_l(n),r&512&&yl(n,n.return);break;case 3:if(ku(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{ho(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Ml(n);case 26:case 5:ku(e,n),t===null&&r&4&&El(n),r&512&&yl(n,n.return);break;case 12:ku(e,n);break;case 31:ku(e,n),r&4&&vu(e,n);break;case 13:ku(e,n),r&4&&yu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||Zl,!r){var a=t!==null&&t.memoizedState!==null||Ql;t=Zl,i=Ql,Zl=r,(Ql=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),ju(e,n,r)):ku(e,n),Zl=t,Ql=i}break;case 30:ku(e,n),r&512&&yl(n,n.return);break;case 7:r&512&&yl(n,n.return);default:ku(e,n)}}function uu(e,t){for(e=e.child;e!==null;)du(e,t),e=e.sibling}function du(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){ff(e,e.return,t)}fu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,zt=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&uu(e,t);break;default:uu(e,t)}}function fu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:du(n,r);break a;case 22:n.memoizedState===null&&fu(n,r);break a;default:fu(n,r)}}e=e.sibling}}function pu(e){var t=e.alternate;t!==null&&(e.alternate=null,pu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(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 mu=null,hu=!1;function gu(e,t,n){for(n=n.child;n!==null;)_u(e,t,n),n=n.sibling}function _u(e,t,n){if(Ue&&typeof Ue.onCommitFiberUnmount==`function`)try{Ue.onCommitFiberUnmount(He,n)}catch{}switch(n.tag){case 26:Ql||bl(n,t),gu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Ql&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ql||bl(n,t),Cl(n);var r=mu,i=hu;Cp(n.type)&&(mu=n.stateNode,hu=!1),gu(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),mu=r,hu=i;break;case 5:Ql||bl(n,t),Cl(n);case 6:if(n.tag===6&&Cl(n),r=mu,i=hu,mu=null,gu(e,t,n),mu=r,hu=i,mu!==null){if(hu)try{(mu.nodeType===9?mu.body:mu.nodeName===`HTML`?mu.ownerDocument.body:mu).removeChild(n.stateNode),zt=!0}catch(e){ff(n,t,e)}else try{mu.removeChild(n.stateNode),zt=!0}catch(e){ff(n,t,e)}}break;case 18:mu!==null&&(hu?(e=mu,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Uh(e)):wp(mu,n.stateNode));break;case 4:r=mu,i=hu,mu=n.stateNode.containerInfo,hu=!0,gu(e,t,n),mu=r,hu=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),Ql||gl(4,n,t),gu(e,t,n);break;case 1:Ql||(bl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&vl(n,t,r)),gu(e,t,n);break;case 21:gu(e,t,n);break;case 22:Ql=(r=Ql)||n.memoizedState!==null,gu(e,t,n),Ql=r;break;case 30:bl(n,t),gu(e,t,n);break;case 7:Ql||bl(n,t),gu(e,t,n);break;default:gu(e,t,n)}}function vu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Uh(e)}catch(e){ff(t,t.return,e)}}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Uh(e)}catch(e){ff(t,t.return,e)}}function bu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tu),t;default:throw Error(i(435,e.tag))}}function xu(e,t){var n=bu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function Su(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(Cp(l.type)){mu=l.stateNode,hu=!1;break a}break;case 5:mu=l.stateNode,hu=!1;break a;case 3:case 4:mu=l.stateNode.containerInfo,hu=!0;break a}l=l.return}if(mu===null)throw Error(i(160));_u(s,c,o),mu=null,hu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wu(t,e,n),t=t.sibling}var Cu=null;function wu(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}Su(t,e,n),Tu(e),a&4&&(gl(3,e,e.return),hl(3,e),gl(5,e,e.return));break;case 1:Su(t,e,n),Tu(e),a&512&&(Ql||r===null||bl(r,r.return)),a&64&&Zl&&(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=Cu,Su(t,e,n),Tu(e),a&512&&(Ql||r===null||bl(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(Zl)e.stateNode=pp(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[Ct]||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`))),rp(r,t,n),r[ht]=e,At(r),t=r;break a;case`link`:if(o=Km(`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),rp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Km(`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),rp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[ht]=e,At(r),t=r}e.stateNode=t}}else Zl||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Dl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||Ql||t.parentNode.removeChild(t)):a.count--,n===null?Zl||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:Su(t,e,n),Tu(e),a&512&&(Ql||r===null||bl(r,r.return)),r!==null&&a&4&&Dl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=$l,$l=!1,Su(t,e,n),$l=o,Tu(e),a&512&&(Ql||r===null||bl(r,r.return)),e.flags&32){t=e.stateNode;try{rn(t,``),zt=!0}catch(t){ff(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Dl(e,t,r===null?t:r.memoizedProps)),a&1024&&(eu=!0);break;case 6:if(Su(t,e,n),Tu(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){ff(e,e.return,t)}}break;case 3:if(zt=!1,Gm=null,o=Cu,Cu=xm(t.containerInfo),Su(t,e,n),Cu=o,Tu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Uh(t.containerInfo)}catch(t){ff(e,e.return,t)}eu&&(eu=!1,Eu(e)),zt=!1;break;case 4:a=$l,$l=Zl,r=Bt(),o=Cu,Cu=xm(e.stateNode.containerInfo),Su(t,e,n),Tu(e),Cu=o,zt&&iu&&(au=!0),zt=r,$l=a;break;case 12:Su(t,e,n),Tu(e);break;case 31:Su(t,e,n),Tu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 13:Su(t,e,n),Tu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pd=Ne()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Zl,l=Ql,u=$l;Zl=c||o,$l=u||o,Ql=l||s,Su(t,e,n),Ql=l,$l=u,Zl=c,Tu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Zl||Ql||(t=s||Ql,n=Zl,r=Ql,Zl=o||Zl,Ql=t,Au(e,2),Zl=n,Ql=r),!o&&$l||uu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,xu(e,n))));break;case 19:Su(t,e,n),Tu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 30:a&512&&(Ql||r===null||bl(r,r.return)),a=Bt(),o=iu,s=(n&335544064)===n,c=e.memoizedProps,iu=s&&ci(c.default,c.update)!==`none`,Su(t,e,n),Tu(e),s&&r!==null&&zt&&(e.flags|=4),iu=o,zt=a;break;case 21:break;case 7:a&512&&(Ql||r===null||bl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Su(t,e,n),Tu(e)}}function Tu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ol(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Tl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(wl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;jl(e,kl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(rn(l,``),n.flags&=-33),jl(e,kl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Al(e,kl(e),u,s);break;default:throw Error(i(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Eu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Eu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,_h=!0,t.reset(),_h=!1),e=e.sibling}}function Du(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ou(t,e),t=t.sibling;else Xl(t,!1)}function Ou(e,t){var n=e.alternate;if(n===null)Ul(e,!1);else switch(e.tag){case 3:if(ou=ru=!1,Ll(),Du(t,e),!ru&&!au){if(e=Il,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(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`})),ou=!0}Il=null;break;case 5:Du(t,e);break;case 4:r=ru,ru=!1,Du(t,e),ru&&(au=!0),ru=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Du(t,e):Ul(e,!1));break;case 30:r=ru,i=Ll(),ru=!1,Du(t,e),ru&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=oi(a,o),o=oi(n.memoizedProps,o);var s=ci(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Rl=0,t=Yl(e,n,t,o,s,a,!0),Rl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Il=i):i!==null&&(i.push.apply(i,Il),Il=i),ru=e.flags&32?!0:r;break;default:Du(t,e)}}function ku(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lu(e,t.alternate,t),t=t.sibling}function Au(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:gl(4,n,n.return),Au(n,r);break;case 1:bl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&vl(n,n.return,i),Au(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:bl(n,n.return),n.tag!==5&&n.tag!==27||Cl(n),Au(n,r);break;case 6:Cl(n);break;case 26:bl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Ql||i.parentNode.removeChild(i),Au(n,r);break;case 22:n.memoizedState===null&&Au(n,r);break;case 30:bl(n,n.return),Au(n,r);break;case 7:bl(n,n.return);default:Au(n,r)}e=e.sibling}}function ju(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:ju(i,a,n),hl(4,a);break;case 1:if(ju(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(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++)mo(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&_l(a),yl(a,a.return);break;case 27:n&2&&Ml(a);case 5:a.tag!==5&&a.tag!==27||Sl(a),ju(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 6:Sl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Zl||qm(xm(c.ownerDocument),a.type,c),ju(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 12:ju(i,a,n);break;case 31:ju(i,a,n),s&&o&4&&vu(i,a);break;case 13:ju(i,a,n),s&&o&4&&yu(i,a);break;case 22:a.memoizedState===null&&ju(i,a,n),yl(a,a.return);break;case 30:ju(i,a,n),yl(a,a.return);break;case 7:yl(a,a.return);default:ju(i,a,n)}t=t.sibling}}function Mu(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&&Ca(n))}function Nu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ca(e))}function Pu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Fu(e,t,n,r),t=t.sibling;else i&&Jl(t)}function Fu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Pu(e,t,n,r),a&2048&&hl(9,t);break;case 1:Pu(e,t,n,r);break;case 3:Pu(e,t,n,r),i&&ou&&(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&&Ca(a)));break;case 12:if(a&2048){Pu(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){ff(t,t.return,e)}}else Pu(e,t,n,r);break;case 31:Pu(e,t,n,r);break;case 13:Pu(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&&ql(t),o._visibility&2?Pu(e,t,n,r):(o._visibility|=2,Iu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ql(s),o._visibility&2?Pu(e,t,n,r):Lu(e,t)),a&2048&&Mu(s,t);break;case 24:Pu(e,t,n,r),a&2048&&Nu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Vl(a.child,!0),Vl(t.child,!0))),Pu(e,t,n,r);break;default:Pu(e,t,n,r)}}function Iu(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:Iu(a,o,s,c,i),hl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Iu(a,o,s,c,i)):u._visibility&2?Iu(a,o,s,c,i):Lu(a,o),i&&l&2048&&Mu(o.alternate,o);break;case 24:Iu(a,o,s,c,i),i&&l&2048&&Nu(o.alternate,o);break;default:Iu(a,o,s,c,i)}t=t.sibling}}function Lu(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:Lu(n,r),i&2048&&Mu(r.alternate,r);break;case 24:Lu(n,r),i&2048&&Nu(r.alternate,r);break;default:Lu(n,r)}t=t.sibling}}var Ru=8192;function zu(e,t,n){if(e.subtreeFlags&Ru)for(e=e.child;e!==null;)Bu(e,t,n),e=e.sibling}function Bu(e,t,n){switch(e.tag){case 26:zu(e,t,n),e.flags&Ru&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,Cu,e.memoizedState,e.memoizedProps));break;case 5:zu(e,t,n),e.flags&Ru&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=Cu;Cu=xm(e.stateNode.containerInfo),zu(e,t,n),Cu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ru,Ru=16777216,zu(e,t,n),Ru=r):zu(e,t,n));break;case 30:if((e.flags&Ru)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Pl===null&&(Pl=new Map),Pl.set(r,i)}zu(e,t,n);break;default:zu(e,t,n)}}function Vu(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 Hu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nu=r,Gu(r,e)}Vu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Uu(e),e=e.sibling}function Uu(e){switch(e.tag){case 0:case 11:case 15:Hu(e),e.flags&2048&&gl(9,e,e.return);break;case 3:Hu(e);break;case 12:Hu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wu(e)):Hu(e);break;default:Hu(e)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nu=r,Gu(r,e)}Vu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gl(8,t,t.return),Wu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wu(t));break;default:Wu(t)}e=e.sibling}}function Gu(e,t){for(;nu!==null;){var n=nu;switch(n.tag){case 0:case 11:case 15:gl(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:Ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nu=r;else a:for(n=e;nu!==null;){r=nu;var i=r.sibling,a=r.return;if(pu(r),r===n){nu=null;break a}if(i!==null){i.return=a,nu=i;break a}nu=a}}}var Ku={getCacheForType:function(e){var t=ha(xa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ha(xa).controller.signal}},qu=typeof WeakMap==`function`?WeakMap:Map,Ju=0,Yu=null,Xu=null,Zu=0,Qu=0,$u=null,ed=!1,td=!1,nd=!1,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=null,dd=null,fd=!1,pd=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return Ju&2&&Zu!==0?Zu&-Zu:z.T===null?ft():Nf()}function jd(){if(cd===0){if(!(Zu&536870912)||Ji){var e=Xe;Xe<<=1,!(Xe&3932160)&&(Xe=262144),cd=e}else cd=536870912}return e=xo.current,e!==null&&(e.flags|=32),cd}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(oi(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===Yu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,Zu,cd,!1)),at(e,n),(!(Ju&2)||e!==Yu)&&(e===Yu&&(!(Ju&2)&&(od|=n),id===4&&Ld(e,Zu,cd,!1)),Tf(e))}function Pd(e,t,n){if(Ju&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||et(e,t),a=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(a===0){td&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n))a=Kd(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=ud;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(nd&&!l){c.errorRecoveryDisabledLanes|=o,od|=o,a=4;break a}o=dd,dd=a,o!==null&&(dd===null?dd=o:dd.push.apply(dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Bd(e,0),Ld(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:Ld(r,t,cd,!ed);break a;case 2:dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pd+300-Ne(),10<a)){if(Ld(r,t,cd,!ed),$e(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=_p(Fd.bind(null,r,n,dd,gd,fd,t,cd,od,ld,ed,o,`Throttled`,-0,0),a);break a}Fd(r,n,dd,gd,fd,t,cd,od,ld,ed,o,null,-0,0)}break}}while(1);Tf(e)}function Fd(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},Pl=null,Bu(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=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?pd-Ne():(a&4194048)===a?md-Ne():0,m=th(d,m),m!==null)?(xd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(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(!Mr(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 Ld(e,t,n,r){t=tt(e,t),t&=~sd,t&=~od,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 Rd(){return Ju&6?!0:(Ef(0,!1),!1)}function zd(){if(Xu!==null){if(Qu===0)var e=Xu.return;else e=Xu,sa=oa=null,Zo(e),Ya=null,Xa=0,e=Xu;for(;e!==null;)ml(e.alternate,e),e=e.return;Xu=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,zd(),Yu=e,Xu=n=Ci(e.current,null),Zu=t,Qu=0,$u=null,ed=!1,td=et(e,t),nd=!1,ld=cd=sd=od=ad=id=0,dd=ud=null,fd=!1,rd=tt(e,t),pi(),n}function Vd(e,t){No=null,z.H=sc,t===za||t===Va?(t=qa(),Qu=3):t===Ba?(t=qa(),Qu=4):Qu=t===Tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$u=t,Xu===null&&(id=1,yc(e,ji(t,e.current)))}function Hd(){var e=xo.current;return e===null?!0:(Zu&4194048)===Zu?So===null:(Zu&62914560)===Zu||Zu&536870912?e===So:!1}function Ud(){var e=z.H;return z.H=sc,e===null?sc:e}function Wd(){var e=z.A;return z.A=Ku,e}function Gd(){id=4,ed||(Zu&4194048)!==Zu&&xo.current!==null||(td=!0),!(ad&134217727)&&!(od&134217727)||Yu===null||Ld(Yu,Zu,cd,!1)}function Kd(e,t,n){var r=Ju;Ju|=2;var i=Ud(),a=Wd();(Yu!==e||Zu!==t)&&(gd=null,Bd(e,t)),t=!1;var o=id;a:do try{if(Qu!==0&&Xu!==null){var s=Xu,c=$u;switch(Qu){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:xo.current===null&&(t=!0);var l=Qu;if(Qu=0,$u=null,Qd(e,s,c,l),n&&td){o=0;break a}break;default:l=Qu,Qu=0,$u=null,Qd(e,s,c,l)}}qd(),o=id;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,sa=oa=null,Ju=r,z.H=i,z.A=a,Xu===null&&(Yu=null,Zu=0,pi()),o}function qd(){for(;Xu!==null;)Xd(Xu)}function Jd(e,t){var n=Ju;Ju|=2;var r=Ud(),a=Wd();Yu!==e||Zu!==t?(gd=null,hd=Ne()+500,Bd(e,t)):td=et(e,t);a:do try{if(Qu!==0&&Xu!==null){t=Xu;var o=$u;b:switch(Qu){case 1:Qu=0,$u=null,Qd(e,t,o,1);break;case 2:case 9:if(Ua(o)){Qu=0,$u=null,Zd(t);break}t=function(){Qu!==2&&Qu!==9||Yu!==e||(Qu=7),Tf(e)},o.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:Ua(o)?(Qu=0,$u=null,Zd(t)):(Qu=0,$u=null,Qd(e,t,o,7));break;case 5:var s=null;switch(Xu.tag){case 26:s=Xu.memoizedState;case 5:case 27:var c=Xu;if(s?Xm(s):c.stateNode.complete){Qu=0,$u=null;var l=c.sibling;if(l!==null)Xu=l;else{var u=c.return;u===null?Xu=null:(Xu=u,Z(u))}break b}}Qu=0,$u=null,Qd(e,t,o,5);break;case 6:Qu=0,$u=null,Qd(e,t,o,6);break;case 8:zd(),id=6;break a;default:throw Error(i(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return sa=oa=null,z.H=r,z.A=a,Ju=n,Xu===null?(Yu=null,Zu=0,pi(),id):0}function Yd(){for(;Xu!==null&&!je();)Xd(Xu)}function Xd(e){var t=al(e.alternate,e,rd);e.memoizedProps=e.pendingProps,t===null?Z(e):Xu=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=zc(n,t,t.pendingProps,t.type,void 0,Zu);break;case 11:t=zc(n,t,t.pendingProps,t.type.render,t.ref,Zu);break;case 5:Zo(t);var r=t;r===Ki&&(Ji?(ea(r),r.tag===5&&r.stateNode!=null&&(qi=r.stateNode)):(ea(r),Ji=!0));default:ml(n,t),t=Xu=wi(t,rd),t=al(n,t,rd)}e.memoizedProps=e.pendingProps,t===null?Z(e):Xu=t}function Qd(e,t,n,r){sa=oa=null,Zo(t),Ya=null,Xa=0;var i=t.return;try{if(wc(e,i,t,n,Zu)){id=1,yc(e,ji(n,e.current)),Xu=null;return}}catch(t){if(i!==null)throw Xu=i,t;id=1,yc(e,ji(n,e.current)),Xu=null;return}t.flags&32768?(Ji||r===1?e=!0:td||Zu&536870912?e=!1:(ed=e=!0,(r===2||r===9||r===3||r===6)&&(r=xo.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Z(t)}function Z(e){var t=e;do{if(t.flags&32768){$d(t,ed);return}e=t.return;var n=fl(t.alternate,t,rd);if(n!==null){Xu=n;return}if(t=t.sibling,t!==null){Xu=t;return}Xu=t=e}while(t!==null);id===0&&(id=5)}function $d(e,t){do{var n=pl(e.alternate,e);if(n!==null){n.flags&=32767,Xu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Xu=e;return}Xu=e=n}while(e!==null);id=6,Xu=null}function ef(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(vd!==0);if(Ju&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Yu&&(Xu=Yu=null,Zu=0),bd=t,yd=e,xd=n,Cd=a,wd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=fi,ot(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=Ea(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Le,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Nl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=z.T,z.T=null,i=B.p,B.p=2,a=Ju,Ju|=4;try{su(e,t,n)}finally{Ju=a,B.p=i,z.T=r}}vd=1,Nl?Td=Np(o,e.containerInfo,Dd,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function rf(){vd===3&&(vd=0,Ou(bd,yd),vd=4)}function af(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=z.T,z.T=null;var i=B.p;B.p=2;var a=Ju;Ju|=4;try{iu=au=!1,wu(t,e,n),n=lp;var o=Rr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Lr(s.ownerDocument.documentElement,s)){if(c!==null&&zr(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 _=Ir(s,h),v=Ir(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}}_h=!!cp,lp=cp=null}finally{Ju=a,B.p=i,z.T=r}}e.current=t,vd=2}}function of(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=z.T,z.T=null;var r=B.p;B.p=2;var i=Ju;Ju|=4;try{lu(e,t.alternate,t)}finally{Ju=i,B.p=r,z.T=n}}vd=3}}function sf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Me();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=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=z.T,a=B.p,B.p=2,z.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{z.T=n,B.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=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);xd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ca(t)))}function lf(){return Td!==null&&(Td.skipTransition(),Td=null),af(),of(),sf(),uf()}function uf(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=dt(xd),r=z.T,a=B.p;try{B.p=32>n?32:n,z.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,Ju&6)throw Error(i(331));var c=Ju;if(Ju|=4,Uu(o.current),Fu(o,o.current,s,n),Ju=c,Ef(0,!1),Ue&&typeof Ue.onPostCommitFiberRoot==`function`)try{Ue.onPostCommitFiberRoot(He,o)}catch{}return!0}finally{B.p=a,z.T=r,cf(e,t)}}function df(e,t,n){t=ji(n,t),t=xc(e.stateNode,t,2),e=so(e,t,2),e!==null&&(at(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=ji(n,e),n=Sc(2),r=so(t,n,2),r!==null&&(Cc(n,r,t,e),at(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new qu;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)||(nd=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Yu===e&&(Zu&n)===n&&(id===4||id===3&&(Zu&62914560)===Zu&&300>Ne()-pd?Ju&2?sd|=n:Bd(e,0):sd|=n,ld===Zu&&(ld=0)),Tf(e)}function hf(e,t){t===0&&(t=rt()),e=gi(e,t),e!==null&&(at(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(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),hf(e,n)}function vf(e,t){return ke(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;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,jf(r,a))}else a=Zu,a=$e(r,r===Yu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||et(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&gp()&&(e=wf);for(var t=Ne(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}vd!==0&&vd!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(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=Yu,n=Zu,n=$e(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ae(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&&Ae(r),dt(n)){case 2:case 8:n=Ie;break;case 32:n=Le;break;case 268435456:n=ze;break;default:n=Le}return r=Af.bind(null,e),n=ke(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ae(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Zu;return r=$e(e,e===Yu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),kf(e,Ne()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Pd(e,t,!0)}function Mf(){xp(function(){Ju&6?ke(Fe,Df):Of()})}function Nf(){if(wf===0){var e=ka;e===0&&(e=Ye,Ye<<=1,!(Ye&261888)&&(Ye=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:dn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[gt]||null).action),o=r.submitter;o&&(t=(t=o[gt]||null)?Pf(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(wf!==0){var e=new FormData(i,o);qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<ri.length;If++){var Lf=ri[If];ii(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}ii(Xr,`onAnimationEnd`),ii(Zr,`onAnimationIteration`),ii(Qr,`onAnimationStart`),ii(`dblclick`,`onDoubleClick`),ii(`focusin`,`onFocus`),ii(`focusout`,`onBlur`),ii($r,`onTransitionRun`),ii(ei,`onTransitionStart`),ii(ti,`onTransitionCancel`),ii(Y,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),W(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),W(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),W(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),W(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),W(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),W(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`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(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(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){li(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){li(e)}i.currentTarget=null,a=c}}}}function Vf(e,t){var n=t[vt];n===void 0&&(n=t[vt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Mt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(wh(t)){case 2:var i=vh;break;case 8:i=yh;break;default:i=bh}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 Kf(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=Et(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=ni.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=Xn;break;case`focusin`:u=`focus`,l=Vn;break;case`focusout`:u=`blur`,l=Vn;break;case`beforeblur`:case`afterblur`:l=Vn;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=zn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Qn;break;case Xr:case Zr:case Qr:l=Hn;break;case Y:l=$n;break;case`scroll`:case`scrollend`:l=Pn;break;case`wheel`:l=er;break;case`copy`:case`cut`:case`paste`:l=Un;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=K;break;case`submit`:l=Zn;break;case`toggle`:case`beforetoggle`:l=tr}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(qf(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)&&(Et(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?Et(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=zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=K,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ot(c),h=l==null?u:Ot(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=br;else if(mr(c)){if(xr)_=Ar;else{_=Or;var v=Dr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&cn(r.elementType)&&(_=br):_=kr;if(_&&=_(e,r)){hr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ot(r):window,e){case`focusin`:(mr(v)||v.contentEditable===`true`)&&(Vr=v,Hr=r,Ur=null);break;case`focusout`:Ur=Hr=Vr=null;break;case`mousedown`:Wr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Wr=!1,Gr(s,n,i);break;case`selectionchange`:if(Br)break;case`keydown`:case`keyup`:Gr(s,n,i)}var y;if(rr)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 dr?lr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(or&&n.locale!==`ko`&&(dr||b!==`onCompositionStart`?b===`onCompositionEnd`&&dr&&(y=Dn()):(wn=i,Tn=`value`in wn?wn.value:wn.textContent,dr=!0)),v=Jf(r,b),0<v.length&&(b=new Wn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=ur(n),y!==null&&(b.data=y)))),(y=ar?fr(e,n):q(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new Wn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Ff(s,e,r,n,i)}Bf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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(qf(e,i,a)),i=bn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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(qf(n,l,c))):i||(l=bn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
|
51
51
|
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(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`&&tp(e,t,`name`,a.name,a,null),tp(e,t,`formEncType`,a.formEncType,a,null),tp(e,t,`formMethod`,a.formMethod,a,null),tp(e,t,`formTarget`,a.formTarget,a,null)):(tp(e,t,`encType`,a.encType,a,null),tp(e,t,`method`,a.method,a,null),tp(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&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`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`:Vf(`beforetoggle`,e),Vf(`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 np(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&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`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(!Nt.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 rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Vf(`error`,e),Vf(`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:tp(e,t,o,s,n,null)}}a&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Vf(`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:tp(e,t,r,d,n,null)}}Qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Vf(`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:tp(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 Vf(`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:tp(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:tp(e,t,l,r,n,null)}return;case`dialog`:Vf(`beforetoggle`,e),Vf(`toggle`,e),Vf(`cancel`,e),Vf(`close`,e);break;case`iframe`:case`object`:Vf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)Vf(Rf[r],e);break;case`image`:Vf(`error`,e),Vf(`load`,e);break;case`details`:Vf(`toggle`,e);break;case`embed`:case`source`:case`link`:Vf(`error`,e),Vf(`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:tp(e,t,u,r,n,null)}return;default:if(cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(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)||tp(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&&tp(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)||tp(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&&tp(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:tp(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&&tp(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:tp(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:tp(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)&&tp(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:tp(e,t,u,p,r,m)}return;default:if(cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(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||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(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||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){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&&op(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&&op(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 cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 pp(e,t,n,r){return n=up(n).createElement(e),n[ht]=r,n[gt]=t,rp(n,e,t),At(n),n}function mp(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 hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(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),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Tp(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 Ep(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 Dp(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 Op(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 kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(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`&&(jp(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+=Zm(f),u>eh){s.length=o;break}f=new Promise(Mp.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 Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.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},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.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(Vp(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=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(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,zp(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,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=_(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=up(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(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=_(e),t.push.apply(t,e.getClientRects());return!1}Ip.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Up,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(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=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(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=_(n[0]),i=_(n[n.length-1]);var a=m(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||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=Et(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=p(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=w(n,a,C),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function Qp(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)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Up,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),Qp(e,n);return}if(r=_(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=_(a),Qp(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=_(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function tm(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,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(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,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(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[Ct])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=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(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 um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(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 hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(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 _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===fn&&(e.onclick=null),Tt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var ym=new Map,bm=new Set;function xm(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 Sm=B.d;B.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=Rd();return e||t}function wm(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?Ys(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=Xt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),At(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;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=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){jt(o)}),At(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;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=zm(e)}if(!ym.has(a)&&(e=T({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),At(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=kt(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);At(c),rp(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,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=kt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),At(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=kt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),At(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=ge.current)?xm(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=Fm(n.href),t=kt(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=Fm(n.href);var o=kt(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.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},ym.set(e,o)),Rm(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=zm(n),t=kt(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 Fm(e){return`href="`+Xt(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=jt.bind(null,t),rp(t,`link`,n),At(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 zm(e){return`[src="`+Xt(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(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,At(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),rp(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,At(a),a):(r=n,(a=ym.get(o))&&(r=T({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),rp(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,Hm(r,n.precedence,e));return t.instance}function Hm(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 Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,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[Ct]||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 qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(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=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.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=rh.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 ch={$$typeof:N,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function lh(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 uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=xi(3,null,null,t),e.current=a,a.stateNode=e,t=Sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},io(a),e}function dh(e){return e?(e=yi,e):yi}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=oo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=so(e,r,t),n!==null&&(Nd(n,e,t),co(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=gi(e,67108864);t!==null&&Nd(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=Ad();t=ut(t);var n=gi(e,t);n!==null&&Nd(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=z.T;z.T=null;var a=B.p;try{B.p=2,bh(e,t,n,r)}finally{B.p=a,z.T=i}}function yh(e,t,n,r){var i=z.T;z.T=null;var a=B.p;try{B.p=8,bh(e,t,n,r)}finally{B.p=a,z.T=i}}function bh(e,t,n,r){if(_h){var i=xh(r);if(i===null)Kf(e,t,r,Sh,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=Dt(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}Tf(a),!(Ju&6)&&(hd=Ne()+500,Ef(0,!1))}}break;case 31:case 13:s=gi(a,2),s!==null&&Nd(s,a,2),Rd(),mh(a,2)}if(a=xh(r),a===null&&Kf(e,t,r,Sh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function xh(e){return e=mn(e),Ch(e)}var Sh=null;function Ch(e){if(Sh=null,e=Et(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 Sh=e,null}function wh(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(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Th=!1,Eh=null,Dh=null,Oh=null,kh=new Map,Ah=new Map,jh=[],Mh=`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 Nh(e,t){switch(e){case`focusin`:case`focusout`:Eh=null;break;case`dragenter`:case`dragleave`:Dh=null;break;case`mouseover`:case`mouseout`:Oh=null;break;case`pointerover`:case`pointerout`:kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ah.delete(t.pointerId)}}function Ph(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=Dt(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Eh=Ph(Eh,e,t,n,r,i),!0;case`dragenter`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`mouseover`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kh.set(a,Ph(kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=Et(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(){gh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,pt(e.priority,function(){gh(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 Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xh(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=Dt(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Th=!1,Eh!==null&&Lh(Eh)&&(Eh=null),Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh.forEach(Rh),Ah.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Th||(Th=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=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(Ch(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Eh!==null&&Bh(Eh,e),Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh.forEach(t),Ah.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.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||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[gt]||null)s=o.formAction;else if(Ch(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){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 Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fh(n,Ad(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),Rd(),t[_t]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ft();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.1`)throw Error(i(527,qh,`19.3.1`));B.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Jh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:z,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{He=Yh.inject(Jh),Ue=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=gc,s=_c,c=vc;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=uh(e,1,!1,null,null,n,r,null,o,s,c,Wh),e[_t]=t.current,Wf(e),new Gh(t)}})),JC=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=qC()})),YC=()=>zg({opened:!1,empty:!1,selected:-1,listId:``,query:``,registeredActions:new Set}),XC=e=>Bg(e);function ZC(e,t){let n=t.getState();t.setState({...n,...e(t.getState())})}function QC(e){ZC(()=>({opened:!0,selected:-1}),e)}function $C(e){ZC(()=>({opened:!1}),e)}function ew(e){ZC(e=>({opened:!e.opened,selected:e.opened?e.selected:-1}),e)}function tw(e,t){t.updateState(t=>({...t,selected:e}))}function nw(e,t){t.updateState(t=>({...t,listId:e}))}function rw(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t instanceof ShadowRoot?t.host.children:t.children;for(let t=0;t<r.length;t+=1){let n=r[t];if(n.shadowRoot){let t=rw(e,n.shadowRoot);if(t)return t}let i=rw(e,n);if(i)return i}return null}function iw(e,t){let n=t.getState(),r=n.listId?rw(`#${n.listId}`):null,i=r?.querySelector(`[data-selected]`),a=r?.querySelectorAll(`[data-action]`)??[],o=ie(e===-1?a.length-1:e===a.length?0:e,0,a.length-1);return i?.removeAttribute(`data-selected`),a[o]?.scrollIntoView({block:`nearest`}),a[o]?.setAttribute(`data-selected`,`true`),tw(o,t),o}function aw(e){return iw(e.getState().selected+1,e)}function ow(e){return iw(e.getState().selected-1,e)}function sw(e){let t=e.getState();(t.listId?rw(`#${t.listId} [data-selected]`):null)?.click()}function cw(e,t){let n=t.getState();return n.registeredActions.add(e),()=>{n.registeredActions.delete(e)}}function lw(e,t){ZC(()=>({query:e}),t),Promise.resolve().then(()=>{iw(0,t),ZC(e=>({empty:e.query.trim().length>0&&e.registeredActions.size===0||!1}),t)})}function uw({clearQuery:e},t){t.updateState(t=>({...t,selected:-1,query:e?``:t.query,empty:!e&&t.empty}))}var dw={open:QC,close:$C,toggle:ew,updateState:ZC,setSelectedAction:tw,setListId:nw,selectAction:iw,selectNextAction:aw,selectPreviousAction:ow,triggerSelectedAction:sw,registerAction:cw,setQuery:lw,clearSpotlightState:uw};function fw(){let e=YC();return[e,{open:()=>QC(e),close:()=>$C(e),toggle:()=>ew(e)}]}var[pw,mw]=fw(),{open:hw,close:gw,toggle:_w}=mw;function vw(e){let t=e;return t.group!==void 0&&Array.isArray(t.actions)}var[yw,bw]=T(`Spotlight component was not found in tree`),xw={root:`m_d2b315db`,content:`m_3cd250e0`,body:`m_d2abce9b`,search:`m_f366a061`,actionsList:`m_6e463822`,action:`m_d49bb8ef`,actionBody:`m_3d475731`,actionSection:`m_832642f6`,actionLabel:`m_6c2a1345`,actionDescription:`m_a6d9d78d`,empty:`m_82f78f74`,footer:`m_ddcaf054`,actionsGroup:`m_5a3e5f7b`},Sw={dimmedSections:!0,highlightQuery:!1},Cw=J(e=>{let{className:t,style:n,classNames:r,styles:i,id:a,description:o,label:s,leftSection:c,rightSection:l,children:u,dimmedSections:d,highlightQuery:f,highlightColor:p,closeSpotlightOnTrigger:m,onClick:h,onMouseDown:g,keywords:_,vars:v,...y}=K(`SpotlightAction`,Sw,e),b=bw(),x={classNames:r,styles:i},S=f&&typeof s==`string`?(0,G.jsx)(hm,{component:`span`,highlight:b.query,color:p,...b.getStyles(`actionLabel`,x),children:s}):(0,G.jsx)(`span`,{...b.getStyles(`actionLabel`,x),children:s});return(0,G.jsx)(Tc,{"data-action":!0,...b.getStyles(`action`,{className:t,style:n,...x}),...y,onMouseDown:e=>{e.preventDefault(),g?.(e)},onClick:e=>{h?.(e),(m??b.closeOnActionTrigger)&&dw.close(b.store)},tabIndex:-1,children:u||(0,G.jsxs)(G.Fragment,{children:[c&&(0,G.jsx)(Y,{component:`span`,mod:{position:`left`,dimmed:d},...b.getStyles(`actionSection`,x),children:c}),(0,G.jsxs)(`span`,{...b.getStyles(`actionBody`,x),children:[S,(0,G.jsx)(`span`,{...b.getStyles(`actionDescription`,x),children:o})]}),l&&(0,G.jsx)(Y,{component:`span`,mod:{position:`right`,dimmed:d},...b.getStyles(`actionSection`,x),children:l})]})})});Cw.classes=xw,Cw.displayName=`@mantine/spotlight/SpotlightAction`;var ww=J(e=>{let{className:t,style:n,styles:r,classNames:i,label:a,children:o,...s}=K(`SpotlightActionsGroup`,null,e),c=bw();return(0,G.jsx)(Y,{...c.getStyles(`actionsGroup`,{className:t,style:n,classNames:i,styles:r}),...s,__vars:{"--spotlight-label":`'${a?.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)}'`},children:o})});ww.classes=xw,ww.displayName=`@mantine/core/SpotlightActionsGroup`;var Tw=J(e=>{let{className:t,style:n,id:r,children:i,vars:a,classNames:o,styles:s,...c}=K(`SpotlightActionsList`,null,e),l=bw(),u=`mantine-${(0,C.useId)().replace(/:/g,``)}`,d=r||u;return(0,C.useEffect)(()=>(dw.setListId(d,l.store),()=>dw.setListId(``,l.store)),[]),(0,G.jsx)(xc.Autosize,{...l.getStyles(`actionsList`,{className:t,style:n,classNames:o,styles:s}),type:`scroll`,scrollbarSize:`var(--spotlight-actions-list-padding)`,offsetScrollbars:`y`,id:d,...c,children:i})});Tw.classes=xw,Tw.displayName=`@mantine/spotlight/SpotlightActionsList`;var Ew=J(e=>{let{className:t,style:n,classNames:r,styles:i,...a}=K(`SpotlightEmpty`,null,e),o=bw();return(0,G.jsx)(Y,{...o.getStyles(`empty`,{classNames:r,styles:i,className:t,style:n}),...a})});Ew.classes=xw,Ew.displayName=`@mantine/spotlight/SpotlightEmpty`;var Dw=J(e=>{let{className:t,style:n,classNames:r,styles:i,...a}=K(`SpotlightFooter`,null,e),o=bw();return(0,G.jsx)(Y,{...o.getStyles(`footer`,{className:t,classNames:r,style:n,styles:i}),...a})});Dw.classes=xw,Dw.displayName=`@mantine/spotlight/SpotlightFooter`;function Ow(e,t){if(!e)return[];let n=()=>dw.open(t);return Array.isArray(e)?e.map(e=>[e,n]):[[e,n]]}var kw={size:600,yOffset:80,zIndex:N(`max`),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:`pop`},store:pw,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:`mod + K`,maxHeight:400},Aw=J(e=>{let t=K(`SpotlightRoot`,kw,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,store:c,children:l,query:u,onQueryChange:d,transitionProps:f,clearQueryOnClose:p,shortcut:m,tagsToIgnore:h,triggerOnContentEditable:g,disabled:v,onSpotlightOpen:y,onSpotlightClose:b,forceOpened:x,closeOnActionTrigger:S,maxHeight:C,scrollable:w,attributes:T,...E}=t,{opened:D,query:O}=XC(c),k=typeof u==`string`?u:O,A=e=>{d?.(e),dw.setQuery(e,c)},j=q({name:`Spotlight`,classes:xw,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:T}),{resolvedClassNames:M,resolvedStyles:N}=Qn({classNames:n,styles:a,props:t});return lt(Ow(m,c),h,g),fe(()=>{D?y?.():b?.()},[D]),v?null:(0,G.jsx)(yw,{value:{getStyles:j,query:k,setQuery:A,store:c,closeOnActionTrigger:S},children:(0,G.jsx)(Xm,{...E,withCloseButton:!1,opened:D||!!x,padding:0,onClose:()=>dw.close(c),className:r,style:i,classNames:M,styles:N,attributes:T,transitionProps:{...f,onExited:()=>{p&&A(``),dw.clearSpotlightState({clearQuery:p},c),f?.onExited?.()}},__vars:{"--spotlight-max-height":w?_(C):void 0},__staticSelector:`Spotlight`,"data-scrollable":w||void 0,children:l})})});Aw.classes=xw,Aw.displayName=`@mantine/spotlight/SpotlightRoot`;var jw={size:`lg`},Mw=J(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,vars:a,value:o,attributes:s,...c}=K(`SpotlightSearch`,jw,e),l=bw(),u=l.getStyles(`search`),[d,f]=(0,C.useState)(!1),p=e=>{r?.(e),!d&&(e.nativeEvent.code===`ArrowDown`&&(e.preventDefault(),dw.selectNextAction(l.store)),e.nativeEvent.code===`ArrowUp`&&(e.preventDefault(),dw.selectPreviousAction(l.store)),(e.nativeEvent.code===`Enter`||e.nativeEvent.code===`NumpadEnter`)&&(e.preventDefault(),dw.triggerSelectedAction(l.store)))};return(0,G.jsx)(Ld,{...u,classNames:[{input:u.className},t],styles:[{input:u.style},n],...c,value:o??l.query,onChange:e=>{l.setQuery(e.currentTarget.value),i?.(e)},onKeyDown:p,onCompositionStart:()=>f(!0),onCompositionEnd:()=>f(!1)})});Mw.classes=xw,Mw.displayName=`@mantine/spotlight/SpotlightSearch`;function Nw(e){return Array.isArray(e)?e.map(e=>e.trim()).join(`,`).toLowerCase().trim():typeof e==`string`?e.toLowerCase().trim():``}function Pw(e){return e.reduce((e,t)=>`actions`in t?[...e,...t.actions.map(e=>({...e,group:t.group}))]:[...e,t],[])}function Fw(e){let t={},n=[];return e.forEach(e=>{e.group?(t[e.group]||(t[e.group]={pushed:!1,data:{group:e.group,actions:[]}}),t[e.group].data.actions.push(e),t[e.group].pushed||(t[e.group].pushed=!0,n.push(t[e.group].data))):n.push(e)}),n}var Iw=(e,t)=>{let n=e.trim().toLowerCase(),r=[[],[]];return Pw(t).forEach(e=>{e.label?.toLowerCase().includes(n)?r[0].push(e):(e.description?.toLowerCase().includes(n)||Nw(e.keywords).includes(n))&&r[1].push(e)}),Fw(r.flat())};function Lw(e,t){if(!Array.isArray(e))return[];let n=0;return e.reduce((e,r)=>{if(n>=t)return e;if(vw(r)){let i=Lw(r.actions,t-n);e.push({group:r.group,actions:i}),n+=i.length}else e.push(r),n+=1;return e},[])}var Rw={size:600,yOffset:80,limit:1/0,zIndex:N(`max`),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:`pop`},store:pw,filter:Iw,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:`mod + K`},zw=J(e=>{let{searchProps:t,filter:n,query:r,onQueryChange:i,actions:a,nothingFound:o,highlightQuery:s,limit:c,scrollAreaProps:l,...u}=K(`Spotlight`,Rw,e),[d,f]=Ye({value:r,defaultValue:``,finalValue:``,onChange:i}),p=Lw(n(d,a),c).map(e=>{if(vw(e)){let t=e.actions.map(({id:e,...t})=>(0,G.jsx)(Cw,{highlightQuery:s,...t},e));return(0,G.jsx)(ww,{label:e.group,children:t},e.group)}return(0,G.jsx)(Cw,{highlightQuery:s,...e},e.id)});return(0,G.jsxs)(Aw,{...u,query:d,onQueryChange:f,children:[(0,G.jsx)(Mw,{...t}),p.length>0&&(0,G.jsx)(Tw,{...l,children:p}),p.length===0&&o&&(0,G.jsx)(Ew,{children:o})]})});zw.classes=xw,zw.displayName=`@mantine/spotlight/Spotlight`,zw.Search=Mw,zw.ActionsList=Tw,zw.Action=Cw,zw.Empty=Ew,zw.ActionsGroup=ww,zw.Footer=Dw,zw.Root=Aw,zw.open=mw.open,zw.close=mw.close,zw.toggle=mw.toggle;function Bw(e){let t={subscribe(t){let n=null,r=!1,i=!1,a=!1;function o(){n===null?a=!0:i||(i=!0,typeof n==`function`?n():n&&n.unsubscribe())}return n=e({next(e){var n;r||(n=t.next)==null||n.call(t,e)},error(e){var n;r||(r=!0,(n=t.error)==null||n.call(t,e),o())},complete(){var e;r||(r=!0,(e=t.complete)==null||e.call(t),o())}}),a&&o(),{unsubscribe:o}},pipe(...e){return e.reduce(Vw,t)}};return t}function Vw(e,t){return t(e)}function Hw(e){let t=new AbortController;return new Promise((n,r)=>{let i=!1;function a(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener(`abort`,()=>{r(t.signal.reason)});let o=e.subscribe({next(e){i=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})})}function Uw(e){return e=>{let t=0,n=null,r=[];function i(){n||=e.subscribe({next(e){for(let n of r){var t;(t=n.next)==null||t.call(n,e)}},error(e){for(let n of r){var t;(t=n.error)==null||t.call(n,e)}},complete(){for(let t of r){var e;(e=t.complete)==null||e.call(t)}}})}function a(){if(t===0&&n){let e=n;n=null,e.unsubscribe()}}return Bw(e=>(t++,r.push(e),i(),{unsubscribe(){t--,a();let n=r.findIndex(t=>t===e);n>-1&&r.splice(n,1)}}))}}function Ww(e){let t=e,n=[],r=e=>{t!==void 0&&e.next(t),n.push(e)},i=e=>{n.splice(n.indexOf(e),1)},a=Bw(e=>(r(e),()=>{i(e)}));return a.next=e=>{if(t!==e){t=e;for(let t of n)t.next(e)}},a.get=()=>t,a}var Gw=JC();function Kw(e){return Bw(t=>{function n(t=0,r=e.op){let i=e.links[t];if(!i)throw Error(`No more links to execute - did you forget to add an ending link?`);return i({op:r,next(e){return n(t+1,e)}})}return n().subscribe(t)})}function qw(e){return Array.isArray(e)?e:[e]}function Jw(e){return t=>{let n=qw(e.true).map(e=>e(t)),r=qw(e.false).map(e=>e(t));return t=>Bw(i=>{let a=e.condition(t.op)?n:r;return Kw({op:t.op,links:a}).subscribe(i)})}}function Yw(e){"@babel/helpers - typeof";return Yw=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Yw(e)}function Xw(e,t){if(Yw(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Yw(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Zw(e){var t=Xw(e,`string`);return Yw(t)==`symbol`?t:t+``}function Qw(e,t,n){return(t=Zw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$w(Object(n),!0).forEach(function(t){Qw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$w(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tT(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function nT(e){return typeof e==`function`}function rT(){return Object.create(null)}var iT=typeof Symbol==`function`&&!!Symbol.asyncIterator;function aT(e){return iT&&tT(e)&&Symbol.asyncIterator in e}var oT=e=>e(),sT={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099},cT=[sT.BAD_GATEWAY,sT.SERVICE_UNAVAILABLE,sT.GATEWAY_TIMEOUT,sT.INTERNAL_SERVER_ERROR],lT=()=>{},uT=e=>{Object.freeze&&Object.freeze(e)};function dT(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(lT,{get(r,i){if(typeof i==`string`&&i!==`then`)return dT(e,[...t,i],n)},apply(n,r,i){let a=t[t.length-1];if(a===`valueOf`||a===`toString`||a===`toJSON`)return`tRPC.proxy(${t.slice(0,-1).join(`.`)})`;let o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),uT(o.args),uT(o.path),e(o)}})),n[r]}var fT=e=>dT(e,[],rT()),pT=e=>new Proxy(lT,{get(t,n){if(n!==`then`)return e(n)}});function mT(e){"@babel/helpers - typeof";return mT=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},mT(e)}function hT(e,t){if(mT(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(mT(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gT(e){var t=hT(e,`string`);return mT(t)==`symbol`?t:t+``}function _T(e,t,n){return(t=gT(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vT=class extends Error{constructor(e){super(yT(e)),Object.assign(this,e)}};function yT(e){if(`message`in e)return String(e.message)}function bT(e){if(e instanceof Error)return e;let t=typeof e;if(t!==`undefined`&&t!==`function`&&e!==null){if(t!==`object`)return Error(String(e));if(tT(e))return new vT(e)}}var xT=class extends Error{constructor(e){let t=bT(e.cause),n=e.message??t?.message??e.code;super(n,{cause:t}),_T(this,`cause`,void 0),_T(this,`code`,void 0),this.code=e.code,this.name=`TRPCError`,this.cause??=t}};function ST(e){return typeof e==`function`}async function CT(e,t){let{_def:n}=e,r=n.procedures[t];for(;!r;){let e=Object.keys(n.lazy).find(e=>t===e||t.startsWith(e+`.`));if(!e)return null;await n.lazy[e].load(),r=n.procedures[t]}return r}async function wT(e){let{type:t,path:n}=e,r=await CT(e.router,n);if(!r||!ST(r)||r._def.type!==t&&!e.allowMethodOverride)throw new xT({code:`NOT_FOUND`,message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type===`subscription`)throw new xT({code:`METHOD_NOT_SUPPORTED`,message:`Method override is not supported for subscriptions`});return r(e)}var TT,ET=new WeakMap,DT=()=>{};TT=Symbol.toStringTag;var OT=class e{constructor(e){_T(this,`promise`,void 0),_T(this,`subscribers`,[]),_T(this,`settlement`,null),_T(this,TT,`Unpromise`),this.promise=typeof e==`function`?new Promise(e):e;let t=this.promise.then(e=>{let{subscribers:t}=this;this.subscribers=null,this.settlement={status:`fulfilled`,value:e},t?.forEach(({resolve:t})=>{t(e)})});`catch`in t&&t.catch(e=>{let{subscribers:t}=this;this.subscribers=null,this.settlement={status:`rejected`,reason:e},t?.forEach(({reject:t})=>{t(e)})})}subscribe(){let e,t,{settlement:n}=this;if(n===null){if(this.subscribers===null)throw Error(`Unpromise settled but still has subscribers`);let n=AT();this.subscribers=jT(this.subscribers,n),e=n.promise,t=()=>{this.subscribers!==null&&(this.subscribers=NT(this.subscribers,n))}}else{let{status:r}=n;e=r===`fulfilled`?Promise.resolve(n.value):Promise.reject(n.reason),t=DT}return Object.assign(e,{unsubscribe:t})}then(e,t){let n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.then(e,t),{unsubscribe:r})}catch(e){let t=this.subscribe(),{unsubscribe:n}=t;return Object.assign(t.catch(e),{unsubscribe:n})}finally(e){let t=this.subscribe(),{unsubscribe:n}=t;return Object.assign(t.finally(e),{unsubscribe:n})}static proxy(t){let n=e.getSubscribablePromise(t);return n===void 0?e.createSubscribablePromise(t):n}static createSubscribablePromise(t){let n=new e(t);return ET.set(t,n),ET.set(n,n),n}static getSubscribablePromise(e){return ET.get(e)}static resolve(t){let n=typeof t==`object`&&t&&`then`in t&&typeof t.then==`function`?t:Promise.resolve(t);return e.proxy(n).subscribe()}static async any(t){let n=(Array.isArray(t)?t:[...t]).map(e.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:e})=>{e()})}}static async race(t){let n=(Array.isArray(t)?t:[...t]).map(e.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:e})=>{e()})}}static async raceReferences(e){let t=e.map(kT);try{return await Promise.race(t)}finally{for(let e of t)e.unsubscribe()}}};function kT(e){return OT.proxy(e).then(()=>[e])}function AT(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function jT(e,t){return[...e,t]}function MT(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function NT(e,t){let n=e.indexOf(t);return n===-1?e:MT(e,n)}var PT,FT;(PT=Symbol).dispose??(PT.dispose=Symbol()),(FT=Symbol).asyncDispose??(FT.asyncDispose=Symbol());function IT(e,t){let n=e,r=n[Symbol.dispose];return n[Symbol.dispose]=()=>{t(),r?.call(n)},n}function LT(e,t){let n=e,r=n[Symbol.asyncDispose];return n[Symbol.asyncDispose]=async()=>{await t(),await r?.call(n)},n}var RT=Symbol();function zT(e){let t=null;return IT({start(){if(t)throw Error(`Timer already started`);return new Promise(n=>{t=setTimeout(()=>n(RT),e)})}},()=>{t&&clearTimeout(t)})}function BT(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}function VT(e,t){this.v=e,this.k=t}function HT(e){return new VT(e,0)}function UT(e){return function(){return new WT(e.apply(this,arguments))}}function WT(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof VT;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`?`return`:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(a.done?`return`:`normal`,n)},function(e){r(`throw`,e)})}catch(e){i(`throw`,e)}}function i(e,i){switch(e){case`return`:t.resolve({value:i,done:!0});break;case`throw`:t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}WT.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},WT.prototype.next=function(e){return this._invoke(`next`,e)},WT.prototype.throw=function(e){return this._invoke(`throw`,e)},WT.prototype.return=function(e){return this._invoke(`return`,e)};function GT(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var KT=0,qT=1,JT=0,YT=1,XT=0,ZT=1,QT=2,$T=class extends Error{constructor(e){super(`Received error from server`),this.data=e}},eE=e=>({getReader(){return new ReadableStream({start(t){e.on(`data`,e=>{t.enqueue(e)}),e.on(`end`,()=>{t.close()}),e.on(`error`,e=>{t.error(e)})}}).getReader()}});function tE(e){let t=`getReader`in e?e.getReader():eE(e).getReader(),n=``;return new ReadableStream({async pull(e){let{done:n,value:r}=await t.read();n?e.close():e.enqueue(r)},cancel(){return t.cancel()}}).pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({transform(e,t){n+=e;let r=n.split(`
|
|
52
|
-
`);n=r.pop()??``;for(let e of r)t.enqueue(e)}}))}function nE(e){let t=tE(e),n=!1;return t.pipeThrough(new TransformStream({transform(e,t){if(n){let n=JSON.parse(e);t.enqueue(n)}else{let r=JSON.parse(e);t.enqueue(r),n=!0}}}))}function rE(e){let t=new Map;function n(){return Array.from(t.values()).every(e=>e.closed)}function r(){let t,r=new ReadableStream({start(e){t=e}}),i={enqueue:e=>t.enqueue(e),close:()=>{t.close(),a(),n()&&e.abort()},closed:!1,getReaderResource:()=>{let e=r.getReader();return IT(e,()=>{i.close(),e.releaseLock()})},error:e=>{t.error(e),a()}};function a(){Object.assign(i,{closed:!0,close:()=>{},enqueue:()=>{},getReaderResource:null,error:()=>{}})}return i}function i(e){let n=t.get(e);return n||(n=r(),t.set(e,n)),n}function a(e){for(let n of t.values())n.error(e)}function o(){for(let e of t.values())e.close()}return{getOrCreate:i,cancelAll:a,closeAll:o}}async function iE(e){let{deserialize:t=e=>e}=e,n=nE(e.from);t&&(n=n.pipeThrough(new TransformStream({transform(e,n){n.enqueue(t(e))}})));let r=GT(),i=rE(e.abortController);function a(t){let[n,r,a]=t,s=i.getOrCreate(a);switch(r){case KT:return oT(async()=>{try{var t=BT();let{value:n}=await t.u(s.getReaderResource()).read(),[r,i,a]=n;switch(i){case JT:return o(a);case YT:throw e.formatError?.call(e,{error:a})??new $T(a)}}catch(e){t.e=e}finally{t.d()}});case qT:return oT(UT(function*(){try{var t=BT();let n=t.u(s.getReaderResource());for(;;){let{value:t}=yield HT(n.read()),[r,i,a]=t;switch(i){case ZT:yield o(a);break;case XT:return o(a);case QT:throw e.formatError?.call(e,{error:a})??new $T(a)}}}catch(e){t.e=e}finally{t.d()}}))}}function o(e){let[[t],...n]=e;for(let e of n){let[n]=e,r=a(e);if(n===null)return r;t[n]=r}return t}let s=()=>{r&&=(r.reject(Error(`Stream closed before head was received`)),null),i.closeAll()},c=e=>{r?.reject(e),r=null,i.cancelAll(e)};return n.pipeTo(new WritableStream({write(e){if(r){let t=e;for(let[n,r]of Object.entries(e))t[n]=o(r);r.resolve(t),r=null;return}let t=e,[n]=t;i.getOrCreate(n).enqueue(t)},close:s,abort:c})).catch(t=>{var n;(n=e.onError)==null||n.call(e,{error:t}),c(t)}),[await r.promise]}var aE=`ping`,oE=`serialized-error`,sE=`connected`,cE=`return`;async function lE(e){try{var t=BT();let n=t.u(zT(e.timeoutMs)),r=await OT.race([e.promise,n.start()]);return r===RT?await e.onTimeout():r}catch(e){t.e=e}finally{t.d()}}function uE(e){let{deserialize:t=e=>e}=e,n=rT(),r=e.signal,i=null,a=()=>new ReadableStream({async start(a){let[o,s]=await Promise.all([e.url(),e.init()]),c=i=new e.EventSource(o,s);a.enqueue({type:`connecting`,eventSource:i,event:null}),c.addEventListener(sE,e=>{let t=JSON.parse(e.data);n=t,a.enqueue({type:`connected`,options:t,eventSource:c})}),c.addEventListener(oE,e=>{let n=e;a.enqueue({type:`serialized-error`,error:t(JSON.parse(n.data)),eventSource:c})}),c.addEventListener(aE,()=>{a.enqueue({type:`ping`,eventSource:c})}),c.addEventListener(cE,()=>{c.close(),a.close(),i=null}),c.addEventListener(`error`,e=>{c.readyState===c.CLOSED?a.error(e):a.enqueue({type:`connecting`,eventSource:c,event:e})}),c.addEventListener(`message`,e=>{let n=e,r={data:t(JSON.parse(n.data))};n.lastEventId&&(r.id=n.lastEventId),a.enqueue({type:`data`,data:r,eventSource:c})});let l=()=>{try{c.close(),a.close()}catch{}};r.aborted?l():r.addEventListener(`abort`,l)},cancel(){i?.close()}}),o=()=>{let e=a(),t=e.getReader();async function n(){await t.cancel(),i=null}return LT({read(){return t.read()},async recreate(){await n(),e=a(),t=e.getReader()}},n)};return oT(UT(function*(){try{var e=BT();let t=e.a(o());for(;;){let e=t.read(),r=n.reconnectAfterInactivityMs;r&&(e=lE({promise:e,timeoutMs:r,onTimeout:async()=>{let e={value:{type:`timeout`,ms:r,eventSource:i},done:!1};return await t.recreate(),e}}));let a=yield HT(e);if(a.done)return a.value;yield a.value}}catch(t){e.e=t}finally{yield HT(e.d())}}))}function dE(e){return e instanceof mE}function fE(e){return tT(e)&&tT(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function pE(e,t){return typeof e==`string`?e:tT(e)&&typeof e.message==`string`?e.message:t}var mE=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),Qw(this,`cause`,void 0),Qw(this,`shape`,void 0),Qw(this,`data`,void 0),Qw(this,`meta`,void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(i=n.result)==null?void 0:i.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return dE(r)?(n.meta&&(r.meta=eT(eT({},r.meta),n.meta)),r):fE(r)?new e(r.error.message,eT(eT({},n),{},{result:r,cause:n.cause})):new e(pE(r,`Unknown error`),eT(eT({},n),{},{cause:r}))}};function hE(e){let t=e;return t?`input`in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}var gE=e=>typeof e==`function`;function _E(e){if(e)return e;if(typeof window<`u`&&gE(window.fetch))return window.fetch.bind(window);if(typeof globalThis<`u`&&gE(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}function vE(...e){let t=new AbortController,n=e.length,r=0,i=()=>{++r===n&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener(`abort`,i,{once:!0});return t.signal}function yE(...e){let t=new AbortController;for(let n of e)n?.aborted?t.abort():n?.addEventListener(`abort`,()=>t.abort(),{once:!0});return t.signal}function bE(e){return{url:e.url.toString(),fetch:e.fetch,transformer:hE(e.transformer),methodOverride:e.methodOverride}}function xE(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];t[n]=r}return t}var SE={query:`GET`,mutation:`POST`,subscription:`PATCH`};function CE(e){return`input`in e?e.transformer.input.serialize(e.input):xE(e.inputs.map(t=>e.transformer.input.serialize(t)))}var wE=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+e.path,r=[];if(t[1]&&r.push(t[1]),`inputs`in e&&r.push(`batch=1`),e.type===`query`||e.type===`subscription`){let t=CE(e);t!==void 0&&e.methodOverride!==`POST`&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},TE=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=CE(e);return t===void 0?void 0:JSON.stringify(t)},EE=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},DE=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new EE};async function OE(e){DE(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??SE[e.type],i=await(async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a=eT(eT(eT({},e.contentTypeHeader&&r!==`GET`?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),i);return _E(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:a})}var kE=()=>{throw Error(`Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new`)};function AE(e){let t=null,n=null,r=()=>{clearTimeout(n),n=null,t=null};function i(t){let n=[[]],r=0;for(;;){let o=t[r];if(!o)break;let s=n[n.length-1];if(o.aborted){var i;(i=o.reject)==null||i.call(o,Error(`Aborted`)),r++}else if(e.validate(s.concat(o).map(e=>e.key)))s.push(o),r++;else if(s.length===0){var a;(a=o.reject)==null||a.call(o,Error(`Input is too big for a single dispatch`)),r++}else n.push([])}return n}function a(){let n=i(t);r();for(let t of n){if(!t.length)continue;let n={items:t};for(let e of t)e.batch=n;e.fetch(n.items.map(e=>e.key)).then(async e=>{await Promise.all(e.map(async(e,t)=>{let r=n.items[t];try{var i;let t=await Promise.resolve(e);(i=r.resolve)==null||i.call(r,t)}catch(e){var a;(a=r.reject)==null||a.call(r,e)}r.batch=null,r.reject=null,r.resolve=null}));for(let e of n.items){var t;(t=e.reject)==null||t.call(e,Error(`Missing result`)),e.batch=null}}).catch(e=>{for(let r of n.items){var t;(t=r.reject)==null||t.call(r,e),r.batch=null}})}}function o(e){let r={aborted:!1,key:e,batch:null,resolve:kE,reject:kE},i=new Promise((e,n)=>{r.reject=n,r.resolve=e,t??=[],t.push(r)});return n??=setTimeout(a),i}return{load:o}}var jE=(e,...t)=>typeof e==`function`?e(...t):e;function ME(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function NE(e){let t=await jE(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function PE(e,t){let n={method:`connectionParams`,data:await jE(e)};return t.encode(n)}function FE(e){let{promise:t,resolve:n,reject:r}=ME();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}function IE(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function a(){r=setTimeout(()=>{e.send(`PING`),i=setTimeout(()=>{e.close()},n)},t)}function o(){clearTimeout(r),a()}function s(){clearTimeout(i),o()}e.addEventListener(`open`,a),e.addEventListener(`message`,({data:e})=>{clearTimeout(r),a(),e===`PONG`&&s()}),e.addEventListener(`close`,()=>{clearTimeout(r),clearTimeout(i)})}Qw(class e{constructor(t){if(Qw(this,`id`,++e.connectCount),Qw(this,`WebSocketPonyfill`,void 0),Qw(this,`urlOptions`,void 0),Qw(this,`keepAliveOpts`,void 0),Qw(this,`encoder`,void 0),Qw(this,`wsObservable`,Ww(null)),Qw(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++e.connectCount;let t=NE(this.urlOptions).then(e=>new this.WebSocketPonyfill(e));this.openPromise=t.then(async e=>{this.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)}),this.keepAliveOpts.enabled&&IE(e,this.keepAliveOpts),e.addEventListener(`close`,()=>{this.ws===e&&(this.ws=null)}),await FE(e),this.urlOptions.connectionParams&&e.send(await PE(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var e;(e=this.ws)==null||e.close()}}},`connectCount`,0);var LE=class{constructor(e){Qw(this,`links`,void 0),Qw(this,`runtime`,void 0),Qw(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return Kw({links:this.links,op:eT(eT({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(Uw())}async requestAsPromise(e){try{return(await Hw(this.$request(e))).result.data}catch(e){throw mE.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var i;(i=n.onStopped)==null||i.call(n);break;case`data`:case void 0:var a;(a=n.onData)==null||a.call(n,e.result.data)}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}},RE=Symbol.for(`trpc_untypedClient`),zE={query:`query`,mutate:`mutation`,subscribe:`subscription`},BE=e=>zE[e];function VE(e){let t=fT(({path:t,args:n})=>{let r=[...t],i=BE(r.pop()),a=r.join(`.`);return e[i](a,...n)});return pT(n=>n===RE?e:t[n])}function HE(e){return VE(new LE(e))}function UE(e){return e[RE]}function WE(e){let t=bE(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{let i=i=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;let a=e.map(e=>e.path).join(`,`),o=e.map(e=>e.input);return wE(eT(eT({},t),{},{type:i,path:a,inputs:o,signal:null})).length<=n},async fetch(n){let r=n.map(e=>e.path).join(`,`),a=n.map(e=>e.input),o=vE(...n.map(e=>e.signal)),s=new AbortController,c=await OE(eT(eT({},t),{},{signal:yE(o,s.signal),type:i,contentTypeHeader:`application/json`,trpcAcceptHeader:`application/jsonl`,trpcAcceptHeaderKey:e.streamHeader??`trpc-accept`,getUrl:wE,getBody:TE,inputs:a,path:r,headers(){return e.headers?typeof e.headers==`function`?e.headers({opList:n}):e.headers:{}}}));if(!c.ok){let e=await c.json();return`error`in e&&(e.error=t.transformer.output.deserialize(e.error)),n.map(()=>Promise.resolve({json:e,meta:{response:c}}))}let[l]=await iE({from:c.body,deserialize:e=>t.transformer.output.deserialize(e),formatError(e){let t=e.error;return mE.from({error:t})},abortController:s});return Object.keys(n).map(async e=>{let t=await Promise.resolve(l[e]);if(`result`in t){let e=await Promise.resolve(t.result);t={result:{data:await Promise.resolve(e.data)}}}return{json:t,meta:{response:c}}})}}),a={query:AE(i(`query`)),mutation:AE(i(`mutation`))};return({op:e})=>Bw(t=>{if(e.type===`subscription`)throw Error("Subscriptions are unsupported by `httpBatchStreamLink` - use `httpSubscriptionLink` or `wsLink`");let n=new AbortController,r=a[e.type].load(eT(eT({},e),{},{signal:yE(e.signal,n.signal)})),i=!1,o;return r.then(e=>{i=!0,o=e,`error`in e.json?t.error(mE.from(e.json,{meta:e.meta})):(`result`in e.json&&t.next({context:e.meta,result:e.json.result}),t.complete())}).catch(e=>{i=!0,t.error(mE.from(e,{meta:o?.meta}))}),()=>{i||n.abort()}})}}function GE(e,t){return!t||e!=null&&typeof e!=`object`?e:eT(eT({},e??{}),{},{lastEventId:t})}function KE(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new qE(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function qE(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return qE=function(e){this.s=e,this.n=e.next},qE.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new qE(e)}async function JE(e){let t=await jE(e.url);if(e.connectionParams){let n=await jE(e.connectionParams),r=t.includes(`?`)?`&`:`?`;t+=r+`connectionParams=`+encodeURIComponent(JSON.stringify(n))}return t}function YE(e){let t=hE(e.transformer);return()=>({op:n})=>Bw(r=>{let{type:i,path:a,input:o}=n;if(i!==`subscription`)throw Error(`httpSubscriptionLink only supports subscriptions`);let s,c=new AbortController,l=uE({url:async()=>wE({transformer:t,url:await JE(e),input:GE(o,s),path:a,type:i,signal:null}),init:()=>jE(e.eventSourceOptions,{op:n}),signal:yE(n.signal,c.signal),deserialize:e=>t.output.deserialize(e),EventSource:e.EventSource??globalThis.EventSource}),u=Ww({type:`state`,state:`connecting`,error:null}),d=u.subscribe({next(e){r.next({result:e})}});return oT(async()=>{var e=!1,t=!1,n;try{for(var i=KE(l),a;e=!(a=await i.next()).done;e=!1){let e=a.value;switch(e.type){case`ping`:break;case`data`:let t=e.data,n;t.id?(s=t.id,n={id:t.id,data:t}):n={data:t.data},r.next({result:n,context:{eventSource:e.eventSource}});break;case`connected`:r.next({result:{type:`started`},context:{eventSource:e.eventSource}}),u.next({type:`state`,state:`pending`,error:null});break;case`serialized-error`:{let t=mE.from({error:e.error});if(cT.includes(e.error.code)){u.next({type:`state`,state:`connecting`,error:t});break}throw t}case`connecting`:{let t=u.get(),n=e.event&&mE.from(e.event);if(!n&&t.state===`connecting`)break;u.next({type:`state`,state:`connecting`,error:n});break}case`timeout`:u.next({type:`state`,state:`connecting`,error:new mE(`Timeout of ${e.ms}ms reached while waiting for a response`)})}}}catch(e){t=!0,n=e}finally{try{e&&i.return!=null&&await i.return()}finally{if(t)throw n}}r.next({result:{type:`stopped`}}),u.next({type:`state`,state:`idle`,error:null}),r.complete()}).catch(e=>{r.error(mE.from(e))}),()=>{r.complete(),c.abort(),d.unsubscribe()}})}function XE(e,t){this.v=e,this.k=t}function ZE(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof XE;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`?`return`:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(a.done?`return`:`normal`,n)},function(e){r(`throw`,e)})}catch(e){i(`throw`,e)}}function i(e,i){switch(e){case`return`:t.resolve({value:i,done:!0});break;case`throw`:t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ZE.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ZE.prototype.next=function(e){return this._invoke(`next`,e)},ZE.prototype.throw=function(e){return this._invoke(`throw`,e)},ZE.prototype.return=function(e){return this._invoke(`return`,e)};function QE(e){"@babel/helpers - typeof";return QE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QE(e)}function $E(e,t){if(QE(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QE(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function eD(e){var t=$E(e,`string`);return QE(t)==`symbol`?t:t+``}function tD(e,t,n){return(t=eD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nD(Object(n),!0).forEach(function(t){tD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iD(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new aD(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function aD(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return aD=function(e){this.s=e,this.n=e.next},aD.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new aD(e)}function oD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function sD(e,t){if(e==null)return{};var n,r,i=oD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var cD=[`cursor`,`direction`];function lD(e){return{path:e.path.join(`.`)}}function uD(e){return e.length>=3}function dD(e){return uD(e)?{type:`prefixed`,prefix:e[0],path:e[1],args:e[2]}:{type:`unprefixed`,prefix:void 0,path:e[0],args:e[1]}}function fD(e,t,n){let r=dD(e),i=r.args?.input;return n&&(i=rD(rD(rD({},r.args?.input??{}),n.pageParam===void 0?{}:{cursor:n.pageParam}),{},{direction:n.direction})),[r.path.join(`.`),i,t?.trpc]}async function pD(e,t,n){let r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:`success`});let i=[];var a=!1,o=!1,s;try{for(var c=iD(e),l;a=!(l=await c.next()).done;a=!1){let e=l.value;i.push(e),r.setState({data:[...i]})}}catch(e){o=!0,s=e}finally{try{a&&c.return!=null&&await c.return()}finally{if(o)throw s}}return i}function mD(e){let t=oT(()=>{let{input:t,type:n}=e,r=e.path.flatMap(e=>e.split(`.`));if(!t&&n===`any`)return r.length?[r]:[];if(n===`infinite`&&tT(t)&&(`direction`in t||`cursor`in t)){let{cursor:e,direction:n}=t;return[r,{input:sD(t,cD),type:`infinite`}]}return[r,rD(rD({},t!==void 0&&t!==gv&&{input:t}),n&&n!==`any`&&{type:n})]});return e.prefix&&t.unshift([e.prefix]),t}function hD(e){let t=[e.path.flatMap(e=>e.split(`.`))];return e.prefix&&t.unshift([e.prefix]),t}function gD(e){return nT(e)?e():e}function _D(e){let{input:t,query:n,path:r,queryKey:i,opts:a}=e,o=t===gv;return Object.assign(py(rD(rD({},a??{}),{},{queryKey:i,queryFn:o?gv:async e=>{var t;let r=rD(rD({},a),{},{trpc:rD(rD({},a?.trpc),a!=null&&(t=a.trpc)!=null&&t.abortOnUnmount?{signal:e.signal}:{signal:null})});return await n(...fD(i,r,{direction:e.direction,pageParam:e.pageParam}))},initialPageParam:a?.initialCursor??t?.cursor})),{trpc:lD({path:r})})}function vD(e){let{mutate:t,path:n,prefix:r,opts:i,overrides:a}=e,o=gD(e.queryClient),s=hD({path:n,prefix:i?.keyPrefix??r}),c=o.defaultMutationOptions(o.getMutationDefaults(s)),l=a?.onSuccess??(e=>e.originalFn());return rD(rD({},i),{},{mutationKey:s,mutationFn:async e=>await t(...fD([...s,{input:e}],i)),onSuccess(...e){return l({originalFn:()=>{var t,n;return(i==null||(t=i.onSuccess)==null?void 0:t.call(i,...e))??(c==null||(n=c.onSuccess)==null?void 0:n.call(c,...e))},queryClient:o,meta:i?.meta??c?.meta??{}})},trpc:lD({path:n})})}function yD(e){let{input:t,query:n,path:r,queryKey:i,opts:a}=e,o=gD(e.queryClient),s=t===gv;return Object.assign(fy(rD(rD({},a),{},{queryKey:i,queryFn:s?gv:async e=>{var t;let r=rD(rD({},a),{},{trpc:rD(rD({},a?.trpc),a!=null&&(t=a.trpc)!=null&&t.abortOnUnmount?{signal:e.signal}:{signal:null})}),i=e.queryKey,s=await n(...fD(i,r));return aT(s)?pD(s,o,i):s}})),{trpc:lD({path:r})})}var bD=e=>{let{subscribe:t,path:n,queryKey:r,input:i,opts:a={}}=e,o=`enabled`in a?!!a.enabled:i!==gv;return rD(rD({},a),{},{enabled:o,subscribe:e=>t(n.join(`.`),i===gv?void 0:i,e),queryKey:r,trpc:lD({path:n})})};function xD(e){let t=C.useRef(e);t.current=e;let n=C.useRef(new Set([])),r=C.useCallback(e=>{n.current.add(e)},[]),i=C.useRef(()=>{}),a=C.useCallback(()=>{var n;if((n=i.current)==null||n.call(i),u(o),!e.enabled)return;let r=e.subscribe({onStarted:()=>{var e,n;(e=(n=t.current).onStarted)==null||e.call(n),u(e=>rD(rD({},e),{},{status:`pending`,error:null}))},onData:e=>{var n,r;(n=(r=t.current).onData)==null||n.call(r,e),u(t=>rD(rD({},t),{},{status:`pending`,data:e,error:null}))},onError:e=>{var n,r;(n=(r=t.current).onError)==null||n.call(r,e),u(t=>rD(rD({},t),{},{status:`error`,error:e}))},onConnectionStateChange:e=>{var n,r;(n=(r=t.current).onConnectionStateChange)==null||n.call(r,e),u(t=>{switch(e.state){case`connecting`:return rD(rD({},t),{},{status:`connecting`,error:e.error});case`pending`:return t;case`idle`:return rD(rD({},t),{},{status:`idle`,data:void 0,error:null})}})}});i.current=()=>{r.unsubscribe()}},[iv(e.queryKey),e.enabled]),o=C.useCallback(()=>e.enabled?{data:void 0,error:null,status:`connecting`,reset:a}:{data:void 0,error:null,status:`idle`,reset:a},[e.enabled,a]),s=C.useRef(o()),[c,l]=C.useState(SD(s,r));c.reset=a;let u=C.useCallback(e=>{let t=s.current,i=s.current=e(t),a=!1;for(let e of n.current)if(t[e]!==i[e]){a=!0;break}a&&l(SD(s,r))},[r]);return C.useEffect(()=>{if(e.enabled)return a(),()=>{var e;(e=i.current)==null||e.call(i)}},[a,e.enabled]),c}function SD(e,t){return new Proxy(e.current,{get(n,r){return t(r),e.current[r]}})}function CD(e){let t=e.keyPrefix,n=t=>(n,r,i)=>`router`in e?Promise.resolve(gD(e.ctx)).then(i=>wT({router:e.router,path:n,getRawInput:async()=>r,ctx:i,type:t,signal:void 0,batchIndex:0})):(e.client instanceof LE?e.client:UE(e.client))[t](n,r,i);return fT(({args:r,path:i})=>{let a=[...i],o=a.pop(),[s,c]=r;return{"~types":void 0,pathKey:()=>mD({path:a,type:`any`,prefix:t}),pathFilter:()=>rD(rD({},s),{},{queryKey:mD({path:a,type:`any`,prefix:t})}),queryOptions:()=>yD({input:s,opts:c,path:a,queryClient:e.queryClient,queryKey:mD({path:a,input:s,type:`query`,prefix:t}),query:n(`query`)}),queryKey:()=>mD({path:a,input:s,type:`query`,prefix:t}),queryFilter:()=>rD(rD({},c),{},{queryKey:mD({path:a,input:s,type:`query`,prefix:t})}),infiniteQueryOptions:()=>_D({input:s,opts:c,path:a,queryClient:e.queryClient,queryKey:mD({path:a,input:s,type:`infinite`,prefix:t}),query:n(`query`)}),infiniteQueryKey:()=>mD({path:a,input:s,type:`infinite`,prefix:t}),infiniteQueryFilter:()=>rD(rD({},c),{},{queryKey:mD({path:a,input:s,type:`infinite`,prefix:t})}),mutationOptions:()=>vD({opts:s,path:a,prefix:t,queryClient:e.queryClient,mutate:n(`mutation`),overrides:e.overrides?.mutations}),mutationKey:()=>hD({path:a,prefix:t}),subscriptionOptions:()=>bD({opts:c,path:a,input:s,queryKey:mD({path:a,input:s,type:`any`,prefix:t}),subscribe:n(`subscription`)})}[o]()})}function wD(){let e=C.createContext(null),t=C.createContext(null),n=n=>{let r=C.useMemo(()=>CD({client:n.trpcClient,queryClient:n.queryClient,keyPrefix:n.keyPrefix}),[n.trpcClient,n.queryClient,n.keyPrefix]);return C.createElement(e.Provider,{value:n.trpcClient},C.createElement(t.Provider,{value:r},n.children))};n.displayName=`TRPCProvider`;function r(){let e=C.useContext(t);if(!e)throw Error(`useTRPC() can only be used inside of a <TRPCProvider>`);return e}function i(){let t=C.useContext(e);if(!t)throw Error(`useTRPCClient() can only be used inside of a <TRPCProvider>`);return t}return{TRPCProvider:n,useTRPC:r,useTRPCClient:i}}var{TRPCProvider:TD,useTRPC:ED,useTRPCClient:DD}=wD(),OD=new Qv({defaultOptions:{queries:{staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1,retry:(e,t)=>e<2&&!/NOT_FOUND|UNAUTHORIZED|FORBIDDEN/.test(String(t))}}}),kD=HE({links:[Jw({condition:e=>e.type===`subscription`,true:YE({url:`/trpc`}),false:WE({url:`/trpc`,maxURLLength:4e3})})]}),AD={style:`currency`,currency:`USD`,currencyDisplay:`narrowSymbol`},jD=new Intl.NumberFormat(`fr`,{...AD,minimumFractionDigits:2}),MD=new Intl.NumberFormat(`fr`,{...AD,maximumFractionDigits:4}),ND=new Intl.NumberFormat(`fr`,{notation:`compact`,maximumFractionDigits:1}),PD=new Intl.NumberFormat(`fr`),FD=e=>e>0&&e<.01?`< ${jD.format(.01)}`:jD.format(e),ID=e=>`${PD.format(e)} appel${e>1?`s`:``}`,LD={graphql:`GraphQL`,core:`REST`,search:`Recherche`};function RD(){let e=ED(),t=dy({...e.rateLimit.queryOptions(),refetchInterval:3e4}),n=dy({...e.ai.usage.queryOptions(),refetchInterval:3e4}),r=t.data?.find(e=>e.resource===`graphql`),i=r&&r.limit>0?Math.round(r.remaining/r.limit*100):null,a=i===null?`gray`:i<10?`red`:i<30?`yellow`:`teal`;return(0,G.jsxs)(X,{gap:`md`,wrap:`nowrap`,children:[i!==null&&(0,G.jsx)(Gh,{label:(0,G.jsxs)(tg,{gap:2,children:[(0,G.jsx)(Z,{size:`xs`,fw:600,children:`Quota API GitHub restant`}),t.data?.map(e=>(0,G.jsxs)(Z,{size:`xs`,children:[LD[e.resource]??e.resource,` : `,PD.format(e.remaining),` /`,` `,PD.format(e.limit),` · réinitialisé à`,` `,new Date(e.resetAt).toLocaleTimeString(`fr`,{hour:`2-digit`,minute:`2-digit`})]},e.resource))]}),children:(0,G.jsxs)(X,{gap:6,wrap:`nowrap`,children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`GitHub`}),(0,G.jsx)(gh,{value:i,color:a,size:4,w:36,"aria-label":`Quota GitHub restant`}),(0,G.jsxs)(Z,{size:`xs`,c:i<30?a:`dimmed`,children:[i,` %`]})]})}),n.data&&n.data.total.calls>0&&(0,G.jsx)(Gh,{label:(0,G.jsxs)(tg,{gap:2,children:[(0,G.jsx)(Z,{size:`xs`,fw:600,children:`Coût de Claude (vue Intention)`}),(0,G.jsxs)(Z,{size:`xs`,children:[`Aujourd’hui : `,MD.format(n.data.today.costUsd),` · `,ID(n.data.today.calls)]}),(0,G.jsxs)(Z,{size:`xs`,children:[`Ce mois-ci : `,MD.format(n.data.month.costUsd),` · `,ID(n.data.month.calls),` ·`,` `,ND.format(n.data.month.inputTokens),` tokens lus,`,` `,ND.format(n.data.month.outputTokens),` écrits`]}),(0,G.jsxs)(Z,{size:`xs`,children:[`Depuis le début : `,MD.format(n.data.total.costUsd)]}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Modèle local : gratuit, non compté`})]}),children:(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`IA`,` `,(0,G.jsx)(Z,{span:!0,inherit:!0,c:`gray.4`,children:FD(n.data.month.costUsd)}),` `,`ce mois`]})})]})}function zD(){return(0,G.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}),(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}function BD(){let e=ED(),t=aC(),n=dy({...e.viewer.queryOptions(),staleTime:1/0,retry:!1}),r=dy({...e.inbox.get.queryOptions(),enabled:n.isSuccess}),i=(0,C.useMemo)(()=>{let e=[{id:`inbox`,label:`Inbox`,description:`Retour à la liste`,onClick:()=>void t({to:`/`})},{id:`settings`,label:`Paramètres`,description:`Repos et orgs suivis, modèle de la vue Intention`,onClick:()=>void t({to:`/settings`})}];for(let n of r.data?.prs??[])e.push({id:n.id,label:n.title,description:`${n.owner}/${n.repo}#${n.number} · ${n.author?.login??`ghost`}`,onClick:()=>void t({to:`/$owner/$repo/pull/$number`,params:{owner:n.owner,repo:n.repo,number:String(n.number)}})});return e},[r.data,t]);if(n.isPending)return(0,G.jsx)(Rp,{h:`100vh`,children:(0,G.jsx)(El,{})});if(n.isError){let e=n.error instanceof mE&&n.error.data==null;return(0,G.jsx)(Rp,{h:`100vh`,children:(0,G.jsxs)(tg,{align:`center`,maw:560,children:[(0,G.jsx)(Rg,{order:3,children:e?`Session absente`:`Erreur`}),e?(0,G.jsxs)(Z,{c:`dimmed`,ta:`center`,children:[`Ouvrez l’URL `,(0,G.jsx)(qp,{children:`/auth?token=…`}),` affichée dans le terminal au démarrage du serveur.`]}):(0,G.jsx)(Z,{c:`red`,children:n.error.message})]})})}return(0,G.jsxs)(`div`,{className:`app`,children:[(0,G.jsxs)(`header`,{className:`topbar`,children:[(0,G.jsxs)(tf,{component:bC,to:`/`,underline:`never`,c:`gray.3`,fw:700,children:[`better`,(0,G.jsx)(Z,{span:!0,c:`blue.4`,inherit:!0,children:`·`}),`review`]}),(0,G.jsxs)(Tc,{className:`topbar-search`,onClick:mw.open,children:[(0,G.jsx)(Z,{size:`sm`,c:`dimmed`,children:`Aller à une PR…`}),(0,G.jsx)(Em,{size:`xs`,children:`Ctrl K`})]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsxs)(X,{gap:`md`,children:[(0,G.jsx)(tf,{component:bC,to:`/settings`,size:`sm`,c:`dimmed`,children:(0,G.jsxs)(X,{gap:5,wrap:`nowrap`,children:[(0,G.jsx)(zD,{}),`Paramètres`]})}),(0,G.jsx)(RD,{}),(0,G.jsx)(Gh,{label:n.data.login,children:(0,G.jsx)(Cp,{src:n.data.avatarUrl,size:26})})]})]}),(0,G.jsx)(zw,{actions:i,nothingFound:`Aucun résultat`,highlightQuery:!0,limit:30,searchProps:{placeholder:`PR, repo, auteur…`},shortcut:[`mod + K`]}),(0,G.jsx)(FC,{})]})}var VD=new Intl.RelativeTimeFormat(`fr`,{numeric:`auto`,style:`short`}),HD=[[`year`,31536e6],[`month`,2592e6],[`week`,6048e5],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function UD(e,t=Date.now()){let n=(typeof e==`number`?e:Date.parse(e))-t;for(let[e,t]of HD)if(Math.abs(n)>=t)return VD.format(Math.round(n/t),e);return`à l’instant`}function WD(e,t=Date.now()){let n=t-Date.parse(e);return n>=864e5?`${Math.floor(n/864e5)} j`:n>=36e5?`${Math.floor(n/36e5)} h`:`${Math.max(1,Math.floor(n/6e4))} min`}var GD={APPROVED:{label:`approuvé`,color:`green`},CHANGES_REQUESTED:{label:`changements demandés`,color:`red`},COMMENTED:{label:`commenté`,color:`gray`},DISMISSED:{label:`rejeté`,color:`gray`},PENDING:{label:`en attente`,color:`yellow`},REQUESTED:{label:`demandé`,color:`yellow`}},KD={SUCCESS:{label:`CI ok`,color:`green`},FAILURE:{label:`CI en échec`,color:`red`},ERROR:{label:`CI en erreur`,color:`red`},PENDING:{label:`CI en cours`,color:`yellow`},EXPECTED:{label:`CI attendue`,color:`yellow`}},qD=[{stage:`draft`,title:`Brouillon`,hint:`pas encore prêtes à relire`},{stage:`waiting`,title:`En attente de review`,hint:`aucune review pour l’instant`},{stage:`review`,title:`En review`,hint:`commentaires, changements demandés`},{stage:`approved`,title:`Approuvée`,hint:`reste la CI ou des threads ouverts`},{stage:`ready`,title:`Prête à merger`,hint:`approuvée, CI ok, aucun thread ouvert`},{stage:`queued`,title:`Merge queue`,hint:`en file d’attente de merge`},{stage:`merged`,title:`Mergée`,hint:`ces dernières 24 h`}],JD={requested:{label:`review demandée`,color:`orange`,action:!0},rereview:{label:`à re-relire`,color:`orange`,action:!0},todo:{label:`retours à traiter`,color:`orange`,action:!0},mine:{label:`ma PR`,color:`blue`},involved:{label:`je participe`,color:`gray`},stale:{label:`stagnante`,color:`yellow`},unreviewed:{label:`sans reviewer`,color:`yellow`}},YD=[{value:`all`,label:`Toutes`,tags:null},{value:`reviewer`,label:`Reviewer`,tags:[`requested`,`rereview`,`involved`]},{value:`author`,label:`Auteur`,tags:[`mine`]},{value:`lead`,label:`Lead`,tags:[`stale`,`unreviewed`]}],XD=3e5,ZD=e=>e.tags.some(e=>JD[e].action),QD=e=>`${e.owner}/${e.repo}`,$D=(e,t)=>t===null||e.tags.some(e=>t.includes(e));function eO(e){let[t,n]=(0,C.useState)(()=>Date.now());return(0,C.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function tO(){let e=ED(),t=W_(),n=aC(),[r,i]=Ge({key:`br:boardGroup`,defaultValue:`all`,getInitialValueInEffect:!1}),a=YD.find(e=>e.value===r)??YD[0],[o,s]=Ge({key:`br:boardRepo`,defaultValue:null,getInitialValueInEffect:!1}),[c,l]=Ge({key:`br:boardFilter`,defaultValue:`all`,getInitialValueInEffect:!1}),u=c===`unread`||c===`unviewed`?c:`all`,d=dy({...e.inbox.get.queryOptions(),staleTime:3e4,refetchOnWindowFocus:!0,refetchInterval:XD}),[f,p]=(0,C.useState)(0),m=eO(3e4);xD(e.inbox.onChange.subscriptionOptions(void 0,{onData:()=>void t.invalidateQueries({queryKey:e.inbox.get.queryKey()})}));let h=d.data?.prs,g=a.tags,_=(0,C.useMemo)(()=>{let e=(h??[]).filter(e=>$D(e,g)&&(o===null||QD(e)===o)&&(u===`all`||(u===`unread`?e.unread:e.files!==void 0&&e.files.viewed<e.files.total)));return qD.map(t=>({...t,prs:e.filter(e=>e.stage===t.stage)}))},[h,g,o,u]),v=(0,C.useMemo)(()=>{let e=(h??[]).filter(e=>o===null||QD(e)===o);return Object.fromEntries(YD.map(t=>[t.value,e.filter(e=>$D(e,t.tags)).length]))},[h,o]),y=(0,C.useMemo)(()=>{let e=new Map;for(let t of h??[])e.set(QD(t),(e.get(QD(t))??0)+ +!!$D(t,g));return o!==null&&!e.has(o)&&e.set(o,0),[...e].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({value:e,label:e,count:t}))},[h,g,o]),b=new Map(y.map(e=>[e.value,e.count])),x=(0,C.useMemo)(()=>_.flatMap(e=>e.prs),[_]),S=e=>e&&void n({to:`/$owner/$repo/pull/$number`,params:{owner:e.owner,repo:e.repo,number:String(e.number)}});return lt([[`j`,()=>p(e=>Math.min(e+1,x.length-1))],[`k`,()=>p(e=>Math.max(e-1,0))],[`Enter`,()=>S(x[f])],[`o`,()=>x[f]&&window.open(x[f].url,`_blank`)]]),(0,G.jsxs)(`div`,{className:`board`,children:[(0,G.jsxs)(X,{gap:`sm`,mb:`sm`,wrap:`nowrap`,children:[(0,G.jsx)(Yh,{size:`xs`,value:a.value,onChange:i,data:YD.map(e=>({value:e.value,label:`${e.label} ${v[e.value]??0}`}))}),(0,G.jsx)(Zh,{size:`xs`,w:260,placeholder:`Tous les repos`,"aria-label":`Filtrer par repo`,searchable:!0,clearable:!0,value:o,data:y,onChange:s,renderOption:({option:e})=>(0,G.jsxs)(X,{gap:`xs`,justify:`space-between`,wrap:`nowrap`,w:`100%`,children:[(0,G.jsx)(Z,{size:`xs`,truncate:!0,children:e.label}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:b.get(e.value)??0})]}),comboboxProps:{width:`max-content`,position:`bottom-start`},nothingFoundMessage:`Aucun repo`}),(0,G.jsx)(Yh,{size:`xs`,value:u,onChange:l,data:[{value:`all`,label:`Toutes`},{value:`unread`,label:`Non lues`},{value:`unviewed`,label:`Non vues à 100 %`}]}),(0,G.jsx)(`div`,{style:{flex:1}}),d.data&&(0,G.jsx)(Gh,{label:new Date(d.data.fetchedAt).toLocaleString(`fr`),children:(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`synchro `,UD(d.data.fetchedAt,m)]})}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:`default`,loading:d.isFetching,onClick:()=>void d.refetch(),children:`Actualiser`}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[(0,G.jsx)(Em,{size:`xs`,children:`j`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`k`}),` naviguer · `,(0,G.jsx)(Em,{size:`xs`,children:`↵`}),` ouvrir ·`,` `,(0,G.jsx)(Em,{size:`xs`,children:`o`}),` GitHub`]})]}),d.isPending&&(0,G.jsx)(El,{}),d.isError&&(0,G.jsx)(Jd,{color:`red`,title:`Impossible de charger les PR`,children:d.error.message}),d.data&&!d.data.configured&&(0,G.jsxs)(Jd,{title:`Aucun repo suivi`,color:`blue`,mb:`sm`,children:[`Le tableau ne montre que les repos et orgs de votre liste.`,` `,(0,G.jsx)(tf,{component:bC,to:`/settings`,children:`Ajouter des repos`})]}),d.data?.truncated&&(0,G.jsx)(Jd,{color:`yellow`,variant:`light`,mb:`sm`,py:6,children:`Plus de 1000 PR ouvertes dans un repo / une org suivi : seules les 1000 plus récemment mises à jour sont affichées (limite de la recherche GitHub).`}),d.data&&(0,G.jsx)(`div`,{className:`board-columns`,children:_.map(e=>(0,G.jsxs)(`section`,{className:`board-column`,"data-stage":e.stage,children:[(0,G.jsxs)(X,{gap:6,className:`board-column-head`,children:[(0,G.jsx)(Z,{fw:600,size:`sm`,children:e.title}),(0,G.jsx)(Ep,{size:`sm`,variant:`light`,color:`gray`,children:e.prs.length}),e.prs.some(ZD)&&(0,G.jsx)(Gh,{label:`PR qui attendent une action de ma part`,children:(0,G.jsxs)(Ep,{size:`sm`,variant:`light`,color:`orange`,children:[e.prs.filter(ZD).length,` pour moi`]})})]}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,px:10,pb:6,children:e.hint}),(0,G.jsx)(`div`,{className:`board-cards`,children:e.prs.length===0?(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,ta:`center`,py:`md`,children:`Rien ici.`}):e.prs.map(e=>(0,G.jsx)(nO,{pr:e,selected:x[f]===e,now:m},e.id))})]},e.stage))})]})}function nO({pr:e,selected:t,now:n}){let r=(0,C.useRef)(null);(0,C.useEffect)(()=>{t&&r.current?.scrollIntoView({block:`nearest`})},[t]);let i=e.ci===void 0?void 0:e.ci===null?null:KD[e.ci];return(0,G.jsxs)(bC,{ref:r,to:`/$owner/$repo/pull/$number`,params:{owner:e.owner,repo:e.repo,number:String(e.number)},className:`pr-card`,"data-selected":t||void 0,"data-unread":e.unread||void 0,"data-action":ZD(e)||void 0,children:[(0,G.jsxs)(X,{gap:6,wrap:`nowrap`,justify:`space-between`,children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,truncate:!0,children:[e.owner,`/`,e.repo,` #`,e.number]}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,color:`gray`,"aria-label":`Ouvrir sur GitHub`,onClick:t=>{t.preventDefault(),t.stopPropagation(),window.open(e.url,`_blank`,`noopener`)},children:`↗`})]}),(0,G.jsx)(Z,{fw:600,size:`sm`,className:`clamp2`,children:e.title}),(0,G.jsxs)(X,{gap:6,mt:4,wrap:`nowrap`,children:[(0,G.jsx)(Cp,{src:e.author?.avatarUrl,size:18}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,truncate:!0,children:[e.author?.login??`ghost`,` ·`,` `,e.mergedAt?`mergée ${UD(e.mergedAt,n)}`:`${UD(e.updatedAt,n)} · ouverte depuis ${WD(e.createdAt,n)}`]})]}),e.tags.length>0&&(0,G.jsx)(X,{gap:4,mt:6,children:e.tags.map(e=>(0,G.jsx)(Ep,{size:`xs`,variant:JD[e].action?`filled`:`light`,color:JD[e].color,children:JD[e].label},e))}),(e.ci!==void 0||e.threads||e.additions!==void 0||e.files)&&(0,G.jsxs)(X,{gap:8,mt:6,wrap:`wrap`,children:[i!==void 0&&(0,G.jsx)(Z,{size:`xs`,c:i?.color?`${i.color}.4`:`dimmed`,children:i?.label??`pas de CI`}),e.threads&&e.threads.total>0&&(0,G.jsxs)(Z,{size:`xs`,c:e.threads.open>0?`yellow.4`:`dimmed`,children:[(0,G.jsx)(`i`,{className:`ico-c`}),e.threads.open,`/`,e.threads.total,e.tags.includes(`mine`)&&e.threads.awaitingMyReply>0?` · ${e.threads.awaitingMyReply} attendent ma réponse`:``]}),e.additions!==void 0&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[(0,G.jsxs)(Z,{span:!0,c:`green.4`,inherit:!0,children:[`+`,e.additions]}),` `,(0,G.jsxs)(Z,{span:!0,c:`red.4`,inherit:!0,children:[`−`,e.deletions]})]}),e.files&&(0,G.jsx)(Gh,{label:`${e.files.viewed} / ${e.files.total} fichiers marqués vus`,children:(0,G.jsx)(gh,{value:e.files.total===0?0:e.files.viewed/e.files.total*100,size:`sm`,w:44,color:`green`})})]}),(e.reviews.length>0||e.requested.length>0)&&(0,G.jsxs)(X,{gap:4,mt:6,children:[e.reviews.map(e=>(0,G.jsx)(Gh,{label:`${e.login} : ${GD[e.state]?.label??e.state}`,children:(0,G.jsx)(Ep,{size:`xs`,variant:`outline`,color:GD[e.state]?.color??`gray`,leftSection:(0,G.jsx)(Cp,{src:e.avatarUrl,size:12}),children:e.login})},e.login)),e.requested.map(e=>(0,G.jsx)(Gh,{label:`${e} : review demandée`,children:(0,G.jsxs)(Ep,{size:`xs`,variant:`outline`,color:`gray`,children:[e,` ?`]})},e))]})]})}function rO(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 iO(e,t=`|`){return e.map(e=>kO(e)).join(t)}function aO(e,t){return typeof t==`bigint`?t.toString():t}var oO=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 sO(e){return new oO(e)}function cO(e){return e==null}function lO(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function uO(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 dO(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fO(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function pO(e){return fO(e._zod.def)??e._zod.def.shape}function mO(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return dO(this,t,e),e},enumerable:!0,configurable:!0})}function hO(e,t,n){t in e?dO(e,t,n):e[t]=n}function gO(e,t,n,r){let i=pO(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?mO(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):hO(e,a,r?r(n.value,a):n.value))}}function _O(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?mO(e,n,()=>t[n]):hO(e,n,r.value))}}function vO(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function yO(e){return JSON.stringify(e)}function bO(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var xO=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function SO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var CO=sO(()=>{if(yk.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function wO(e){if(SO(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return SO(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function TO(e){return wO(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var EO=new Set([`string`,`number`,`symbol`]);function DO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function OO(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Q(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 kO(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function AO(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var jO={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},MO={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function NO(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 gO(i,e,PO(e,t)),OO(e,vO(n,{shape:i,checks:[]}))}function PO(e,t){let n=pO(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 FO(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(PO(e,t)),a={};return gO(a,e,Reflect.ownKeys(pO(e)).filter(e=>!i.has(e))),OO(e,vO(n,{shape:a,checks:[]}))}function IO(e,t){if(!wO(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=pO(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 OO(e,vO(e._zod.def,{shape:LO(e,t)}))}function LO(e,t){let n={};return gO(n,e,Reflect.ownKeys(pO(e))),_O(n,t),n}function RO(e,t){if(!wO(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return OO(e,vO(e._zod.def,{shape:LO(e,t)}))}function zO(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 gO(n,e,Reflect.ownKeys(pO(e))),gO(n,t,Reflect.ownKeys(pO(t))),OO(e,vO(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function BO(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(PO(t,n)):void 0,o={};return gO(o,t,Reflect.ownKeys(pO(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),OO(t,vO(t._zod.def,{shape:o,checks:[]}))}function VO(e,t,n){let r=n?new Set(PO(t,n)):void 0,i={};return gO(i,t,Reflect.ownKeys(pO(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),OO(t,vO(t._zod.def,{shape:i}))}function HO(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 UO(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 WO(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function GO(e){return typeof e==`string`?e:e?.message}function KO(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 qO(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function JO(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:GO(e.inst?._zod.def?.error?.(e))??GO(a?.(e))??GO(t?.error?.(e))??GO(n.customError?.(e))??GO(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 YO=/[\uD800-\uDBFF]/;function XO(e){let t=e.length;if(!YO.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 ZO(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function QO(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 $O(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function ek(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ik(e,n,r.value)}}function tk(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function nk(e,t,n){return tk(e,t,n,!1)}function rk(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return tk(this,n,r(this))},set(e){tk(this,n,e)}})}return t}function ik(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:tk(this,t,n.bind(this))},set(e){tk(this,t,e)}})}function ak(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var ok,sk=!1,ck={configurable:!0,get(){sk=!0}};function lk(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&ok!==e._zod?ok=void 0:(ok=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ck);let e=sk;sk=!1;try{let r=n(this);return sk?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),sk||=e,r}catch(n){throw delete this[t],sk||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function uk(e,t,n,r){let i=ak(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 dk=`~constantCatch`;function fk(e){let t=()=>e;return t[dk]=!0,t}var pk,mk={value:void 0,enumerable:!1},hk=`captureStackTrace`in Error?Error:null;function gk(e){let t=hk;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return hk=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function $(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){mk.value=new a(r);try{Object.defineProperty(n,"_zod",mk)}finally{mk.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),ek(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?gk(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 _k=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},vk=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(pk=globalThis).__zod_globalConfig??(pk.__zod_globalConfig={});var yk=globalThis.__zod_globalConfig;function bk(e){return e&&Object.assign(yk,e),yk}function xk(){let e=this._zod;return e.message??=JSON.stringify(e.def,aO,2),e.message}function Sk(e){this._zod.message=e}var Ck={get:xk,set:Sk,enumerable:!0,configurable:!0},wk={value:void 0,enumerable:!1},Tk=new WeakSet([Object.prototype,Error.prototype]),Ek=$(`$ZodError`,(e,t)=>{e.name=`$ZodError`,wk.value=t,Object.defineProperty(e,"issues",wk),wk.value=void 0,Object.defineProperty(e,"message",Ck);let n=Object.getPrototypeOf(e);Tk.has(n)||(Tk.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 Dk(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 Ok(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Dk(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function kk(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 Ak(e,t){return{callee:t?.callee??e,Err:t?.Err}}var jk=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 _k;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>JO(e,o,bk())));throw xO(n,a?.callee??t),n}return s.value};return t},Mk=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=>JO(e,o,bk())));throw xO(n,a?.callee??t),n}return s.value};return t},Nk=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 _k;return a.issues.length?Pk(e,a.issues,i):{success:!0,data:a.value}};function Pk(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>JO(e,n,bk()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Fk=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?Pk(e,a.issues,i):{success:!0,data:a.value}},Ik=Symbol.for(`zod.compile.invalid`),Lk=Symbol.for(`zod.compile.fallback`),Rk=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ik)return!0;if(r.definite===!0&&n===void 0)return!1}return zk(e,t,n)});function zk(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Lk]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new _k;return a.issues.length===0}var Bk=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},Vk=e=>{let t=jk(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ak(n,a))};return n},Hk=e=>{let t=jk(e),n=(e,r,i,a)=>t(e,r,i,Ak(n,a));return n},Uk=e=>{let t=Mk(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ak(n,a))};return n},Wk=e=>{let t=Mk(e),n=async(e,r,i,a)=>await t(e,r,i,Ak(n,a));return n},Gk=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Nk(e)(t,n,i)},Kk=e=>(t,n,r)=>Nk(e)(t,n,r),qk=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Fk(e)(t,n,i)},Jk=e=>async(t,n,r)=>Fk(e)(t,n,r),Yk=/^[cC][0-9a-z]{6,}$/,Xk=/^[0-9a-z]+$/,Zk=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Qk=/^[0-9a-vA-V]{20}$/,$k=/^[A-Za-z0-9]{27}$/,eA=/^[a-zA-Z0-9_-]{21}$/;function tA(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var nA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rA=/^([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})$/,iA=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)$/,aA=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,oA=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function sA(){return new RegExp(oA,`u`)}var cA=/^(?:(?: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])$/,lA=/^(([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}|:))$/,uA=/^((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])$/,dA=/^(([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])$/,fA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pA=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,mA=/^https?$/,hA=/^\+[1-9]\d{6,14}$/,gA=`(?:(?:\\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 _A(e){return RegExp(`^${e}$`)}var vA=_A(gA);function yA(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 bA(e){return RegExp(`^${yA(e)}$`)}function xA(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${yA({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${yA({precision:e.precision})}`:n;return RegExp(`^${gA}T(?:${r})$`)}var SA=/^[\s\S]{0,}$/,CA=/^-?\d+(?:\.\d+)?$/,wA=/^[^A-Z]*$/,TA=/^[^a-z]*$/,EA=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),DA=e=>{let t=e.value;return!cO(t)&&t.length!==void 0},OA={number:`number`,bigint:`bigint`,object:`date`},kA=$(`$ZodCheckLessThan`,(e,t)=>{EA.init(e,t);let n=OA[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:OA[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})}}),AA=$(`$ZodCheckGreaterThan`,(e,t)=>{EA.init(e,t);let n=OA[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:OA[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})}}),jA=$(`$ZodCheckMultipleOf`,(e,t)=>{EA.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):uO(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})}}),MA=$(`$ZodCheckNumberFormat`,(e,t)=>{EA.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=jO[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})}}),NA=$(`$ZodCheckMaxLength`,(e,t)=>{var n;EA.init(e,t),(n=e._zod.def).when??(n.when=DA),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?XO(r):i)<=t.maximum)return;let a=ZO(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),PA=$(`$ZodCheckMinLength`,(e,t)=>{var n;EA.init(e,t),(n=e._zod.def).when??(n.when=DA),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?XO(r):i)>=t.minimum)return;let a=ZO(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),FA=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;EA.init(e,t),(n=e._zod.def).when??(n.when=DA),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?XO(r):i;if(a===t.length)return;let o=ZO(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})}}),IA=$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;EA.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=()=>{})}),LA=$(`$ZodCheckRegex`,(e,t)=>{IA.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})}}),RA=$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=wA,IA.init(e,t)}),zA=$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=TA,IA.init(e,t)}),BA=$(`$ZodCheckIncludes`,(e,t)=>{EA.init(e,t);let n=DO(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})}}),VA=$(`$ZodCheckStartsWith`,(e,t)=>{EA.init(e,t);let n=RegExp(`^${DO(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})}}),HA=$(`$ZodCheckEndsWith`,(e,t)=>{EA.init(e,t);let n=RegExp(`.*${DO(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})}}),UA=$(`$ZodCheckOverwrite`,(e,t)=>{EA.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),WA=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(`
|
|
52
|
+
`);n=r.pop()??``;for(let e of r)t.enqueue(e)}}))}function nE(e){let t=tE(e),n=!1;return t.pipeThrough(new TransformStream({transform(e,t){if(n){let n=JSON.parse(e);t.enqueue(n)}else{let r=JSON.parse(e);t.enqueue(r),n=!0}}}))}function rE(e){let t=new Map;function n(){return Array.from(t.values()).every(e=>e.closed)}function r(){let t,r=new ReadableStream({start(e){t=e}}),i={enqueue:e=>t.enqueue(e),close:()=>{t.close(),a(),n()&&e.abort()},closed:!1,getReaderResource:()=>{let e=r.getReader();return IT(e,()=>{i.close(),e.releaseLock()})},error:e=>{t.error(e),a()}};function a(){Object.assign(i,{closed:!0,close:()=>{},enqueue:()=>{},getReaderResource:null,error:()=>{}})}return i}function i(e){let n=t.get(e);return n||(n=r(),t.set(e,n)),n}function a(e){for(let n of t.values())n.error(e)}function o(){for(let e of t.values())e.close()}return{getOrCreate:i,cancelAll:a,closeAll:o}}async function iE(e){let{deserialize:t=e=>e}=e,n=nE(e.from);t&&(n=n.pipeThrough(new TransformStream({transform(e,n){n.enqueue(t(e))}})));let r=GT(),i=rE(e.abortController);function a(t){let[n,r,a]=t,s=i.getOrCreate(a);switch(r){case KT:return oT(async()=>{try{var t=BT();let{value:n}=await t.u(s.getReaderResource()).read(),[r,i,a]=n;switch(i){case JT:return o(a);case YT:throw e.formatError?.call(e,{error:a})??new $T(a)}}catch(e){t.e=e}finally{t.d()}});case qT:return oT(UT(function*(){try{var t=BT();let n=t.u(s.getReaderResource());for(;;){let{value:t}=yield HT(n.read()),[r,i,a]=t;switch(i){case ZT:yield o(a);break;case XT:return o(a);case QT:throw e.formatError?.call(e,{error:a})??new $T(a)}}}catch(e){t.e=e}finally{t.d()}}))}}function o(e){let[[t],...n]=e;for(let e of n){let[n]=e,r=a(e);if(n===null)return r;t[n]=r}return t}let s=()=>{r&&=(r.reject(Error(`Stream closed before head was received`)),null),i.closeAll()},c=e=>{r?.reject(e),r=null,i.cancelAll(e)};return n.pipeTo(new WritableStream({write(e){if(r){let t=e;for(let[n,r]of Object.entries(e))t[n]=o(r);r.resolve(t),r=null;return}let t=e,[n]=t;i.getOrCreate(n).enqueue(t)},close:s,abort:c})).catch(t=>{var n;(n=e.onError)==null||n.call(e,{error:t}),c(t)}),[await r.promise]}var aE=`ping`,oE=`serialized-error`,sE=`connected`,cE=`return`;async function lE(e){try{var t=BT();let n=t.u(zT(e.timeoutMs)),r=await OT.race([e.promise,n.start()]);return r===RT?await e.onTimeout():r}catch(e){t.e=e}finally{t.d()}}function uE(e){let{deserialize:t=e=>e}=e,n=rT(),r=e.signal,i=null,a=()=>new ReadableStream({async start(a){let[o,s]=await Promise.all([e.url(),e.init()]),c=i=new e.EventSource(o,s);a.enqueue({type:`connecting`,eventSource:i,event:null}),c.addEventListener(sE,e=>{let t=JSON.parse(e.data);n=t,a.enqueue({type:`connected`,options:t,eventSource:c})}),c.addEventListener(oE,e=>{let n=e;a.enqueue({type:`serialized-error`,error:t(JSON.parse(n.data)),eventSource:c})}),c.addEventListener(aE,()=>{a.enqueue({type:`ping`,eventSource:c})}),c.addEventListener(cE,()=>{c.close(),a.close(),i=null}),c.addEventListener(`error`,e=>{c.readyState===c.CLOSED?a.error(e):a.enqueue({type:`connecting`,eventSource:c,event:e})}),c.addEventListener(`message`,e=>{let n=e,r={data:t(JSON.parse(n.data))};n.lastEventId&&(r.id=n.lastEventId),a.enqueue({type:`data`,data:r,eventSource:c})});let l=()=>{try{c.close(),a.close()}catch{}};r.aborted?l():r.addEventListener(`abort`,l)},cancel(){i?.close()}}),o=()=>{let e=a(),t=e.getReader();async function n(){await t.cancel(),i=null}return LT({read(){return t.read()},async recreate(){await n(),e=a(),t=e.getReader()}},n)};return oT(UT(function*(){try{var e=BT();let t=e.a(o());for(;;){let e=t.read(),r=n.reconnectAfterInactivityMs;r&&(e=lE({promise:e,timeoutMs:r,onTimeout:async()=>{let e={value:{type:`timeout`,ms:r,eventSource:i},done:!1};return await t.recreate(),e}}));let a=yield HT(e);if(a.done)return a.value;yield a.value}}catch(t){e.e=t}finally{yield HT(e.d())}}))}function dE(e){return e instanceof mE}function fE(e){return tT(e)&&tT(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function pE(e,t){return typeof e==`string`?e:tT(e)&&typeof e.message==`string`?e.message:t}var mE=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),Qw(this,`cause`,void 0),Qw(this,`shape`,void 0),Qw(this,`data`,void 0),Qw(this,`meta`,void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(i=n.result)==null?void 0:i.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return dE(r)?(n.meta&&(r.meta=eT(eT({},r.meta),n.meta)),r):fE(r)?new e(r.error.message,eT(eT({},n),{},{result:r,cause:n.cause})):new e(pE(r,`Unknown error`),eT(eT({},n),{},{cause:r}))}};function hE(e){let t=e;return t?`input`in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}var gE=e=>typeof e==`function`;function _E(e){if(e)return e;if(typeof window<`u`&&gE(window.fetch))return window.fetch.bind(window);if(typeof globalThis<`u`&&gE(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}function vE(...e){let t=new AbortController,n=e.length,r=0,i=()=>{++r===n&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener(`abort`,i,{once:!0});return t.signal}function yE(...e){let t=new AbortController;for(let n of e)n?.aborted?t.abort():n?.addEventListener(`abort`,()=>t.abort(),{once:!0});return t.signal}function bE(e){return{url:e.url.toString(),fetch:e.fetch,transformer:hE(e.transformer),methodOverride:e.methodOverride}}function xE(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];t[n]=r}return t}var SE={query:`GET`,mutation:`POST`,subscription:`PATCH`};function CE(e){return`input`in e?e.transformer.input.serialize(e.input):xE(e.inputs.map(t=>e.transformer.input.serialize(t)))}var wE=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+e.path,r=[];if(t[1]&&r.push(t[1]),`inputs`in e&&r.push(`batch=1`),e.type===`query`||e.type===`subscription`){let t=CE(e);t!==void 0&&e.methodOverride!==`POST`&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},TE=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=CE(e);return t===void 0?void 0:JSON.stringify(t)},EE=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},DE=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new EE};async function OE(e){DE(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??SE[e.type],i=await(async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a=eT(eT(eT({},e.contentTypeHeader&&r!==`GET`?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),i);return _E(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:a})}var kE=()=>{throw Error(`Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new`)};function AE(e){let t=null,n=null,r=()=>{clearTimeout(n),n=null,t=null};function i(t){let n=[[]],r=0;for(;;){let o=t[r];if(!o)break;let s=n[n.length-1];if(o.aborted){var i;(i=o.reject)==null||i.call(o,Error(`Aborted`)),r++}else if(e.validate(s.concat(o).map(e=>e.key)))s.push(o),r++;else if(s.length===0){var a;(a=o.reject)==null||a.call(o,Error(`Input is too big for a single dispatch`)),r++}else n.push([])}return n}function a(){let n=i(t);r();for(let t of n){if(!t.length)continue;let n={items:t};for(let e of t)e.batch=n;e.fetch(n.items.map(e=>e.key)).then(async e=>{await Promise.all(e.map(async(e,t)=>{let r=n.items[t];try{var i;let t=await Promise.resolve(e);(i=r.resolve)==null||i.call(r,t)}catch(e){var a;(a=r.reject)==null||a.call(r,e)}r.batch=null,r.reject=null,r.resolve=null}));for(let e of n.items){var t;(t=e.reject)==null||t.call(e,Error(`Missing result`)),e.batch=null}}).catch(e=>{for(let r of n.items){var t;(t=r.reject)==null||t.call(r,e),r.batch=null}})}}function o(e){let r={aborted:!1,key:e,batch:null,resolve:kE,reject:kE},i=new Promise((e,n)=>{r.reject=n,r.resolve=e,t??=[],t.push(r)});return n??=setTimeout(a),i}return{load:o}}var jE=(e,...t)=>typeof e==`function`?e(...t):e;function ME(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function NE(e){let t=await jE(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function PE(e,t){let n={method:`connectionParams`,data:await jE(e)};return t.encode(n)}function FE(e){let{promise:t,resolve:n,reject:r}=ME();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}function IE(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function a(){r=setTimeout(()=>{e.send(`PING`),i=setTimeout(()=>{e.close()},n)},t)}function o(){clearTimeout(r),a()}function s(){clearTimeout(i),o()}e.addEventListener(`open`,a),e.addEventListener(`message`,({data:e})=>{clearTimeout(r),a(),e===`PONG`&&s()}),e.addEventListener(`close`,()=>{clearTimeout(r),clearTimeout(i)})}Qw(class e{constructor(t){if(Qw(this,`id`,++e.connectCount),Qw(this,`WebSocketPonyfill`,void 0),Qw(this,`urlOptions`,void 0),Qw(this,`keepAliveOpts`,void 0),Qw(this,`encoder`,void 0),Qw(this,`wsObservable`,Ww(null)),Qw(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++e.connectCount;let t=NE(this.urlOptions).then(e=>new this.WebSocketPonyfill(e));this.openPromise=t.then(async e=>{this.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)}),this.keepAliveOpts.enabled&&IE(e,this.keepAliveOpts),e.addEventListener(`close`,()=>{this.ws===e&&(this.ws=null)}),await FE(e),this.urlOptions.connectionParams&&e.send(await PE(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var e;(e=this.ws)==null||e.close()}}},`connectCount`,0);var LE=class{constructor(e){Qw(this,`links`,void 0),Qw(this,`runtime`,void 0),Qw(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return Kw({links:this.links,op:eT(eT({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(Uw())}async requestAsPromise(e){try{return(await Hw(this.$request(e))).result.data}catch(e){throw mE.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var i;(i=n.onStopped)==null||i.call(n);break;case`data`:case void 0:var a;(a=n.onData)==null||a.call(n,e.result.data)}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}},RE=Symbol.for(`trpc_untypedClient`),zE={query:`query`,mutate:`mutation`,subscribe:`subscription`},BE=e=>zE[e];function VE(e){let t=fT(({path:t,args:n})=>{let r=[...t],i=BE(r.pop()),a=r.join(`.`);return e[i](a,...n)});return pT(n=>n===RE?e:t[n])}function HE(e){return VE(new LE(e))}function UE(e){return e[RE]}function WE(e){let t=bE(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{let i=i=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;let a=e.map(e=>e.path).join(`,`),o=e.map(e=>e.input);return wE(eT(eT({},t),{},{type:i,path:a,inputs:o,signal:null})).length<=n},async fetch(n){let r=n.map(e=>e.path).join(`,`),a=n.map(e=>e.input),o=vE(...n.map(e=>e.signal)),s=new AbortController,c=await OE(eT(eT({},t),{},{signal:yE(o,s.signal),type:i,contentTypeHeader:`application/json`,trpcAcceptHeader:`application/jsonl`,trpcAcceptHeaderKey:e.streamHeader??`trpc-accept`,getUrl:wE,getBody:TE,inputs:a,path:r,headers(){return e.headers?typeof e.headers==`function`?e.headers({opList:n}):e.headers:{}}}));if(!c.ok){let e=await c.json();return`error`in e&&(e.error=t.transformer.output.deserialize(e.error)),n.map(()=>Promise.resolve({json:e,meta:{response:c}}))}let[l]=await iE({from:c.body,deserialize:e=>t.transformer.output.deserialize(e),formatError(e){let t=e.error;return mE.from({error:t})},abortController:s});return Object.keys(n).map(async e=>{let t=await Promise.resolve(l[e]);if(`result`in t){let e=await Promise.resolve(t.result);t={result:{data:await Promise.resolve(e.data)}}}return{json:t,meta:{response:c}}})}}),a={query:AE(i(`query`)),mutation:AE(i(`mutation`))};return({op:e})=>Bw(t=>{if(e.type===`subscription`)throw Error("Subscriptions are unsupported by `httpBatchStreamLink` - use `httpSubscriptionLink` or `wsLink`");let n=new AbortController,r=a[e.type].load(eT(eT({},e),{},{signal:yE(e.signal,n.signal)})),i=!1,o;return r.then(e=>{i=!0,o=e,`error`in e.json?t.error(mE.from(e.json,{meta:e.meta})):(`result`in e.json&&t.next({context:e.meta,result:e.json.result}),t.complete())}).catch(e=>{i=!0,t.error(mE.from(e,{meta:o?.meta}))}),()=>{i||n.abort()}})}}function GE(e,t){return!t||e!=null&&typeof e!=`object`?e:eT(eT({},e??{}),{},{lastEventId:t})}function KE(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new qE(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function qE(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return qE=function(e){this.s=e,this.n=e.next},qE.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new qE(e)}async function JE(e){let t=await jE(e.url);if(e.connectionParams){let n=await jE(e.connectionParams),r=t.includes(`?`)?`&`:`?`;t+=r+`connectionParams=`+encodeURIComponent(JSON.stringify(n))}return t}function YE(e){let t=hE(e.transformer);return()=>({op:n})=>Bw(r=>{let{type:i,path:a,input:o}=n;if(i!==`subscription`)throw Error(`httpSubscriptionLink only supports subscriptions`);let s,c=new AbortController,l=uE({url:async()=>wE({transformer:t,url:await JE(e),input:GE(o,s),path:a,type:i,signal:null}),init:()=>jE(e.eventSourceOptions,{op:n}),signal:yE(n.signal,c.signal),deserialize:e=>t.output.deserialize(e),EventSource:e.EventSource??globalThis.EventSource}),u=Ww({type:`state`,state:`connecting`,error:null}),d=u.subscribe({next(e){r.next({result:e})}});return oT(async()=>{var e=!1,t=!1,n;try{for(var i=KE(l),a;e=!(a=await i.next()).done;e=!1){let e=a.value;switch(e.type){case`ping`:break;case`data`:let t=e.data,n;t.id?(s=t.id,n={id:t.id,data:t}):n={data:t.data},r.next({result:n,context:{eventSource:e.eventSource}});break;case`connected`:r.next({result:{type:`started`},context:{eventSource:e.eventSource}}),u.next({type:`state`,state:`pending`,error:null});break;case`serialized-error`:{let t=mE.from({error:e.error});if(cT.includes(e.error.code)){u.next({type:`state`,state:`connecting`,error:t});break}throw t}case`connecting`:{let t=u.get(),n=e.event&&mE.from(e.event);if(!n&&t.state===`connecting`)break;u.next({type:`state`,state:`connecting`,error:n});break}case`timeout`:u.next({type:`state`,state:`connecting`,error:new mE(`Timeout of ${e.ms}ms reached while waiting for a response`)})}}}catch(e){t=!0,n=e}finally{try{e&&i.return!=null&&await i.return()}finally{if(t)throw n}}r.next({result:{type:`stopped`}}),u.next({type:`state`,state:`idle`,error:null}),r.complete()}).catch(e=>{r.error(mE.from(e))}),()=>{r.complete(),c.abort(),d.unsubscribe()}})}function XE(e,t){this.v=e,this.k=t}function ZE(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof XE;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`?`return`:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(a.done?`return`:`normal`,n)},function(e){r(`throw`,e)})}catch(e){i(`throw`,e)}}function i(e,i){switch(e){case`return`:t.resolve({value:i,done:!0});break;case`throw`:t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ZE.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ZE.prototype.next=function(e){return this._invoke(`next`,e)},ZE.prototype.throw=function(e){return this._invoke(`throw`,e)},ZE.prototype.return=function(e){return this._invoke(`return`,e)};function QE(e){"@babel/helpers - typeof";return QE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QE(e)}function $E(e,t){if(QE(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QE(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function eD(e){var t=$E(e,`string`);return QE(t)==`symbol`?t:t+``}function tD(e,t,n){return(t=eD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nD(Object(n),!0).forEach(function(t){tD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iD(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new aD(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function aD(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return aD=function(e){this.s=e,this.n=e.next},aD.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new aD(e)}function oD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function sD(e,t){if(e==null)return{};var n,r,i=oD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var cD=[`cursor`,`direction`];function lD(e){return{path:e.path.join(`.`)}}function uD(e){return e.length>=3}function dD(e){return uD(e)?{type:`prefixed`,prefix:e[0],path:e[1],args:e[2]}:{type:`unprefixed`,prefix:void 0,path:e[0],args:e[1]}}function fD(e,t,n){let r=dD(e),i=r.args?.input;return n&&(i=rD(rD(rD({},r.args?.input??{}),n.pageParam===void 0?{}:{cursor:n.pageParam}),{},{direction:n.direction})),[r.path.join(`.`),i,t?.trpc]}async function pD(e,t,n){let r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:`success`});let i=[];var a=!1,o=!1,s;try{for(var c=iD(e),l;a=!(l=await c.next()).done;a=!1){let e=l.value;i.push(e),r.setState({data:[...i]})}}catch(e){o=!0,s=e}finally{try{a&&c.return!=null&&await c.return()}finally{if(o)throw s}}return i}function mD(e){let t=oT(()=>{let{input:t,type:n}=e,r=e.path.flatMap(e=>e.split(`.`));if(!t&&n===`any`)return r.length?[r]:[];if(n===`infinite`&&tT(t)&&(`direction`in t||`cursor`in t)){let{cursor:e,direction:n}=t;return[r,{input:sD(t,cD),type:`infinite`}]}return[r,rD(rD({},t!==void 0&&t!==gv&&{input:t}),n&&n!==`any`&&{type:n})]});return e.prefix&&t.unshift([e.prefix]),t}function hD(e){let t=[e.path.flatMap(e=>e.split(`.`))];return e.prefix&&t.unshift([e.prefix]),t}function gD(e){return nT(e)?e():e}function _D(e){let{input:t,query:n,path:r,queryKey:i,opts:a}=e,o=t===gv;return Object.assign(py(rD(rD({},a??{}),{},{queryKey:i,queryFn:o?gv:async e=>{var t;let r=rD(rD({},a),{},{trpc:rD(rD({},a?.trpc),a!=null&&(t=a.trpc)!=null&&t.abortOnUnmount?{signal:e.signal}:{signal:null})});return await n(...fD(i,r,{direction:e.direction,pageParam:e.pageParam}))},initialPageParam:a?.initialCursor??t?.cursor})),{trpc:lD({path:r})})}function vD(e){let{mutate:t,path:n,prefix:r,opts:i,overrides:a}=e,o=gD(e.queryClient),s=hD({path:n,prefix:i?.keyPrefix??r}),c=o.defaultMutationOptions(o.getMutationDefaults(s)),l=a?.onSuccess??(e=>e.originalFn());return rD(rD({},i),{},{mutationKey:s,mutationFn:async e=>await t(...fD([...s,{input:e}],i)),onSuccess(...e){return l({originalFn:()=>{var t,n;return(i==null||(t=i.onSuccess)==null?void 0:t.call(i,...e))??(c==null||(n=c.onSuccess)==null?void 0:n.call(c,...e))},queryClient:o,meta:i?.meta??c?.meta??{}})},trpc:lD({path:n})})}function yD(e){let{input:t,query:n,path:r,queryKey:i,opts:a}=e,o=gD(e.queryClient),s=t===gv;return Object.assign(fy(rD(rD({},a),{},{queryKey:i,queryFn:s?gv:async e=>{var t;let r=rD(rD({},a),{},{trpc:rD(rD({},a?.trpc),a!=null&&(t=a.trpc)!=null&&t.abortOnUnmount?{signal:e.signal}:{signal:null})}),i=e.queryKey,s=await n(...fD(i,r));return aT(s)?pD(s,o,i):s}})),{trpc:lD({path:r})})}var bD=e=>{let{subscribe:t,path:n,queryKey:r,input:i,opts:a={}}=e,o=`enabled`in a?!!a.enabled:i!==gv;return rD(rD({},a),{},{enabled:o,subscribe:e=>t(n.join(`.`),i===gv?void 0:i,e),queryKey:r,trpc:lD({path:n})})};function xD(e){let t=C.useRef(e);t.current=e;let n=C.useRef(new Set([])),r=C.useCallback(e=>{n.current.add(e)},[]),i=C.useRef(()=>{}),a=C.useCallback(()=>{var n;if((n=i.current)==null||n.call(i),u(o),!e.enabled)return;let r=e.subscribe({onStarted:()=>{var e,n;(e=(n=t.current).onStarted)==null||e.call(n),u(e=>rD(rD({},e),{},{status:`pending`,error:null}))},onData:e=>{var n,r;(n=(r=t.current).onData)==null||n.call(r,e),u(t=>rD(rD({},t),{},{status:`pending`,data:e,error:null}))},onError:e=>{var n,r;(n=(r=t.current).onError)==null||n.call(r,e),u(t=>rD(rD({},t),{},{status:`error`,error:e}))},onConnectionStateChange:e=>{var n,r;(n=(r=t.current).onConnectionStateChange)==null||n.call(r,e),u(t=>{switch(e.state){case`connecting`:return rD(rD({},t),{},{status:`connecting`,error:e.error});case`pending`:return t;case`idle`:return rD(rD({},t),{},{status:`idle`,data:void 0,error:null})}})}});i.current=()=>{r.unsubscribe()}},[iv(e.queryKey),e.enabled]),o=C.useCallback(()=>e.enabled?{data:void 0,error:null,status:`connecting`,reset:a}:{data:void 0,error:null,status:`idle`,reset:a},[e.enabled,a]),s=C.useRef(o()),[c,l]=C.useState(SD(s,r));c.reset=a;let u=C.useCallback(e=>{let t=s.current,i=s.current=e(t),a=!1;for(let e of n.current)if(t[e]!==i[e]){a=!0;break}a&&l(SD(s,r))},[r]);return C.useEffect(()=>{if(e.enabled)return a(),()=>{var e;(e=i.current)==null||e.call(i)}},[a,e.enabled]),c}function SD(e,t){return new Proxy(e.current,{get(n,r){return t(r),e.current[r]}})}function CD(e){let t=e.keyPrefix,n=t=>(n,r,i)=>`router`in e?Promise.resolve(gD(e.ctx)).then(i=>wT({router:e.router,path:n,getRawInput:async()=>r,ctx:i,type:t,signal:void 0,batchIndex:0})):(e.client instanceof LE?e.client:UE(e.client))[t](n,r,i);return fT(({args:r,path:i})=>{let a=[...i],o=a.pop(),[s,c]=r;return{"~types":void 0,pathKey:()=>mD({path:a,type:`any`,prefix:t}),pathFilter:()=>rD(rD({},s),{},{queryKey:mD({path:a,type:`any`,prefix:t})}),queryOptions:()=>yD({input:s,opts:c,path:a,queryClient:e.queryClient,queryKey:mD({path:a,input:s,type:`query`,prefix:t}),query:n(`query`)}),queryKey:()=>mD({path:a,input:s,type:`query`,prefix:t}),queryFilter:()=>rD(rD({},c),{},{queryKey:mD({path:a,input:s,type:`query`,prefix:t})}),infiniteQueryOptions:()=>_D({input:s,opts:c,path:a,queryClient:e.queryClient,queryKey:mD({path:a,input:s,type:`infinite`,prefix:t}),query:n(`query`)}),infiniteQueryKey:()=>mD({path:a,input:s,type:`infinite`,prefix:t}),infiniteQueryFilter:()=>rD(rD({},c),{},{queryKey:mD({path:a,input:s,type:`infinite`,prefix:t})}),mutationOptions:()=>vD({opts:s,path:a,prefix:t,queryClient:e.queryClient,mutate:n(`mutation`),overrides:e.overrides?.mutations}),mutationKey:()=>hD({path:a,prefix:t}),subscriptionOptions:()=>bD({opts:c,path:a,input:s,queryKey:mD({path:a,input:s,type:`any`,prefix:t}),subscribe:n(`subscription`)})}[o]()})}function wD(){let e=C.createContext(null),t=C.createContext(null),n=n=>{let r=C.useMemo(()=>CD({client:n.trpcClient,queryClient:n.queryClient,keyPrefix:n.keyPrefix}),[n.trpcClient,n.queryClient,n.keyPrefix]);return C.createElement(e.Provider,{value:n.trpcClient},C.createElement(t.Provider,{value:r},n.children))};n.displayName=`TRPCProvider`;function r(){let e=C.useContext(t);if(!e)throw Error(`useTRPC() can only be used inside of a <TRPCProvider>`);return e}function i(){let t=C.useContext(e);if(!t)throw Error(`useTRPCClient() can only be used inside of a <TRPCProvider>`);return t}return{TRPCProvider:n,useTRPC:r,useTRPCClient:i}}var{TRPCProvider:TD,useTRPC:ED,useTRPCClient:DD}=wD(),OD=new Qv({defaultOptions:{queries:{staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1,retry:(e,t)=>e<2&&!/NOT_FOUND|UNAUTHORIZED|FORBIDDEN/.test(String(t))}}}),kD=HE({links:[Jw({condition:e=>e.type===`subscription`,true:YE({url:`/trpc`}),false:WE({url:`/trpc`,maxURLLength:4e3})})]}),AD={style:`currency`,currency:`USD`,currencyDisplay:`narrowSymbol`},jD=new Intl.NumberFormat(`fr`,{...AD,minimumFractionDigits:2}),MD=new Intl.NumberFormat(`fr`,{...AD,maximumFractionDigits:4}),ND=new Intl.NumberFormat(`fr`,{notation:`compact`,maximumFractionDigits:1}),PD=new Intl.NumberFormat(`fr`),FD=e=>e>0&&e<.01?`< ${jD.format(.01)}`:jD.format(e),ID=e=>`${PD.format(e)} appel${e>1?`s`:``}`,LD={graphql:`GraphQL`,core:`REST`,search:`Recherche`};function RD(){let e=ED(),t=dy({...e.rateLimit.queryOptions(),refetchInterval:3e4}),n=dy({...e.ai.usage.queryOptions(),refetchInterval:3e4}),r=t.data?.find(e=>e.resource===`graphql`),i=r&&r.limit>0?Math.round(r.remaining/r.limit*100):null,a=i===null?`gray`:i<10?`red`:i<30?`yellow`:`teal`;return(0,G.jsxs)(X,{gap:`md`,wrap:`nowrap`,children:[i!==null&&(0,G.jsx)(Gh,{label:(0,G.jsxs)(tg,{gap:2,children:[(0,G.jsx)(Z,{size:`xs`,fw:600,children:`Quota API GitHub restant`}),t.data?.map(e=>(0,G.jsxs)(Z,{size:`xs`,children:[LD[e.resource]??e.resource,` : `,PD.format(e.remaining),` /`,` `,PD.format(e.limit),` · réinitialisé à`,` `,new Date(e.resetAt).toLocaleTimeString(`fr`,{hour:`2-digit`,minute:`2-digit`})]},e.resource))]}),children:(0,G.jsxs)(X,{gap:6,wrap:`nowrap`,children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`GitHub`}),(0,G.jsx)(gh,{value:i,color:a,size:4,w:36,"aria-label":`Quota GitHub restant`}),(0,G.jsxs)(Z,{size:`xs`,c:i<30?a:`dimmed`,children:[i,` %`]})]})}),n.data&&n.data.total.calls>0&&(0,G.jsx)(Gh,{label:(0,G.jsxs)(tg,{gap:2,children:[(0,G.jsx)(Z,{size:`xs`,fw:600,children:`Coût de Claude (vue Intention)`}),(0,G.jsxs)(Z,{size:`xs`,children:[`Aujourd’hui : `,MD.format(n.data.today.costUsd),` · `,ID(n.data.today.calls)]}),(0,G.jsxs)(Z,{size:`xs`,children:[`Ce mois-ci : `,MD.format(n.data.month.costUsd),` · `,ID(n.data.month.calls),` ·`,` `,ND.format(n.data.month.inputTokens),` tokens lus,`,` `,ND.format(n.data.month.outputTokens),` écrits`]}),(0,G.jsxs)(Z,{size:`xs`,children:[`Depuis le début : `,MD.format(n.data.total.costUsd)]}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Modèle local : gratuit, non compté`})]}),children:(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`IA`,` `,(0,G.jsx)(Z,{span:!0,inherit:!0,c:`gray.4`,children:FD(n.data.month.costUsd)}),` `,`ce mois`]})})]})}function zD(){return(0,G.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}),(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}function BD(){let e=ED(),t=aC(),n=dy({...e.viewer.queryOptions(),staleTime:1/0,retry:!1}),r=dy({...e.inbox.get.queryOptions(),enabled:n.isSuccess}),i=(0,C.useMemo)(()=>{let e=[{id:`inbox`,label:`Inbox`,description:`Retour à la liste`,onClick:()=>void t({to:`/`})},{id:`settings`,label:`Paramètres`,description:`Repos et orgs suivis, modèle de la vue Intention`,onClick:()=>void t({to:`/settings`})}];for(let n of r.data?.prs??[])e.push({id:n.id,label:n.title,description:`${n.owner}/${n.repo}#${n.number} · ${n.author?.login??`ghost`}`,onClick:()=>void t({to:`/$owner/$repo/pull/$number`,params:{owner:n.owner,repo:n.repo,number:String(n.number)}})});return e},[r.data,t]);if(n.isPending)return(0,G.jsx)(Rp,{h:`100vh`,children:(0,G.jsx)(El,{})});if(n.isError){let e=n.error instanceof mE&&n.error.data==null;return(0,G.jsx)(Rp,{h:`100vh`,children:(0,G.jsxs)(tg,{align:`center`,maw:560,children:[(0,G.jsx)(Rg,{order:3,children:e?`Session absente`:`Erreur`}),e?(0,G.jsxs)(Z,{c:`dimmed`,ta:`center`,children:[`Ouvrez l’URL `,(0,G.jsx)(qp,{children:`/auth?token=…`}),` affichée dans le terminal au démarrage du serveur.`]}):(0,G.jsx)(Z,{c:`red`,children:n.error.message})]})})}return(0,G.jsxs)(`div`,{className:`app`,children:[(0,G.jsxs)(`header`,{className:`topbar`,children:[(0,G.jsxs)(tf,{component:bC,to:`/`,underline:`never`,c:`gray.3`,className:`brand`,"aria-label":`better-review`,children:[(0,G.jsx)(`img`,{src:`/favicon.svg`,alt:``,width:20,height:20}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`span`,{className:`brand-better`,children:`better`}),`review`]})]}),(0,G.jsxs)(Tc,{className:`topbar-search`,onClick:mw.open,children:[(0,G.jsx)(Z,{size:`sm`,c:`dimmed`,children:`Aller à une PR…`}),(0,G.jsx)(Em,{size:`xs`,children:`Ctrl K`})]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsxs)(X,{gap:`md`,children:[(0,G.jsx)(tf,{component:bC,to:`/settings`,size:`sm`,c:`dimmed`,children:(0,G.jsxs)(X,{gap:5,wrap:`nowrap`,children:[(0,G.jsx)(zD,{}),`Paramètres`]})}),(0,G.jsx)(RD,{}),(0,G.jsx)(Gh,{label:n.data.login,children:(0,G.jsx)(Cp,{src:n.data.avatarUrl,size:26})})]})]}),(0,G.jsx)(zw,{actions:i,nothingFound:`Aucun résultat`,highlightQuery:!0,limit:30,searchProps:{placeholder:`PR, repo, auteur…`},shortcut:[`mod + K`]}),(0,G.jsx)(FC,{})]})}var VD=new Intl.RelativeTimeFormat(`fr`,{numeric:`auto`,style:`short`}),HD=[[`year`,31536e6],[`month`,2592e6],[`week`,6048e5],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function UD(e,t=Date.now()){let n=(typeof e==`number`?e:Date.parse(e))-t;for(let[e,t]of HD)if(Math.abs(n)>=t)return VD.format(Math.round(n/t),e);return`à l’instant`}function WD(e,t=Date.now()){let n=t-Date.parse(e);return n>=864e5?`${Math.floor(n/864e5)} j`:n>=36e5?`${Math.floor(n/36e5)} h`:`${Math.max(1,Math.floor(n/6e4))} min`}var GD={APPROVED:{label:`approuvé`,color:`green`},CHANGES_REQUESTED:{label:`changements demandés`,color:`red`},COMMENTED:{label:`commenté`,color:`gray`},DISMISSED:{label:`rejeté`,color:`gray`},PENDING:{label:`en attente`,color:`yellow`},REQUESTED:{label:`demandé`,color:`yellow`}},KD={SUCCESS:{label:`CI ok`,color:`green`},FAILURE:{label:`CI en échec`,color:`red`},ERROR:{label:`CI en erreur`,color:`red`},PENDING:{label:`CI en cours`,color:`yellow`},EXPECTED:{label:`CI attendue`,color:`yellow`}},qD=[{stage:`draft`,title:`Brouillon`,hint:`pas encore prêtes à relire`},{stage:`waiting`,title:`En attente de review`,hint:`aucune review pour l’instant`},{stage:`review`,title:`En review`,hint:`commentaires, changements demandés`},{stage:`approved`,title:`Approuvée`,hint:`reste la CI ou des threads ouverts`},{stage:`ready`,title:`Prête à merger`,hint:`approuvée, CI ok, aucun thread ouvert`},{stage:`queued`,title:`Merge queue`,hint:`en file d’attente de merge`},{stage:`merged`,title:`Mergée`,hint:`ces dernières 24 h`}],JD={requested:{label:`review demandée`,color:`orange`,action:!0},rereview:{label:`à re-relire`,color:`orange`,action:!0},todo:{label:`retours à traiter`,color:`orange`,action:!0},mine:{label:`ma PR`,color:`blue`},involved:{label:`je participe`,color:`gray`},stale:{label:`stagnante`,color:`yellow`},unreviewed:{label:`sans reviewer`,color:`yellow`}},YD=[{value:`all`,label:`Toutes`,tags:null},{value:`reviewer`,label:`Reviewer`,tags:[`requested`,`rereview`,`involved`]},{value:`author`,label:`Auteur`,tags:[`mine`]},{value:`lead`,label:`Lead`,tags:[`stale`,`unreviewed`]}],XD=3e5,ZD=e=>e.tags.some(e=>JD[e].action),QD=e=>`${e.owner}/${e.repo}`,$D=(e,t)=>t===null||e.tags.some(e=>t.includes(e));function eO(e){let[t,n]=(0,C.useState)(()=>Date.now());return(0,C.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function tO(){let e=ED(),t=W_(),n=aC(),[r,i]=Ge({key:`br:boardGroup`,defaultValue:`all`,getInitialValueInEffect:!1}),a=YD.find(e=>e.value===r)??YD[0],[o,s]=Ge({key:`br:boardRepo`,defaultValue:null,getInitialValueInEffect:!1}),[c,l]=Ge({key:`br:boardFilter`,defaultValue:`all`,getInitialValueInEffect:!1}),u=c===`unread`||c===`unviewed`?c:`all`,d=dy({...e.inbox.get.queryOptions(),staleTime:3e4,refetchOnWindowFocus:!0,refetchInterval:XD}),[f,p]=(0,C.useState)(0),m=eO(3e4);xD(e.inbox.onChange.subscriptionOptions(void 0,{onData:()=>void t.invalidateQueries({queryKey:e.inbox.get.queryKey()})}));let h=d.data?.prs,g=a.tags,_=(0,C.useMemo)(()=>{let e=(h??[]).filter(e=>$D(e,g)&&(o===null||QD(e)===o)&&(u===`all`||(u===`unread`?e.unread:e.files!==void 0&&e.files.viewed<e.files.total)));return qD.map(t=>({...t,prs:e.filter(e=>e.stage===t.stage)}))},[h,g,o,u]),v=(0,C.useMemo)(()=>{let e=(h??[]).filter(e=>o===null||QD(e)===o);return Object.fromEntries(YD.map(t=>[t.value,e.filter(e=>$D(e,t.tags)).length]))},[h,o]),y=(0,C.useMemo)(()=>{let e=new Map;for(let t of h??[])e.set(QD(t),(e.get(QD(t))??0)+ +!!$D(t,g));return o!==null&&!e.has(o)&&e.set(o,0),[...e].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({value:e,label:e,count:t}))},[h,g,o]),b=new Map(y.map(e=>[e.value,e.count])),x=(0,C.useMemo)(()=>_.flatMap(e=>e.prs),[_]),S=e=>e&&void n({to:`/$owner/$repo/pull/$number`,params:{owner:e.owner,repo:e.repo,number:String(e.number)}});return lt([[`j`,()=>p(e=>Math.min(e+1,x.length-1))],[`k`,()=>p(e=>Math.max(e-1,0))],[`Enter`,()=>S(x[f])],[`o`,()=>x[f]&&window.open(x[f].url,`_blank`)]]),(0,G.jsxs)(`div`,{className:`board`,children:[(0,G.jsxs)(X,{gap:`sm`,mb:`sm`,wrap:`nowrap`,children:[(0,G.jsx)(Yh,{size:`xs`,value:a.value,onChange:i,data:YD.map(e=>({value:e.value,label:`${e.label} ${v[e.value]??0}`}))}),(0,G.jsx)(Zh,{size:`xs`,w:260,placeholder:`Tous les repos`,"aria-label":`Filtrer par repo`,searchable:!0,clearable:!0,value:o,data:y,onChange:s,renderOption:({option:e})=>(0,G.jsxs)(X,{gap:`xs`,justify:`space-between`,wrap:`nowrap`,w:`100%`,children:[(0,G.jsx)(Z,{size:`xs`,truncate:!0,children:e.label}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:b.get(e.value)??0})]}),comboboxProps:{width:`max-content`,position:`bottom-start`},nothingFoundMessage:`Aucun repo`}),(0,G.jsx)(Yh,{size:`xs`,value:u,onChange:l,data:[{value:`all`,label:`Toutes`},{value:`unread`,label:`Non lues`},{value:`unviewed`,label:`Non vues à 100 %`}]}),(0,G.jsx)(`div`,{style:{flex:1}}),d.data&&(0,G.jsx)(Gh,{label:new Date(d.data.fetchedAt).toLocaleString(`fr`),children:(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`synchro `,UD(d.data.fetchedAt,m)]})}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:`default`,loading:d.isFetching,onClick:()=>void d.refetch(),children:`Actualiser`}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[(0,G.jsx)(Em,{size:`xs`,children:`j`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`k`}),` naviguer · `,(0,G.jsx)(Em,{size:`xs`,children:`↵`}),` ouvrir ·`,` `,(0,G.jsx)(Em,{size:`xs`,children:`o`}),` GitHub`]})]}),d.isPending&&(0,G.jsx)(El,{}),d.isError&&(0,G.jsx)(Jd,{color:`red`,title:`Impossible de charger les PR`,children:d.error.message}),d.data&&!d.data.configured&&(0,G.jsxs)(Jd,{title:`Aucun repo suivi`,color:`blue`,mb:`sm`,children:[`Le tableau ne montre que les repos et orgs de votre liste.`,` `,(0,G.jsx)(tf,{component:bC,to:`/settings`,children:`Ajouter des repos`})]}),d.data?.truncated&&(0,G.jsx)(Jd,{color:`yellow`,variant:`light`,mb:`sm`,py:6,children:`Plus de 1000 PR ouvertes dans un repo / une org suivi : seules les 1000 plus récemment mises à jour sont affichées (limite de la recherche GitHub).`}),d.data&&(0,G.jsx)(`div`,{className:`board-columns`,children:_.map(e=>(0,G.jsxs)(`section`,{className:`board-column`,"data-stage":e.stage,children:[(0,G.jsxs)(X,{gap:6,className:`board-column-head`,children:[(0,G.jsx)(Z,{fw:600,size:`sm`,children:e.title}),(0,G.jsx)(Ep,{size:`sm`,variant:`light`,color:`gray`,children:e.prs.length}),e.prs.some(ZD)&&(0,G.jsx)(Gh,{label:`PR qui attendent une action de ma part`,children:(0,G.jsxs)(Ep,{size:`sm`,variant:`light`,color:`orange`,children:[e.prs.filter(ZD).length,` pour moi`]})})]}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,px:10,pb:6,children:e.hint}),(0,G.jsx)(`div`,{className:`board-cards`,children:e.prs.length===0?(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,ta:`center`,py:`md`,children:`Rien ici.`}):e.prs.map(e=>(0,G.jsx)(nO,{pr:e,selected:x[f]===e,now:m},e.id))})]},e.stage))})]})}function nO({pr:e,selected:t,now:n}){let r=(0,C.useRef)(null);(0,C.useEffect)(()=>{t&&r.current?.scrollIntoView({block:`nearest`})},[t]);let i=e.ci===void 0?void 0:e.ci===null?null:KD[e.ci];return(0,G.jsxs)(bC,{ref:r,to:`/$owner/$repo/pull/$number`,params:{owner:e.owner,repo:e.repo,number:String(e.number)},className:`pr-card`,"data-selected":t||void 0,"data-unread":e.unread||void 0,"data-action":ZD(e)||void 0,children:[(0,G.jsxs)(X,{gap:6,wrap:`nowrap`,justify:`space-between`,children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,truncate:!0,children:[e.owner,`/`,e.repo,` #`,e.number]}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,color:`gray`,"aria-label":`Ouvrir sur GitHub`,onClick:t=>{t.preventDefault(),t.stopPropagation(),window.open(e.url,`_blank`,`noopener`)},children:`↗`})]}),(0,G.jsx)(Z,{fw:600,size:`sm`,className:`clamp2`,children:e.title}),(0,G.jsxs)(X,{gap:6,mt:4,wrap:`nowrap`,children:[(0,G.jsx)(Cp,{src:e.author?.avatarUrl,size:18}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,truncate:!0,children:[e.author?.login??`ghost`,` ·`,` `,e.mergedAt?`mergée ${UD(e.mergedAt,n)}`:`${UD(e.updatedAt,n)} · ouverte depuis ${WD(e.createdAt,n)}`]})]}),e.tags.length>0&&(0,G.jsx)(X,{gap:4,mt:6,children:e.tags.map(e=>(0,G.jsx)(Ep,{size:`xs`,variant:JD[e].action?`filled`:`light`,color:JD[e].color,children:JD[e].label},e))}),(e.ci!==void 0||e.threads||e.additions!==void 0||e.files)&&(0,G.jsxs)(X,{gap:8,mt:6,wrap:`wrap`,children:[i!==void 0&&(0,G.jsx)(Z,{size:`xs`,c:i?.color?`${i.color}.4`:`dimmed`,children:i?.label??`pas de CI`}),e.threads&&e.threads.total>0&&(0,G.jsxs)(Z,{size:`xs`,c:e.threads.open>0?`yellow.4`:`dimmed`,children:[(0,G.jsx)(`i`,{className:`ico-c`}),e.threads.open,`/`,e.threads.total,e.tags.includes(`mine`)&&e.threads.awaitingMyReply>0?` · ${e.threads.awaitingMyReply} attendent ma réponse`:``]}),e.additions!==void 0&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[(0,G.jsxs)(Z,{span:!0,c:`green.4`,inherit:!0,children:[`+`,e.additions]}),` `,(0,G.jsxs)(Z,{span:!0,c:`red.4`,inherit:!0,children:[`−`,e.deletions]})]}),e.files&&(0,G.jsx)(Gh,{label:`${e.files.viewed} / ${e.files.total} fichiers marqués vus`,children:(0,G.jsx)(gh,{value:e.files.total===0?0:e.files.viewed/e.files.total*100,size:`sm`,w:44,color:`green`})})]}),(e.reviews.length>0||e.requested.length>0)&&(0,G.jsxs)(X,{gap:4,mt:6,children:[e.reviews.map(e=>(0,G.jsx)(Gh,{label:`${e.login} : ${GD[e.state]?.label??e.state}`,children:(0,G.jsx)(Ep,{size:`xs`,variant:`outline`,color:GD[e.state]?.color??`gray`,leftSection:(0,G.jsx)(Cp,{src:e.avatarUrl,size:12}),children:e.login})},e.login)),e.requested.map(e=>(0,G.jsx)(Gh,{label:`${e} : review demandée`,children:(0,G.jsxs)(Ep,{size:`xs`,variant:`outline`,color:`gray`,children:[e,` ?`]})},e))]})]})}function rO(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 iO(e,t=`|`){return e.map(e=>kO(e)).join(t)}function aO(e,t){return typeof t==`bigint`?t.toString():t}var oO=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 sO(e){return new oO(e)}function cO(e){return e==null}function lO(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function uO(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 dO(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fO(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function pO(e){return fO(e._zod.def)??e._zod.def.shape}function mO(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return dO(this,t,e),e},enumerable:!0,configurable:!0})}function hO(e,t,n){t in e?dO(e,t,n):e[t]=n}function gO(e,t,n,r){let i=pO(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?mO(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):hO(e,a,r?r(n.value,a):n.value))}}function _O(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?mO(e,n,()=>t[n]):hO(e,n,r.value))}}function vO(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function yO(e){return JSON.stringify(e)}function bO(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var xO=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function SO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var CO=sO(()=>{if(yk.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function wO(e){if(SO(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return SO(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function TO(e){return wO(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var EO=new Set([`string`,`number`,`symbol`]);function DO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function OO(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Q(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 kO(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function AO(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var jO={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},MO={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function NO(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 gO(i,e,PO(e,t)),OO(e,vO(n,{shape:i,checks:[]}))}function PO(e,t){let n=pO(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 FO(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(PO(e,t)),a={};return gO(a,e,Reflect.ownKeys(pO(e)).filter(e=>!i.has(e))),OO(e,vO(n,{shape:a,checks:[]}))}function IO(e,t){if(!wO(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=pO(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 OO(e,vO(e._zod.def,{shape:LO(e,t)}))}function LO(e,t){let n={};return gO(n,e,Reflect.ownKeys(pO(e))),_O(n,t),n}function RO(e,t){if(!wO(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return OO(e,vO(e._zod.def,{shape:LO(e,t)}))}function zO(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 gO(n,e,Reflect.ownKeys(pO(e))),gO(n,t,Reflect.ownKeys(pO(t))),OO(e,vO(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function BO(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(PO(t,n)):void 0,o={};return gO(o,t,Reflect.ownKeys(pO(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),OO(t,vO(t._zod.def,{shape:o,checks:[]}))}function VO(e,t,n){let r=n?new Set(PO(t,n)):void 0,i={};return gO(i,t,Reflect.ownKeys(pO(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),OO(t,vO(t._zod.def,{shape:i}))}function HO(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 UO(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 WO(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function GO(e){return typeof e==`string`?e:e?.message}function KO(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 qO(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function JO(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:GO(e.inst?._zod.def?.error?.(e))??GO(a?.(e))??GO(t?.error?.(e))??GO(n.customError?.(e))??GO(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 YO=/[\uD800-\uDBFF]/;function XO(e){let t=e.length;if(!YO.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 ZO(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function QO(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 $O(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function ek(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ik(e,n,r.value)}}function tk(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function nk(e,t,n){return tk(e,t,n,!1)}function rk(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return tk(this,n,r(this))},set(e){tk(this,n,e)}})}return t}function ik(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:tk(this,t,n.bind(this))},set(e){tk(this,t,e)}})}function ak(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var ok,sk=!1,ck={configurable:!0,get(){sk=!0}};function lk(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&ok!==e._zod?ok=void 0:(ok=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ck);let e=sk;sk=!1;try{let r=n(this);return sk?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),sk||=e,r}catch(n){throw delete this[t],sk||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function uk(e,t,n,r){let i=ak(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 dk=`~constantCatch`;function fk(e){let t=()=>e;return t[dk]=!0,t}var pk,mk={value:void 0,enumerable:!1},hk=`captureStackTrace`in Error?Error:null;function gk(e){let t=hk;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return hk=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function $(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){mk.value=new a(r);try{Object.defineProperty(n,"_zod",mk)}finally{mk.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),ek(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?gk(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 _k=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},vk=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(pk=globalThis).__zod_globalConfig??(pk.__zod_globalConfig={});var yk=globalThis.__zod_globalConfig;function bk(e){return e&&Object.assign(yk,e),yk}function xk(){let e=this._zod;return e.message??=JSON.stringify(e.def,aO,2),e.message}function Sk(e){this._zod.message=e}var Ck={get:xk,set:Sk,enumerable:!0,configurable:!0},wk={value:void 0,enumerable:!1},Tk=new WeakSet([Object.prototype,Error.prototype]),Ek=$(`$ZodError`,(e,t)=>{e.name=`$ZodError`,wk.value=t,Object.defineProperty(e,"issues",wk),wk.value=void 0,Object.defineProperty(e,"message",Ck);let n=Object.getPrototypeOf(e);Tk.has(n)||(Tk.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 Dk(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 Ok(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Dk(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function kk(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 Ak(e,t){return{callee:t?.callee??e,Err:t?.Err}}var jk=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 _k;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>JO(e,o,bk())));throw xO(n,a?.callee??t),n}return s.value};return t},Mk=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=>JO(e,o,bk())));throw xO(n,a?.callee??t),n}return s.value};return t},Nk=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 _k;return a.issues.length?Pk(e,a.issues,i):{success:!0,data:a.value}};function Pk(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>JO(e,n,bk()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Fk=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?Pk(e,a.issues,i):{success:!0,data:a.value}},Ik=Symbol.for(`zod.compile.invalid`),Lk=Symbol.for(`zod.compile.fallback`),Rk=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ik)return!0;if(r.definite===!0&&n===void 0)return!1}return zk(e,t,n)});function zk(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Lk]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new _k;return a.issues.length===0}var Bk=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},Vk=e=>{let t=jk(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ak(n,a))};return n},Hk=e=>{let t=jk(e),n=(e,r,i,a)=>t(e,r,i,Ak(n,a));return n},Uk=e=>{let t=Mk(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ak(n,a))};return n},Wk=e=>{let t=Mk(e),n=async(e,r,i,a)=>await t(e,r,i,Ak(n,a));return n},Gk=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Nk(e)(t,n,i)},Kk=e=>(t,n,r)=>Nk(e)(t,n,r),qk=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Fk(e)(t,n,i)},Jk=e=>async(t,n,r)=>Fk(e)(t,n,r),Yk=/^[cC][0-9a-z]{6,}$/,Xk=/^[0-9a-z]+$/,Zk=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Qk=/^[0-9a-vA-V]{20}$/,$k=/^[A-Za-z0-9]{27}$/,eA=/^[a-zA-Z0-9_-]{21}$/;function tA(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var nA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rA=/^([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})$/,iA=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)$/,aA=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,oA=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function sA(){return new RegExp(oA,`u`)}var cA=/^(?:(?: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])$/,lA=/^(([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}|:))$/,uA=/^((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])$/,dA=/^(([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])$/,fA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pA=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,mA=/^https?$/,hA=/^\+[1-9]\d{6,14}$/,gA=`(?:(?:\\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 _A(e){return RegExp(`^${e}$`)}var vA=_A(gA);function yA(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 bA(e){return RegExp(`^${yA(e)}$`)}function xA(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${yA({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${yA({precision:e.precision})}`:n;return RegExp(`^${gA}T(?:${r})$`)}var SA=/^[\s\S]{0,}$/,CA=/^-?\d+(?:\.\d+)?$/,wA=/^[^A-Z]*$/,TA=/^[^a-z]*$/,EA=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),DA=e=>{let t=e.value;return!cO(t)&&t.length!==void 0},OA={number:`number`,bigint:`bigint`,object:`date`},kA=$(`$ZodCheckLessThan`,(e,t)=>{EA.init(e,t);let n=OA[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:OA[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})}}),AA=$(`$ZodCheckGreaterThan`,(e,t)=>{EA.init(e,t);let n=OA[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:OA[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})}}),jA=$(`$ZodCheckMultipleOf`,(e,t)=>{EA.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):uO(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})}}),MA=$(`$ZodCheckNumberFormat`,(e,t)=>{EA.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=jO[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})}}),NA=$(`$ZodCheckMaxLength`,(e,t)=>{var n;EA.init(e,t),(n=e._zod.def).when??(n.when=DA),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?XO(r):i)<=t.maximum)return;let a=ZO(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),PA=$(`$ZodCheckMinLength`,(e,t)=>{var n;EA.init(e,t),(n=e._zod.def).when??(n.when=DA),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?XO(r):i)>=t.minimum)return;let a=ZO(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),FA=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;EA.init(e,t),(n=e._zod.def).when??(n.when=DA),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?XO(r):i;if(a===t.length)return;let o=ZO(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})}}),IA=$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;EA.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=()=>{})}),LA=$(`$ZodCheckRegex`,(e,t)=>{IA.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})}}),RA=$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=wA,IA.init(e,t)}),zA=$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=TA,IA.init(e,t)}),BA=$(`$ZodCheckIncludes`,(e,t)=>{EA.init(e,t);let n=DO(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})}}),VA=$(`$ZodCheckStartsWith`,(e,t)=>{EA.init(e,t);let n=RegExp(`^${DO(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})}}),HA=$(`$ZodCheckEndsWith`,(e,t)=>{EA.init(e,t);let n=RegExp(`.*${DO(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})}}),UA=$(`$ZodCheckOverwrite`,(e,t)=>{EA.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),WA=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(`
|
|
53
53
|
`).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(`
|
|
54
54
|
`)}\n};`)(...Object.values(this.closed))}},GA={major:4,minor:6,patch:7},KA=$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=GA;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=HO(t),a;for(let o of n){if(o._zod.def.when){if(UO(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 _k;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(qO(t.issues,n,e),i||=HO(t,n))});else{if(t.issues.length===n)continue;qO(t.issues,n,e),i||=HO(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(HO(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new _k;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 _k;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return nk(this,`~standard`,YA(this))},set"~standard"(e){tk(this,`~standard`,e)}}),qA=(e,t)=>e.issues.length?{issues:e.issues.map(e=>JO(e,t,bk()))}:{value:e.value};async function JA(e,t){let n={async:!0};return qA(await e._zod.run({value:t,issues:[]},n),n)}function YA(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return qA(r,n)}catch{}return JA(e,t)},vendor:`zod`,version:1}}var XA=$(`$ZodString`,(e,t)=>{KA.init(e,t),e._zod.pattern=t.pattern??SA,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}}),ZA=$(`$ZodStringFormat`,(e,t)=>{IA.init(e,t),XA.init(e,t)}),QA=$(`$ZodGUID`,(e,t)=>{t.pattern??=rA,ZA.init(e,t)}),$A=$(`$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??=iA(e)}else t.pattern??=iA();ZA.init(e,t)}),ej=$(`$ZodEmail`,(e,t)=>{t.pattern??=aA,ZA.init(e,t)});function tj(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function nj(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?tj(e)||2:rj(e,t)}function rj(e,t){if(!t.normalize&&t.protocol?.source===mA.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 ij=/[\t\n\r]/g;function aj(e){return e.replace(ij,``)}function oj(e,t){return t.lastIndex=0,t.test(e.hostname)}function sj(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var cj=$(`$ZodURL`,(e,t)=>{ZA.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=nj(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=aj(r);return}t.hostname&&!oj(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&&!sj(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:aj(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),lj=$(`$ZodEmoji`,(e,t)=>{t.pattern??=sA(),ZA.init(e,t)}),uj=$(`$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?eA:tA(t.length),ZA.init(e,t)}),dj=$(`$ZodCUID`,(e,t)=>{t.pattern??=Yk,ZA.init(e,t)}),fj=$(`$ZodCUID2`,(e,t)=>{t.pattern??=Xk,ZA.init(e,t)}),pj=$(`$ZodULID`,(e,t)=>{t.pattern??=Zk,ZA.init(e,t)}),mj=$(`$ZodXID`,(e,t)=>{t.pattern??=Qk,ZA.init(e,t)}),hj=$(`$ZodKSUID`,(e,t)=>{t.pattern??=$k,ZA.init(e,t)}),gj=$(`$ZodISODateTime`,(e,t)=>{t.pattern??=xA(t),ZA.init(e,t)}),_j=$(`$ZodISODate`,(e,t)=>{t.pattern??=vA,ZA.init(e,t)}),vj=$(`$ZodISOTime`,(e,t)=>{t.pattern??=bA(t),ZA.init(e,t)}),yj=$(`$ZodISODuration`,(e,t)=>{t.pattern??=nA,ZA.init(e,t)}),bj=$(`$ZodIPv4`,(e,t)=>{t.pattern??=cA,ZA.init(e,t)}),xj=/^[0-9a-fA-F:.]+$/;function Sj(e){return xj.test(e)?tj(`http://[${e}]`):!1}var Cj=$(`$ZodIPv6`,(e,t)=>{t.pattern??=lA,ZA.init(e,t),e._zod.check=n=>{Sj(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),wj=$(`$ZodCIDRv4`,(e,t)=>{t.pattern??=uA,ZA.init(e,t)});function Tj(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:Sj(n)}var Ej=$(`$ZodCIDRv6`,(e,t)=>{t.pattern??=dA,ZA.init(e,t),e._zod.check=n=>{Tj(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Dj(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Oj=/^[0-9a-zA-Z+/]*={0,2}$/,kj=$(`$ZodBase64`,(e,t)=>{t.pattern??=Oj,ZA.init(e,t),e._zod.check=n=>{Dj(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Aj=/^[A-Za-z0-9_-]*$/;function jj(e){if(!Aj.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Dj(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Mj=$(`$ZodBase64URL`,(e,t)=>{t.pattern??=Aj,ZA.init(e,t),e._zod.check=n=>{jj(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Nj=$(`$ZodE164`,(e,t)=>{t.pattern??=hA,ZA.init(e,t)});function Pj(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 Fj=$(`$ZodJWT`,(e,t)=>{ZA.init(e,t),e._zod.check=n=>{Pj(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Ij=$(`$ZodNumber`,(e,t)=>{KA.init(e,t),e._zod.pattern=CA,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}}),Lj=$(`$ZodNumberFormat`,(e,t)=>{MA.init(e,t),Ij.init(e,t)}),Rj=$(`$ZodUnknown`,(e,t)=>{KA.init(e,t),e._zod.parse=e=>e}),zj=$(`$ZodNever`,(e,t)=>{KA.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Bj(e,t){let n=KO(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 KO(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,qO(n.issues,t,e),n}}return i(n,a)}}var Vj=e=>Array.isArray(e)?e.length:-1;function Hj(e,t,n){e.issues.length&&t.issues.push(...WO(n,e.issues)),t.value[n]=e.value}var Uj=$(`$ZodArray`,(e,t)=>{KA.init(e,t);let n=yk.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=>Hj(t,r,e)));else if(Hj(c,r,e),s&&c.issues.length!==0&&HO(c))break}return o.length?Promise.all(o).then(()=>r):r},Bj(e,Vj)});function Wj(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(...WO(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 Gj=[];function Kj(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Gj,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=AO(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function qj(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(HO(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=>Wj(e,n,i,t,d,f))):Wj(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 Jj=$(`$ZodObject`,(e,t)=>{KA.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=sO(()=>Kj(t));lk(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)||dO(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=SO,o=t.catchall,s,c=yk.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(HO(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=>Wj(n,t,e,r,a,o))):Wj(s,t,e,r,a,o)}return o?qj(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Yj=$(`$ZodObjectJIT`,(e,t)=>{Jj.init(e,t);let n=e._zod.parse,r=sO(()=>Kj(t)),i=yk.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new WA([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
55
55
|
let ${e}_ab = false;
|
|
@@ -109,5 +109,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
109
109
|
`:``)+t+n.slice(o)),a(`write`),requestAnimationFrame(()=>i?.focus())},children:`± suggestion`})]}),(0,G.jsx)(Ag.Panel,{value:`write`,pt:6,children:(0,G.jsx)(Cm,{ref:c,autosize:!0,minRows:3,maxRows:18,autoFocus:e.autoFocus??!0,placeholder:e.placeholder??`Laisser un commentaire (Markdown)…`,value:n,onChange:e=>r(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&(t.ctrlKey||t.metaKey)?(t.preventDefault(),u(e.actions.length-1)):t.key===`Escape`&&(t.preventDefault(),e.onCancel?.())},styles:{input:{fontFamily:`var(--mantine-font-family-monospace)`,fontSize:13}}})}),(0,G.jsx)(Ag.Panel,{value:`preview`,pt:6,children:(0,G.jsxs)(Y,{mih:70,p:6,children:[n.trim()===``&&(0,G.jsx)(Z,{c:`dimmed`,children:`Rien à prévisualiser.`}),l.isFetching&&(0,G.jsx)(El,{size:`xs`}),l.data&&(0,G.jsx)(BI,{html:l.data})]})})]}),(0,G.jsxs)(X,{gap:6,mt:6,justify:`flex-end`,children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,mr:`auto`,children:[`brouillon conservé localement · `,(0,G.jsx)(Em,{size:`xs`,children:`Ctrl ↵`}),` envoyer · `,(0,G.jsx)(Em,{size:`xs`,children:`Esc`}),` `,`fermer`]}),e.onCancel&&(0,G.jsx)(Fp,{size:`compact-sm`,variant:`subtle`,color:`gray`,onClick:e.onCancel,children:`Annuler`}),e.actions.map((t,r)=>(0,G.jsx)(Fp,{size:`compact-sm`,variant:t.variant??(r===e.actions.length-1?`filled`:`default`),color:t.color,disabled:t.disabled||n.trim()===``,loading:o===r,onClick:()=>void u(r),children:t.label},t.label))]})]})}var HI=480/6e4,UI=1e3,WI=1e4;function GI(e){let t=e.split(/\s+/).filter(Boolean).length;return Math.round(Math.min(WI,UI+t/HI))}function KI(e,t,n){return{...e,threads:e.threads.map(e=>{let r=e.id===t?e.comments.findIndex(e=>e.id===n):-1;if(r===-1)return e;let i=e.comments.map((e,t)=>t<=r&&e.unread?{...e,unread:!1}:e);return{...e,comments:i,unread:i.filter(e=>e.unread).length}})}}function qI(e,t){let n=new Set(t);return{...e,timeline:e.timeline.map(e=>n.has(e.id)&&e.unread?{...e,unread:!1}:e)}}var JI=400;function YI({text:e,active:t,onRead:n}){let r=(0,C.useRef)(null),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(()=>document.visibilityState===`visible`),[c,l]=(0,C.useState)(!1),u=(0,C.useEffectEvent)(n);(0,C.useEffect)(()=>{let e=r.current?.closest(`.comment`)??r.current;if(!e)return;let t=new IntersectionObserver(([e])=>{if(!e)return;let t=e.rootBounds?.height??window.innerHeight;a(e.intersectionRatio>=.5||e.intersectionRect.height>=t/2)},{threshold:[0,.25,.5,.75,1]});return t.observe(e),()=>t.disconnect()},[]),(0,C.useEffect)(()=>{let e=()=>s(document.visibilityState===`visible`);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,C.useEffect)(()=>{if(!c)return;let e=!1,t=()=>{e||(e=!0,u())},n=setTimeout(t,JI);return()=>{clearTimeout(n),t()}},[c]);let d=t&&i&&o&&!c;return(0,G.jsx)(Gh,{label:c?`Lu`:`Se remplit pendant la lecture · clic : lu tout de suite`,openDelay:400,children:(0,G.jsxs)(Tc,{ref:r,className:`read-btn`,"data-done":c||void 0,"data-running":d||void 0,"aria-label":`Marquer comme lu`,onClick:()=>l(!0),children:[(0,G.jsx)(`span`,{className:`read-fill`,style:{animationDuration:`${GI(e)}ms`,animationPlayState:d?`running`:`paused`},onAnimationEnd:()=>l(!0)}),(0,G.jsx)(`span`,{className:`read-label`,children:c?`✓ Lu`:`Nouveau`})]})})}var XI=[{content:`THUMBS_UP`,emoji:`👍`,label:`+1`},{content:`THUMBS_DOWN`,emoji:`👎`,label:`-1`},{content:`LAUGH`,emoji:`😄`,label:`rire`},{content:`HOORAY`,emoji:`🎉`,label:`hourra`},{content:`CONFUSED`,emoji:`😕`,label:`perplexe`},{content:`HEART`,emoji:`❤️`,label:`cœur`},{content:`ROCKET`,emoji:`🚀`,label:`fusée`},{content:`EYES`,emoji:`👀`,label:`yeux`}],ZI=new Map(XI.map((e,t)=>[e.content,t]));function QI(e,t,n){let r=e.find(e=>e.content===t);return(r?.mine??!1)===n?[...e]:r?e.map(e=>e===r?{...e,count:e.count+(n?1:-1),mine:n}:e).filter(e=>e.count>0):[...e,{content:t,count:1,mine:!0}].sort((e,t)=>ZI.get(e.content)-ZI.get(t.content))}function $I(e,t){let n=e.logins.map(e=>e===t?`moi`:e),r=e.total-n.length;if(r>0){let e=`${r} ${n.length>0?`autre`:`personne`}${r>1?`s`:``}`;return n.length>0?`${n.join(`, `)} et ${e}`:e}return n.length<2?n.join(``):`${n.slice(0,-1).join(`, `)} et ${n.at(-1)}`}function eL(e,t,n){return e.pr.id===t?{...e,pr:{...e.pr,reactions:n(e.pr.reactions)}}:e.timeline.some(e=>e.id===t)?{...e,timeline:e.timeline.map(e=>e.id===t?{...e,reactions:n(e.reactions)}:e)}:{...e,threads:e.threads.map(e=>e.comments.some(e=>e.id===t)?{...e,comments:e.comments.map(e=>e.id===t?{...e,reactions:n(e.reactions)}:e)}:e)}}var tL=new Map(XI.map(e=>[e.content,e]));function nL({subjectId:e,reactions:t,onToggle:n}){let r=ED(),i=W_(),{me:a}=zI(),[o,s]=(0,C.useState)(!1),c=new Set(t.filter(e=>e.mine).map(e=>e.content)),l=r.pr.reactors.queryOptions({subjectId:e}),{data:u}=dy({...l,enabled:!1}),d=u!==void 0&&t.every(e=>u.find(t=>t.content===e.content)?.total===e.count),f=()=>{t.length>0&&i.prefetchQuery({...l,staleTime:d?3e4:0})};return(0,G.jsxs)(X,{gap:4,mt:6,className:`reactions`,onMouseEnter:f,onFocus:f,children:[t.map(e=>{let t=u?.find(t=>t.content===e.content);return(0,G.jsx)(Gh,{multiline:!0,maw:320,label:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{children:t?$I(t,a):`…`}),(0,G.jsx)(Z,{size:`xs`,opacity:.7,children:e.mine?`Clic : retirer ma réaction`:`Clic : réagir aussi`})]}),children:(0,G.jsxs)(Tc,{className:`reaction`,"data-mine":e.mine||void 0,"aria-pressed":e.mine,onClick:()=>n(e.content,!e.mine),children:[tL.get(e.content)?.emoji,` `,e.count]})},e.content)}),(0,G.jsxs)(vl,{opened:o,onChange:s,position:`top-start`,shadow:`md`,withinPortal:!0,children:[(0,G.jsx)(vl.Target,{children:(0,G.jsx)(Pl,{className:`reaction-add`,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Ajouter une réaction`,onClick:()=>s(e=>!e),children:`☺`})}),(0,G.jsx)(vl.Dropdown,{p:4,children:(0,G.jsx)(X,{gap:2,children:XI.map(e=>(0,G.jsx)(Tc,{className:`reaction-pick`,"data-mine":c.has(e.content)||void 0,"aria-label":e.label,title:e.label,onClick:()=>{n(e.content,!c.has(e.content)),s(!1)},children:e.emoji},e.content))})})]})]})}function rL(e){return t=>t_.show({color:`red`,title:e,message:t.message})}function iL(e){let t=ED(),n=W_(),r=t.pr.get.queryKey(e),i=e=>n.setQueryData(r,t=>t&&e(t)),a=()=>n.invalidateQueries({queryKey:r}),o=()=>{a(),n.invalidateQueries({queryKey:t.inbox.get.queryKey()})},s=async e=>{await n.cancelQueries({queryKey:r}),i(e),o()},c=(e,t,n)=>({id:t,comments:(e.pendingReview?.id===t?e.pendingReview.comments:0)+n}),l=gy(t.pr.setFileViewed.mutationOptions({onMutate:async({path:e,viewed:t})=>{await n.cancelQueries({queryKey:r}),i(n=>({...n,files:n.files.map(n=>n.path===e?{...n,viewed:t?`VIEWED`:`UNVIEWED`}:n)}))},onError:e=>{rL(`Marquage « vu » impossible`)(e),a()}})),u=gy(t.pr.setHunksSeen.mutationOptions({onMutate:async({hunks:e,seen:t})=>{await n.cancelQueries({queryKey:r}),i(n=>{let r=new Set(n.seenHunks);for(let n of e){let e=`${n.path}\n${n.hash}`;t?r.add(e):r.delete(e)}return{...n,seenHunks:[...r]}})},onError:rL(`Marquage du hunk impossible`)})),d=()=>void n.invalidateQueries({queryKey:t.inbox.get.queryKey(),refetchType:`none`});return{setFileViewed:l,setHunksSeen:u,markThreadsRead:gy(t.pr.markThreadsRead.mutationOptions({onMutate:async e=>{await n.cancelQueries({queryKey:r}),i(t=>e.reduce((e,t)=>KI(e,t.threadId,t.lastCommentId),t))},onSuccess:d,onError:rL(`Marquage comme lu impossible`)})),markEntriesRead:gy(t.pr.markEntriesRead.mutationOptions({onMutate:async e=>{await n.cancelQueries({queryKey:r}),i(t=>qI(t,e))},onSuccess:d,onError:rL(`Marquage comme lu impossible`)})),visit:gy(t.pr.visit.mutationOptions()),reply:gy(t.pr.reply.mutationOptions({onSuccess:(e,{threadId:t,pendingReviewId:n})=>s(r=>({...KI({...r,threads:r.threads.map(n=>n.id===t?{...n,comments:[...n.comments,e]}:n)},t,e.id),pendingReview:e.pending&&n?c(r,n,1):r.pendingReview})),onError:rL(`Réponse non envoyée`)})),setResolved:gy(t.pr.setResolved.mutationOptions({onMutate:({threadId:e,resolved:t})=>i(n=>({...n,threads:n.threads.map(n=>n.id===e?{...n,isResolved:t}:n)})),onSettled:o,onError:rL(`Changement de statut impossible`)})),react:gy(t.pr.react.mutationOptions({onMutate:async({subjectId:e,content:t,on:a})=>{await n.cancelQueries({queryKey:r}),i(n=>eL(n,e,e=>QI(e,t,a)))},onSuccess:(e,{subjectId:r})=>{i(t=>eL(t,r,()=>e));let a=t.pr.reactors.queryOptions({subjectId:r});n.getQueryData(a.queryKey)!==void 0&&n.fetchQuery({...a,staleTime:0})},onError:e=>{rL(`Réaction impossible`)(e),a()}})),addThread:gy(t.pr.addThread.mutationOptions({onSuccess:({thread:e,pendingReviewId:t})=>s(n=>({...n,threads:[...n.threads,e],pendingReview:t?c(n,t,1):n.pendingReview})),onError:rL(`Commentaire non envoyé`)})),submitReview:gy(t.pr.submitReview.mutationOptions({onSuccess:()=>{t_.show({color:`green`,message:`Review envoyée.`}),o()},onError:rL(`Review non envoyée`)})),discardReview:gy(t.pr.discardReview.mutationOptions({onSuccess:o,onError:rL(`Abandon impossible`)})),comment:gy(t.pr.comment.mutationOptions({onSuccess:e=>s(t=>({...t,timeline:[...t.timeline,e]})),onError:rL(`Commentaire non envoyé`)})),deleteComment:gy(t.pr.deleteComment.mutationOptions({onSuccess:o,onError:rL(`Suppression impossible`)})),updateComment:gy(t.pr.updateComment.mutationOptions({onSuccess:o,onError:rL(`Modification impossible`)})),applySuggestion:gy(t.pr.applySuggestion.mutationOptions({onSuccess:e=>{t_.show({color:`green`,message:`Suggestion appliquée (commit ${e.slice(0,7)}).`}),o()},onError:rL(`Suggestion non appliquée`)}))}}function aL(e,t,n){let r=e.comments.at(-1);return e.isResolved||!r||r.author?.login===t?!1:n===t||e.comments.some(e=>e.author?.login===t)}function oL(){let e=zI(),t=iL(e.ref),[n,r]=(0,C.useState)(`open`),i=e.me,a=e.detail.pr.author?.login,o=e.detail.threads,s={open:o.filter(e=>!e.isResolved).length,mine:o.filter(e=>aL(e,i,a)).length,unread:o.filter(e=>e.unread>0).length,all:o.length},c=o.filter(e=>n===`open`?!e.isResolved:n===`mine`?aL(e,i,a):n!==`unread`||e.unread>0);return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{style:{padding:`10px 12px`,borderBottom:`1px solid var(--br-border)`,position:`sticky`,top:0,background:`var(--br-bg)`,zIndex:1},children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,mb:6,children:[o.length,` threads · `,e.detail.timeline.length,` messages généraux`]}),(0,G.jsx)(Yh,{size:`xs`,fullWidth:!0,value:n,onChange:e=>r(e),data:[{value:`open`,label:`Ouverts ${s.open}`},{value:`mine`,label:`Ma réponse ${s.mine}`},{value:`unread`,label:`Non lus ${s.unread}`},{value:`all`,label:`Tous ${s.all}`}]})]}),c.map(t=>{let n=t.comments.at(-1),r=t.isResolved&&e.focusedThread!==t.id;return(0,G.jsxs)(`div`,{className:`conv-item`,"data-state":t.pending?`pending`:t.isResolved?`resolved`:`open`,"data-current":e.focusedThread===t.id||void 0,onClick:()=>e.scrollToThread(t.id),children:[(0,G.jsxs)(X,{gap:6,wrap:`nowrap`,children:[t.pending?(0,G.jsx)(Ep,{size:`sm`,color:`grape`,variant:`filled`,children:`En attente`}):t.isResolved?(0,G.jsx)(Ep,{size:`sm`,color:`green`,variant:`filled`,children:`✓ Résolu`}):(0,G.jsx)(Ep,{size:`sm`,color:`yellow`,variant:`filled`,autoContrast:!0,children:`● Non résolu`}),(0,G.jsxs)(Z,{size:`xs`,ff:`monospace`,c:`dimmed`,truncate:!0,style:{flex:1},children:[t.path,t.subjectType===`FILE`?` · fichier`:t.line===null?``:`:${t.line}`,t.isOutdated?` · outdated`:``]}),t.unread>0&&(0,G.jsxs)(Ep,{size:`xs`,color:`orange`,variant:`light`,children:[t.unread,` nouveau`,t.unread>1?`x`:``]})]}),n&&!r&&(0,G.jsxs)(Z,{size:`sm`,className:`clamp2`,my:2,children:[(0,G.jsx)(`b`,{children:n.author?.login??`ghost`}),` :`,` `,n.body.replace(/```suggestion[\s\S]*?```/g,`[suggestion]`)]}),(0,G.jsxs)(X,{gap:4,hidden:r,children:[[...new Map(t.comments.map(e=>[e.author?.login,e.author])).values()].map(e=>(0,G.jsx)(Cp,{src:e?.avatarUrl,size:16},e?.login??`ghost`)),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[t.comments.length,` message`,t.comments.length>1?`s`:``,aL(t,i,a)?` · attend ma réponse`:``]})]})]},t.id)}),c.length===0&&(0,G.jsx)(Z,{size:`sm`,c:`dimmed`,p:`md`,children:`Aucun thread pour ce filtre.`}),(0,G.jsx)(Z,{size:`xs`,tt:`uppercase`,fw:600,c:`dimmed`,px:12,pt:`md`,pb:4,children:`Conversation générale`}),(0,G.jsx)(tg,{gap:0,children:e.detail.timeline.map(e=>(0,G.jsxs)(`div`,{className:`comment`,"data-new":e.unread||void 0,children:[(0,G.jsx)(Cp,{src:e.author?.avatarUrl,size:22}),(0,G.jsxs)(`div`,{className:`comment-body`,children:[(0,G.jsxs)(X,{gap:6,mb:2,children:[(0,G.jsx)(Z,{size:`sm`,fw:600,children:e.author?.login??`ghost`}),e.kind===`review`&&(0,G.jsxs)(Ep,{size:`xs`,variant:`light`,color:GD[e.state]?.color??`gray`,children:[`review : `,GD[e.state]?.label??e.state]}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:UD(e.createdAt)}),e.unread&&(0,G.jsx)(YI,{text:e.body,active:!0,onRead:()=>t.markEntriesRead.mutate([e.id])})]}),e.bodyHTML?(0,G.jsx)(BI,{html:e.bodyHTML}):(0,G.jsx)(Z,{size:`sm`,c:`dimmed`,children:`(sans message)`}),(0,G.jsx)(nL,{subjectId:e.id,reactions:e.reactions,onToggle:(n,r)=>t.react.mutate({subjectId:e.id,content:n,on:r})})]})]},e.id))}),(0,G.jsx)(VI,{draftKey:`general:${e.ref.owner}/${e.ref.repo}#${e.ref.number}`,repoContext:`${e.ref.owner}/${e.ref.repo}`,placeholder:`Commentaire général sur la PR…`,autoFocus:!1,actions:[{label:`Commenter`,run:n=>t.comment.mutateAsync({prId:e.detail.pr.id,body:n})}]})]})}function sL(){let e=zI(),{pr:t}=e.detail,n=iL(e.ref).react;return(0,G.jsxs)(`div`,{className:`panel-body`,children:[(0,G.jsxs)(X,{gap:8,mb:`sm`,children:[(0,G.jsx)(Cp,{src:t.author?.avatarUrl,size:22}),(0,G.jsx)(Z,{size:`sm`,fw:600,children:t.author?.login??`ghost`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:UD(t.createdAt)}),(0,G.jsx)(tf,{href:t.url,target:`_blank`,size:`xs`,c:`dimmed`,ml:`auto`,children:`modifier sur GitHub ↗`})]}),t.bodyHTML?(0,G.jsx)(BI,{html:t.bodyHTML}):(0,G.jsx)(Z,{size:`sm`,c:`dimmed`,children:`Pas de description.`}),(0,G.jsx)(nL,{subjectId:t.id,reactions:t.reactions,onToggle:(e,r)=>n.mutate({subjectId:t.id,content:e,on:r})})]})}function cL(e){return typeof e==`object`?e.key:e}function lL(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function uL(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return(o.length!==r.length||o.some((e,t)=>r[t]!==e))&&(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return o.updateDeps=e=>{r=e},o}function dL(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var fL=(e,t)=>Math.abs(e-t)<1.01,pL=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};function mL({offset:e,isScrolling:t,elementMax:n,holdOffset:r,scrollOffset:i,pendingWrite:a,clampedMaxAtWrite:o}){return t&&a===null&&e===i?`spurious`:a!==null&&Math.abs(e-a.target)<1.5?`readBack`:a!==null&&!a.smooth&&n!==null&&a.target>n+r+.5&&Math.abs(e-(n+r))<1.5||a!==null&&!a.smooth&&a.lowMaxes?.some(t=>Math.abs(e-t)<1.5)?`clampedReadBack`:o!==null&&Math.abs(e-o)<1.5?`clampedEcho`:`external`}var hL=e=>e===`smooth`||e===`smoothFinishing`;function gL({kind:e,offset:t,command:n,target:r}){return e!==`spurious`&&e!==`readBack`&&e!==`clampedReadBack`&&n?.index!=null&&n.phase!==`queued`&&!hL(n.phase)&&!fL(t,n.lastTargetOffset)&&!fL(t,r())&&e!==`clampedEcho`}var _L=40;function vL(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<_L;)n--;if(n<0)return!1;let r=e[n],i=n-1;for(;i>=0&&r.t-e[i].t<_L;)i--;if(i<0)return!1;let a=e[i],o=(t.offset-r.offset)/(t.t-r.t),s=(r.offset-a.offset)/(r.t-a.t);return o*s>=0&&Math.abs(o)>=2*Math.abs(s)&&Math.abs(o)-Math.abs(s)>=.8}function yL(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<_L;)n--;if(n<0)return!1;let r=e[n];return Math.abs(t.offset-r.offset)/(t.t-r.t)>=.05}var bL,xL=()=>{if(bL!==void 0)return bL;if(typeof navigator>`u`)return bL=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return bL=!0;let e=navigator.maxTouchPoints;return bL=navigator.platform===`MacIntel`&&e!==void 0&&e>0},SL,CL=()=>SL===void 0?SL=xL()&&typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`overflow-anchor: auto`):SL,wL={capture:!0,passive:!0},TL=class{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!==`lateFling`,this.dragging=()=>this._touch?.phase===`down`&&this._touch.moved,this.tail=()=>this._touch?.phase===`tail`?this._touch.moved?`fling`:`tap`:null,this.onScroll=({isScrolling:e,ownReadBack:t,moved:n,external:r})=>(e&&this._touch?.phase===`tail`?this._openTail(this._touch.moved||!t,!1):this._touch?.phase===`lateFling`&&(this.host.now()>this._touch.until?this._touch=null:r&&e&&n&&this._openTail(!0,!1)),!t&&e&&n&&this._touch?.phase===`down`?(this._touch.moved=!0,!0):!1),this.touchStart=()=>{this.end(),this._touch={phase:`down`,moved:!1}},this.touchEnd=()=>{let e=this._touch?.phase===`down`&&this._touch.moved;this.end(),this._openTail(e,e)},this.end=()=>{let e=this.host.getWindow();this._touch?.phase===`tail`&&e!=null&&e.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),n=()=>this.touchEnd();return e.addEventListener(`touchstart`,t,wL),e.addEventListener(`touchend`,n,wL),e.addEventListener(`touchcancel`,n,wL),()=>{e.removeEventListener(`touchstart`,t,wL),e.removeEventListener(`touchend`,n,wL),e.removeEventListener(`touchcancel`,n,wL),this.end()}},this._openTail=(e,t)=>{let n=this.host.getWindow();if(!xL()||n==null)return;this.end();let r={phase:`tail`,moved:e,awaitingFling:t,timerId:n.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(r.moved,r.awaitingFling):(this._touch=r.awaitingFling?{phase:`lateFling`,until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=r}}get touch(){return this._touch}},EL=e=>{let{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},DL=e=>{let t=new Set;return{schedule:n=>{let r=e.requestAnimationFrame(()=>{t.delete(r),n()});t.add(r)},cancel:()=>{t.forEach(t=>e.cancelAnimationFrame(t)),t.clear()}}},OL=e=>e,kL=e=>{let t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-n+1,i=Array(r);for(let e=0;e<r;e++)i[e]=n+e;return i},AL=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(EL(n)),!r.ResizeObserver)return()=>{};let a=DL(r),o=new r.ResizeObserver(()=>{let t=()=>{i(EL(n))};e.options.useAnimationFrameWithResizeObserver?a.schedule(t):t()});return o.observe(n,{box:`content-box`}),()=>{o.unobserve(n),a.cancel()}},jL={passive:!0},ML=typeof window>`u`||`onscrollend`in window,NL=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&ML,o=0,s=a?null:pL(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,jL),a&&r.addEventListener(`scrollend`,u,jL),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},PL=(e,t)=>NL(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),FL=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},IL=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},LL=(e,t)=>e===`smooth`?t?`smoothLanded`:`smooth`:`instant`,RL=e=>e?.phase===`smooth`||e?.phase===`smoothLanded`;function zL(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var BL=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new TL({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if(e?.phase!==`queued`||this.pendingWrite!==null)return!1;let t=this._readElementOffset();return t===null||this._lastElementOffset===null||Math.abs(t-this._lastElementOffset)<1?!1:(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;e?.phase===`queued`&&yL(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=null,n=()=>{if(e)return e;let n=this.targetWindow;if(!n||!n.ResizeObserver)return null;let i=t=DL(n);return e=new n.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(r)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment())}};this.options.useAnimationFrameWithResizeObserver?i.schedule(t):t()})},r=e=>{let t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};return{disconnect:()=>{var r;(r=n())==null||r.disconnect(),t?.cancel(),e=null,t=null},observe:e=>n()?.observe(e,{box:`border-box`}),unobserve:e=>n()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:OL,rangeExtractor:kL,onChange:()=>{},measureElement:FL,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>cL(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||zL(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:s}=this.options,c=0;for(;c<a&&s(c)!==e;)c++;if(c<a){let e=n[c];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(o=n-this.scrollOffset,this.scrollOffset=n)}}}i?this.pendingScrollAnchor={kind:`follow`,behavior:i}:o!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:`anchor`,delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=uL(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(e=this._momentumStop)==null||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{let n=t?this._elementMaxScrollOffset():null,r=this._reportedOverscroll;this._reportedOverscroll=e<0||n!==null&&e>n+1;let i=e;this._lastElementOffset=i,e=this._toLayoutOffset(e);let a=this._classifyScrollEvent(e,t,n);if(a===`spurious`)return;a===`readBack`?e=this.pendingWrite.target:a===`clampedReadBack`&&this.scrollState?.index!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:gL({kind:a,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let o=this.getScrollOffset(),s=this.scrollDirection;this.scrollDirection=t?o===e?this.scrollDirection:o<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t;let c=this.scrollState;if(c?.phase===`queued`&&a===`external`&&t){if(r||this._reportedOverscroll)c.samples=[];else{let e=this.now();c.samples=[...(c.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:i}],(s!==null&&this.scrollDirection!==s||vL(c.samples))&&(this.scrollState=null)}}this._iosGesture.onScroll({isScrolling:t,ownReadBack:a===`readBack`,moved:e!==o,external:a===`external`&&this.scrollState?.phase!==`smooth`&&this.scrollState?.phase!==`smoothFinishing`})&&this.scrollState?.phase===`queued`&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let t=this.pendingScrollAnchor;this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled&&(t.kind===`anchor`?this._canWriteScroll()?RL(this.scrollState)&&!fL(this.getScrollOffset()-t.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(t.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=t.delta,this._followOffsetTarget(t.delta),this.notify(!1)):this.scrollToEnd({behavior:t.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,n)=>mL({offset:e,isScrolling:t,elementMax:n,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:this._clampedAdjustment?.maxAtWrite??null}),this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(e===null||e.phase!==`queued`)return;let{behavior:t}=e;this.getMeasurements();let n=this.getScrollStateTarget(e);e.lastTargetOffset=n,this._clampedAdjustment=null,e.phase=LL(t,e.index!=null&&fL(n,this.getScrollOffset())),this._scrollToOffset(n,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(e==null)return null;let{horizontal:t,isRtl:n}=this.options;return typeof e.scrollTop==`number`?t?e.scrollLeft*(n&&-1||1):e.scrollTop:typeof e.scrollY==`number`?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(xL()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||this.scrollState?.phase===`smooth`)return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let t=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(t),this._scrollToOffset(t)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=uL(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=uL(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=lL(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=uL(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=UL(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=uL(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,n,r,i,a)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n,lanes:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!RL(this.scrollState))return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n;if(!this.isIndexInRange(e))return;this._resizeBatch?.sync&&this.getMeasurements();let r,i,a,o=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&o!=null)a=this.options.getItemKey(e),i=o[e*2],r=o[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;a=t.key,i=t.start,r=t.size}let s=this.itemSizeCache.get(a)??r,c=t-s;if(c!==0){let o=this.options.anchorTo===`end`&&!RL(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,l=o?this._getLayoutTotalSize():0,u=this.getScrollOffset(),d=this.itemSizeCache.has(a)?i+s<=u&&this.scrollDirection!==`backward`:i<u,f=!RL(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?d:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:a,start:i,size:r,end:i+r,lane:0},c,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(a,t),this.itemSizeCacheVersion++;let p=!1;if(this._awaitingCommandReadBack()||(o?p=this.applyScrollAdjustment(this._getLayoutTotalSize()-l):f&&(p=this.applyScrollAdjustment(c))),this._resizeBatch){this._resizeBatch.notify=!0,(n=this._resizeBatch).sync||(n.sync=p);return}this.notify(p),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=uL(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,n)=>{let r=[];for(let i=0,a=e.length;i<a;i++){let a=t[e[i]];r.push(n===0?a:{...a,start:a.start-n,end:a.end-n})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return dL(t[VL(0,t.length-1,r?e=>n[e*2]:e=>dL(t[e]).start,e)])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(e===null)return;let t=this.pendingWrite,n=Math.max(e,0)+this._holdOffset;if(n>=t.target)return;let r=t.lowMaxes??=[];r[r.length-1]!==n&&r.push(n)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{let t=e+this._holdOffset;return this.pendingScrollAnchor?.kind===`anchor`&&(t+=this.pendingScrollAnchor.delta),t},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(e===null)return null;if(`scrollHeight`in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(`document`in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,n=this.targetWindow;if(t===null||n===null)return;let r=`document`in t?t.document.scrollingElement:t;if(!r?.style)return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:i}=r,a=this.options.horizontal?`overflow-x`:`overflow-y`,o=i.getPropertyValue(a),s=i.getPropertyPriority(a);i.setProperty(a,`hidden`,`important`);let c={restore:()=>i.getPropertyValue(a)!==`hidden`||i.getPropertyPriority(a)!==`important`?!1:(i.setProperty(a,o,s),!0),done:e};this._momentumStop=c,n.requestAnimationFrame(()=>n.requestAnimationFrame(()=>{this._momentumStop===c&&(this._momentumStop=null,c.restore()&&c.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(t===null)return null;let n=t+this._holdOffset;return e>n+.5?{target:e,maxAtWrite:n}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1){let e=this.getMaxScrollOffset(),n=e-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(n,e),0),t]}let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),n,`absolute`)},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r;this._startScroll({index:e,align:a},i,n,`absolute`)},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,`start`);this._startScroll({index:null,align:`start`},n,t,`relative`)},this.scrollToEnd=({behavior:e=`auto`}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:`end`,toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,`absolute`):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n}={})=>{let r={target:e+(t??0),smooth:n===`smooth`};return this.pendingWrite=r,this.options.scrollToFn(e-this._holdOffset,{behavior:n,adjustments:t},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(xL()&&this._iosGesture.dragging())&&e!==null&&!fL(e,this.getScrollOffset())},this._followOffsetTarget=e=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(e===0)return!1;if(this._followOffsetTarget(e),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+e);let r=this._scrollToOffset(n,{adjustments:e,behavior:t});return this.scrollOffset!==null&&(this.pendingWrite===r&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}return this._holdOffset+=e,this.scrollOffset!==null&&(this.scrollOffset+=e),!0}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index==null?void 0:this.getOffsetForIndex(e.index,e.align);return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase===`queued`){this.scheduleScrollReconcile();return}this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,n=e!==this.scrollState.lastTargetOffset;if(!n&&fL(e,this.getScrollOffset())){if(this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothLanded`:this.scrollState.phase===`smoothFinishing`&&(this.scrollState.phase=`instant`),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let t=this.getSize()||600,n=Math.abs(e-this.getScrollOffset()),r=RL(this.scrollState)&&n>t;this.scrollState.lastTargetOffset=e,r?this.scrollState.phase=`smooth`:this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothFinishing`:this.scrollState.phase===`smoothLanded`&&(this.scrollState.phase=`instant`),this._scrollToOffset(e,{behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){let i=this._iosGesture.tail();if(r===`absolute`&&i!==null){if(i===`fling`&&CL()){this._stopMomentum(()=>{this.scrollState?.phase!==`queued`||this._iosGesture.tail()!==`fling`||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:`queued`,behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:LL(n,e.index!=null&&fL(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}},VL=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function HL(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function UL(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=HL(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=VL(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var WL=typeof document<`u`?C.useLayoutEffect:C.useEffect;function GL({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=C.useReducer(e=>e+1,0)[1],a=C.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=C.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=(e,t,n)=>{let r=a.current,i=!!e.options.horizontal,o=t.start-e.options.scrollMargin;r.lastPositions.get(n)!==o&&(r.lastPositions.set(n,o),r.mode===`transform`?n.style.transform=i?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:n.style[i?`left`:`top`]=`${o}px`)},l=e=>{let t=a.current;if(t.enabled&&t.container){s(e);for(let t of e.getVirtualItems()){let n=e.elementsCache.get(t.key);n&&c(e,t,n)}}},u={...r,onChange:(t,n)=>{var s;let c=a.current,u=!0;if(c.enabled){l(t);let e=t.range,n=c.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,ss.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[d]=C.useState(()=>{let e=new BL(u),t=e.measureElement;return e.measureElement=n=>{o.current=!0;try{t(n)}finally{o.current=!1}let r=a.current;if(n!==null&&r.enabled&&r.container){let t=e.measurementsCache[e.indexFromElement(n)];t&&c(e,t,n)}},Object.assign(e,{containerRef:t=>{let n=a.current;n.container=t,n.lastSize=null,t!==null&&l(e)}})});return d.setOptions(u),WL(()=>d._didMount(),[]),WL(()=>(s(d),d._willUpdate())),WL(()=>{l(d)}),d}function KL(e){return GL({observeElementRect:AL,observeElementOffset:PL,scrollToFn:IL,...e})}function qL(e){return e.slice(e.lastIndexOf(`/`)+1)}var JL=class{#e=new Map;#t=new Map;#n=[];constructor(e){let t=new Map;for(let n of e){let{id:e,extensions:r,filenames:i=[]}=n.info;if(this.#e.has(e))throw Error(`Langage déclaré deux fois : ${e}`);this.#e.set(e,n);for(let e of i)YL(this.#t,e.toLowerCase(),n);for(let e of r)YL(t,e.toLowerCase(),n)}this.#n=[...t].sort(([e],[t])=>t.length-e.length)}all(){return[...this.#e.values()]}byId(e){return this.#e.get(e)}detect(e){let t=qL(e).toLowerCase(),n=this.#t.get(t);if(n!==void 0)return n;for(let[e,n]of this.#n)if(t.length>e.length&&t.endsWith(e))return n;return null}};function YL(e,t,n){let r=e.get(t);if(r!==void 0&&r!==n)throw Error(`« ${t} » revendiqué par ${r.info.id} et ${n.info.id}`);e.set(t,n)}var XL={id:`css`,label:`CSS`,extensions:[`.css`]},ZL={id:`scss`,label:`SCSS`,extensions:[`.scss`]},QL={id:`sass`,label:`Sass`,extensions:[`.sass`]},$L={id:`less`,label:`Less`,extensions:[`.less`]},eR=`modulepreload`,tR=function(e){return`/`+e},nR={},rR=function(e){return e.pathname.endsWith(`.css`)},iR=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},aR=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=tR(t,n);let r=s(t),i=rR(r);return iR(nR,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`:eR,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)})},oR={info:XL,grammars:{css:()=>aR(()=>import(`./css-DgaLhXQH.js`),__vite__mapDeps([0,1]))},grammarFor:()=>`css`},sR={info:ZL,grammars:{scss:()=>aR(()=>import(`./scss-8bKmll0B.js`),__vite__mapDeps([2,1]))},grammarFor:()=>`scss`},cR={info:QL,grammars:{sass:()=>aR(()=>import(`./sass-DXrisJhu.js`),[])},grammarFor:()=>`sass`},lR={info:$L,grammars:{less:()=>aR(()=>import(`./less-DVTAwKKz.js`),[])},grammarFor:()=>`less`},uR={info:{id:`html`,label:`HTML`,extensions:[`.html`,`.htm`]},grammars:{html:()=>aR(()=>import(`./html-BHZv6uqE.js`),__vite__mapDeps([3,1,4]))},grammarFor:()=>`html`},dR={id:`json`,label:`JSON`,extensions:[`.json`,`.jsonc`],filenames:[`.babelrc`,`.eslintrc`,`.prettierrc`,`.swcrc`]},fR=new Set([`.babelrc`,`.eslintrc`,`.swcrc`]);function pR(e){let t=qL(e).toLowerCase();return t.endsWith(`.jsonc`)||fR.has(t)||(t.startsWith(`tsconfig.`)||t.startsWith(`jsconfig.`))&&t.endsWith(`.json`)?!0:t.endsWith(`.json`)&&(e.startsWith(`.vscode/`)||e.includes(`/.vscode/`))}var mR={info:dR,grammars:{json:()=>aR(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>aR(()=>import(`./jsonc-CYpm1nAK.js`),[])},grammarFor:e=>pR(e)?`jsonc`:`json`},hR={info:{id:`markdown`,label:`MD`,extensions:[`.md`,`.markdown`]},grammars:{markdown:()=>aR(()=>import(`./markdown-BYOwaDjH.js`),[])},grammarFor:()=>`markdown`},gR={info:{id:`text`,label:`TXT`,extensions:[`.txt`]},grammars:{},grammarFor:()=>null},_R={id:`typescript`,label:`TS`,extensions:[`.ts`,`.tsx`,`.mts`,`.cts`]},vR={id:`javascript`,label:`JS`,extensions:[`.js`,`.jsx`,`.mjs`,`.cjs`]},yR=e=>e.toLowerCase(),bR=new JL([{info:_R,grammars:{typescript:()=>aR(()=>import(`./typescript-bsJCZSQ-.js`),[]),tsx:()=>aR(()=>import(`./tsx-udAQXfEw.js`),[])},grammarFor:e=>yR(e).endsWith(`.tsx`)?`tsx`:`typescript`},{info:vR,grammars:{javascript:()=>aR(()=>import(`./javascript-CpIGwZ_Y.js`),__vite__mapDeps([5,4])),jsx:()=>aR(()=>import(`./jsx-Bz0zcwM4.js`),[])},grammarFor:e=>yR(e).endsWith(`.jsx`)?`jsx`:`javascript`},uR,oR,sR,cR,lR,hR,mR,gR]);new Map(bR.all().flatMap(e=>Object.entries(e.grammars)));function xR(e){return bR.detect(e)?.grammarFor(e)??null}function SR(e){return bR.byId(e)?.info.label??e}function CR(e){return typeof e==`object`&&!!e&&`content`in e&&typeof e.content==`string`&&`color`in e&&(e.color===void 0||typeof e.color==`string`)&&`fontStyle`in e&&typeof e.fontStyle==`number`}function wR(e){return Array.isArray(e)&&e.every(e=>Array.isArray(e)&&e.every(CR))}function TR(e){return typeof e!=`object`||!e||!(`id`in e)||typeof e.id!=`number`?!1:`ok`in e&&e.ok===!0?`tokens`in e&&wR(e.tokens):`ok`in e&&e.ok===!1&&`error`in e&&typeof e.error==`string`}var ER=200,DR,OR=!1,kR=!1,AR=0,jR=new Map;function MR(...e){kR||(kR=!0,console.warn(`[highlight]`,...e))}function NR(e){MR(`syntax highlighting disabled:`,e),OR=!0,DR?.terminate(),DR=void 0;let t=Error(`highlight worker unavailable`);for(let e of jR.values())e.reject(t);jR.clear()}function PR(){if(DR)return DR;let e=new Worker(new URL(`/assets/highlight.worker-BOqhB448.js`,``+import.meta.url),{type:`module`});return e.addEventListener(`message`,e=>{let t=e.data;if(!TR(t)){NR(Error(`malformed worker message`));return}let n=jR.get(t.id);n&&(jR.delete(t.id),t.ok?n.resolve(t.tokens):n.reject(Error(t.error)))}),e.addEventListener(`error`,e=>NR(e.message||`worker error`)),e.addEventListener(`messageerror`,()=>NR(Error(`undeserializable worker message`))),DR=e,e}async function FR(e,t){if(OR)throw Error(`highlight worker unavailable`);let n=AR++,r=Promise.withResolvers();return jR.set(n,r),PR().postMessage({id:n,lang:e,lines:t}),r.promise}var IR=new Map,LR=new WeakMap;function RR(e){if(IR.delete(e.key),IR.set(e.key,e),!(IR.size<=ER))for(let[e,t]of IR){if(IR.size<=ER)break;t.listeners.size===0&&t.state!==`pending`&&IR.delete(e)}}function zR(e){e.state=`pending`;let t=t=>{e.tokens=t,e.state=`settled`;for(let t of e.listeners)t()};FR(e.lang,e.lines).then(t,e=>{MR(`highlighting failed:`,e),t(null)})}function BR(e,t,n){let r={key:e,lang:t,lines:n,tokens:null,state:`idle`,listeners:new Set,subscribe:e=>(r.listeners.add(e),RR(r),r.state===`idle`&&zR(r),()=>r.listeners.delete(e)),getSnapshot:()=>r.tokens};return r}function VR(e){let t=3735928559,n=1103547991,r=0;for(let i of e){if(r+=i.length+1,i.length>2e3||r>3e5)return null;for(let e=0;e<i.length;e++){let r=i.charCodeAt(e);t=Math.imul(t^r,2654435761),n=Math.imul(n^r,1597334677)}t=Math.imul(t^10,2654435761),n=Math.imul(n^10,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(4294967296*(2097151&n)+(t>>>0)).toString(36)}function HR(e,t){let n=LR.get(t);n||(n=new Map,LR.set(t,n));let r=n.get(e);if(r!==void 0)return r;let i=xR(e),a=i===null?null:VR(t),o=null;if(i!==null&&a!==null){let n=`${i}\0${e}\0${t.length}\0${a}`;o=IR.get(n)??BR(n,i,t)}return n.set(e,o),o}var UR=()=>()=>{},WR=()=>null;function GR(e,t){let n=t===null?null:HR(e,t);return(0,C.useSyncExternalStore)(n?.subscribe??UR,n?.getSnapshot??WR)}function KR(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.type===`context`){t.push({left:r,right:r}),n++;continue}let i=[],a=[];for(;n<e.length&&e[n].type===`del`;)i.push(e[n++]);for(;n<e.length&&e[n].type===`add`;)a.push(e[n++]);for(let e=0;e<Math.max(i.length,a.length);e++)t.push({left:i[e]??null,right:a[e]??null})}return t}function qR(e,t,n){return`${t}:${n}:${e}`}function JR(e){let t=new Map;for(let n of e){let e={LEFT:new Map,RIGHT:new Map};n.hunks.forEach((t,n)=>{for(let r of t.lines)r.oldNo!==null&&e.LEFT.set(r.oldNo,n),r.newNo!==null&&e.RIGHT.set(r.newNo,n)}),t.set(n.path,e)}return t}var YR=(e,t)=>t===0?e+1:e+t,XR=(e,t)=>t===0?e:e-1;function ZR(e,t,n=[]){let r=e.hunks.length;if(r===0)return[];let i=[];for(let a=0;a<=r;a++){let o=e.hunks[a-1],s=e.hunks[a],c=o?YR(o.newStart,o.newLines):1,l=s?XR(s.newStart,s.newLines):t,u=o?YR(o.oldStart,o.oldLines)-c:XR(s.oldStart,s.oldLines)-l,d=Math.max(0,l-c+1),f=n[a],p=a===0?0:Math.min(f?.down??0,d),m=a===r?0:Math.min(f?.up??0,d-p);i.push({start:c,end:l,offset:u,down:p,up:m,hidden:d-p-m})}return i}function QR(e,t,n,r){let i=[...e?.gaps??[]],a=i[n]??{down:0,up:0};return i[n]=r===`all`?n===0?{...a,up:1/0}:{...a,down:1/0}:{...a,[r]:a[r]+20},{lines:t,gaps:i}}function $R(e,t,n,r){let i=[];for(let a=n;a<n+r;a++)i.push({type:`context`,oldNo:a+t.offset,newNo:a,content:e[a-1],noNewline:!1});return i}function ez(e){return e.hunks.length>0&&e.newBlob!==null&&e.status!==`added`}function tz(e){let t=[],n=[],r=[],i=new Map,a=new Map,o=new Map,s=new Map;for(let t of e.threads){let e=s.get(t.path)??[];e.push(t),s.set(t.path,e)}let c=new Set,l=new Set(e.files.map(e=>e.path));for(let t of e.threads)if(t.line!==null&&t.subjectType===`LINE`&&e.anchorable(t.side)){let e=qR(t.path,t.side,t.line);o.set(e,[...o.get(e)??[],t.id])}let u=(e,n,r)=>{let a=n.filter(e=>!c.has(e));if(a.length!==0){for(let e of a)c.add(e),i.set(e,t.length);t.push({kind:`threads`,key:r,fileIdx:e,threadIds:a})}};if(e.files.forEach((l,d)=>{if(e.onlyFile!==null&&l.path!==e.onlyFile||(n[d]=t.length,t.push({kind:`file`,key:`f:${l.path}`,fileIdx:d}),e.collapsed.has(l.path)))return;let f=s.get(l.path)??[],p=f.filter(e=>e.subjectType===`FILE`).map(e=>e.id);u(d,p,`tf:${l.path}`),e.fileComposer===l.path&&t.push({kind:`composer`,key:`cf:${l.path}`,fileIdx:d,target:`file`}),l.binary?t.push({kind:`notice`,key:`n:${l.path}`,fileIdx:d,text:`Fichier binaire.`}):l.truncated?t.push({kind:`notice`,key:`n:${l.path}`,fileIdx:d,text:`Diff trop volumineux pour l’API GitHub : contenu à consulter sur GitHub.`}):l.hunks.length===0&&t.push({kind:`notice`,key:`n:${l.path}`,fileIdx:d,text:l.status===`renamed`?`Renommé sans modification.`:`Aucun changement de contenu (mode / fichier vide).`});let m=(t,n)=>e.composer!==null&&e.composer.path===l.path&&e.composer.side===t&&e.composer.end===n,h=(n,r,i)=>{let s=t.length-1;r?.newNo!=null&&e.anchorable(`RIGHT`)&&a.set(qR(l.path,`RIGHT`,r.newNo),s),n?.oldNo!=null&&e.anchorable(`LEFT`)&&a.set(qR(l.path,`LEFT`,n.oldNo),s);let c=[],f=!1;r?.newNo!=null&&(c.push(...o.get(qR(l.path,`RIGHT`,r.newNo))??[]),f||=m(`RIGHT`,r.newNo)),n?.oldNo!=null&&(c.push(...o.get(qR(l.path,`LEFT`,n.oldNo))??[]),f||=m(`LEFT`,n.oldNo)),u(d,c,`t:${i}`),f&&t.push({kind:`composer`,key:`c:${i}`,fileIdx:d,target:`line`})},g=e.layout===`split`&&l.status!==`added`&&l.status!==`deleted`,_=(e,n,r)=>{let i=`${l.path}:${n?.oldNo??`-`}:${r?.newNo??`-`}`;t.push({kind:`split`,key:`s:${i}`,fileIdx:d,hunkIdx:e,left:n,right:r}),h(n,r,i)},v=(e,n)=>{let r=`${l.path}:${n.oldNo??`-`}:${n.newNo??`-`}`;t.push({kind:`line`,key:`l:${r}`,fileIdx:d,hunkIdx:e,line:n}),h(n.type===`add`?null:n,n.type===`del`?null:n,r)},y=(e,t)=>{for(let n of t)g?_(e,n,n):v(e,n)},b=e.expansions.get(l),x=b?ZR(l,b.lines.length,b.gaps):null,S=(e,t)=>{let n=x?.[e];return!n||!b?[]:t===`down`?$R(b.lines,n,n.start,n.down):$R(b.lines,n,n.end-n.up+1,n.up)};if(l.hunks.forEach((e,n)=>{if(n>0&&y(n-1,S(n,`down`)),r.push({row:t.length,fileIdx:d,hunkIdx:n}),t.push({kind:`hunk`,key:`h:${l.path}:${n}`,fileIdx:d,hunkIdx:n}),y(n,S(n,`up`)),g)for(let t of KR(e.lines))_(n,t.left,t.right);else for(let t of e.lines)v(n,t)}),l.hunks.length>0){let e=l.hunks.length;y(e-1,S(e,`down`)),ez(l)&&(x?.[e]?.hidden??1)>0&&t.push({kind:`expand`,key:`x:${l.path}`,fileIdx:d})}let C=f.filter(e=>!c.has(e.id)).map(e=>e.id);if(C.length>0){for(let e of C)c.add(e),i.set(e,t.length);t.push({kind:`orphans`,key:`o:${l.path}`,fileIdx:d,threadIds:C,title:`Threads outdated ou hors de la plage affichée`})}}),e.onlyFile===null){let n=e.threads.filter(e=>!l.has(e.path)&&!c.has(e.id)).map(e=>e.id);if(n.length>0){for(let e of n)i.set(e,t.length);t.push({kind:`orphans`,key:`o:outside`,fileIdx:null,threadIds:n,title:`Threads sur des fichiers hors de la plage affichée`})}}return{rows:t,fileRow:n,hunkRows:r,threadRow:i,lineRow:a}}function nz(e){let t=[],n=/```suggestion[^\n]*\n([\s\S]*?)```/g;for(let r=n.exec(e);r;r=n.exec(e))t.push(r[1]??``);return t}function rz(e,t){return e.index===null?t-1:e.index.get(t)}function iz(e,t){let n=[],r=new Map;for(let i of e.hunks)for(let e of i.lines){let i=e[t];i!==null&&(r.set(i,n.length),n.push(e.content))}return{lines:n,index:r}}function az(e,t,n){if(n==null)return null;let r=n.split(`
|
|
110
110
|
`);n.endsWith(`
|
|
111
111
|
`)&&r.pop();for(let n of e.hunks)for(let e of n.lines){let n=e[t];if(n!==null&&r[n-1]!==e.content)return null}return r}function oz(e,t,n){if(n===null||n.some(e=>e.length>2e3))return iz(e,t);let r=0;for(let e of n)r+=e.length+1;return r>3e5?iz(e,t):{lines:n,index:null}}function sz({diffHunk:e}){let t=e.split(`
|
|
112
|
-
`).slice(1).slice(-8);return(0,G.jsx)(`div`,{className:`snippet`,children:t.map((e,t)=>(0,G.jsx)(`div`,{className:e.startsWith(`+`)?`c-add`:e.startsWith(`-`)?`c-del`:void 0,children:e||` `},t))})}function cz({thread:e,showPath:t=!1}){let n=zI(),r=iL(n.ref),[i,a]=(0,C.useState)(!1),o=n.focusedThread===e.id,s=e.comments.find(e=>e.unread)?.id,c=n.detail.canWrite&&n.detail.pr.sameRepo&&n.detail.pr.state===`OPEN`&&!e.isOutdated&&e.side===`RIGHT`&&e.line!==null,l=n.pendingReviewId,u=e.subjectType===`FILE`?`commentaire sur le fichier`:e.isOutdated?`ligne ${e.originalLine??`?`} (version d’origine)`:e.startLine!==null&&e.startLine!==e.line?`lignes ${e.startLine}–${e.line}`:`ligne ${e.line}`,d=e.pending?`pending`:e.isResolved?`resolved`:`open`,f=e.isResolved?e.canUnresolve:e.canResolve,[p,m]=(0,C.useState)(null),h=p??(!e.isResolved||o);return(0,G.jsxs)(`div`,{className:`thread`,"data-thread":e.id,"data-state":d,"data-unread":e.unread>0||void 0,"data-collapsed":!h||void 0,"data-focus":o||void 0,onClick:()=>n.setFocusedThread(e.id),children:[(0,G.jsxs)(`div`,{className:`thread-head`,children:[d===`pending`?(0,G.jsx)(Ep,{size:`md`,color:`grape`,variant:`filled`,children:`En attente · review non soumise`}):d===`resolved`?(0,G.jsxs)(Ep,{size:`md`,color:`green`,variant:`filled`,children:[`✓ Résolu`,e.resolvedBy?` par ${e.resolvedBy}`:``]}):(0,G.jsx)(Ep,{size:`md`,color:`yellow`,variant:`filled`,autoContrast:!0,children:`● Non résolu`}),e.isOutdated&&(0,G.jsx)(Ep,{size:`sm`,color:`gray`,variant:`outline`,children:`outdated`}),e.unread>0&&(0,G.jsxs)(Ep,{size:`sm`,color:`orange`,variant:`light`,children:[e.unread,` nouveau`,e.unread>1?`x`:``]}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,truncate:!0,children:[t?`${e.path} · `:``,u,e.subjectType===`LINE`?` · ${e.side===`LEFT`?`ancien code`:`nouveau code`}`:``]}),(0,G.jsx)(`div`,{style:{flex:1}}),e.isResolved&&(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,color:`gray`,style:{flex:`none`},"aria-expanded":h,onClick:e=>{e.stopPropagation(),m(!h)},children:h?`Replier`:`Afficher ${e.comments.length} message${e.comments.length>1?`s`:``}`}),e.comments[0]&&(0,G.jsx)(tf,{href:e.comments[0].url,target:`_blank`,size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`,flex:`none`},children:`GitHub ↗`})]}),h&&(e.isOutdated||e.line===null)&&e.diffHunk&&(0,G.jsx)(sz,{diffHunk:e.diffHunk}),h&&e.comments.map(t=>(0,G.jsxs)(`div`,{className:`comment`,"data-new":t.unread||void 0,children:[(0,G.jsx)(Cp,{src:t.author?.avatarUrl,size:24}),(0,G.jsxs)(`div`,{className:`comment-body`,children:[(0,G.jsxs)(X,{gap:6,mb:2,children:[(0,G.jsx)(Z,{size:`sm`,fw:600,children:t.author?.login??`ghost`}),(0,G.jsx)(Gh,{label:new Date(t.createdAt).toLocaleString(`fr`),children:(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:UD(t.createdAt)})}),t.pending&&(0,G.jsx)(Ep,{size:`xs`,color:`yellow`,variant:`light`,children:`en attente`}),t.pending&&t.canDelete&&(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,color:`red`,ml:`auto`,onClick:()=>r.deleteComment.mutate({commentId:t.id}),children:`Supprimer`}),t.unread&&(0,G.jsx)(YI,{text:t.body,active:t.id===s,onRead:()=>r.markThreadsRead.mutate([{threadId:e.id,lastCommentId:t.id}])})]}),(0,G.jsx)(BI,{html:t.bodyHTML}),!t.pending&&(0,G.jsx)(nL,{subjectId:t.id,reactions:t.reactions,onToggle:(e,n)=>r.react.mutate({subjectId:t.id,content:e,on:n})}),c&&!t.pending&&nz(t.body).map((i,a)=>(0,G.jsx)(Fp,{mt:6,size:`compact-xs`,color:`green`,variant:`light`,loading:r.applySuggestion.isPending,onClick:()=>r.applySuggestion.mutate({ref:n.ref,branch:n.detail.pr.headRefName,expectedHeadOid:n.detail.pr.headRefOid,path:e.path,side:`RIGHT`,startLine:e.startLine??e.line,endLine:e.line,replacement:i,message:`Apply suggestion from @${t.author?.login??`reviewer`}\n\n${t.url}`}),children:`Appliquer la suggestion (commit)`},a))]})]},t.id)),h?i&&e.canReply?(0,G.jsx)(VI,{draftKey:`reply:${e.id}`,repoContext:`${n.ref.owner}/${n.ref.repo}`,onCancel:()=>a(!1),placeholder:`Répondre…`,actions:[...e.canResolve&&!e.isResolved&&!l?[{label:`Répondre & résoudre`,variant:`default`,run:async t=>{await r.reply.mutateAsync({threadId:e.id,body:t,pendingReviewId:null}),await r.setResolved.mutateAsync({threadId:e.id,resolved:!0})}}]:[],{label:l?`Ajouter à la review`:`Répondre`,run:t=>r.reply.mutateAsync({threadId:e.id,body:t,pendingReviewId:l})}]}):(e.canReply||f)&&(0,G.jsxs)(X,{className:`thread-foot`,p:8,gap:8,children:[e.canReply&&(0,G.jsx)(Fp,{"data-reply":!0,variant:`default`,size:`compact-sm`,style:{flex:1,justifyContent:`flex-start`},styles:{inner:{justifyContent:`flex-start`}},onClick:()=>a(!0),children:(0,G.jsx)(Z,{size:`sm`,c:`dimmed`,children:`Répondre…`})}),f&&(0,G.jsx)(Fp,{size:`compact-sm`,ml:`auto`,color:e.isResolved?`yellow`:`green`,variant:e.isResolved?`light`:`filled`,onClick:t=>{t.stopPropagation(),r.setResolved.mutate({threadId:e.id,resolved:!e.isResolved})},children:e.isResolved?`Rouvrir la conversation`:`✓ Résoudre la conversation`})]}):null]})}var lz=new WeakMap;function uz(e){let t=zI(),n=ED(),r=[e.oldBlob,e.newBlob].filter(e=>e!==null),i=dy({...n.pr.blobs.queryOptions({ref:t.ref,oids:r}),staleTime:1/0,enabled:r.length>0&&!e.binary});if(i.isPending&&r.length>0&&!e.binary)return{old:null,new:null,newLines:null};let a=lz.get(e);if(a&&a.data===i.data)return a.sources;let o=e=>e===null?null:i.data?.[e],s=az(e,`newNo`,o(e.newBlob)),c={old:oz(e,`oldNo`,az(e,`oldNo`,o(e.oldBlob))),new:oz(e,`newNo`,s),newLines:s};return lz.set(e,{data:i.data,sources:c}),c}var dz={file:52,hunk:28,expand:28,split:20,line:20,threads:160,composer:230,notice:36,orphans:200};function fz(e,t,n){let r=e.hunks.filter(t=>n.has(`${e.path}\n${t.hash}`)).length;return{state:t===`VIEWED`?`viewed`:t===`DISMISSED`?`dismissed`:r>0?`partial`:`none`,seenHunks:r}}function pz(e){let t=zI();return fz(e,t.detail.files.find(t=>t.path===e.path)?.viewed,t.seenHunks)}var mz=40;function hz(){let e=zI(),t=iL(e.ref),n=(e,t)=>t.map(t=>({path:e.path,hash:t.hash}));return{toggleFile:(r,i)=>{t.setFileViewed.mutate({prId:e.detail.pr.id,path:r.path,viewed:i}),r.hunks.length>0&&t.setHunksSeen.mutate({ref:e.ref,hunks:n(r,r.hunks),seen:i})},toggleHunk:(r,i,a)=>{t.setHunksSeen.mutate({ref:e.ref,hunks:n(r,[i]),seen:a});let o=r.hunks.filter(e=>e!==i),s=a&&o.every(t=>e.seenHunks.has(`${r.path}\n${t.hash}`)),c=e.detail.files.find(e=>e.path===r.path)?.viewed;e.range.fullPr&&s&&c!==`VIEWED`?t.setFileViewed.mutate({prId:e.detail.pr.id,path:r.path,viewed:!0}):!a&&c===`VIEWED`&&t.setFileViewed.mutate({prId:e.detail.pr.id,path:r.path,viewed:!1})}}}function gz({state:e}){return(0,G.jsx)(`span`,{className:`vbox`,"data-state":e,children:e===`viewed`?`✓`:e===`dismissed`?`•`:``})}var _z={added:{label:`ajouté`,color:`green`},deleted:{label:`supprimé`,color:`red`},renamed:{label:`renommé`,color:`blue`},modified:null};function vz(e){let{file:t}=e,n=zI(),r=hz(),{state:i,seenHunks:a}=pz(t),o=n.detail.threads.filter(e=>e.path===t.path),s=o.filter(e=>!e.isResolved).length,c=_z[t.status];return(0,G.jsxs)(`div`,{className:`file-head`,"data-viewed":i===`viewed`||void 0,children:[(0,G.jsx)(Pl,{size:`sm`,variant:`subtle`,color:`gray`,onClick:e.onToggleCollapse,"aria-label":`Replier`,children:e.collapsed?`▸`:`▾`}),(0,G.jsx)(Gh,{label:t.status===`renamed`?`${t.oldPath} → ${t.path}`:t.path,openDelay:400,children:(0,G.jsxs)(`span`,{className:`file-path`,children:[t.status===`renamed`&&(0,G.jsxs)(Z,{span:!0,c:`dimmed`,inherit:!0,children:[t.oldPath,` →`,` `]}),t.path]})}),c&&(0,G.jsx)(Ep,{size:`xs`,variant:`light`,color:c.color,children:c.label}),i===`dismissed`&&(0,G.jsx)(Ep,{size:`xs`,variant:`light`,color:`orange`,children:`modifié depuis vu`}),(0,G.jsxs)(Z,{size:`xs`,span:!0,children:[(0,G.jsxs)(Z,{span:!0,c:`green.4`,inherit:!0,children:[`+`,t.additions]}),` `,(0,G.jsxs)(Z,{span:!0,c:`red.4`,inherit:!0,children:[`−`,t.deletions]})]}),t.hunks.length>1&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[a,`/`,t.hunks.length,` hunks vus`]}),o.length>0&&(0,G.jsxs)(Z,{size:`xs`,c:s>0?`yellow.4`:`dimmed`,children:[(0,G.jsx)(`i`,{className:`ico-c`}),s,`/`,o.length]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsx)(tf,{size:`xs`,c:`dimmed`,target:`_blank`,href:`https://github.com/${n.ref.owner}/${n.ref.repo}/blob/${n.detail.pr.headRefOid}/${t.path}`,children:`fichier ↗`}),n.canCommentFile(t.path)&&(0,G.jsx)(Gh,{label:`Commenter le fichier entier`,openDelay:300,children:(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,color:`gray`,leftSection:(0,G.jsx)(`i`,{className:`ico-c`}),onClick:()=>{e.collapsed&&e.onToggleCollapse(),n.setFileComposer(t.path)},children:`Commenter`})}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:i===`viewed`?`light`:`default`,color:i===`viewed`?`green`:`gray`,leftSection:(0,G.jsx)(gz,{state:i}),onClick:()=>{let e=i!==`viewed`;r.toggleFile(t,e),e&&n.advanceFrom(t.path)},children:`Vu`})]})}function yz({tokens:e,text:t}){return e?(0,G.jsx)(G.Fragment,{children:e.map((e,t)=>(0,G.jsx)(`span`,{style:{color:e.color,fontStyle:e.fontStyle&1?`italic`:void 0,fontWeight:e.fontStyle&2?600:void 0},children:e.content},t))}):(0,G.jsx)(G.Fragment,{children:t})}var bz={add:`c-add`,del:`c-del`,context:``},xz=(0,C.memo)(function(e){let{row:t,file:n}=e,r=zI(),i=uz(n),a=GR(n.path,i.old?.lines??null),o=GR(n.path,i.new?.lines??null),s=r.selection,c=(e,t)=>t!==null&&s!==null&&s.path===n.path&&s.side===e&&t>=s.start&&t<=s.end,l=r.linkTarget,u=(e,t)=>t!==null&&l!==null&&l.path===n.path&&l.side===e&&t>=l.start&&t<=l.end,d=(e,t)=>{if(t===`LEFT`){let t=e.oldNo===null||!i.old?void 0:rz(i.old,e.oldNo);return t===void 0?void 0:a?.[t]}let n=e.newNo===null||!i.new?void 0:rz(i.new,e.newNo);return n===void 0?void 0:o?.[n]},f=(e,t,i)=>{let a=t===null?null:r.commentHunk(n.path,e,t);t!==null&&a!==null&&(i.shiftKey&&s&&s.path===n.path&&s.side===e&&r.commentHunk(n.path,e,s.start)===a?r.setSelection({...s,start:Math.min(s.start,t),end:Math.max(s.end,t)}):r.setSelection({path:n.path,side:e,start:t,end:t}))},p=(e,t,i)=>{let a=t!==null&&r.commentHunk(n.path,e,t)!==null;return(0,G.jsx)(`div`,{className:`ln ${i}`,"data-disabled":!a||void 0,title:a?`Commenter (Maj+clic : plage dans le même hunk)`:void 0,onClick:n=>f(e,t,n),children:t??``})},m=(e,t,n)=>(0,G.jsxs)(`div`,{className:`tx ${n}`,children:[e&&(0,G.jsx)(yz,{tokens:d(e,t),text:e.content}),e?.noNewline&&(0,G.jsx)(`span`,{className:`nonl`,children:`⏎̸ pas de fin de ligne`})]});if(t.kind===`split`){let n=t.left,r=t.right,i=n?n.type===`del`?bz.del:``:`c-empty`,a=r?r.type===`add`?bz.add:``:`c-empty`,o=c(`LEFT`,n?.oldNo??null)?` c-sel`:u(`LEFT`,n?.oldNo??null)?` c-target`:``,s=c(`RIGHT`,r?.newNo??null)?` c-sel`:u(`RIGHT`,r?.newNo??null)?` c-target`:``;return(0,G.jsx)(`div`,{className:`code${e.last?` last`:``}`,children:(0,G.jsxs)(`div`,{className:`code-row split`,"data-viewed":e.viewed||void 0,children:[p(`LEFT`,n?.oldNo??null,i+o),m(n,`LEFT`,i+o),p(`RIGHT`,r?.newNo??null,a+s),m(r,`RIGHT`,a+s)]})})}let h=t.line,g=bz[h.type],_=h.type===`del`?`LEFT`:`RIGHT`,v=c(_,_===`LEFT`?h.oldNo:h.newNo)?` c-sel`:u(`LEFT`,h.oldNo)||u(`RIGHT`,h.newNo)?` c-target`:``;return(0,G.jsx)(`div`,{className:`code${e.last?` last`:``}`,children:(0,G.jsxs)(`div`,{className:`code-row unified`,"data-viewed":e.viewed||void 0,children:[p(`LEFT`,h.oldNo,g+v),p(`RIGHT`,h.newNo,g+v),m(h,_,g+v)]})})});function Sz(e,t,n,r){let i=uz(e).newLines;if(i===null)return null;let a=ZR(e,i.length,n?.gaps)[t];if(!a||a.hidden===0)return null;let o=Math.min(20,a.hidden),s=(n,a,o)=>(0,G.jsx)(Gh,{label:o,openDelay:300,children:(0,G.jsx)(Pl,{size:`xs`,variant:`subtle`,color:`gray`,"aria-label":o,onClick:()=>r(e,i,t,n),children:a})}),c=`${a.hidden} ligne${a.hidden>1?`s`:``} masquée${a.hidden>1?`s`:``}`,l;return l=t===e.hunks.length?s(`down`,`↓`,`Afficher ${o} lignes de plus (${c})`):t===0?s(`up`,`↑`,`Afficher ${o} lignes de plus (${c})`):a.hidden<=20?s(`all`,`↕`,`Afficher les ${c}`):(0,G.jsxs)(G.Fragment,{children:[s(`down`,`↓`,`Afficher 20 lignes sous le hunk précédent (${c})`),s(`up`,`↑`,`Afficher 20 lignes au-dessus du hunk (${c})`)]}),(0,G.jsx)(`span`,{className:`gap-expand`,children:l})}function Cz(e){let t=zI(),n=hz(),r=e.file.hunks[e.hunkIdx],i=t.seenHunks.has(`${e.file.path}\n${r.hash}`),a=Sz(e.file,e.hunkIdx,e.expansion,e.onExpand);return(0,G.jsxs)(`div`,{className:`hunk-head`,"data-current":e.current||void 0,"data-unseen":!i||void 0,children:[a,(0,G.jsxs)(`span`,{children:[`@@ -`,r.oldStart,`,`,r.oldLines,` +`,r.newStart,`,`,r.newLines,` @@ `,r.section]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:i?`light`:`subtle`,color:i?`green`:`gray`,onClick:()=>n.toggleHunk(e.file,r,!i),children:i?`✓ hunk vu`:`Marquer le hunk vu`})]})}function wz(e){let t=Sz(e.file,e.file.hunks.length,e.expansion,e.onExpand);return t?(0,G.jsx)(`div`,{className:`hunk-head${e.last?` last`:``}`,children:t}):e.last?(0,G.jsx)(`div`,{className:`code last`}):null}function Tz({file:e,target:t}){let n=zI(),r=iL(n.ref),i=n.selection;if(t===`line`&&!i)return null;let a,o,s=null,c;t===`file`||!i?(a=t=>({subjectType:`FILE`,path:e.path,body:t}),o=`sur le fichier`,c=()=>n.setFileComposer(null)):(a=e=>({subjectType:`LINE`,path:i.path,side:i.side,line:i.end,startLine:i.start===i.end?null:i.start,startSide:i.start===i.end?null:i.side,body:e}),o=`${i.start===i.end?`ligne ${i.end}`:`lignes ${i.start}–${i.end}`} · ${i.side===`LEFT`?`ancien code`:`nouveau code`}`,i.side===`RIGHT`&&(s=e.hunks.flatMap(e=>e.lines.filter(e=>e.newNo!==null&&e.newNo>=i.start&&e.newNo<=i.end).map(e=>e.content))),c=()=>n.setSelection(null));let l=n.pendingReviewId,u=(e,t)=>r.addThread.mutateAsync({prId:n.detail.pr.id,pendingReviewId:t===`review`?l:null,thread:a(e),mode:t});return(0,G.jsx)(`div`,{className:`diff-block`,children:(0,G.jsxs)(`div`,{className:`thread`,"data-focus":!0,children:[(0,G.jsxs)(`div`,{className:`thread-head`,children:[`Nouveau commentaire · `,o,l&&(0,G.jsx)(Ep,{size:`xs`,color:`yellow`,variant:`light`,ml:`auto`,children:`review en attente`})]}),(0,G.jsx)(VI,{draftKey:`new:${n.ref.owner}/${n.ref.repo}#${n.ref.number}`,repoContext:`${n.ref.owner}/${n.ref.repo}`,suggestionLines:s,onCancel:c,actions:[{label:`Commenter seul`,disabled:l!==null,run:e=>u(e,`single`)},{label:l?`Ajouter à la review`:`Démarrer une review`,run:e=>u(e,`review`)}]})]})})}function Ez(e){let t=zI(),[n,r]=(0,C.useState)(()=>new Map),i=(0,C.useCallback)((e,t,n,i)=>r(r=>new Map(r).set(e,QR(r.get(e),t,n,i))),[]),a=(0,C.useRef)(null),o=(0,C.useRef)({fileIdx:null,hunkIdx:null}),s=t.range.head===t.detail.pr.headRefOid,c=(0,C.useMemo)(()=>tz({files:e.files,layout:t.layout,threads:t.detail.threads,anchorable:e=>s&&(e===`RIGHT`||t.range.fullPr),collapsed:e.collapsed,composer:t.selection,fileComposer:t.fileComposer,onlyFile:e.onlyFile,expansions:n}),[e.files,t.layout,t.detail.threads,s,t.range.fullPr,e.collapsed,t.selection,t.fileComposer,e.onlyFile,n]),l=c.rows,u=KL({count:l.length,getScrollElement:()=>a.current,estimateSize:e=>dz[l[e].kind],getItemKey:e=>l[e].key,overscan:30,onChange:t=>{let n=t.getVirtualItemForOffset((t.scrollOffset??0)+mz+4),r=n?l[n.index]:void 0,i=null;if(n)for(let e=c.hunkRows.length-1;e>=0;e--){let t=c.hunkRows[e];if(t.row<=n.index&&t.fileIdx===r?.fileIdx){i=t.hunkIdx;break}}let a=r?.fileIdx??null;(a!==o.current.fileIdx||i!==o.current.hunkIdx)&&(o.current={fileIdx:a,hunkIdx:i},e.onCurrentChange(a,i))}}),d=e.onCurrentChange;(0,C.useImperativeHandle)(e.handleRef,()=>{let n=()=>u.getVirtualItemForOffset((u.scrollOffset??0)+mz+4)?.index??0,r=e=>{if(e===void 0)return;if(l[e]?.kind===`file`){u.scrollToIndex(e,{align:`start`});return}let t=u.getOffsetForIndex(e,`start`)?.[0];t!==void 0&&u.scrollToOffset(Math.max(0,t-mz))};return{scrollToFile:t=>{let n=e.files.findIndex(e=>e.path===t);r(c.fileRow[n]),n!==-1&&n!==o.current.fileIdx&&(o.current={fileIdx:n,hunkIdx:null},d(n,null))},scrollToThread:e=>{let t=c.threadRow.get(e);return t!==void 0&&(u.scrollToIndex(t,{align:`center`}),!0)},scrollToLine:(e,t,n)=>{let r=c.lineRow.get(qR(e,t,n));return r!==void 0&&(u.scrollToIndex(r,{align:`center`}),!0)},step:(e,i)=>{let a=n(),o;if(e===`file`)o=c.fileRow.filter(e=>e!==void 0);else if(e===`hunk`)o=c.hunkRows.map(e=>e.row);else{let e=new Set(t.detail.threads.filter(e=>!e.isResolved).map(e=>e.id));o=[...new Set([...c.threadRow].filter(([t])=>e.has(t)).map(([,e])=>e))].sort((e,t)=>e-t)}let s=i>0?o.find(e=>e>a):o.filter(e=>e<a).at(-1);if(r(s),e===`thread`&&s!==void 0){let e=l[s],n=e&&(e.kind===`threads`||e.kind===`orphans`)?e.threadIds.find(e=>!t.detail.threads.find(t=>t.id===e)?.isResolved):void 0;n&&t.setFocusedThread(n)}},current:()=>o.current}},[u,c,e.files,l,t,d]);let f=u.getVirtualItems(),p=u.getVirtualItemForOffset((u.scrollOffset??0)+4),m=p?l[p.index]:void 0,h=m&&m.kind!==`file`&&m.fileIdx!==null?e.files[m.fileIdx]:void 0,g=(0,C.useMemo)(()=>new Map(t.detail.threads.map(e=>[e.id,e])),[t.detail.threads]),_=(r,a)=>{let s=l[a+1],c=!s||s.kind===`file`,u=r.fileIdx===null?void 0:e.files[r.fileIdx];switch(r.kind){case`file`:return(0,G.jsx)(vz,{file:u,collapsed:e.collapsed.has(u.path),onToggleCollapse:()=>e.onToggleCollapse(u.path)});case`hunk`:return(0,G.jsx)(Cz,{file:u,hunkIdx:r.hunkIdx,current:o.current.fileIdx===r.fileIdx&&o.current.hunkIdx===r.hunkIdx,expansion:n.get(u),onExpand:i});case`expand`:return(0,G.jsx)(wz,{file:u,last:c,expansion:n.get(u),onExpand:i});case`split`:case`line`:{let e=u.hunks[r.hunkIdx];return(0,G.jsx)(xz,{row:r,file:u,viewed:t.seenHunks.has(`${u.path}\n${e.hash}`),last:c})}case`threads`:return(0,G.jsx)(`div`,{className:`diff-block${c?` last`:``}`,children:r.threadIds.map(e=>{let t=g.get(e);return t?(0,G.jsx)(cz,{thread:t},e):null})});case`composer`:return(0,G.jsx)(Tz,{file:u,target:r.target});case`notice`:return(0,G.jsx)(`div`,{className:`diff-block${c?` last`:``}`,children:(0,G.jsx)(Z,{size:`sm`,c:`dimmed`,children:r.text})});case`orphans`:return(0,G.jsxs)(`div`,{className:`diff-block${c?` last`:``}`,style:r.fileIdx===null?{marginTop:16,borderTop:`1px solid var(--br-border)`}:void 0,children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,tt:`uppercase`,fw:600,mb:4,children:r.title}),r.threadIds.map(e=>{let t=g.get(e);return t?(0,G.jsx)(cz,{thread:t,showPath:r.fileIdx===null},e):null})]})}};return l.length===0?(0,G.jsx)(`div`,{className:`diff-scroll`,ref:a,children:(0,G.jsx)(Z,{c:`dimmed`,p:`lg`,children:`Aucun changement dans cette plage.`})}):(0,G.jsxs)(`div`,{className:`diff-scroll`,ref:a,children:[h&&(0,G.jsx)(`div`,{className:`sticky-file`,children:(0,G.jsx)(vz,{file:h,collapsed:e.collapsed.has(h.path),onToggleCollapse:()=>e.onToggleCollapse(h.path)})}),(0,G.jsx)(`div`,{className:`diff-inner`,style:{height:u.getTotalSize()+80},children:f.map(e=>(0,G.jsx)(`div`,{"data-index":e.index,ref:u.measureElement,className:`diff-row`,style:{transform:`translateY(${e.start}px)`},children:_(l[e.index],e.index)},e.key))}),(0,G.jsx)(X,{className:`diff-end`,justify:`center`,p:`md`,children:(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[(0,G.jsx)(Em,{size:`xs`,children:`j`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`k`}),` fichier · `,(0,G.jsx)(Em,{size:`xs`,children:`n`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`p`}),` hunk · `,(0,G.jsx)(Em,{size:`xs`,children:`]`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`[`}),` thread ouvert`]})})]})}var Dz=e=>e.additions+e.deletions;function Oz(e){let t=Dz(e),n=t===0?.5:e.additions/t;return`hsl(${Math.round(n*130)} 45% 30%)`}function kz(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],additions:0,deletions:0,fileCount:0,viewedCount:0,openThreads:0}}function Az(e,t){let n=kz(``,``);for(let t of e){let e=t.path.split(`/`),r=n;for(let t of e.slice(0,-1)){let e=r.path?`${r.path}/${t}`:t,n=r.dirs.find(t=>t.path===e);n||(n=kz(t,e),r.dirs.push(n)),r=n}r.files.push({kind:`file`,name:e.at(-1),path:t.path,stat:t})}let r=(e,n)=>{let i=e;for(;!n&&i.files.length===0&&i.dirs.length===1;){let e=i.dirs[0];i={...e,name:`${i.name}/${e.name}`}}i.dirs=i.dirs.map(e=>r(e,!1)),i.additions=i.deletions=i.fileCount=i.viewedCount=i.openThreads=0;for(let e of i.dirs)i.additions+=e.additions,i.deletions+=e.deletions,i.fileCount+=e.fileCount,i.viewedCount+=e.viewedCount,i.openThreads+=e.openThreads;for(let e of i.files)i.additions+=e.stat.additions,i.deletions+=e.stat.deletions,i.fileCount+=1,i.viewedCount+=+(e.stat.state===`viewed`),i.openThreads+=e.stat.openThreads;if(t){let e=(e,t)=>e.name.localeCompare(t.name),n=(t,n)=>Dz(n.kind===`dir`?n:n.stat)-Dz(t.kind===`dir`?t:t.stat)||e(t,n);i.dirs.sort(t===`churn`?n:e),i.files.sort(t===`churn`?n:e)}return i};return r(n,!0)}function jz(e,t){let n=[],r=(e,i)=>{for(let a of e.dirs)n.push({...a,depth:i}),t.has(a.path)||r(a,i+1);for(let t of e.files)n.push({...t,depth:i})};return r(e,0),n}function Mz(e,t,n){return t===`list`?n===`name`?e.map(e=>e.path):[...e].sort((e,t)=>Dz(t)-Dz(e)||e.path.localeCompare(t.path)).map(e=>e.path):jz(Az(e.map(e=>({...e,state:`none`,openThreads:0,unreadThreads:0})),n),new Set).flatMap(e=>e.kind===`file`?[e.path]:[])}var Nz={local:`d1-3B (local)`,claude:`Claude Haiku 5.5 (API Anthropic)`},Pz=`https://platform.claude.com/settings/keys`;function Fz(){let e=ED(),t=W_(),n=dy(e.ai.status.queryOptions()),[r,i]=(0,C.useState)(``),a=()=>{t.invalidateQueries({queryKey:e.ai.status.queryKey()}),t.invalidateQueries({queryKey:e.config.get.queryKey()})},o=gy(e.ai.setModel.mutationOptions({onSuccess:a})),s=gy(e.ai.setClaudeKey.mutationOptions({onSuccess:()=>{i(``),a()},onError:e=>t_.show({color:`red`,title:`Clé non enregistrée`,message:e.message})})),c=n.data?.kind??`local`;return(0,G.jsxs)(tg,{gap:`xs`,children:[(0,G.jsx)(Yh,{size:`xs`,value:c,disabled:n.isPending||o.isPending,onChange:e=>o.mutate(e===`claude`?`claude`:`local`),data:[{value:`local`,label:Nz.local},{value:`claude`,label:Nz.claude}]}),c===`local`?(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`d1-3B, modèle de décision de Liquid AI servi par llama-server sur cette machine : le code ne la quitte pas. Probabilités calibrées, ≈ 0,3 s par fichier avec un GPU.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Le diff, le début de chaque fichier et la description de la PR sont envoyés à l’API Anthropic. Coût indicatif : moins d’un dixième de centime par fichier. Claude ne donne pas de probabilités mesurées : confiances et pourcentages sont ceux qu’il estime, moins fiables que ceux de d1.`}),n.data?.claudeKey===`env`?(0,G.jsxs)(Z,{size:`xs`,children:[`Clé fournie par `,(0,G.jsx)(qp,{children:`ANTHROPIC_API_KEY`}),`.`]}):(0,G.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),r.trim()&&s.mutate({key:r.trim()})},children:(0,G.jsxs)(X,{gap:`xs`,align:`flex-end`,wrap:`nowrap`,children:[(0,G.jsx)(sh,{size:`xs`,style:{flex:1},label:n.data?.claudeKey===`file`?`Remplacer la clé API`:`Clé API Anthropic`,placeholder:`sk-ant-…`,value:r,onChange:e=>i(e.currentTarget.value),autoComplete:`off`}),(0,G.jsx)(Fp,{size:`xs`,type:`submit`,loading:s.isPending,disabled:!r.trim(),children:`Enregistrer`})]})}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Clé à créer dans la `,(0,G.jsx)(tf,{href:Pz,children:`console Claude`}),`, gardée sur cette machine (fichier `,(0,G.jsx)(qp,{children:`anthropic-key`}),`, lisible par vous seul) et jamais renvoyée au navigateur.`,` `,(0,G.jsx)(qp,{children:`ANTHROPIC_API_KEY`}),` la remplace si elle est définie.`]})]})]})}var Iz=[{id:`core`,label:`Cœur du changement`,hint:`attention élevée, comportement modifié ou code sensible`},{id:`contract`,label:`Contrats et API`,hint:`API publique, types partagés, schémas, formats de données`},{id:`other`,label:`Autres changements de code`,hint:`sans changement de comportement probable`},{id:`tests`,label:`Tests`,hint:`tests, fixtures, snapshots`},{id:`support`,label:`Docs et configuration`,hint:`documentation, build, outillage, CI`},{id:`mechanical`,label:`Mécanique`,hint:`renommages, mise en forme, dépendances, fichiers générés`}],Lz={logic:`Logique`,contract:`Contrat`,ui:`UI`,tests:`Tests`,config:`Config`,docs:`Docs`,generated:`Généré`},Rz={feature:`Ajout`,fix:`Correctif`,refactor:`Refactor`,rename:`Renommage`,format:`Forme`,deps:`Dépendances`},zz=[`Mécanique`,`Faible risque`,`À lire`,`Critique`],Bz=.5,Vz=[`rename`,`format`,`deps`];function Hz(e){let t=e.role.value,n=e.attention.value;return t===`generated`||Vz.includes(e.nature.value)&&n<1?`mechanical`:t===`tests`?`tests`:t===`docs`||t===`config`?`support`:n>=1.5||e.sensitive>=.5?`core`:t===`contract`||e.api>=.5?`contract`:e.behaviour>=.5?`core`:`other`}function Uz(e,t,n){let r=new Map;for(let[e,n]of t)r.set(e,Hz(n));return FI(Iz.map(t=>({items:e.filter(e=>r.get(e)===t.id)})),e,n)}var Wz=e=>e.split(`/`).at(-1)??e,Gz=e=>e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``,Kz=e=>`${Math.round(e*100)} %`,qz=1e4,Jz=e=>({key:e,intents:new Map,failed:new Map,total:null,concurrency:1,done:!1,modelMs:0,modelFiles:0,error:null});function Yz(e,t){switch(t.type){case`start`:return{...e,total:t.total,concurrency:t.concurrency,error:null};case`file`:{let n=new Map(e.failed);return n.delete(t.path),{...e,intents:new Map(e.intents).set(t.path,t.intent),failed:n,modelMs:e.modelMs+(t.ms??0),modelFiles:e.modelFiles+(t.ms===null?0:1)}}case`failed`:return{...e,failed:new Map(e.failed).set(t.path,t.message)};case`done`:return{...e,done:!0}}}function Xz(e,t,n){let r=ED(),i=W_(),a=dy({...r.ai.status.queryOptions(),enabled:n,staleTime:0,refetchInterval:e=>e.state.data?.state!==`ready`&&e.state.data?.kind===`local`&&3e3}),o=a.data?.state===`ready`?a.data.kind:null,s=`${e.owner}/${e.repo}#${e.number}:${t.base}...${t.head}:${o}`,[c,l]=(0,C.useState)(()=>Jz(s)),u=c.key===s?c:Jz(s),d=e=>l(t=>e(t.key===s?t:Jz(s)));return xD(r.pr.intent.subscriptionOptions({ref:e,base:t.base,head:t.head,fullPr:t.fullPr,model:o??`local`},{enabled:n&&o!==null,onData:e=>{d(t=>Yz(t,e)),o===`claude`&&e.type!==`start`&&i.invalidateQueries({queryKey:r.ai.usage.queryKey()})},onError:e=>{d(t=>({...t,error:e.message})),a.refetch()}})),{status:a,progress:u}}var Zz={logic:`blue`,contract:`grape`,ui:`cyan`,tests:`teal`,config:`gray`,docs:`gray`,generated:`dark`};function Qz({value:e}){let t=Math.round(e);return(0,G.jsxs)(Z,{span:!0,size:`xs`,ff:`monospace`,c:t>=3?`red`:t===2?`orange`:`dimmed`,children:[`●`.repeat(t+1),`○`.repeat(3-t)]})}function $z(e){let t=t=>e.ruled.includes(t)?` (règle de chemin)`:``;return[`Rôle : ${Lz[e.role.value]} — confiance ${Kz(e.role.confidence)}${t(`role`)}`,`Nature : ${Rz[e.nature.value]} — confiance ${Kz(e.nature.confidence)}${t(`nature`)}`,`Attention : ${zz[Math.round(e.attention.value)]} (${e.attention.value.toFixed(1)} / 3)${t(`attention`)}`,`Comportement modifié : ${Kz(e.behaviour)}${t(`behaviour`)}`,`API / schéma / format modifié : ${Kz(e.api)}${t(`api`)}`,`Code sensible (auth, secrets, SQL, fichiers, entrées) : ${Kz(e.sensitive)}${t(`sensitive`)}`].join(`
|
|
113
|
-
`)}function eB({intent:e}){let t=e.role.confidence>=Bz,n=e.nature.confidence>=Bz;return(0,G.jsxs)(X,{gap:4,wrap:`nowrap`,children:[e.sensitive>=.5&&(0,G.jsx)(Ep,{size:`xs`,color:`red`,variant:`filled`,radius:`sm`,children:`sensible`}),e.api>=.5&&!(t&&e.role.value===`contract`)&&(0,G.jsx)(Ep,{size:`xs`,color:`grape`,variant:`outline`,radius:`sm`,children:`API`}),t&&(0,G.jsx)(Ep,{size:`xs`,radius:`sm`,variant:`light`,color:Zz[e.role.value],children:Lz[e.role.value]}),n&&(0,G.jsx)(Ep,{size:`xs`,radius:`sm`,variant:`outline`,color:`gray`,children:Rz[e.nature.value]}),(0,G.jsx)(Qz,{value:e.attention.value}),(0,G.jsx)(Gh,{multiline:!0,w:360,withArrow:!0,position:`right`,label:(0,G.jsx)(`span`,{style:{whiteSpace:`pre-line`},children:$z(e)}),children:(0,G.jsx)(`span`,{className:`intent-help`,"aria-label":`Détail du classement`,title:``,children:`?`})})]})}function tB(e){let t=Math.round(e/1e3);return t<90?`${t} s`:`${Math.round(t/60)} min`}function nB(e){let{status:t,progress:n}=e.intents,[r,i]=Ge({key:`br:intentHideMechanical`,defaultValue:!1});if(t.isPending)return(0,G.jsx)(X,{justify:`center`,p:`md`,children:(0,G.jsx)(El,{size:`sm`})});if(t.isError)return(0,G.jsx)(Jd,{color:`red`,m:`xs`,title:`Statut du modèle indisponible`,children:t.error.message});if(t.data.state!==`ready`)return(0,G.jsx)(sB,{status:t.data,onRetry:()=>void t.refetch()});let a=n.intents.size+n.failed.size,o=n.total,s=n.modelFiles>0?n.modelMs/n.modelFiles:null,c=e=>{let t=n.intents.get(e);return t?Hz(t):null},l=t=>{let r=n.intents.get(t.path),i=n.failed.get(t.path);return(0,G.jsxs)(`div`,{className:`tree-node intent-node`,"data-current":t.path===e.currentPath||void 0,"data-viewed":t.state===`viewed`||void 0,title:t.path,onClick:()=>e.onSelect(t.path),children:[n.done&&(0,G.jsx)(`span`,{className:`link-rank`,children:e.stats.indexOf(t)+1}),(0,G.jsx)(gz,{state:t.state}),(0,G.jsxs)(`span`,{className:`tree-name`,children:[Wz(t.path),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,ml:6,children:Gz(t.path)})]}),(0,G.jsx)(`div`,{className:`intent-tags`,children:r?(0,G.jsx)(eB,{intent:r}):i?(0,G.jsx)(Gh,{label:i,children:(0,G.jsx)(Ep,{size:`xs`,color:`red`,variant:`outline`,radius:`sm`,children:`échec`})}):(0,G.jsx)(El,{size:10})})]},t.path)},u=e.stats.filter(e=>c(e.path)===null);return(0,G.jsxs)(`div`,{className:`links-view`,children:[(0,G.jsxs)(tg,{gap:4,px:10,pb:6,children:[n.error&&(0,G.jsx)(Jd,{color:`red`,p:6,title:`Classement interrompu`,children:(0,G.jsx)(Z,{size:`xs`,children:n.error})}),!n.done&&!n.error&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Classement : `,a,`/`,o??`…`,s!==null&&o!==null?` · ≈ ${tB(s)} / fichier · reste ≈ ${tB((o-a)*s/n.concurrency)}`:``]}),(0,G.jsx)(gh,{size:`xs`,value:o?a/o*100:0,animated:!0})]}),t.data.kind===`local`&&s!==null&&s>qz&&(0,G.jsxs)(Z,{size:`xs`,c:`orange`,children:[`Machine lente pour ce modèle (`,tB(s),` par fichier) : un GPU est recommandé. Les fichiers déjà classés restent en cache.`]}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:n.done?`Ordre de lecture : du cœur du changement au mécanique, la base d’abord dans chaque groupe.`:`L’ordre de lecture passe par intention quand tous les fichiers sont classés.`}),(0,G.jsx)(ip,{size:`xs`,label:`Masquer le mécanique`,checked:r,onChange:e=>i(e.currentTarget.checked)}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Modèle : `,Nz[t.data.kind],` ·`,` `,(0,G.jsx)(tf,{component:bC,to:`/settings`,size:`xs`,children:`changer`})]})]}),(0,G.jsxs)(`div`,{className:`file-nav-scroll`,children:[Iz.map(t=>{if(r&&t.id===`mechanical`)return null;let n=e.stats.filter(e=>c(e.path)===t.id);return n.length===0?null:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Gh,{label:t.hint,children:(0,G.jsxs)(`div`,{className:`pkg-head`,children:[(0,G.jsx)(Z,{span:!0,size:`xs`,fw:700,style:{flex:1},children:t.label}),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,children:n.length})]})}),n.map(l)]},t.id)}),u.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`pkg-head`,children:[(0,G.jsx)(Z,{span:!0,size:`xs`,fw:700,style:{flex:1},children:n.done?`Non classés`:`En cours de classement`}),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,children:u.length})]}),u.map(l)]})]})]})}var rB={absent:e=>`Aucun serveur ne répond sur ${e.url}.`,loading:()=>`llama-server charge le modèle…`,"no-key":e=>`${e.url} demande une clé.`,unauthorized:e=>`${e.url} refuse la clé de better-review : relancer llama-server avec la commande ci-dessous (option --api-key).`,"not-decision":e=>`${e.url} répond, mais ne sert pas de modèle de décision${e.model?` (${e.model})`:``} : vérifier le modèle et la version de llama.cpp (≥ 0.7.0).`},iB={absent:()=>`API Anthropic injoignable, ou Claude Haiku 5.5 indisponible pour ce compte.`,loading:()=>`API Anthropic en cours de vérification…`,"no-key":()=>`Clé API Anthropic requise.`,unauthorized:()=>`La clé Anthropic est refusée : en enregistrer une autre.`,"not-decision":()=>`Réponse inattendue de l’API Anthropic.`},aB=`https://github.com/ggml-org/llama.cpp/releases`;function oB({platform:e}){return e===`darwin`?(0,G.jsxs)(Z,{size:`xs`,children:[(0,G.jsx)(qp,{children:`brew install llama.cpp`}),` puis vérifier `,(0,G.jsx)(qp,{children:`llama-server --version`}),` ≥ 0.7.0 (la 0.6.0 ne charge pas d1), ou l’archive `,(0,G.jsx)(qp,{children:`macos-arm64`}),` des`,` `,(0,G.jsx)(tf,{href:aB,children:`releases`}),` (Apple Silicon : accélération Metal).`]}):e===`win32`?(0,G.jsxs)(Z,{size:`xs`,children:[`Archive des `,(0,G.jsx)(tf,{href:aB,children:`releases llama.cpp`}),` selon le GPU :`,` `,(0,G.jsx)(qp,{children:`win-cuda-13.4-x64`}),` ou `,(0,G.jsx)(qp,{children:`win-cuda-12.4-x64`}),` (NVIDIA), `,(0,G.jsx)(qp,{children:`win-rocm`}),` `,`(AMD), `,(0,G.jsx)(qp,{children:`win-vulkan-x64`}),` (autres) ; l’extraire et ajouter le dossier au `,(0,G.jsx)(qp,{children:`PATH`}),`.`]}):(0,G.jsxs)(Z,{size:`xs`,children:[`Archive des `,(0,G.jsx)(tf,{href:aB,children:`releases llama.cpp`}),` selon le GPU :`,` `,(0,G.jsx)(qp,{children:`ubuntu-cuda-13.4-x64`}),` ou `,(0,G.jsx)(qp,{children:`ubuntu-cuda-12.8-x64`}),` (NVIDIA),`,` `,(0,G.jsx)(qp,{children:`ubuntu-rocm`}),` (AMD), `,(0,G.jsx)(qp,{children:`ubuntu-vulkan-x64`}),` (autres), `,(0,G.jsx)(qp,{children:`ubuntu-x64`}),` (CPU seul) ; l’extraire et ajouter le dossier au `,(0,G.jsx)(qp,{children:`PATH`}),`.`]})}function sB(e){let{status:t}=e,n=t.kind===`claude`?iB:rB,r=t.state===`ready`?null:n[t.state](t);return(0,G.jsx)(`div`,{className:`file-nav-scroll`,children:(0,G.jsxs)(tg,{gap:`xs`,px:10,pb:`md`,children:[(0,G.jsx)(Z,{size:`sm`,fw:600,children:`Vue Intention : modèle requis`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Chaque fichier est classé (rôle, nature du changement, attention requise, API, code sensible) par un modèle, au choix :`}),(0,G.jsx)(Fz,{}),(0,G.jsx)(Jd,{color:t.state===`loading`?`blue`:`orange`,p:6,children:(0,G.jsxs)(X,{gap:6,wrap:`nowrap`,children:[t.state===`loading`&&(0,G.jsx)(El,{size:12}),(0,G.jsx)(Z,{size:`xs`,children:r})]})}),t.kind===`local`&&(0,G.jsx)(cB,{status:t,onRetry:e.onRetry})]})})}function cB(e){let{status:t}=e;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{size:`xs`,fw:600,children:`Prérequis`}),(0,G.jsxs)(Nm,{size:`xs`,spacing:2,children:[(0,G.jsx)(Nm.Item,{children:`GPU avec ≥ 6 Go de VRAM (NVIDIA, AMD, Vulkan) ou Apple Silicon 16 Go`}),(0,G.jsx)(Nm.Item,{children:`≈ 3 Go de disque pour le modèle (téléchargé au premier lancement)`}),(0,G.jsx)(Nm.Item,{children:`Sans GPU : fonctionne, mais ≈ 30 s par fichier`})]}),(0,G.jsx)(Z,{size:`xs`,fw:600,children:`1. Installer llama.cpp ≥ 0.7.0`}),(0,G.jsx)(oB,{platform:t.platform}),(0,G.jsx)(Z,{size:`xs`,fw:600,children:`2. Lancer le modèle (laisser tourner)`}),(0,G.jsx)(qp,{block:!0,style:{whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:t.command}),(0,G.jsx)($p,{value:t.command,children:({copied:e,copy:t})=>(0,G.jsx)(Fp,{size:`compact-xs`,variant:`light`,onClick:t,w:`fit-content`,children:e?`Copié`:`Copier la commande`})}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`La clé protège le serveur des autres sites ouverts dans le navigateur (llama-server accepte toutes les origines). Autre adresse : `,(0,G.jsx)(qp,{children:`BR_AI_URL`}),` ; clé imposée : `,(0,G.jsx)(qp,{children:`BR_AI_KEY`}),`.`]}),(0,G.jsx)(Z,{size:`xs`,fw:600,children:`3. Détection`}),(0,G.jsxs)(X,{gap:6,children:[(0,G.jsx)(El,{size:10}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Vérifié toutes les 3 s`}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,onClick:e.onRetry,children:`Tester maintenant`})]})]})}var lB=Object.defineProperty,uB=(e,t,n)=>t in e?lB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dB=(e,t)=>{for(var n in t)lB(e,n,{get:t[n],enumerable:!0})},fB=(e,t,n)=>uB(e,typeof t==`symbol`?t:t+``,n),pB={};dB(pB,{Graph:()=>QB,alg:()=>EB});var mB=Object.defineProperty,hB=(e,t)=>{for(var n in t)mB(e,n,{get:t[n],enumerable:!0})},gB=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=yB(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=bB(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,_B(this._preds[a],i),_B(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?xB(this._isDirected,e):yB(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?xB(this._isDirected,e):yB(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?xB(this._isDirected,e):yB(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],vB(this._preds[t],e),vB(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function _B(e,t){e[t]?e[t]++:e[t]=1}function vB(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function yB(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function bB(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function xB(e,t){return yB(e,t.v,t.w,t.name)}hB({},{read:()=>TB,write:()=>SB});function SB(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:CB(e),edges:wB(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function CB(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function wB(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function TB(e){let t=new gB(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var EB={};hB(EB,{CycleException:()=>VB,bellmanFord:()=>OB,components:()=>AB,dijkstra:()=>NB,dijkstraAll:()=>FB,findCycles:()=>LB,floydWarshall:()=>zB,isAcyclic:()=>UB,postorder:()=>qB,preorder:()=>JB,prim:()=>YB,shortestPaths:()=>XB,tarjan:()=>IB,topsort:()=>HB});var DB=()=>1;function OB(e,t,n,r){return kB(e,String(t),n||DB,r||function(t){return e.outEdges(t)??[]})}function kB(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function AB(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var jB=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},MB=()=>1;function NB(e,t,n,r){return PB(e,String(t),n||MB,r||function(t){return e.outEdges(t)??[]})}function PB(e,t,n,r){let i={},a=new jB,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function FB(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=NB(e,i,t,n),r},{})}function IB(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function LB(e){return IB(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var RB=()=>1;function zB(e,t,n){return BB(e,t||RB,n||function(t){return e.outEdges(t)??[]})}function BB(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var VB=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function HB(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new VB;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new VB;return r}function UB(e){try{HB(e)}catch(e){if(e instanceof VB)return!1;throw e}return!0}function WB(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=GB(e,t,n===`post`,o,a,r,i)}),i}function GB(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=GB(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function KB(e,t,n){return WB(e,t,n,function(e,t){return e.push(t),e},[])}function qB(e,t){return KB(e,t,`post`)}function JB(e,t){return KB(e,t,`pre`)}function YB(e,t){var n;let r=new gB,i={},a=new jB,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function XB(e,t,n,r){return ZB(e,t,n,r??(t=>e.outEdges(t)??[]))}function ZB(e,t,n,r){if(n===void 0)return NB(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return OB(e,t,n,r)}return NB(e,t,n,r)}var QB=gB;function $B(e,t,n,r){let i=r;for(;e.hasNode(i);)i=hV(r);return n.dummy=t,e.setNode(i,n),i}function eV(e){let t=new QB().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function tV(e){let t=new QB({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function nV(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function rV(e){let t=gV(uV(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function iV(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=lV(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function aV(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=lV(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function oV(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),$B(e,`border`,i,t)}function sV(e,t=cV){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var cV=65535;function lV(e,t){return t.length>cV?e(...sV(t).map(t=>e(...t))):e(...t)}function uV(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return lV(Math.max,t)}function dV(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function fV(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function pV(e,t){return t()}var mV=0;function hV(e){return e+(``+ ++mV)}function gV(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function _V(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function vV(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function yV(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var bV=`\0`;function xV(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var SV=`3.1.1`,CV=class{constructor(){fB(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return wV(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&wV(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,TV)),n=n._prev;return`[`+e.join(`, `)+`]`}};function wV(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function TV(e,t){if(e!==`_next`&&e!==`_prev`)return t}var EV=CV,DV=()=>1;function OV(e,t){if(e.nodeCount()<=1)return[];let n=jV(e,t||DV);return kV(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function kV(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)AV(e,t,n,o);for(;o=i.dequeue();)AV(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(AV(e,t,n,o,!0)||[]);break}}}return r}function AV(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,MV(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,MV(t,n,o)}),e.removeNode(r.v),o}function jV(e,t){let n=new QB,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=NV(i+r+3).map(()=>new EV),o=r+1;return n.nodes().forEach(e=>{MV(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function MV(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function NV(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function PV(e,t){(e.graph().acyclicer===`greedy`?OV(e,n(e)):FV(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,hV(`rev`))});function n(e){return t=>e.edge(t).weight}}function FV(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&LV(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function IV(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function LV(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function RV(e){e.graph().dummyChains=[],e.edges().forEach(t=>zV(e,t))}function zV(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=$B(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function BV(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function VV(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=lV(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function HV(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var UV=WV;function WV(e){let t=new QB({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;GV(t,e)<i&&(a=KV(t,e),a);)o=t.hasNode(a.v)?HV(e,a):-HV(e,a),qV(t,e,o);return t}function GV(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!HV(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function KV(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=HV(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function qV(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:JV,postorder:YV}=EB,XV=ZV;ZV.initLowLimValues=tH,ZV.initCutValues=QV,ZV.calcCutValue=eH,ZV.leaveEdge=rH,ZV.enterEdge=iH,ZV.exchangeEdges=aH;function ZV(e){e=eV(e),VV(e);let t=UV(e);tH(t),QV(t,e);let n,r;for(;n=rH(t);)r=iH(t,e,n),aH(t,e,n,r)}function QV(e,t){let n=YV(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>$V(e,t,n))}function $V(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=eH(e,t,n)}function eH(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,sH(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function tH(e,t){arguments.length<2&&(t=e.nodes()[0]),nH(e,{},1,t)}function nH(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=nH(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function rH(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function iH(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===cH(e,e.node(t.v),s)&&c!==cH(e,e.node(t.w),s)).reduce((e,n)=>HV(t,n)<HV(t,e)?n:e)}function aH(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),tH(e),QV(e,t),oH(e,t)}function oH(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=JV(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function sH(e,t,n){return e.hasEdge(t,n)}function cH(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var lH=uH;function uH(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:pH(e);break;case`tight-tree`:fH(e);break;case`longest-path`:dH(e);break;case`none`:break;default:pH(e)}}var dH=VV;function fH(e){VV(e),UV(e)}function pH(e){XV(e)}var mH=hH;function hH(e){let t=_H(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=gH(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function gH(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function _H(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(bV).forEach(r),t}function vH(e){let t=$B(e,`root`,{},`_root`),n=bH(e),r=Object.values(n),i=lV(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=xH(e)+1;e.children(bV).forEach(r=>{yH(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function yH(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=oV(e,`_bt`),l=oV(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{yH(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function bH(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(bV).forEach(e=>n(e,1)),t}function xH(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function SH(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var CH=wH;function wH(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)TH(e,`borderLeft`,`_bl`,n,i,t),TH(e,`borderRight`,`_br`,n,i,t)}}e.children(bV).forEach(t)}function TH(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=$B(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function EH(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&OH(e)}function DH(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&AH(e),(t===`lr`||t===`rl`)&&(MH(e),OH(e))}function OH(e){e.nodes().forEach(t=>kH(e.node(t))),e.edges().forEach(t=>kH(e.edge(t)))}function kH(e){let t=e.width;e.width=e.height,e.height=t}function AH(e){e.nodes().forEach(t=>jH(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(jH),Object.hasOwn(r,`y`)&&jH(r)})}function jH(e){e.y=-e.y}function MH(e){e.nodes().forEach(t=>NH(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(NH),Object.hasOwn(r,`x`)&&NH(r)})}function NH(e){let t=e.x;e.x=e.y,e.y=t}function PH(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=gV(lV(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return xV(t,e.node(n),e.node(r))}return a}function FH(e,t){let n=0;for(let r=1;r<t.length;++r)n+=IH(e,t[r-1],t[r]);return n}function IH(e,t,n){let r=yV(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function LH(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function RH(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),zH(Object.values(n).filter(e=>!e.indegree))}function zH(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&BH(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>_V(e,[`vs`,`i`,`barycenter`,`weight`]))}function BH(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function VH(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=dV(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(UH(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=HH(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=HH(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function HH(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function UH(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=xV(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function WH(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=LH(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=WH(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&KH(t,r)}});let h=RH(m,n);GH(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=VH(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function GH(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function KH(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function qH(e,t,n,r){r||=e.nodes();let i=JH(e),a=new QB({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function JH(e){let t;for(;e.hasNode(t=hV(`_root`)););return t}function YH(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function XH(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,XH);return}let r=uV(e),i=ZH(e,gV(1,r+1),`inEdges`),a=ZH(e,gV(r-1,-1,-1),`outEdges`),o=PH(e,n);if($H(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){QH(t%2?i:a,t%4>=2,l,n),o=rV(e);let u=FH(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}$H(e,c)}function ZH(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return qH(e,t,n,r.get(t)||[])})}function QH(e,t,n,r){let i=!0,a=new QB;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=WH(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),YH(e,a,s.vs)})}function $H(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function eU(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=nU(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&rU(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function tU(e,t){let n={};function r(t,r,i,a,o){gV(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&rU(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function nU(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function rU(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function iU(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function aU(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||mU(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>mU(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!iU(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function oU(e,t,n,r,i=!1){let a={},o=sU(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function sU(e,t,n,r){let i=new QB,a=e.graph(),o=fU(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function cU(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=pU(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function lU(e,t){let n=Object.values(t),r=lV(Math.min,n),i=lV(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-lV(Math.min,c);a!==`l`&&(l=i-lV(Math.max,c)),l&&(e[o]=vV(s,e=>e+l))})})}function uU(e,t=void 0){let n=e.ul;return n?vV(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function dU(e,t){let n=rV(e),r=Object.assign(eU(e,n),tU(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=aU(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=oU(e,a,s.root,s.align,n===`r`);n===`r`&&(c=vV(c,e=>-e)),i[o+n]=c})}),lU(i,cU(e,i)),uU(i,e.graph().align)}function fU(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function pU(e,t){return e.node(t).width}function mU(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function hU(e,t){e=tV(e),gU(e),Object.entries(dU(e,t)).forEach(([t,n])=>e.node(t).x=n)}function gU(e){let t=rV(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var _U=new WeakMap;function vU(e,t={}){return bU(e,pV,t),e}function yU(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function bU(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new QB({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=yU(e,t.v,r),i=yU(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),bU(o,t,n);let l=jU(o);xU(l,t,n,null),SU(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=jU(e),g=xU(h,t,n,_U.get(e)??null);_U.set(e,g),SU(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function xU(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>MU(e)),t(` removeSelfEdges`,()=>VU(e)),t(` acyclic`,()=>PV(e,s)),t(` nestingGraph.run`,()=>vH(e)),t(` rank`,()=>lH(tV(e))),t(` injectEdgeLabelProxies`,()=>NU(e)),t(` removeEmptyRanks`,()=>aV(e)),t(` nestingGraph.cleanup`,()=>SH(e)),t(` normalizeRanks`,()=>iV(e)),t(` assignRankMinMax`,()=>PU(e)),t(` removeEdgeLabelProxies`,()=>FU(e)),t(` normalize.run`,()=>RV(e)),t(` parentDummyChains`,()=>mH(e)),t(` addBorderSegments`,()=>CH(e)),t(` order`,()=>XH(e,n,c)),t(` insertSelfEdges`,()=>HU(e)),t(` adjustCoordinateSystem`,()=>EH(e)),t(` position`,()=>hU(e,n.corePath)),t(` positionSelfEdges`,()=>UU(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>BU(e)),t(` normalize.undo`,()=>BV(e)),t(` fixupEdgeLabelCoords`,()=>RU(e)),t(` undoCoordinateSystem`,()=>DH(e)),t(` translateGraph`,()=>IU(e)),t(` assignNodeIntersects`,()=>LU(e)),t(` reversePoints`,()=>zU(e)),t(` acyclic.undo`,()=>IV(e)),{graph:e,rawNodes:l}}function SU(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var CU=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],wU={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},TU=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],EU=[`width`,`height`,`rank`],DU={width:0,height:0},OU=[`minlen`,`weight`,`width`,`height`,`labeloffset`],kU={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},AU=[`labelpos`];function jU(e){let t=new QB({multigraph:!0,compound:!0}),n=GU(e.graph());return t.setGraph(Object.assign({},wU,WU(n,CU),_V(n,TU))),e.nodes().forEach(n=>{let r=WU(GU(e.node(n)),EU);Object.keys(DU).forEach(e=>{r[e]===void 0&&(r[e]=DU[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=GU(e.edge(n));t.setEdge(n,Object.assign({},kU,WU(r,OU),_V(r,AU)))}),t}function MU(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function NU(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);$B(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function PU(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function FU(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function IU(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function LU(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(nV(r,a)),n.points.push(nV(i,o))})}function RU(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function zU(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function BU(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function VU(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function HU(e){rV(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{$B(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function UU(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function WU(e,t){return vV(_V(e,t),Number)}function GU(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function KU(e){let t=rV(e),n=new QB({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var qU={graphlib:pB,version:SV,layout:vU,debug:KU,util:{time:fV,notime:pV}},JU=7.2;function YU(e){let t=e.split(`/`).at(-1)??e,n=e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``;return Math.min(300,Math.max(110,Math.max(t.length,Math.min(n.length,36)*.85)*JU+28))}function XU(e,t,n=[],r=null){let i=new qU.graphlib.Graph({multigraph:!0,compound:!0});i.setGraph({rankdir:`LR`,nodesep:n.length>0?44:16,ranksep:90,edgesep:10,marginx:24,marginy:24+(n.length>0?18:0)}),i.setDefaultEdgeLabel(()=>({}));for(let t of e)i.setNode(t,{width:YU(t),height:38});let a=new Set(e),o=[];for(let e of n){let t=e.members.filter(e=>a.has(e));if(t.length===0)continue;let n=`cluster:${e.id}`;i.setNode(n,{width:0,height:0});for(let e of t)i.setParent(e,n);o.push({id:e.id,label:e.label,key:n})}let s=new Map(o.map(e=>[e.id,e.key])),c=e=>`package:${e}`;for(let e of r?.packages??[]){i.setNode(c(e.id),{width:Math.max(110,e.label.length*JU+32),height:26});let t=s.get(e.id);t&&i.setParent(c(e.id),t)}let l=(r?.edges??[]).filter(e=>i.hasNode(c(e.from))&&i.hasNode(c(e.to)));l.forEach((e,t)=>i.setEdge(c(e.to),c(e.from),{},`pkg:${t}`)),t.forEach((e,t)=>i.setEdge(e.to,e.from,{},`${e.kind}:${t}`)),qU.layout(i);let u=e=>{let t=i.node(e);return{x:(t.x??0)-t.width/2,y:(t.y??0)-t.height/2,width:t.width,height:t.height}},d=e.map(e=>({path:e,...u(e)})),f=o.map(({id:e,label:t,key:n})=>({id:e,label:t,...u(n)})),p=t.map((e,t)=>({edge:e,points:i.edge({v:e.to,w:e.from,name:`${e.kind}:${t}`}).points??[]})),m=new Set((r?.packages??[]).filter(e=>e.touched).map(e=>e.id)),h=(r?.packages??[]).map(e=>({...e,...u(c(e.id))})),g=l.map((e,t)=>({from:e.from,to:e.to,touched:m.has(e.from)&&m.has(e.to),points:i.edge({v:c(e.to),w:c(e.from),name:`pkg:${t}`}).points??[]})),_=i.graph();return{nodes:d,edges:p,clusters:f,packageNodes:h,packageEdges:g,width:_.width??0,height:_.height??0}}var ZU=6,QU=34;function $U(e,t,n,r){let i=new Map;for(let r of e){let e=n===`from`?r.from:r.to;(n===`from`?r.to:r.from)===t&&e!==t&&i.set(e,[...i.get(e)??[],r])}let a=e=>+!e.some(e=>e.kind===`import`);return[...i].sort(([e,t],[n,i])=>r(e)-r(n)||a(t)-a(i)||e.localeCompare(n))}function eW(e,t,n,r=()=>0){let i=$U(t,e,`from`,r),a=$U(t,e,`to`,r),o=Math.max(1,i.length,a.length),s=Math.max(38,o*26+(o-1)*ZU),c=Math.min(Math.max(100,n*.3),200),l=+(i.length>0)+ +(a.length>0),u=l===0?0:Math.max(60,(n-c-l*QU)/l),d=(e,t)=>{let n=e.length*26+Math.max(0,e.length-1)*ZU,r=(s-n)/2;return e.map(([e,n],i)=>({path:e,x:t,y:r+i*32,width:u,height:26,edges:n}))},f=a.length>0?u+QU:l===0?(n-c)/2:0;return{center:{path:e,x:f,y:(s-38)/2,width:c,height:38},outgoing:d(a,0),incoming:d(i,f+c+QU),width:n,height:s}}var tW=e=>e.split(`/`).at(-1)??e,nW=e=>e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``;function rW(e){if(e.length===0)return``;let t=`M${e[0].x},${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]??e[n],i=e[n],a=e[n+1],o=e[n+2]??a,s={x:i.x+(a.x-r.x)/6,y:i.y+(a.y-r.y)/6},c={x:a.x-(o.x-i.x)/6,y:a.y-(o.y-i.y)/6};t+=` C${s.x},${s.y} ${c.x},${c.y} ${a.x},${a.y}`}return t}function iW(e,t){let n=Math.max(3,Math.floor((t-14)/7.7));return e.length>n?`${e.slice(0,n-1)}…`:e}function aW(e,t,n,r){let i=(n-e)/2;return`M${e},${t} C${e+i},${t} ${n-i},${r} ${n},${r}`}var oW=`package:`;function sW(e){let{ref:t,width:n}=$e(),r=(0,C.useMemo)(()=>new Map(e.stats.map(e=>[e.path,e])),[e.stats]),i=e.packages,a=(0,C.useMemo)(()=>new Map(i?.context.packages.map(e=>[e.id,e])??[]),[i]),o=e.center,s=(0,C.useMemo)(()=>{if(!o||!i)return e.edges;let t=i.rootOf.get(o),n=new Set(e.edges.filter(e=>e.from===o).map(e=>i.rootOf.get(e.to))),r=new Set(e.edges.filter(e=>e.to===o).map(e=>i.rootOf.get(e.from))),a=[];for(let e of i.imports[o]??[])e!==t&&!n.has(e)&&a.push({from:o,to:oW+e,kind:`import`,detail:[]});if(t!==void 0)for(let e of i.context.edges)e.to===t&&e.from!==t&&!r.has(e.from)&&a.push({from:oW+e.from,to:o,kind:`import`,detail:[]});return[...e.edges,...a]},[o,i,e.edges]),c=o&&n>0?eW(o,s,n,e=>+!!e.startsWith(oW)):null,l=c?r.get(c.center.path):void 0,u=o&&i?a.get(i.rootOf.get(o)??``)?.label:void 0,d=(t,n)=>{let r=t.path.slice(8),s=a.get(r),c=i?.firstFile.get(r),l=s?.touched===!0&&c!==void 0,d=s?.label??(r||`(racine)`),f=n===`out`?`${tW(o??``)} importe le package ${d}`:`le package ${d} utilise ${u??`ce package`}`;return(0,G.jsxs)(`g`,{className:`link-pkg`,"data-touched":s?.touched||void 0,transform:`translate(${t.x} ${t.y})`,style:{cursor:l?`pointer`:`default`},onClick:()=>l&&e.onSelect(c),children:[(0,G.jsx)(`rect`,{width:t.width,height:t.height,rx:t.height/2}),(0,G.jsx)(`text`,{x:t.width/2,y:17,textAnchor:`middle`,children:iW(d,t.width+6)}),(0,G.jsx)(`title`,{children:`${f}${s?.touched?l?` · clic : ouvrir ses fichiers`:``:` · aucun fichier modifié`}`})]},`${n}:${t.path}`)},f=(t,n)=>{let s=r.get(t.path),c=t.edges.every(e=>e.kind===`mention`),l=n===`in`?c?`mentionne`:`importe`:c?`mentionné par`:`importé par`,d=[...new Set(t.edges.flatMap(e=>e.detail))].join(`, `),f=i?a.get(i.rootOf.get(t.path)??``)?.label:void 0;return(0,G.jsxs)(`g`,{className:`link-node`,"data-state":s?.state,transform:`translate(${t.x} ${t.y})`,onClick:()=>e.onSelect(t.path),children:[(0,G.jsx)(`rect`,{width:t.width,height:t.height,rx:5,fill:s?Oz(s):`var(--br-surface)`}),(0,G.jsxs)(`text`,{x:7,y:17,className:`link-name`,children:[s?.state===`viewed`?`✓ `:``,iW(tW(t.path),t.width-(s?.state===`viewed`?14:0)),f&&f!==u&&(0,G.jsx)(`tspan`,{dx:6,className:`link-pkg-tag`,children:iW(f,t.width-(tW(t.path).length+2)*7.7)})]}),(0,G.jsx)(`title`,{children:`${t.path}${f?` (${f})`:``}\n${l} ${tW(o??``)}${d?` : ${d}`:``}`})]},`${n}:${t.path}`)},p=(e,t,n)=>{let r=t===`out`?aW(e.x+e.width,e.y+e.height/2,n.x,n.y+n.height/2):aW(n.x+n.width,n.y+n.height/2,e.x,e.y+e.height/2);if(e.path.startsWith(oW)){let n=a.get(e.path.slice(8))?.touched===!0;return(0,G.jsx)(`path`,{d:r,className:`link-pkg-edge`,"data-touched":n||void 0,markerEnd:n?`url(#ego-arrow-pkg)`:`url(#ego-arrow)`},`e:${t}:${e.path}`)}return(0,G.jsx)(`path`,{d:r,className:`link-edge`,"data-kind":e.edges.every(e=>e.kind===`mention`)?`mention`:`import`,markerEnd:`url(#ego-arrow)`},`e:${t}:${e.path}`)},m=(e,t)=>e.path.startsWith(oW)?d(e,t):f(e,t);return(0,G.jsxs)(`div`,{className:`ego`,ref:t,children:[(0,G.jsxs)(X,{gap:6,py:4,wrap:`nowrap`,children:[(0,G.jsxs)(Z,{size:`xs`,fw:600,truncate:!0,style:{flex:1},children:[o?tW(o):``,u&&(0,G.jsx)(Z,{span:!0,size:`xs`,c:`violet.3`,fw:500,ml:6,children:u})]}),c&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`utilise `,c.outgoing.length,` · utilisé par `,c.incoming.length]})]}),!o&&(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,pb:8,children:`Ouvrez un fichier pour voir ce qui l’utilise et ce qu’il utilise.`}),c&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(X,{justify:`space-between`,mb:2,children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`ce qu’il utilise`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`ce qui l’utilise →`})]}),c.incoming.length+c.outgoing.length===0?(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Aucun lien avec les autres fichiers`,i?` ou packages`:``,` de la PR.`]}):(0,G.jsxs)(`svg`,{width:`100%`,viewBox:`0 0 ${c.width} ${c.height}`,children:[(0,G.jsxs)(`defs`,{children:[(0,G.jsx)(`marker`,{id:`ego-arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-gray-5)`})}),(0,G.jsx)(`marker`,{id:`ego-arrow-pkg`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-violet-4)`})})]}),c.incoming.map(e=>p(e,`in`,c.center)),c.outgoing.map(e=>p(e,`out`,c.center)),c.incoming.map(e=>m(e,`in`)),c.outgoing.map(e=>m(e,`out`)),(0,G.jsxs)(`g`,{className:`link-node`,"data-current":!0,"data-state":l?.state,transform:`translate(${c.center.x} ${c.center.y})`,children:[(0,G.jsx)(`rect`,{width:c.center.width,height:38,rx:6,fill:l?Oz(l):`var(--br-surface)`}),(0,G.jsx)(`text`,{x:9,y:16,className:`link-name`,children:iW(tW(c.center.path),c.center.width)}),(0,G.jsx)(`text`,{x:9,y:30,className:`link-dir`,children:iW(nW(c.center.path)||`/`,c.center.width+10)}),(0,G.jsx)(`title`,{children:`${c.center.path}${u?` (${u})`:``}`})]})]})]})]})}function cW(e){let{ref:t,width:n,height:r}=$e(),[i,a]=(0,C.useState)(null),[o,s]=(0,C.useState)(null),c=(0,C.useRef)(null),l=(0,C.useMemo)(()=>new Map(e.stats.map(e=>[e.path,e])),[e.stats]),u=(0,C.useMemo)(()=>XU(e.stats.map(e=>e.path),e.edges,e.groups,e.context),[e.stats,e.edges,e.groups,e.context]),d=n>0&&u.width>0?Math.min(1.4,n/u.width,r/u.height):1,f=o??{k:d,x:(n-u.width*d)/2,y:(r-u.height*d)/2},p=new Map(u.packageNodes.map(e=>[e.id,e.label])),m=t=>i===null||t===i||e.edges.some(e=>e.from===i&&e.to===t||e.to===i&&e.from===t);return(0,G.jsxs)(`div`,{ref:t,className:`link-graph`,onWheel:e=>{let t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=Math.min(4,Math.max(.15,f.k*(e.deltaY<0?1.15:1/1.15)));s({k:i,x:n-(n-f.x)*i/f.k,y:r-(r-f.y)*i/f.k})},onMouseDown:e=>c.current={x:e.clientX-f.x,y:e.clientY-f.y},onMouseMove:e=>c.current&&s({k:f.k,x:e.clientX-c.current.x,y:e.clientY-c.current.y}),onMouseUp:()=>c.current=null,onMouseLeave:()=>c.current=null,children:[(0,G.jsxs)(`svg`,{width:n,height:r,children:[(0,G.jsxs)(`defs`,{children:[(0,G.jsx)(`marker`,{id:`arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-gray-5)`})}),(0,G.jsx)(`marker`,{id:`arrow-hl`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-blue-4)`})}),(0,G.jsx)(`marker`,{id:`arrow-pkg`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-violet-4)`})})]}),(0,G.jsxs)(`g`,{transform:`translate(${f.x} ${f.y}) scale(${f.k})`,children:[u.clusters.map(e=>(0,G.jsxs)(`g`,{className:`link-cluster`,transform:`translate(${e.x} ${e.y})`,children:[(0,G.jsx)(`rect`,{width:e.width,height:e.height,rx:10}),u.packageNodes.length===0&&(0,G.jsx)(`text`,{x:6,y:-6,children:e.label})]},e.id)),u.packageEdges.map(e=>{let t=i===`package:${e.from}`||i===`package:${e.to}`;return(0,G.jsx)(`path`,{d:rW(e.points),className:`link-pkg-edge`,"data-touched":e.touched||void 0,"data-active":t||void 0,markerEnd:e.touched?`url(#arrow-pkg)`:`url(#arrow)`,children:(0,G.jsx)(`title`,{children:`${p.get(e.from)??e.from} utilise ${p.get(e.to)??e.to}`})},`pkg:${e.from}:${e.to}`)}),u.packageNodes.map(e=>(0,G.jsxs)(`g`,{className:`link-pkg`,"data-touched":e.touched||void 0,transform:`translate(${e.x} ${e.y})`,onMouseEnter:()=>a(`package:${e.id}`),onMouseLeave:()=>a(null),children:[(0,G.jsx)(`rect`,{width:e.width,height:e.height,rx:e.height/2}),(0,G.jsx)(`text`,{x:e.width/2,y:17,textAnchor:`middle`,children:e.label}),(0,G.jsx)(`title`,{children:`${e.label} — ${e.id||`(racine)`}${e.touched?``:` · aucun fichier modifié`}`})]},`package:${e.id}`)),u.edges.map(({edge:e,points:t},n)=>{let r=i!==null&&(e.from===i||e.to===i),a=rW(t);return(0,G.jsx)(`path`,{d:a,className:`link-edge`,"data-kind":e.kind,"data-active":r||void 0,"data-dim":i!==null&&!r||void 0,markerEnd:r?`url(#arrow-hl)`:`url(#arrow)`,children:(0,G.jsxs)(`title`,{children:[e.from,` `,e.kind===`import`?`importe`:`mentionne`,` `,e.to,e.detail.length?` : ${e.detail.join(`, `)}`:``]})},n)}),u.nodes.map(t=>{let n=l.get(t.path);return(0,G.jsxs)(`g`,{className:`link-node`,"data-state":n?.state,"data-current":t.path===e.currentPath||void 0,"data-dim":!m(t.path)||void 0,transform:`translate(${t.x} ${t.y})`,onMouseEnter:()=>a(t.path),onMouseLeave:()=>a(null),onClick:()=>e.onSelect(t.path),children:[(0,G.jsx)(`rect`,{width:t.width,height:38,rx:6,fill:n?Oz(n):`var(--br-surface)`}),(0,G.jsxs)(`text`,{x:10,y:16,className:`link-name`,children:[n?.state===`viewed`?`✓ `:``,tW(t.path)]}),(0,G.jsx)(`text`,{x:10,y:30,className:`link-dir`,children:nW(t.path)||`/`}),n&&n.openThreads>0&&(0,G.jsx)(`circle`,{cx:t.width-9,cy:9,r:4,className:`link-thread`,"data-unread":n.unreadThreads>0||void 0}),(0,G.jsx)(`title`,{children:`${t.path}\n+${n?.additions??0} −${n?.deletions??0}`})]},t.path)})]})]}),o&&(0,G.jsx)(Fp,{size:`compact-xs`,variant:`default`,className:`link-fit`,onClick:()=>s(null),children:`Recadrer`})]})}function lW(e){let t=dW(),[n,r]=Ge({key:`br:linksMentions`,defaultValue:!0}),[i,a]=Ge({key:`br:linksIsolated`,defaultValue:!1}),[o,s]=(0,C.useState)(!1),c=(0,C.useMemo)(()=>(t.data?.edges??[]).filter(e=>n||e.kind===`import`),[t.data,n]),l=(0,C.useMemo)(()=>new Set(e.stats.map(e=>e.path)),[e.stats]),u=(0,C.useMemo)(()=>(t.data?.packages??[]).map(e=>({id:e.root,label:e.name,members:e.files})),[t.data]),d=fW(t.data),[f,p]=Ge({key:`br:linksWorkspace`,defaultValue:!0}),m=(0,C.useMemo)(()=>c.filter(e=>l.has(e.from)&&l.has(e.to)),[c,l]),h=new Map,g=new Map;for(let e of c)h.set(e.from,(h.get(e.from)??0)+1),g.set(e.to,(g.get(e.to)??0)+1);let _=e=>(h.get(e)??0)+(g.get(e)??0),v=t.data?.packages??[],y=e.stats,b=y.filter(e=>_(e.path)>0),x=y.filter(e=>_(e.path)===0),S=new Map(v.flatMap(e=>e.files.map(t=>[t,e.root]))),w=new Map(v.map(e=>[e.root,e.name])),T=i?e.stats:e.stats.filter(e=>m.some(t=>t.from===e.path||t.to===e.path));if(t.isPending)return(0,G.jsx)(pW,{});if(t.isError)return(0,G.jsx)(mW,{message:t.error.message});let E=(n,r)=>{let i=t.data.languages[n.path],a=t.data.externalImports[n.path]??0;return(0,G.jsxs)(`div`,{className:`tree-node`,"data-current":n.path===e.currentPath||void 0,"data-viewed":n.state===`viewed`||void 0,title:n.path,onClick:()=>e.onSelect(n.path),children:[r!==void 0&&(0,G.jsx)(`span`,{className:`link-rank`,children:r}),(0,G.jsx)(gz,{state:n.state}),(0,G.jsxs)(`span`,{className:`tree-name`,children:[tW(n.path),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,ml:6,children:nW(n.path)})]}),i&&(0,G.jsx)(Ep,{size:`xs`,variant:`outline`,color:`gray`,radius:`sm`,children:SR(i)}),(0,G.jsx)(Gh,{label:`importe / mentionne ${h.get(n.path)??0} · utilisé par ${g.get(n.path)??0}${a?` · ${a} import(s) hors PR`:``}`,children:(0,G.jsxs)(Z,{span:!0,size:`xs`,ff:`monospace`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`→`,h.get(n.path)??0,` ←`,g.get(n.path)??0]})})]},n.path)};return(0,G.jsxs)(`div`,{className:`links-view`,children:[(0,G.jsxs)(X,{gap:6,px:10,pb:6,children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[c.length,` liens · `,b.length,` fichiers reliés`]}),(0,G.jsx)(Fp,{size:`compact-xs`,ml:`auto`,variant:`light`,onClick:()=>s(!0),disabled:T.length===0,children:`Graphe ⤢`})]}),(0,G.jsx)(ip,{size:`xs`,px:10,pb:6,label:`Inclure les mentions (noms ou chemins cités dans le texte)`,checked:n,onChange:e=>r(e.currentTarget.checked)}),t.data.unreadable.length>0&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,px:10,pb:4,children:[`Non analysés (binaires / trop gros) : `,t.data.unreadable.length]}),(0,G.jsxs)(`div`,{className:`file-nav-scroll`,children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,px:10,pt:6,pb:2,children:v.length>0?`Ordre de lecture : packages les plus utilisés en premier, puis la base d’abord dans chaque package.`:`Ordre de lecture : la base d’abord (fichiers utilisés par les autres), puis ce qui les assemble.`}),v.length>0?(0,G.jsxs)(G.Fragment,{children:[v.map(e=>{let t=y.filter(t=>S.get(t.path)===e.root);if(t.length===0)return null;let n=e=>e.map(e=>w.get(e)??e).join(`, `);return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Gh,{multiline:!0,w:320,label:`${e.root||`(racine)`} · utilise : ${n(e.dependsOn)||`—`} · utilisé par : ${n(e.usedBy)||`—`}`,children:(0,G.jsxs)(`div`,{className:`pkg-head`,children:[(0,G.jsx)(Ep,{size:`xs`,variant:`light`,color:`violet`,radius:`sm`,children:e.ecosystem}),(0,G.jsx)(Z,{span:!0,size:`xs`,fw:700,truncate:!0,children:e.name}),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,truncate:!0,style:{flex:1},children:e.root?`${e.root}/`:``}),(0,G.jsxs)(Z,{span:!0,size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`utilisé par `,e.usedBy.length,` · utilise `,e.dependsOn.length]})]})}),t.map(e=>E(e,y.indexOf(e)+1))]},e.root)}),y.some(e=>!S.has(e.path))&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`tree-dir`,children:`Hors des packages`}),y.filter(e=>!S.has(e.path)).map(e=>E(e,y.indexOf(e)+1))]})]}):(0,G.jsxs)(G.Fragment,{children:[b.map((e,t)=>E(e,t+1)),x.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`tree-dir`,children:[`Sans lien avec les autres fichiers de la PR (`,x.length,`)`]}),x.map(e=>E(e))]})]})]}),(0,G.jsx)(Xm,{opened:o,onClose:()=>s(!1),fullScreen:!0,title:(0,G.jsxs)(X,{gap:`md`,children:[(0,G.jsx)(Z,{fw:600,children:`Liens entre les fichiers modifiés`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`à gauche la base (fichiers utilisés par les autres), à droite ce qui les utilise · flèche = « est utilisé par » · trait plein = import, pointillé = mention · glisser pour déplacer, molette pour zoomer, clic pour ouvrir le fichier`})]}),styles:{body:{height:`calc(100vh - 60px)`,padding:0}},children:(0,G.jsxs)(tg,{gap:0,h:`100%`,children:[(0,G.jsxs)(X,{gap:`lg`,px:`md`,py:6,children:[(0,G.jsx)(ip,{size:`xs`,label:`Mentions`,checked:n,onChange:e=>r(e.currentTarget.checked)}),(0,G.jsx)(ip,{size:`xs`,label:`Fichiers sans lien`,checked:i,onChange:e=>a(e.currentTarget.checked)}),d&&(0,G.jsx)(ip,{size:`xs`,label:`Autres packages du monorepo (${d.packages.filter(e=>!e.touched).length})`,checked:f,onChange:e=>p(e.currentTarget.checked)})]}),(0,G.jsx)(cW,{stats:T,groups:u,context:f?d:null,edges:m,currentPath:e.currentPath,onSelect:t=>{s(!1),e.onSelect(t)}})]})})]})}function uW(e){let t=dW(),[n,r]=Ge({key:`br:linksMentions`,defaultValue:!0}),i=(0,C.useMemo)(()=>(t.data?.edges??[]).filter(e=>n||e.kind===`import`),[t.data,n]),a=fW(t.data),o=(0,C.useMemo)(()=>{if(!t.data||!a)return null;let n=new Map(t.data.packages.flatMap(e=>e.files.map(t=>[t,e.root]))),r=new Map;for(let t of e.stats){let e=n.get(t.path);e!==void 0&&!r.has(e)&&r.set(e,t.path)}return{context:a,rootOf:n,firstFile:r,imports:t.data.packageImports}},[t.data,a,e.stats]);return t.isPending?(0,G.jsx)(pW,{}):t.isError?(0,G.jsx)(mW,{message:t.error.message}):(0,G.jsxs)(`div`,{className:`panel-body`,children:[(0,G.jsx)(ip,{size:`xs`,pb:6,label:`Inclure les mentions (noms ou chemins cités dans le texte)`,checked:n,onChange:e=>r(e.currentTarget.checked)}),(0,G.jsx)(sW,{center:e.currentPath,edges:i,stats:e.stats,onSelect:e.onSelect,packages:o})]})}function dW(){let e=zI();return dy({...ED().pr.links.queryOptions({ref:e.ref,base:e.range.base,head:e.range.head,fullPr:e.range.fullPr}),staleTime:1/0})}function fW(e){return(0,C.useMemo)(()=>e&&e.workspace.length>0?{packages:e.workspace.map(e=>({id:e.root,label:e.name,touched:e.touched})),edges:e.packageEdges}:null,[e])}function pW(){return(0,G.jsxs)(X,{p:`md`,gap:`xs`,children:[(0,G.jsx)(El,{size:`xs`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Analyse des imports…`})]})}function mW({message:e}){return(0,G.jsx)(Jd,{color:`red`,m:`xs`,title:`Liens indisponibles`,children:e})}function hW(e){let t=e.width??48,n=Dz(e),r=e.max>0?Math.max(n>0?2:0,n/e.max*t):0,i=n>0?e.additions/n*r:0;return(0,G.jsxs)(`span`,{className:`churn-bar`,style:{width:t},children:[(0,G.jsx)(`i`,{className:`add`,style:{width:i}}),(0,G.jsx)(`i`,{className:`del`,style:{width:r-i}})]})}function gW({additions:e,deletions:t}){return(0,G.jsxs)(Z,{span:!0,size:`xs`,ff:`monospace`,style:{whiteSpace:`nowrap`},children:[e>0&&(0,G.jsxs)(Z,{span:!0,c:`green.4`,inherit:!0,children:[`+`,e]}),` `,t>0&&(0,G.jsxs)(Z,{span:!0,c:`red.4`,inherit:!0,children:[`−`,t]})]})}function _W(e){let{stat:t}=e,n=(0,C.useRef)(null),r=e.current;return(0,C.useEffect)(()=>{r&&n.current?.scrollIntoView({block:`nearest`})},[r]),(0,G.jsxs)(`div`,{ref:n,className:`tree-node`,"data-current":r||void 0,"data-viewed":t.state===`viewed`||void 0,onClick:e.onSelect,title:t.path,style:{paddingLeft:10+e.depth*14},children:[(0,G.jsx)(gz,{state:t.state}),(0,G.jsxs)(`span`,{className:`tree-name`,children:[t.path.split(`/`).at(-1),e.dir&&(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,ml:6,children:e.dir})]}),t.openThreads>0&&(0,G.jsxs)(Z,{span:!0,size:`xs`,c:t.unreadThreads>0?`orange.4`:`yellow.4`,children:[(0,G.jsx)(`i`,{className:`ico-c`}),t.openThreads]}),(0,G.jsx)(hW,{additions:t.additions,deletions:t.deletions,max:e.maxChurn,width:36}),(0,G.jsx)(gW,{additions:t.additions,deletions:t.deletions})]})}function vW(e){let t=Math.max(0,...e.stats.map(Dz));if(e.sort===`churn`)return(0,G.jsx)(G.Fragment,{children:e.stats.map(n=>(0,G.jsx)(_W,{stat:n,depth:0,dir:n.path.includes(`/`)?n.path.slice(0,n.path.lastIndexOf(`/`)):void 0,current:n.path===e.currentPath,maxChurn:t,onSelect:()=>e.onSelect(n.path)},n.path))});let n=[];for(let t of e.stats){let e=t.path.includes(`/`)?t.path.slice(0,t.path.lastIndexOf(`/`)):``,r=n.at(-1);r&&r.dir===e?r.stats.push(t):n.push({dir:e,stats:[t]})}return(0,G.jsx)(G.Fragment,{children:n.map((n,r)=>(0,G.jsxs)(`div`,{children:[n.dir&&(0,G.jsxs)(`div`,{className:`tree-dir`,children:[n.dir,`/`]}),n.stats.map(n=>(0,G.jsx)(_W,{stat:n,depth:1,current:n.path===e.currentPath,maxChurn:t,onSelect:()=>e.onSelect(n.path)},n.path))]},`${n.dir}:${r}`))})}function yW(e){let[t,n]=(0,C.useState)(new Set),r=jz(e.root,t),i=Dz(e.root),a=Math.max(0,...r.flatMap(e=>e.kind===`file`?[Dz(e.stat)]:[])),o=e=>n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,G.jsx)(G.Fragment,{children:r.map(n=>n.kind===`dir`?(0,G.jsxs)(`div`,{className:`tree-node tree-folder`,style:{paddingLeft:6+n.depth*14},onClick:()=>o(n.path),title:`${n.path}/ · ${n.fileCount} fichiers · ${n.viewedCount} vus`,children:[(0,G.jsx)(`span`,{className:`tree-chevron`,children:t.has(n.path)?`▸`:`▾`}),(0,G.jsxs)(`span`,{className:`tree-name`,children:[n.name,`/`]}),n.openThreads>0&&(0,G.jsxs)(Z,{span:!0,size:`xs`,c:`yellow.4`,children:[(0,G.jsx)(`i`,{className:`ico-c`}),n.openThreads]}),(0,G.jsxs)(Z,{span:!0,size:`xs`,c:n.viewedCount===n.fileCount?`green.5`:`dimmed`,children:[n.viewedCount,`/`,n.fileCount]}),(0,G.jsx)(hW,{additions:n.additions,deletions:n.deletions,max:i,width:36}),(0,G.jsx)(gW,{additions:n.additions,deletions:n.deletions})]},`d:${n.path}`):(0,G.jsx)(_W,{stat:n.stat,depth:n.depth+.6,current:n.path===e.currentPath,maxChurn:a,onSelect:()=>e.onSelect(n.path)},n.path))})}function bW(e){let{stats:t}=e,[n,r]=(0,C.useState)([]),[i,a]=(0,C.useState)(``),o=(0,C.useMemo)(()=>t.filter(e=>(!n.includes(`unviewed`)||e.state!==`viewed`)&&(!n.includes(`threads`)||e.openThreads>0)&&(i===``||e.path.toLowerCase().includes(i.toLowerCase()))),[t,n,i]),s=(0,C.useMemo)(()=>Az(o),[o]),c=t.filter(e=>e.state===`viewed`).length;return(0,G.jsxs)(`div`,{className:`file-nav`,children:[(0,G.jsx)(Yh,{size:`xs`,mx:10,mb:6,value:e.nav,onChange:t=>e.onNavChange(t===`list`||t===`links`||t===`intent`?t:`tree`),data:[{value:`list`,label:`Liste`},{value:`tree`,label:`Arbre`},{value:`links`,label:`Liens`},{value:`intent`,label:`Intention`}]}),(0,G.jsxs)(X,{gap:4,px:10,pb:6,children:[(0,G.jsxs)(Wp.Group,{multiple:!0,value:n,onChange:r,children:[(0,G.jsx)(Wp,{size:`xs`,value:`unviewed`,children:`Non vus`}),(0,G.jsx)(Wp,{size:`xs`,value:`threads`,children:`Threads ouverts`})]}),(e.nav===`list`||e.nav===`tree`)&&(0,G.jsx)(Yh,{size:`xs`,ml:`auto`,value:e.sort,onChange:t=>e.onSortChange(t===`churn`?`churn`:`name`),data:[{value:`name`,label:`A→Z`},{value:`churn`,label:`Taille`}]})]}),(0,G.jsx)(jg,{size:`xs`,px:10,pb:6,placeholder:`Filtrer les fichiers…`,value:i,onChange:e=>a(e.currentTarget.value)}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,px:10,pb:4,children:[c,`/`,t.length,` fichiers vus · `,Dz(s),` lignes modifiées`,o.length===t.length?``:` · ${o.length} affichés`]}),o.length===0?(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,px:10,children:`Aucun fichier.`}):e.nav===`links`?(0,G.jsx)(lW,{stats:o,currentPath:e.currentPath,onSelect:e.onSelect}):e.nav===`intent`?(0,G.jsx)(nB,{stats:o,intents:e.intents,currentPath:e.currentPath,onSelect:e.onSelect}):(0,G.jsx)(`div`,{className:`file-nav-scroll`,children:e.nav===`tree`?(0,G.jsx)(yW,{root:s,currentPath:e.currentPath,onSelect:e.onSelect}):(0,G.jsx)(vW,{stats:o,sort:e.sort,currentPath:e.currentPath,onSelect:e.onSelect})})]})}var xW=/^[0-9a-f]{7,40}$/i;function SW(e){let t;try{t=new URL(e)}catch{return null}if(t.hostname!==`github.com`&&t.hostname!==`www.github.com`)return null;let n;try{n=t.pathname.split(`/`).filter(Boolean).map(decodeURIComponent)}catch{return null}let[r,i,a,...o]=n;if(!r||!i)return null;let s=t.hash.slice(1);if(a===`pull`&&/^\d+$/.test(o[0]??``)){let e=o[1]===`commits`&&xW.test(o[2]??``)?o[2].toLowerCase():null,t=/^diff-([0-9a-f]{64})(?:([LR])(\d+)(?:-([LR])(\d+))?)?$/.exec(s),n=null;if(t?.[2]){let e=Number(t[3]),r=t[4]===t[2]?Number(t[5]):e;n={side:t[2]===`L`?`LEFT`:`RIGHT`,start:Math.min(e,r),end:Math.max(e,r)}}let a=/^discussion_r(\d+)$/.exec(s);return{kind:`pr`,owner:r,repo:i,number:Number(o[0]),commit:e,fileHash:t?.[1]??null,lines:n,discussion:a?Number(a[1]):null}}if(a===`blob`&&o.length>=2){let e=/^L(\d+)(?:C\d+)?(?:-L(\d+)(?:C\d+)?)?$/.exec(s),t=e?{start:Number(e[1]),end:Number(e[2]??e[1])}:null;return{kind:`blob`,owner:r,repo:i,refAndPath:o.join(`/`),lines:t}}return a===`commit`&&xW.test(o[0]??``)?{kind:`commit`,owner:r,repo:i,sha:o[0].toLowerCase()}:null}var CW=(e,t)=>e.toLowerCase()===t.toLowerCase();function wW(e,t){if(!CW(e.owner,t.owner)||!CW(e.repo,t.repo))return e.kind===`pr`?{kind:`otherPr`,owner:e.owner,repo:e.repo,number:e.number}:null;let n=e=>{let n=t.commits.find(t=>t.oid.startsWith(e));return n?.parentOid?`${n.parentOid}..${n.oid}`:null};if(e.kind===`pr`){if(e.number!==t.number)return{kind:`otherPr`,owner:t.owner,repo:t.repo,number:e.number};if(e.discussion!==null){let n=t.threads.find(t=>t.comments.some(t=>t.databaseId===e.discussion));return n?{kind:`thread`,threadId:n.id}:null}let r=e.fileHash===null?null:t.pathByHash.get(e.fileHash);if(r===void 0)return null;let i=r===null?null:{path:r,lines:e.lines};if(e.commit!==null){let t=n(e.commit);return t?{kind:`commit`,range:t,file:i}:null}return i?{kind:`file`,file:i}:{kind:`pr`}}if(e.kind===`commit`){let t=n(e.sha);return t?{kind:`commit`,range:t,file:null}:null}let r=e.refAndPath.split(`/`);for(let n=1;n<r.length;n++){let i=r.slice(n).join(`/`);if(!t.files.includes(i))continue;let a=r.slice(0,n).join(`/`);return{kind:`file`,file:{path:i,lines:(a===t.headRefName||xW.test(a)&&t.headRefOid.toLowerCase().startsWith(a.toLowerCase()))&&e.lines?{side:`RIGHT`,...e.lines}:null}}}return null}async function TW(e){let t=new TextEncoder,n=await Promise.all(e.map(async e=>{let n=await crypto.subtle.digest(`SHA-256`,t.encode(e));return[[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,`0`)).join(``),e]}));return new Map(n)}function EW(e,t,n){if(t.length===0&&n.length===0)return e;let r=new Map(t.map(e=>[e.path,e.viewed])),i=new Set(e.seenHunks);for(let e of n)for(let t of e.hunks){let n=`${t.path}\n${t.hash}`;e.seen?i.add(n):i.delete(n)}return{...e,files:e.files.map(e=>{let t=r.get(e.path);return t===void 0?e:{...e,viewed:t?`VIEWED`:`UNVIEWED`}}),seenHunks:[...i]}}function DW(e){let t=zI(),n=aC({from:`/$owner/$repo/pull/$number`}),[r,i]=(0,C.useState)(!1),[a,o]=(0,C.useState)(null),s=t.detail.commits,c=t.detail.pr.headRefOid,l=t.detail.myReview?.commitOid??null,u=e.visitHead!==null&&!LI(t.detail,e.visitHead),d=l!==null&&!LI(t.detail,l),f=e=>{n({search:t=>({...t,range:e})}),i(!1)},p=new Set;if(t.range.kind===`commits`){let e=s.findIndex(e=>e.parentOid===t.range.base),n=s.findIndex(e=>e.oid===t.range.head);if(e!==-1&&n>=e)for(let t of s.slice(e,n+1))p.add(t.oid)}let m=(e,t,n,r=!1)=>(0,G.jsx)(jh,{value:e,disabled:r,label:(0,G.jsxs)(X,{gap:8,justify:`space-between`,wrap:`nowrap`,w:380,children:[(0,G.jsx)(Z,{size:`sm`,children:t}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:n})]})},e);return(0,G.jsxs)(vl,{opened:r,onChange:i,position:`bottom-start`,shadow:`lg`,width:460,trapFocus:!0,children:[(0,G.jsx)(vl.Target,{children:(0,G.jsxs)(Fp,{size:`compact-sm`,variant:`light`,onClick:()=>i(e=>!e),rightSection:`▾`,children:[`Plage : `,t.range.label]})}),(0,G.jsxs)(vl.Dropdown,{p:`sm`,children:[(0,G.jsx)(Z,{size:`xs`,tt:`uppercase`,fw:600,c:`dimmed`,mb:6,children:`Plage de comparaison`}),(0,G.jsx)(jh.Group,{value:t.range.kind===`commits`?``:t.range.kind,onChange:f,children:(0,G.jsxs)(tg,{gap:8,children:[m(`all`,`Tous les changements`,`${s.length} commits · ${t.detail.files.length} fichiers`),m(`visit`,`Depuis ma dernière visite`,e.visitAt?e.visitHead===c?`aucun nouveau commit`:u?`branche rebasée depuis`:new Date(e.visitAt).toLocaleString(`fr`):`jamais visitée`,!e.visitAt||e.visitHead===c||u),m(`review`,`Depuis ma dernière review`,l?l===c?`à jour`:d?`branche rebasée depuis`:l.slice(0,7):`jamais reviewée`,!l||l===c||d)]})}),(0,G.jsx)(rm,{my:`sm`}),(0,G.jsx)(Z,{size:`xs`,tt:`uppercase`,fw:600,c:`dimmed`,mb:6,children:`Commits (clic : un commit · Maj+clic : intervalle)`}),(0,G.jsx)(tg,{gap:2,mah:320,style:{overflow:`auto`},children:s.map((e,t)=>(0,G.jsxs)(X,{gap:8,wrap:`nowrap`,px:4,py:2,style:{cursor:`pointer`,borderRadius:4,background:e.seen?void 0:`rgba(255,146,43,.08)`},onClick:e=>{let n=e.shiftKey&&a!==null?Math.min(a,t):t,r=e.shiftKey&&a!==null?Math.max(a,t):t;o(t);let i=s[n],c=s[r];i.parentOid&&f(`${i.parentOid}..${c.oid}`)},children:[(0,G.jsx)(ip,{size:`xs`,readOnly:!0,checked:p.has(e.oid)}),(0,G.jsx)(Z,{ff:`monospace`,size:`xs`,c:`dimmed`,children:e.shortOid}),(0,G.jsx)(Z,{size:`sm`,truncate:!0,style:{flex:1},children:e.headline}),!e.seen&&(0,G.jsx)(Ep,{size:`xs`,color:`orange`,variant:`light`,children:`nouveau`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:UD(e.date)})]},e.oid))}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,mt:`sm`,children:`Hors « tous les changements », seuls les commentaires côté nouveau code sont possibles (numéros de ligne de la PR).`})]})]})}function OW(e){let t=zI(),n=iL(t.ref),[r,i]=(0,C.useState)(``),a=t.detail.pr.author?.login===t.me,[o,s]=(0,C.useState)(`COMMENT`),c=t.detail.pendingReview,l=async()=>{await n.submitReview.mutateAsync({prId:t.detail.pr.id,pendingReviewId:c?.id??null,event:o,body:r}),i(``),e.onChange(!1)};return(0,G.jsxs)(vl,{opened:e.opened,onChange:e.onChange,position:`bottom-end`,shadow:`lg`,width:400,trapFocus:!0,children:[(0,G.jsx)(vl.Target,{children:(0,G.jsx)(Fp,{size:`compact-sm`,onClick:()=>e.onChange(!e.opened),rightSection:(0,G.jsx)(Em,{size:`xs`,children:`⇧S`}),children:c?`Soumettre la review (${c.comments})`:`Review`})}),(0,G.jsxs)(vl.Dropdown,{children:[(0,G.jsx)(Z,{fw:600,mb:6,children:c?`Review en attente · ${c.comments} commentaire${c.comments>1?`s`:``}`:`Nouvelle review`}),(0,G.jsx)(Cm,{autosize:!0,minRows:3,placeholder:`Résumé (optionnel)`,value:r,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&l()}}),(0,G.jsx)(jh.Group,{value:o,onChange:e=>s(e),my:`sm`,children:(0,G.jsxs)(tg,{gap:6,children:[(0,G.jsx)(jh,{value:`COMMENT`,label:`Commenter`}),(0,G.jsx)(Gh,{label:`Impossible d’approuver sa propre PR`,disabled:!a,children:(0,G.jsx)(jh,{value:`APPROVE`,label:`Approuver`,disabled:a})}),(0,G.jsx)(Gh,{label:`Impossible sur sa propre PR`,disabled:!a,children:(0,G.jsx)(jh,{value:`REQUEST_CHANGES`,label:`Demander des changements`,disabled:a})})]})}),(0,G.jsxs)(X,{justify:`flex-end`,gap:6,children:[c&&(0,G.jsx)(Fp,{size:`compact-sm`,variant:`subtle`,color:`red`,loading:n.discardReview.isPending,onClick:()=>n.discardReview.mutate({reviewId:c.id}),children:`Abandonner la review`}),(0,G.jsx)(Fp,{size:`compact-sm`,color:o===`APPROVE`?`green`:o===`REQUEST_CHANGES`?`red`:`blue`,loading:n.submitReview.isPending,disabled:!c&&o===`COMMENT`&&r.trim()===``,onClick:()=>void l(),children:`Soumettre`})]})]})]})}function kW(e){let t=zI(),{pr:n,reviewers:r,requestedTeams:i}=t.detail;return(0,G.jsxs)(`div`,{className:`pr-head`,children:[(0,G.jsxs)(X,{gap:8,wrap:`nowrap`,align:`baseline`,children:[(0,G.jsxs)(Rg,{order:3,fw:600,style:{minWidth:0},lineClamp:1,children:[n.title,` `,(0,G.jsxs)(Z,{span:!0,c:`dimmed`,fw:400,inherit:!0,children:[n.owner,`/`,n.repo,` #`,n.number]})]}),(0,G.jsx)(tf,{href:n.url,target:`_blank`,size:`sm`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:`GitHub ↗`})]}),(0,G.jsxs)(X,{gap:8,mt:4,wrap:`wrap`,children:[(0,G.jsx)(Ep,{color:n.state===`OPEN`?n.isDraft?`gray`:`green`:n.state===`MERGED`?`violet`:`red`,variant:`light`,children:n.isDraft?`Brouillon`:n.state===`OPEN`?`Ouverte`:n.state===`MERGED`?`Mergée`:`Fermée`}),(0,G.jsx)(Cp,{src:n.author?.avatarUrl,size:20}),(0,G.jsxs)(Z,{size:`sm`,c:`dimmed`,children:[n.author?.login??`ghost`,` · `,t.detail.commits.length,` commits de`,` `,(0,G.jsx)(Z,{span:!0,ff:`monospace`,c:`blue.4`,inherit:!0,children:n.headRefName}),` `,`vers`,` `,(0,G.jsx)(Z,{span:!0,ff:`monospace`,c:`blue.4`,inherit:!0,children:n.baseRefName}),` `,`· ouverte `,UD(n.createdAt)]}),(0,G.jsx)(MW,{}),n.mergeable===`CONFLICTING`&&(0,G.jsx)(Ep,{color:`red`,variant:`light`,children:`conflits`}),r.map(e=>(0,G.jsxs)(Ep,{variant:`outline`,color:GD[e.state]?.color??`gray`,leftSection:(0,G.jsx)(Cp,{src:e.avatarUrl,size:14}),children:[e.login,` : `,GD[e.state]?.label??e.state]},e.login)),i.map(e=>(0,G.jsxs)(Ep,{variant:`outline`,color:`yellow`,children:[`@`,e,` : demandé`]},e))]}),(0,G.jsxs)(`div`,{className:`pr-bar`,children:[(0,G.jsx)(DW,{visitAt:e.visitAt,visitHead:e.visitHead}),e.children]})]})}var AW=15e3,jW={failure:{label:`En échec`,color:`red`},pending:{label:`En cours`,color:`yellow`},success:{label:`Réussis`,color:`green`},skipped:{label:`Ignorés`,color:`gray`}};function MW(){let e=zI(),t=dy(ED().pr.checks.queryOptions(e.ref,{refetchInterval:e=>e.state.data?.checks.some(e=>e.outcome===`pending`)?AW:!1})).data;if(!t||t.checks.length===0)return null;let n=e=>t.checks.filter(t=>t.outcome===e),r=n(`failure`),i=n(`pending`),a=t.checks.length-i.length,o=r.length===1?`✕ CI : ${r[0].name}`:r.length>1?`✕ CI : ${r.length} en échec`:i.length>0?`● CI en cours ${a}/${t.checks.length}`:`✓ CI ok · ${t.checks.length}`;return(0,G.jsxs)(vl,{position:`bottom-start`,shadow:`md`,width:440,children:[(0,G.jsx)(vl.Target,{children:(0,G.jsxs)(Ep,{color:r.length>0?`red`:i.length>0?`yellow`:`green`,variant:r.length>0?`filled`:`light`,style:{cursor:`pointer`,textTransform:`none`,maxWidth:420},title:r.length>0?`${r.length} check(s) en échec`:void 0,children:[o,r.length>0&&i.length>0?` · ${i.length} en cours`:``]})}),(0,G.jsx)(vl.Dropdown,{mah:420,style:{overflowY:`auto`},children:(0,G.jsx)(tg,{gap:8,children:[`failure`,`pending`,`success`,`skipped`].map(e=>{let t=n(e);if(t.length===0)return null;let a=e===`failure`||e===`pending`||r.length+i.length===0;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(Z,{size:`xs`,fw:600,c:`${jW[e].color}.4`,mb:2,children:[jW[e].label,` · `,t.length]}),a&&t.map(t=>(0,G.jsxs)(`div`,{className:`check-row`,children:[t.url?(0,G.jsx)(tf,{href:t.url,target:`_blank`,size:`sm`,truncate:!0,children:t.name}):(0,G.jsx)(Z,{size:`sm`,truncate:!0,children:t.name}),(t.summary||e===`failure`)&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,truncate:!0,children:[t.state,t.summary?` · ${t.summary}`:``]})]},t.name))]},e)})})})]})}function NW(){let e=GW.useParams(),t=(0,C.useMemo)(()=>({owner:e.owner,repo:e.repo,number:Number(e.number)}),[e.owner,e.repo,e.number]),n=ED(),r=W_(),i=dy(n.pr.get.queryOptions(t)),a=hy({filters:{mutationKey:n.pr.setFileViewed.mutationKey(),status:`pending`},select:e=>e.state.variables}),o=hy({filters:{mutationKey:n.pr.setHunksSeen.mutationKey(),status:`pending`},select:e=>e.state.variables}),s=(0,C.useMemo)(()=>i.data&&EW(i.data,a,o),[i.data,a,o]);return xD(n.pr.onChange.subscriptionOptions(t,{onData:()=>{r.invalidateQueries({queryKey:n.pr.get.queryKey(t)}),r.invalidateQueries({queryKey:n.pr.checks.queryKey(t)})}})),i.isPending?(0,G.jsx)(Rp,{style:{flex:1},children:(0,G.jsx)(El,{})}):i.isError?(0,G.jsx)(Jd,{color:`red`,m:`lg`,title:`PR introuvable ou inaccessible`,children:i.error.message}):(0,G.jsx)(FW,{ref_:t,detail:s},`${t.owner}/${t.repo}#${t.number}`)}function PW(e,t,n){let{baseRefOid:r,headRefOid:i}=t.pr,a={kind:`all`,base:r,head:i,fullPr:!0,label:`Tous les changements`};if(e===`visit`&&n&&n!==i&&LI(t,n))return{kind:`visit`,base:n,head:i,fullPr:!1,label:`Depuis ma dernière visite`};let o=t.myReview?.commitOid;if(e===`review`&&o&&o!==i&&LI(t,o))return{kind:`review`,base:o,head:i,fullPr:!1,label:`Depuis ma dernière review`};let s=/^([0-9a-f]{7,40})\.\.([0-9a-f]{7,40})$/.exec(e);if(s){let[,e,n]=s,r=t.commits.find(t=>t.parentOid===e),i=t.commits.find(e=>e.oid===n);return{kind:`commits`,base:e,head:n,fullPr:!1,label:r&&i&&r.oid===i.oid?`Commit ${i.shortOid}`:`Commits ${r?.shortOid??e.slice(0,7)}…${i?.shortOid??n.slice(0,7)}`}}return a}function FW({ref_:e,detail:t}){let n=ED(),r=aC({from:`/$owner/$repo/pull/$number`}),i=GW.useSearch(),a=iL(e),[o]=(0,C.useState)(()=>Date.now()),[s]=(0,C.useState)(()=>t.pr.headRefOid),[c,l]=Ge({key:`br:layout`,defaultValue:`split`}),[u,d]=Ge({key:`br:panel`,defaultValue:!0}),[f,p]=Ge({key:`br:panelTab`,defaultValue:`conversations`}),m=e=>{u&&f===e?d(!1):(p(e),d(!0))},[h,g]=Ge({key:`br:tree`,defaultValue:!0}),[_,v]=Ge({key:`br:nav`,defaultValue:`tree`}),y=_===`list`||_===`links`||_===`intent`?_:`tree`,[b,x]=Ge({key:`br:navSort`,defaultValue:`name`}),[S]=Ge({key:`br:linksMentions`,defaultValue:!0}),[w,T]=(0,C.useState)(null),[E,D]=(0,C.useState)(null),[O,k]=(0,C.useState)(null),[A,j]=(0,C.useState)(new Set),[M,N]=(0,C.useState)({fileIdx:null,hunkIdx:null}),[ee,P]=(0,C.useState)(!1),[F,I]=(0,C.useState)(!1),L=(0,C.useRef)(null),[R,te]=(0,C.useState)(null),ne=t.pr.headRefOid,re=t.visits.find(e=>e.visitedAt<o)??null,ie=re?.headOid??null,ae=PW(i.range??`all`,t,ie),oe=i.mode??`continuous`,se=dy({...n.pr.diff.queryOptions({ref:e,base:ae.base,head:ae.head,fullPr:ae.fullPr}),staleTime:1/0}),ce=t.pr.state===`OPEN`,le=dy({...n.pr.diff.queryOptions({ref:e,base:t.pr.baseRefOid,head:ne,fullPr:!0}),staleTime:1/0,enabled:ce}),z=(0,C.useMemo)(()=>ce&&le.data?JR(le.data.files):null,[ce,le.data]),B=dy({...n.pr.links.queryOptions({ref:e,base:ae.base,head:ae.head,fullPr:ae.fullPr}),staleTime:1/0,enabled:y===`links`||y===`intent`}),V=Xz(e,ae,y===`intent`),ue=V.progress.done?V.progress.intents:null,H=(0,C.useMemo)(()=>{let e=se.data?.files??[],t=new Map(e.map(e=>[e.path,e])),n=e.map(e=>e.path),r;if(y===`list`||y===`tree`)r=Mz(e,y,b);else if(y===`intent`&&ue){let e=(B.data?.edges??[]).filter(e=>S||e.kind===`import`);r=Uz(n,ue,e)}else if(B.data){let e=B.data.edges.filter(e=>S||e.kind===`import`);r=B.data.packages.length>0?FI(B.data.packages.map(e=>({items:e.files})),n,e):PI(n,e)}else return e;return r.flatMap(e=>t.get(e)??[])},[se.data,y,b,B.data,S,ue]),de=(0,C.useMemo)(()=>t.files.map(e=>e.path),[t.files]),fe=dy({queryKey:[`pathHashes`,de],queryFn:()=>TW(de),staleTime:1/0}),pe=n=>{let r=SW(n);return!r||!fe.data?null:wW(r,{...e,headRefOid:ne,headRefName:t.pr.headRefName,files:de,pathByHash:fe.data,threads:t.threads,commits:t.commits})},me=a.visit.mutate,he=(0,C.useRef)(!1);(0,C.useEffect)(()=>{he.current||(he.current=!0,me({ref:e,headOid:ne,commitOids:t.commits.map(e=>e.oid)}))},[me,e,ne,t.commits]);let ge=(0,C.useMemo)(()=>new Set(t.seenHunks),[t.seenHunks]),_e=(0,C.useMemo)(()=>{let e=new Map(t.files.map(e=>[e.path,e.viewed]));return H.map(n=>{let r=t.threads.filter(e=>e.path===n.path&&!e.isResolved);return{path:n.path,additions:n.additions,deletions:n.deletions,state:fz(n,e.get(n.path),ge).state,openThreads:r.length,unreadThreads:r.filter(e=>e.unread>0).length}})},[H,t.files,t.threads,ge]),ve=oe===`focus`?H.find(e=>e.path===i.file)??H.find(e=>t.files.find(t=>t.path===e.path)?.viewed!==`VIEWED`)??H[0]??null:null,ye=oe===`focus`?ve?.path??null:H[M.fileIdx??-1]?.path??null,U=`${ae.base}..${ae.head}`,be=e=>{k(e);let n=t.threads.find(t=>t.id===e);oe===`focus`&&n&&n.path!==ve?.path&&H.some(e=>e.path===n.path)?(r({search:e=>({...e,file:n.path})}),requestAnimationFrame(()=>L.current?.scrollToThread(e))):L.current?.scrollToThread(e)},xe=(0,C.useEffectEvent)(e=>{let t=()=>void r({search:({goto:e,...t})=>t,replace:!0}),n=e=>void r({search:t=>({...t,...e}),replace:!0}),a=pe(e);if(!a||a.kind===`pr`)return t();if(a.kind===`otherPr`){let{owner:t,repo:n,number:i}=a;r({to:`/$owner/$repo/pull/$number`,params:{owner:t,repo:n,number:String(i)},search:{goto:e},replace:!0});return}if(a.kind===`thread`){let e=a.threadId;requestAnimationFrame(()=>{if(oe!==`focus`&&!L.current?.scrollToThread(e)&&ae.kind!==`all`)return n({range:`all`});be(e),t()});return}let o;if(a.kind===`commit`){if(i.range!==a.range)return n({range:a.range});o=a.file}else o=a.file;if(!o)return t();let s=o;if(!H.some(e=>e.path===s.path))return a.kind===`file`&&ae.kind!==`all`?n({range:`all`}):t();if(oe===`focus`&&ve?.path!==s.path)return n({file:s.path});requestAnimationFrame(()=>{if(A.has(s.path)){j(e=>new Set([...e].filter(e=>e!==s.path)));return}let e=s.lines;if(e&&L.current?.scrollToLine(s.path,e.side,e.start))te({range:U,lines:{path:s.path,...e}});else if(e&&a.kind===`file`&&ae.kind!==`all`)return n({range:`all`});else L.current?.scrollToFile(s.path),te(null);t()})}),Se=se.data!==void 0&&fe.data!==void 0;(0,C.useEffect)(()=>{i.goto&&Se&&xe(i.goto)},[i.goto,Se,U,A,ve?.path,oe]);let Ce={ref:e,detail:t,diff:se.data??null,me:t.viewer.login,range:ae,layout:c,mode:oe,pendingReviewId:t.pendingReview?.id??null,seenHunks:ge,selection:w,setSelection:e=>{T(e),e&&D(null)},fileComposer:E,setFileComposer:e=>{D(e),e&&T(null)},focusedThread:O,setFocusedThread:k,commentHunk:(e,t,n)=>ae.head!==ne||t===`LEFT`&&!ae.fullPr?null:z?.get(e)?.[t].get(n)??null,canCommentFile:e=>z?.has(e)??!1,scrollToThread:be,scrollToFile:e=>{oe===`focus`?r({search:t=>({...t,file:e})}):L.current?.scrollToFile(e)},linkTarget:R?.range===U?R.lines:null,onMarkdownClick:e=>{let t=e.target instanceof Element?e.target.closest(`a[href]`):null;if(!(t instanceof HTMLAnchorElement)||e.defaultPrevented||t.origin===window.location.origin||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;e.preventDefault();let n=pe(t.href);if(!n)window.open(t.href,`_blank`,`noopener`);else if(n.kind===`otherPr`){let{owner:e,repo:i,number:a}=n;r({to:`/$owner/$repo/pull/$number`,params:{owner:e,repo:i,number:String(a)},search:{goto:t.href}})}else r({search:e=>({...e,goto:t.href})})},advanceFrom:e=>{if(oe===`focus`){let n=IW(H,t,e);n&&r({search:e=>({...e,file:n.path})});return}let n=H[H.findIndex(t=>t.path===e)+1];n&&L.current?.scrollToFile(n.path)}},we=t.files.filter(e=>e.viewed===`VIEWED`).length,Te=H.reduce((e,t)=>e+t.hunks.length,0),Ee=H.reduce((e,t)=>e+t.hunks.filter(e=>ge.has(`${t.path}\n${e.hash}`)).length,0);return(0,G.jsx)(RI,{value:Ce,children:(0,G.jsxs)(`div`,{className:`pr-page`,children:[(0,G.jsxs)(kW,{visitAt:re?.visitedAt??null,visitHead:ie,children:[(0,G.jsx)(Yh,{size:`xs`,value:oe,onChange:e=>void r({search:t=>({...t,mode:e===`focus`?`focus`:`continuous`})}),data:[{value:`continuous`,label:`Continu`},{value:`focus`,label:`Focus`}]}),(0,G.jsx)(Yh,{size:`xs`,value:c,onChange:e=>l(e===`unified`?`unified`:`split`),data:[{value:`split`,label:`Côte à côte`},{value:`unified`,label:`Unifié`}]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsx)(Gh,{label:`${Ee}/${Te} hunks vus dans la plage`,children:(0,G.jsxs)(X,{gap:6,children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Vu `,we,`/`,t.files.length,` fichiers`]}),(0,G.jsx)(gh,{w:90,size:`sm`,color:`green`,value:t.files.length?we/t.files.length*100:0})]})}),(0,G.jsx)(Fp,{size:`compact-sm`,variant:h?`light`:`default`,onClick:()=>g(!h),children:`Fichiers`}),(0,G.jsx)(Fp,{size:`compact-sm`,variant:u&&f===`description`?`light`:`default`,onClick:()=>m(`description`),children:`Description`}),(0,G.jsxs)(Fp,{size:`compact-sm`,variant:u&&f===`conversations`?`light`:`default`,onClick:()=>m(`conversations`),children:[`Conversations `,t.threads.filter(e=>!e.isResolved).length]}),(0,G.jsx)(Fp,{size:`compact-sm`,variant:u&&f===`neighbors`?`light`:`default`,onClick:()=>m(`neighbors`),children:`Voisinage`}),(0,G.jsx)(OW,{opened:ee,onChange:P})]}),s!==ne&&ae.base!==s&&(0,G.jsx)(Jd,{color:`orange`,variant:`light`,radius:0,py:6,children:(0,G.jsxs)(X,{gap:`sm`,children:[(0,G.jsx)(Z,{size:`sm`,children:`Nouveaux commits poussés pendant votre lecture.`}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:`light`,color:`orange`,onClick:()=>void r({search:e=>({...e,range:`${s}..${ne}`})}),children:`Voir uniquement ces changements`})]})}),oe===`focus`&&ve&&(0,G.jsx)(LW,{files:H,current:ve}),(0,G.jsxs)(`div`,{className:`pr-body`,"data-tree":h?`open`:`closed`,"data-panel":u?`open`:`closed`,children:[h&&(0,G.jsx)(`aside`,{className:`pr-tree`,children:(0,G.jsx)(bW,{stats:_e,nav:y,onNavChange:v,sort:b,onSortChange:x,currentPath:ye,onSelect:Ce.scrollToFile,intents:V})}),(0,G.jsxs)(`main`,{style:{minWidth:0,minHeight:0},children:[se.isPending&&(0,G.jsx)(Rp,{h:`100%`,children:(0,G.jsx)(El,{})}),se.isError&&(0,G.jsxs)(Jd,{color:`red`,m:`md`,title:`Diff indisponible pour cette plage`,children:[se.error.message,(0,G.jsx)(Fp,{mt:`sm`,size:`xs`,onClick:()=>void r({search:e=>({...e,range:`all`})}),children:`Revenir à tous les changements`})]}),se.data&&(0,G.jsx)(Ez,{files:H,onlyFile:ve?.path??null,collapsed:A,onToggleCollapse:e=>j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onCurrentChange:(e,t)=>N({fileIdx:e,hunkIdx:t}),handleRef:L})]}),u&&(0,G.jsxs)(`aside`,{className:`pr-panel`,children:[(0,G.jsx)(Yh,{className:`panel-tabs`,size:`xs`,fullWidth:!0,value:f,onChange:e=>p(e===`description`||e===`neighbors`?e:`conversations`),data:[{value:`conversations`,label:`Conversations ${t.threads.filter(e=>!e.isResolved).length}`},{value:`description`,label:`Description`},{value:`neighbors`,label:`Voisinage`}]}),(0,G.jsx)(`div`,{className:`panel-scroll`,children:f===`description`?(0,G.jsx)(sL,{}):f===`neighbors`?(0,G.jsx)(uW,{stats:_e,currentPath:ye,onSelect:Ce.scrollToFile}):(0,G.jsx)(oL,{})})]})]}),(0,G.jsx)(RW,{files:H,focusFile:ve,current:M,listRef:L,onToggleReview:()=>P(e=>!e),onToggleConversations:()=>m(`conversations`),onToggleDescription:()=>m(`description`),onToggleTree:()=>g(!h),onToggleLayout:()=>l(c===`split`?`unified`:`split`),onHelp:()=>I(!0)}),(0,G.jsx)(BW,{opened:F,onClose:()=>I(!1)})]})})}function IW(e,t,n){let r=e.findIndex(e=>e.path===n);return[...e.slice(r+1),...e.slice(0,r)].find(e=>t.files.find(t=>t.path===e.path)?.viewed!==`VIEWED`)}function LW({files:e,current:t}){let n=aC({from:`/$owner/$repo/pull/$number`}),r=hz(),i=zI(),a=e.indexOf(t),o=e=>e&&void n({search:t=>({...t,file:e.path})}),s=e.filter(e=>i.detail.files.find(t=>t.path===e.path)?.viewed!==`VIEWED`).length;return(0,G.jsxs)(X,{className:`focus-bar`,gap:`sm`,px:`md`,py:6,children:[(0,G.jsxs)(Fp,{size:`compact-xs`,variant:`default`,onClick:()=>o(e[a-1]),disabled:a<=0,children:[`←`,` `,(0,G.jsx)(Em,{size:`xs`,ml:4,children:`k`})]}),(0,G.jsx)(Z,{ff:`monospace`,fw:600,size:`sm`,children:t.path}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`fichier `,a+1,`/`,e.length,` · `,s,` non vu`,s>1?`s`:``]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsx)(`div`,{className:`steps`,children:e.map(e=>{let n=i.detail.files.find(t=>t.path===e.path)?.viewed;return(0,G.jsx)(`i`,{title:e.path,"data-state":e===t?`current`:n===`VIEWED`?`viewed`:`none`,onClick:()=>o(e)},e.path)})}),(0,G.jsx)(Fp,{size:`compact-xs`,color:`green`,onClick:()=>{r.toggleFile(t,!0),i.advanceFrom(t.path)},rightSection:(0,G.jsx)(Em,{size:`xs`,children:`v`}),children:`✓ Vu, suivant non vu`}),(0,G.jsxs)(Fp,{size:`compact-xs`,variant:`default`,onClick:()=>o(e[a+1]),disabled:a>=e.length-1,children:[(0,G.jsx)(Em,{size:`xs`,mr:4,children:`j`}),` `,`→`]})]})}function RW(e){let t=zI(),n=iL(t.ref),r=hz(),i=aC({from:`/$owner/$repo/pull/$number`}),{files:a,focusFile:o,listRef:s}=e,c=o??a[e.current.fileIdx??-1]??null,l=c&&e.current.hunkIdx!==null?c.hunks[e.current.hunkIdx]:void 0,u=e=>{if(o){let t=a[a.indexOf(o)+e];t&&i({search:e=>({...e,file:t.path})})}else s.current?.step(`file`,e)},d=t.detail.threads.find(e=>e.id===t.focusedThread);return lt([[`j`,()=>u(1)],[`k`,()=>u(-1)],[`n`,()=>s.current?.step(`hunk`,1)],[`p`,()=>s.current?.step(`hunk`,-1)],[`]`,()=>s.current?.step(`thread`,1)],[`v`,()=>{if(!c)return;let e=t.detail.files.find(e=>e.path===c.path)?.viewed===`VIEWED`;r.toggleFile(c,!e),e||t.advanceFrom(c.path)}],[`h`,()=>{c&&l&&(r.toggleHunk(c,l,!t.seenHunks.has(`${c.path}\n${l.hash}`)),s.current?.step(`hunk`,1))}],[`r`,()=>{document.querySelector(`[data-thread="${t.focusedThread}"] [data-reply]`)?.click()}],[`x`,()=>d&&(d.isResolved?d.canUnresolve:d.canResolve)&&n.setResolved.mutate({threadId:d.id,resolved:!d.isResolved})],[`m`,()=>void i({search:e=>({...e,mode:t.mode===`focus`?`continuous`:`focus`})})],[`u`,e.onToggleLayout],[`t`,e.onToggleConversations],[`d`,e.onToggleDescription],[`f`,e.onToggleTree],[`shift+S`,e.onToggleReview],[`i`,()=>void i({to:`/`})],[`Escape`,()=>{t.setSelection(null),t.setFileComposer(null)}],[`shift+?`,e.onHelp]]),(0,G.jsxs)(`div`,{className:`statusbar`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`j`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`k`}),` fichier`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`n`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`p`}),` hunk`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`]`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`[`}),` thread ouvert`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`v`}),` fichier vu · `,(0,G.jsx)(Em,{size:`xs`,children:`h`}),` hunk vu`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`r`}),` répondre · `,(0,G.jsx)(Em,{size:`xs`,children:`x`}),` résoudre`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`?`}),` aide`]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsxs)(`span`,{children:[c?c.path:``,c&&l?` · hunk ${(e.current.hunkIdx??0)+1}/${c.hunks.length}`:``]})]})}var zW=[[`j / k`,`fichier suivant / précédent`],[`n / p`,`hunk suivant / précédent`],[`] / [`,`thread non résolu suivant / précédent`],[`v`,`marquer le fichier vu, puis fichier suivant (focus : fichier non vu suivant)`],[`h`,`marquer le hunk courant vu, puis hunk suivant`],[`r`,`répondre au thread sélectionné`],[`x`,`résoudre / rouvrir le thread sélectionné`],[`clic n° de ligne`,`commenter (Maj+clic : plage)`],[`m`,`mode continu / focus`],[`u`,`côte à côte / unifié`],[`t`,`panneau conversations`],[`d`,`description de la PR`],[`f`,`arbre des fichiers`],[`Maj+S`,`soumettre la review`],[`i`,`retour à l’inbox`],[`Ctrl+K`,`aller à une PR`],[`Échap`,`fermer le commentaire en cours`]];function BW(e){return(0,G.jsx)(Xm,{opened:e.opened,onClose:e.onClose,title:`Raccourcis clavier`,size:`md`,children:(0,G.jsx)(bg,{children:(0,G.jsx)(bg.Tbody,{children:zW.map(([e,t])=>(0,G.jsxs)(bg.Tr,{children:[(0,G.jsx)(bg.Td,{children:(0,G.jsx)(Em,{children:e})}),(0,G.jsx)(bg.Td,{children:t})]},e))})})})}function VW(){let e=ED(),t=W_(),n=dy(e.config.get.queryOptions()),[r,i]=(0,C.useState)(`repo`),[a,o]=(0,C.useState)(``),s=()=>{t.invalidateQueries({queryKey:e.config.get.queryKey()}),t.invalidateQueries({queryKey:e.inbox.get.queryKey()})},c=gy(e.config.add.mutationOptions({onSuccess:()=>{o(``),s()},onError:e=>t_.show({color:`red`,title:`Ajout impossible`,message:e.message})})),l=gy(e.config.remove.mutationOptions({onSuccess:s})),u=[...n.data?.orgs.map(e=>({kind:`org`,name:e}))??[],...n.data?.repos.map(e=>({kind:`repo`,name:e}))??[]];return(0,G.jsxs)(Zp,{size:`sm`,py:`xl`,children:[(0,G.jsx)(Rg,{order:2,mb:`xs`,children:`Repos et orgs suivis`}),(0,G.jsx)(Z,{c:`dimmed`,size:`sm`,mb:`lg`,children:`L’inbox ne montre que les PR de cette liste. Une org (ou un compte) suivie inclut tous ses repos. Le fichier de config peut aussi être édité à la main : les modifications sont prises en compte à chaud.`}),(0,G.jsx)(`form`,{onSubmit:e=>{e.preventDefault();let t=a.trim();t&&c.mutate({kind:r,name:t})},children:(0,G.jsxs)(X,{align:`flex-end`,mb:`lg`,children:[(0,G.jsx)(Yh,{value:r,onChange:e=>i(e===`org`?`org`:`repo`),data:[{value:`repo`,label:`Repo`},{value:`org`,label:`Org / compte`}]}),(0,G.jsx)(jg,{style:{flex:1},placeholder:r===`repo`?`owner/repo`:`nom-de-l-org`,value:a,onChange:e=>o(e.currentTarget.value),"data-autofocus":!0}),(0,G.jsx)(Fp,{type:`submit`,loading:c.isPending,children:`Suivre`})]})}),(0,G.jsxs)(tg,{gap:`xs`,children:[u.length===0&&(0,G.jsx)(Z,{c:`dimmed`,children:`Aucun repo suivi pour l’instant.`}),u.map(e=>(0,G.jsx)(Ac,{withBorder:!0,p:`xs`,px:`sm`,children:(0,G.jsxs)(X,{justify:`space-between`,children:[(0,G.jsxs)(X,{gap:`xs`,children:[(0,G.jsx)(Ep,{variant:`light`,color:e.kind===`org`?`violet`:`blue`,children:e.kind===`org`?`org`:`repo`}),(0,G.jsx)(Z,{ff:`monospace`,size:`sm`,children:e.name})]}),(0,G.jsx)(Pl,{variant:`subtle`,color:`red`,"aria-label":`Ne plus suivre ${e.name}`,onClick:()=>l.mutate(e),children:`✕`})]})},`${e.kind}:${e.name}`))]}),(0,G.jsx)(Rg,{order:2,mt:`xl`,mb:`xs`,children:`Modèle de la vue Intention`}),(0,G.jsx)(Fz,{})]})}var HW=TC({component:BD}),UW=CC({getParentRoute:()=>HW,path:`/`,component:tO}),WW=CC({getParentRoute:()=>HW,path:`/settings`,component:VW}),GW=CC({getParentRoute:()=>HW,path:`/$owner/$repo/pull/$number`,validateSearch:e=>({...typeof e.range==`string`?{range:e.range}:{},...e.mode===`focus`||e.mode===`continuous`?{mode:e.mode}:{},...typeof e.file==`string`?{file:e.file}:{},...typeof e.goto==`string`?{goto:e.goto}:{}}),component:NW}),KW=VC({routeTree:HW.addChildren([UW,WW,GW]),defaultPreload:`intent`,scrollRestoration:!1}),qW=Zn({primaryColor:`blue`,defaultRadius:`sm`,fontFamilyMonospace:`ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace`,cursorType:`pointer`});(0,Gw.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(C.StrictMode,{children:(0,G.jsxs)(Xn,{theme:qW,defaultColorScheme:`dark`,forceColorScheme:`dark`,children:[(0,G.jsx)(H_,{position:`bottom-left`,limit:4}),(0,G.jsx)(G_,{client:OD,children:(0,G.jsx)(TD,{trpcClient:kD,queryClient:OD,children:(0,G.jsx)(WC,{router:KW})})})]})}));
|
|
112
|
+
`).slice(1).slice(-8);return(0,G.jsx)(`div`,{className:`snippet`,children:t.map((e,t)=>(0,G.jsx)(`div`,{className:e.startsWith(`+`)?`c-add`:e.startsWith(`-`)?`c-del`:void 0,children:e||` `},t))})}function cz({thread:e,showPath:t=!1}){let n=zI(),r=iL(n.ref),[i,a]=(0,C.useState)(!1),o=n.focusedThread===e.id,s=e.comments.find(e=>e.unread)?.id,c=n.detail.canWrite&&n.detail.pr.sameRepo&&n.detail.pr.state===`OPEN`&&!e.isOutdated&&e.side===`RIGHT`&&e.line!==null,l=n.pendingReviewId,u=e.subjectType===`FILE`?`commentaire sur le fichier`:e.isOutdated?`ligne ${e.originalLine??`?`} (version d’origine)`:e.startLine!==null&&e.startLine!==e.line?`lignes ${e.startLine}–${e.line}`:`ligne ${e.line}`,d=e.pending?`pending`:e.isResolved?`resolved`:`open`,f=e.isResolved?e.canUnresolve:e.canResolve,[p,m]=(0,C.useState)(null),h=p??(!e.isResolved||o);return(0,G.jsxs)(`div`,{className:`thread`,"data-thread":e.id,"data-state":d,"data-unread":e.unread>0||void 0,"data-collapsed":!h||void 0,"data-focus":o||void 0,onClick:()=>n.setFocusedThread(e.id),children:[(0,G.jsxs)(`div`,{className:`thread-head`,children:[d===`pending`?(0,G.jsx)(Ep,{size:`md`,color:`grape`,variant:`filled`,children:`En attente · review non soumise`}):d===`resolved`?(0,G.jsxs)(Ep,{size:`md`,color:`green`,variant:`filled`,children:[`✓ Résolu`,e.resolvedBy?` par ${e.resolvedBy}`:``]}):(0,G.jsx)(Ep,{size:`md`,color:`yellow`,variant:`filled`,autoContrast:!0,children:`● Non résolu`}),e.isOutdated&&(0,G.jsx)(Ep,{size:`sm`,color:`gray`,variant:`outline`,children:`outdated`}),e.unread>0&&(0,G.jsxs)(Ep,{size:`sm`,color:`orange`,variant:`light`,children:[e.unread,` nouveau`,e.unread>1?`x`:``]}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,truncate:!0,children:[t?`${e.path} · `:``,u,e.subjectType===`LINE`?` · ${e.side===`LEFT`?`ancien code`:`nouveau code`}`:``]}),(0,G.jsx)(`div`,{style:{flex:1}}),e.isResolved&&(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,color:`gray`,style:{flex:`none`},"aria-expanded":h,onClick:e=>{e.stopPropagation(),m(!h)},children:h?`Replier`:`Afficher ${e.comments.length} message${e.comments.length>1?`s`:``}`}),e.comments[0]&&(0,G.jsx)(tf,{href:e.comments[0].url,target:`_blank`,size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`,flex:`none`},children:`GitHub ↗`})]}),h&&(e.isOutdated||e.line===null)&&e.diffHunk&&(0,G.jsx)(sz,{diffHunk:e.diffHunk}),h&&e.comments.map(t=>(0,G.jsxs)(`div`,{className:`comment`,"data-new":t.unread||void 0,children:[(0,G.jsx)(Cp,{src:t.author?.avatarUrl,size:24}),(0,G.jsxs)(`div`,{className:`comment-body`,children:[(0,G.jsxs)(X,{gap:6,mb:2,children:[(0,G.jsx)(Z,{size:`sm`,fw:600,children:t.author?.login??`ghost`}),(0,G.jsx)(Gh,{label:new Date(t.createdAt).toLocaleString(`fr`),children:(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:UD(t.createdAt)})}),t.pending&&(0,G.jsx)(Ep,{size:`xs`,color:`yellow`,variant:`light`,children:`en attente`}),t.pending&&t.canDelete&&(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,color:`red`,ml:`auto`,onClick:()=>r.deleteComment.mutate({commentId:t.id}),children:`Supprimer`}),t.unread&&(0,G.jsx)(YI,{text:t.body,active:t.id===s,onRead:()=>r.markThreadsRead.mutate([{threadId:e.id,lastCommentId:t.id}])})]}),(0,G.jsx)(BI,{html:t.bodyHTML}),!t.pending&&(0,G.jsx)(nL,{subjectId:t.id,reactions:t.reactions,onToggle:(e,n)=>r.react.mutate({subjectId:t.id,content:e,on:n})}),c&&!t.pending&&nz(t.body).map((i,a)=>(0,G.jsx)(Fp,{mt:6,size:`compact-xs`,color:`green`,variant:`light`,loading:r.applySuggestion.isPending,onClick:()=>r.applySuggestion.mutate({ref:n.ref,branch:n.detail.pr.headRefName,expectedHeadOid:n.detail.pr.headRefOid,path:e.path,side:`RIGHT`,startLine:e.startLine??e.line,endLine:e.line,replacement:i,message:`Apply suggestion from @${t.author?.login??`reviewer`}\n\n${t.url}`}),children:`Appliquer la suggestion (commit)`},a))]})]},t.id)),h?i&&e.canReply?(0,G.jsx)(VI,{draftKey:`reply:${e.id}`,repoContext:`${n.ref.owner}/${n.ref.repo}`,onCancel:()=>a(!1),placeholder:`Répondre…`,actions:[...e.canResolve&&!e.isResolved&&!l?[{label:`Répondre & résoudre`,variant:`default`,run:async t=>{await r.reply.mutateAsync({threadId:e.id,body:t,pendingReviewId:null}),await r.setResolved.mutateAsync({threadId:e.id,resolved:!0})}}]:[],{label:l?`Ajouter à la review`:`Répondre`,run:t=>r.reply.mutateAsync({threadId:e.id,body:t,pendingReviewId:l})}]}):(e.canReply||f)&&(0,G.jsxs)(X,{className:`thread-foot`,p:8,gap:8,children:[e.canReply&&(0,G.jsx)(Fp,{"data-reply":!0,variant:`default`,size:`compact-sm`,style:{flex:1,justifyContent:`flex-start`},styles:{inner:{justifyContent:`flex-start`}},onClick:()=>a(!0),children:(0,G.jsx)(Z,{size:`sm`,c:`dimmed`,children:`Répondre…`})}),f&&(0,G.jsx)(Fp,{size:`compact-sm`,ml:`auto`,color:e.isResolved?`yellow`:`green`,variant:e.isResolved?`light`:`filled`,onClick:t=>{t.stopPropagation(),r.setResolved.mutate({threadId:e.id,resolved:!e.isResolved})},children:e.isResolved?`Rouvrir la conversation`:`✓ Résoudre la conversation`})]}):null]})}var lz=new WeakMap;function uz(e){let t=zI(),n=ED(),r=[e.oldBlob,e.newBlob].filter(e=>e!==null),i=dy({...n.pr.blobs.queryOptions({ref:t.ref,oids:r}),staleTime:1/0,enabled:r.length>0&&!e.binary});if(i.isPending&&r.length>0&&!e.binary)return{old:null,new:null,newLines:null};let a=lz.get(e);if(a&&a.data===i.data)return a.sources;let o=e=>e===null?null:i.data?.[e],s=az(e,`newNo`,o(e.newBlob)),c={old:oz(e,`oldNo`,az(e,`oldNo`,o(e.oldBlob))),new:oz(e,`newNo`,s),newLines:s};return lz.set(e,{data:i.data,sources:c}),c}var dz={file:70,hunk:28,expand:28,split:20,line:20,threads:160,composer:230,notice:36,orphans:200};function fz(e,t,n){let r=e.hunks.filter(t=>n.has(`${e.path}\n${t.hash}`)).length;return{state:t===`VIEWED`?`viewed`:t===`DISMISSED`?`dismissed`:r>0?`partial`:`none`,seenHunks:r}}function pz(e){let t=zI();return fz(e,t.detail.files.find(t=>t.path===e.path)?.viewed,t.seenHunks)}var mz=58;function hz(){let e=zI(),t=iL(e.ref),n=(e,t)=>t.map(t=>({path:e.path,hash:t.hash}));return{toggleFile:(r,i)=>{t.setFileViewed.mutate({prId:e.detail.pr.id,path:r.path,viewed:i}),r.hunks.length>0&&t.setHunksSeen.mutate({ref:e.ref,hunks:n(r,r.hunks),seen:i})},toggleHunk:(r,i,a)=>{t.setHunksSeen.mutate({ref:e.ref,hunks:n(r,[i]),seen:a});let o=r.hunks.filter(e=>e!==i),s=a&&o.every(t=>e.seenHunks.has(`${r.path}\n${t.hash}`)),c=e.detail.files.find(e=>e.path===r.path)?.viewed;e.range.fullPr&&s&&c!==`VIEWED`?t.setFileViewed.mutate({prId:e.detail.pr.id,path:r.path,viewed:!0}):!a&&c===`VIEWED`&&t.setFileViewed.mutate({prId:e.detail.pr.id,path:r.path,viewed:!1})}}}function gz({state:e}){return(0,G.jsx)(`span`,{className:`vbox`,"data-state":e,children:e===`viewed`?`✓`:e===`dismissed`?`•`:``})}var _z={added:{label:`ajouté`,color:`green`},deleted:{label:`supprimé`,color:`red`},renamed:{label:`renommé`,color:`blue`},modified:null};function vz(e){let{file:t}=e,n=zI(),r=hz(),{state:i,seenHunks:a}=pz(t),o=n.detail.threads.filter(e=>e.path===t.path),s=o.filter(e=>!e.isResolved).length,c=_z[t.status];return(0,G.jsxs)(`div`,{className:`file-head`,"data-viewed":i===`viewed`||void 0,children:[(0,G.jsx)(Pl,{size:`lg`,variant:`subtle`,color:`gray`,onClick:e.onToggleCollapse,"aria-label":e.collapsed?`Déplier`:`Replier`,children:(0,G.jsx)(yz,{collapsed:e.collapsed})}),(0,G.jsxs)(`div`,{className:`file-head-main`,children:[(0,G.jsxs)(`div`,{className:`file-head-line`,children:[(0,G.jsx)(Gh,{label:t.status===`renamed`?`${t.oldPath} → ${t.path}`:t.path,openDelay:400,children:(0,G.jsxs)(`span`,{className:`file-path`,children:[t.status===`renamed`&&(0,G.jsxs)(Z,{span:!0,c:`dimmed`,inherit:!0,children:[t.oldPath,` →`,` `]}),t.path]})}),c&&(0,G.jsx)(Ep,{size:`xs`,variant:`light`,color:c.color,children:c.label}),i===`dismissed`&&(0,G.jsx)(Ep,{size:`xs`,variant:`light`,color:`orange`,children:`modifié depuis vu`})]}),(0,G.jsxs)(`div`,{className:`file-head-line`,children:[(0,G.jsxs)(Z,{size:`xs`,span:!0,children:[(0,G.jsxs)(Z,{span:!0,c:`green.4`,inherit:!0,children:[`+`,t.additions]}),` `,(0,G.jsxs)(Z,{span:!0,c:`red.4`,inherit:!0,children:[`−`,t.deletions]})]}),t.hunks.length>1&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[a,`/`,t.hunks.length,` hunks vus`]}),o.length>0&&(0,G.jsxs)(Z,{size:`xs`,c:s>0?`yellow.4`:`dimmed`,children:[(0,G.jsx)(`i`,{className:`ico-c`}),s,`/`,o.length]}),(0,G.jsx)(tf,{size:`xs`,c:`dimmed`,target:`_blank`,href:`https://github.com/${n.ref.owner}/${n.ref.repo}/blob/${n.detail.pr.headRefOid}/${t.path}`,children:`fichier ↗`}),n.canCommentFile(t.path)&&(0,G.jsx)(Gh,{label:`Commenter le fichier entier`,openDelay:300,children:(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,color:`gray`,leftSection:(0,G.jsx)(`i`,{className:`ico-c`}),onClick:()=>{e.collapsed&&e.onToggleCollapse(),n.setFileComposer(t.path)},children:`Commenter`})})]})]}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:i===`viewed`?`light`:`default`,color:i===`viewed`?`green`:`gray`,leftSection:(0,G.jsx)(gz,{state:i}),onClick:()=>{let e=i!==`viewed`;r.toggleFile(t,e),e&&n.advanceFrom(t.path)},children:`Vu`})]})}function yz({collapsed:e}){return(0,G.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.25`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{transform:e?`rotate(-90deg)`:void 0,transition:`transform 120ms`},"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function bz({tokens:e,text:t}){return e?(0,G.jsx)(G.Fragment,{children:e.map((e,t)=>(0,G.jsx)(`span`,{style:{color:e.color,fontStyle:e.fontStyle&1?`italic`:void 0,fontWeight:e.fontStyle&2?600:void 0},children:e.content},t))}):(0,G.jsx)(G.Fragment,{children:t})}var xz={add:`c-add`,del:`c-del`,context:``},Sz=(0,C.memo)(function(e){let{row:t,file:n}=e,r=zI(),i=uz(n),a=GR(n.path,i.old?.lines??null),o=GR(n.path,i.new?.lines??null),s=r.selection,c=(e,t)=>t!==null&&s!==null&&s.path===n.path&&s.side===e&&t>=s.start&&t<=s.end,l=r.linkTarget,u=(e,t)=>t!==null&&l!==null&&l.path===n.path&&l.side===e&&t>=l.start&&t<=l.end,d=(e,t)=>{if(t===`LEFT`){let t=e.oldNo===null||!i.old?void 0:rz(i.old,e.oldNo);return t===void 0?void 0:a?.[t]}let n=e.newNo===null||!i.new?void 0:rz(i.new,e.newNo);return n===void 0?void 0:o?.[n]},f=(e,t,i)=>{let a=t===null?null:r.commentHunk(n.path,e,t);t!==null&&a!==null&&(i.shiftKey&&s&&s.path===n.path&&s.side===e&&r.commentHunk(n.path,e,s.start)===a?r.setSelection({...s,start:Math.min(s.start,t),end:Math.max(s.end,t)}):r.setSelection({path:n.path,side:e,start:t,end:t}))},p=(e,t,i)=>{let a=t!==null&&r.commentHunk(n.path,e,t)!==null;return(0,G.jsx)(`div`,{className:`ln ${i}`,"data-disabled":!a||void 0,title:a?`Commenter (Maj+clic : plage dans le même hunk)`:void 0,onClick:n=>f(e,t,n),children:t??``})},m=(e,t,n)=>(0,G.jsxs)(`div`,{className:`tx ${n}`,children:[e&&(0,G.jsx)(bz,{tokens:d(e,t),text:e.content}),e?.noNewline&&(0,G.jsx)(`span`,{className:`nonl`,children:`⏎̸ pas de fin de ligne`})]});if(t.kind===`split`){let n=t.left,r=t.right,i=n?n.type===`del`?xz.del:``:`c-empty`,a=r?r.type===`add`?xz.add:``:`c-empty`,o=c(`LEFT`,n?.oldNo??null)?` c-sel`:u(`LEFT`,n?.oldNo??null)?` c-target`:``,s=c(`RIGHT`,r?.newNo??null)?` c-sel`:u(`RIGHT`,r?.newNo??null)?` c-target`:``;return(0,G.jsx)(`div`,{className:`code${e.last?` last`:``}`,children:(0,G.jsxs)(`div`,{className:`code-row split`,"data-viewed":e.viewed||void 0,children:[p(`LEFT`,n?.oldNo??null,i+o),m(n,`LEFT`,i+o),p(`RIGHT`,r?.newNo??null,a+s),m(r,`RIGHT`,a+s)]})})}let h=t.line,g=xz[h.type],_=h.type===`del`?`LEFT`:`RIGHT`,v=c(_,_===`LEFT`?h.oldNo:h.newNo)?` c-sel`:u(`LEFT`,h.oldNo)||u(`RIGHT`,h.newNo)?` c-target`:``;return(0,G.jsx)(`div`,{className:`code${e.last?` last`:``}`,children:(0,G.jsxs)(`div`,{className:`code-row unified`,"data-viewed":e.viewed||void 0,children:[p(`LEFT`,h.oldNo,g+v),p(`RIGHT`,h.newNo,g+v),m(h,_,g+v)]})})});function Cz(e,t,n,r){let i=uz(e).newLines;if(i===null)return null;let a=ZR(e,i.length,n?.gaps)[t];if(!a||a.hidden===0)return null;let o=Math.min(20,a.hidden),s=(n,a,o)=>(0,G.jsx)(Gh,{label:o,openDelay:300,children:(0,G.jsx)(Pl,{size:`xs`,variant:`subtle`,color:`gray`,"aria-label":o,onClick:()=>r(e,i,t,n),children:a})}),c=`${a.hidden} ligne${a.hidden>1?`s`:``} masquée${a.hidden>1?`s`:``}`,l;return l=t===e.hunks.length?s(`down`,`↓`,`Afficher ${o} lignes de plus (${c})`):t===0?s(`up`,`↑`,`Afficher ${o} lignes de plus (${c})`):a.hidden<=20?s(`all`,`↕`,`Afficher les ${c}`):(0,G.jsxs)(G.Fragment,{children:[s(`down`,`↓`,`Afficher 20 lignes sous le hunk précédent (${c})`),s(`up`,`↑`,`Afficher 20 lignes au-dessus du hunk (${c})`)]}),(0,G.jsx)(`span`,{className:`gap-expand`,children:l})}function wz(e){let t=zI(),n=hz(),r=e.file.hunks[e.hunkIdx],i=t.seenHunks.has(`${e.file.path}\n${r.hash}`),a=Cz(e.file,e.hunkIdx,e.expansion,e.onExpand);return(0,G.jsxs)(`div`,{className:`hunk-head`,"data-current":e.current||void 0,"data-unseen":!i||void 0,children:[a,(0,G.jsxs)(`span`,{children:[`@@ -`,r.oldStart,`,`,r.oldLines,` +`,r.newStart,`,`,r.newLines,` @@ `,r.section]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:i?`light`:`subtle`,color:i?`green`:`gray`,onClick:()=>n.toggleHunk(e.file,r,!i),children:i?`✓ hunk vu`:`Marquer le hunk vu`})]})}function Tz(e){let t=Cz(e.file,e.file.hunks.length,e.expansion,e.onExpand);return t?(0,G.jsx)(`div`,{className:`hunk-head${e.last?` last`:``}`,children:t}):e.last?(0,G.jsx)(`div`,{className:`code last`}):null}function Ez({file:e,target:t}){let n=zI(),r=iL(n.ref),i=n.selection;if(t===`line`&&!i)return null;let a,o,s=null,c;t===`file`||!i?(a=t=>({subjectType:`FILE`,path:e.path,body:t}),o=`sur le fichier`,c=()=>n.setFileComposer(null)):(a=e=>({subjectType:`LINE`,path:i.path,side:i.side,line:i.end,startLine:i.start===i.end?null:i.start,startSide:i.start===i.end?null:i.side,body:e}),o=`${i.start===i.end?`ligne ${i.end}`:`lignes ${i.start}–${i.end}`} · ${i.side===`LEFT`?`ancien code`:`nouveau code`}`,i.side===`RIGHT`&&(s=e.hunks.flatMap(e=>e.lines.filter(e=>e.newNo!==null&&e.newNo>=i.start&&e.newNo<=i.end).map(e=>e.content))),c=()=>n.setSelection(null));let l=n.pendingReviewId,u=(e,t)=>r.addThread.mutateAsync({prId:n.detail.pr.id,pendingReviewId:t===`review`?l:null,thread:a(e),mode:t});return(0,G.jsx)(`div`,{className:`diff-block`,children:(0,G.jsxs)(`div`,{className:`thread`,"data-focus":!0,children:[(0,G.jsxs)(`div`,{className:`thread-head`,children:[`Nouveau commentaire · `,o,l&&(0,G.jsx)(Ep,{size:`xs`,color:`yellow`,variant:`light`,ml:`auto`,children:`review en attente`})]}),(0,G.jsx)(VI,{draftKey:`new:${n.ref.owner}/${n.ref.repo}#${n.ref.number}`,repoContext:`${n.ref.owner}/${n.ref.repo}`,suggestionLines:s,onCancel:c,actions:[{label:`Commenter seul`,disabled:l!==null,run:e=>u(e,`single`)},{label:l?`Ajouter à la review`:`Démarrer une review`,run:e=>u(e,`review`)}]})]})})}function Dz(e){let t=zI(),[n,r]=(0,C.useState)(()=>new Map),i=(0,C.useCallback)((e,t,n,i)=>r(r=>new Map(r).set(e,QR(r.get(e),t,n,i))),[]),a=(0,C.useRef)(null),o=(0,C.useRef)({fileIdx:null,hunkIdx:null}),s=t.range.head===t.detail.pr.headRefOid,c=(0,C.useMemo)(()=>tz({files:e.files,layout:t.layout,threads:t.detail.threads,anchorable:e=>s&&(e===`RIGHT`||t.range.fullPr),collapsed:e.collapsed,composer:t.selection,fileComposer:t.fileComposer,onlyFile:e.onlyFile,expansions:n}),[e.files,t.layout,t.detail.threads,s,t.range.fullPr,e.collapsed,t.selection,t.fileComposer,e.onlyFile,n]),l=c.rows,u=KL({count:l.length,getScrollElement:()=>a.current,estimateSize:e=>dz[l[e].kind],getItemKey:e=>l[e].key,overscan:30,onChange:t=>{let n=t.getVirtualItemForOffset((t.scrollOffset??0)+mz+4),r=n?l[n.index]:void 0,i=null;if(n)for(let e=c.hunkRows.length-1;e>=0;e--){let t=c.hunkRows[e];if(t.row<=n.index&&t.fileIdx===r?.fileIdx){i=t.hunkIdx;break}}let a=r?.fileIdx??null;(a!==o.current.fileIdx||i!==o.current.hunkIdx)&&(o.current={fileIdx:a,hunkIdx:i},e.onCurrentChange(a,i))}}),d=e.onCurrentChange;(0,C.useImperativeHandle)(e.handleRef,()=>{let n=()=>u.getVirtualItemForOffset((u.scrollOffset??0)+mz+4)?.index??0,r=e=>{if(e===void 0)return;if(l[e]?.kind===`file`){u.scrollToIndex(e,{align:`start`});return}let t=u.getOffsetForIndex(e,`start`)?.[0];t!==void 0&&u.scrollToOffset(Math.max(0,t-mz))};return{scrollToFile:t=>{let n=e.files.findIndex(e=>e.path===t);r(c.fileRow[n]),n!==-1&&n!==o.current.fileIdx&&(o.current={fileIdx:n,hunkIdx:null},d(n,null))},scrollToThread:e=>{let t=c.threadRow.get(e);return t!==void 0&&(u.scrollToIndex(t,{align:`center`}),!0)},scrollToLine:(e,t,n)=>{let r=c.lineRow.get(qR(e,t,n));return r!==void 0&&(u.scrollToIndex(r,{align:`center`}),!0)},step:(e,i)=>{let a=n(),o;if(e===`file`)o=c.fileRow.filter(e=>e!==void 0);else if(e===`hunk`)o=c.hunkRows.map(e=>e.row);else{let e=new Set(t.detail.threads.filter(e=>!e.isResolved).map(e=>e.id));o=[...new Set([...c.threadRow].filter(([t])=>e.has(t)).map(([,e])=>e))].sort((e,t)=>e-t)}let s=i>0?o.find(e=>e>a):o.filter(e=>e<a).at(-1);if(r(s),e===`thread`&&s!==void 0){let e=l[s],n=e&&(e.kind===`threads`||e.kind===`orphans`)?e.threadIds.find(e=>!t.detail.threads.find(t=>t.id===e)?.isResolved):void 0;n&&t.setFocusedThread(n)}},current:()=>o.current}},[u,c,e.files,l,t,d]);let f=u.getVirtualItems(),p=u.getVirtualItemForOffset((u.scrollOffset??0)+4),m=p?l[p.index]:void 0,h=m&&m.kind!==`file`&&m.fileIdx!==null?e.files[m.fileIdx]:void 0,g=(0,C.useMemo)(()=>new Map(t.detail.threads.map(e=>[e.id,e])),[t.detail.threads]),_=(r,a)=>{let s=l[a+1],c=!s||s.kind===`file`,u=r.fileIdx===null?void 0:e.files[r.fileIdx];switch(r.kind){case`file`:return(0,G.jsx)(vz,{file:u,collapsed:e.collapsed.has(u.path),onToggleCollapse:()=>e.onToggleCollapse(u.path)});case`hunk`:return(0,G.jsx)(wz,{file:u,hunkIdx:r.hunkIdx,current:o.current.fileIdx===r.fileIdx&&o.current.hunkIdx===r.hunkIdx,expansion:n.get(u),onExpand:i});case`expand`:return(0,G.jsx)(Tz,{file:u,last:c,expansion:n.get(u),onExpand:i});case`split`:case`line`:{let e=u.hunks[r.hunkIdx];return(0,G.jsx)(Sz,{row:r,file:u,viewed:t.seenHunks.has(`${u.path}\n${e.hash}`),last:c})}case`threads`:return(0,G.jsx)(`div`,{className:`diff-block${c?` last`:``}`,children:r.threadIds.map(e=>{let t=g.get(e);return t?(0,G.jsx)(cz,{thread:t},e):null})});case`composer`:return(0,G.jsx)(Ez,{file:u,target:r.target});case`notice`:return(0,G.jsx)(`div`,{className:`diff-block${c?` last`:``}`,children:(0,G.jsx)(Z,{size:`sm`,c:`dimmed`,children:r.text})});case`orphans`:return(0,G.jsxs)(`div`,{className:`diff-block${c?` last`:``}`,style:r.fileIdx===null?{marginTop:16,borderTop:`1px solid var(--br-border)`}:void 0,children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,tt:`uppercase`,fw:600,mb:4,children:r.title}),r.threadIds.map(e=>{let t=g.get(e);return t?(0,G.jsx)(cz,{thread:t,showPath:r.fileIdx===null},e):null})]})}};return l.length===0?(0,G.jsx)(`div`,{className:`diff-scroll`,ref:a,children:(0,G.jsx)(Z,{c:`dimmed`,p:`lg`,children:`Aucun changement dans cette plage.`})}):(0,G.jsxs)(`div`,{className:`diff-scroll`,ref:a,children:[h&&(0,G.jsx)(`div`,{className:`sticky-file`,children:(0,G.jsx)(vz,{file:h,collapsed:e.collapsed.has(h.path),onToggleCollapse:()=>e.onToggleCollapse(h.path)})}),(0,G.jsx)(`div`,{className:`diff-inner`,style:{height:u.getTotalSize()+80},children:f.map(e=>(0,G.jsx)(`div`,{"data-index":e.index,ref:u.measureElement,className:`diff-row`,style:{transform:`translateY(${e.start}px)`},children:_(l[e.index],e.index)},e.key))}),(0,G.jsx)(X,{className:`diff-end`,justify:`center`,p:`md`,children:(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[(0,G.jsx)(Em,{size:`xs`,children:`j`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`k`}),` fichier · `,(0,G.jsx)(Em,{size:`xs`,children:`n`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`p`}),` hunk · `,(0,G.jsx)(Em,{size:`xs`,children:`]`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`[`}),` thread ouvert`]})})]})}var Oz=e=>e.additions+e.deletions;function kz(e){let t=Oz(e),n=t===0?.5:e.additions/t;return`hsl(${Math.round(n*130)} 45% 30%)`}function Az(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],additions:0,deletions:0,fileCount:0,viewedCount:0,openThreads:0}}function jz(e,t){let n=Az(``,``);for(let t of e){let e=t.path.split(`/`),r=n;for(let t of e.slice(0,-1)){let e=r.path?`${r.path}/${t}`:t,n=r.dirs.find(t=>t.path===e);n||(n=Az(t,e),r.dirs.push(n)),r=n}r.files.push({kind:`file`,name:e.at(-1),path:t.path,stat:t})}let r=(e,n)=>{let i=e;for(;!n&&i.files.length===0&&i.dirs.length===1;){let e=i.dirs[0];i={...e,name:`${i.name}/${e.name}`}}i.dirs=i.dirs.map(e=>r(e,!1)),i.additions=i.deletions=i.fileCount=i.viewedCount=i.openThreads=0;for(let e of i.dirs)i.additions+=e.additions,i.deletions+=e.deletions,i.fileCount+=e.fileCount,i.viewedCount+=e.viewedCount,i.openThreads+=e.openThreads;for(let e of i.files)i.additions+=e.stat.additions,i.deletions+=e.stat.deletions,i.fileCount+=1,i.viewedCount+=+(e.stat.state===`viewed`),i.openThreads+=e.stat.openThreads;if(t){let e=(e,t)=>e.name.localeCompare(t.name),n=(t,n)=>Oz(n.kind===`dir`?n:n.stat)-Oz(t.kind===`dir`?t:t.stat)||e(t,n);i.dirs.sort(t===`churn`?n:e),i.files.sort(t===`churn`?n:e)}return i};return r(n,!0)}function Mz(e,t){let n=[],r=(e,i)=>{for(let a of e.dirs)n.push({...a,depth:i}),t.has(a.path)||r(a,i+1);for(let t of e.files)n.push({...t,depth:i})};return r(e,0),n}function Nz(e,t,n){return t===`list`?n===`name`?e.map(e=>e.path):[...e].sort((e,t)=>Oz(t)-Oz(e)||e.path.localeCompare(t.path)).map(e=>e.path):Mz(jz(e.map(e=>({...e,state:`none`,openThreads:0,unreadThreads:0})),n),new Set).flatMap(e=>e.kind===`file`?[e.path]:[])}var Pz={local:`d1-3B (local)`,claude:`Claude Haiku 5.5 (API Anthropic)`},Fz=`https://platform.claude.com/settings/keys`;function Iz(){let e=ED(),t=W_(),n=dy(e.ai.status.queryOptions()),[r,i]=(0,C.useState)(``),a=()=>{t.invalidateQueries({queryKey:e.ai.status.queryKey()}),t.invalidateQueries({queryKey:e.config.get.queryKey()})},o=gy(e.ai.setModel.mutationOptions({onSuccess:a})),s=gy(e.ai.setClaudeKey.mutationOptions({onSuccess:()=>{i(``),a()},onError:e=>t_.show({color:`red`,title:`Clé non enregistrée`,message:e.message})})),c=n.data?.kind??`local`;return(0,G.jsxs)(tg,{gap:`xs`,children:[(0,G.jsx)(Yh,{size:`xs`,value:c,disabled:n.isPending||o.isPending,onChange:e=>o.mutate(e===`claude`?`claude`:`local`),data:[{value:`local`,label:Pz.local},{value:`claude`,label:Pz.claude}]}),c===`local`?(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`d1-3B, modèle de décision de Liquid AI servi par llama-server sur cette machine : le code ne la quitte pas. Probabilités calibrées, ≈ 0,3 s par fichier avec un GPU.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Le diff, le début de chaque fichier et la description de la PR sont envoyés à l’API Anthropic. Coût indicatif : moins d’un dixième de centime par fichier. Claude ne donne pas de probabilités mesurées : confiances et pourcentages sont ceux qu’il estime, moins fiables que ceux de d1.`}),n.data?.claudeKey===`env`?(0,G.jsxs)(Z,{size:`xs`,children:[`Clé fournie par `,(0,G.jsx)(qp,{children:`ANTHROPIC_API_KEY`}),`.`]}):(0,G.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),r.trim()&&s.mutate({key:r.trim()})},children:(0,G.jsxs)(X,{gap:`xs`,align:`flex-end`,wrap:`nowrap`,children:[(0,G.jsx)(sh,{size:`xs`,style:{flex:1},label:n.data?.claudeKey===`file`?`Remplacer la clé API`:`Clé API Anthropic`,placeholder:`sk-ant-…`,value:r,onChange:e=>i(e.currentTarget.value),autoComplete:`off`}),(0,G.jsx)(Fp,{size:`xs`,type:`submit`,loading:s.isPending,disabled:!r.trim(),children:`Enregistrer`})]})}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Clé à créer dans la `,(0,G.jsx)(tf,{href:Fz,children:`console Claude`}),`, gardée sur cette machine (fichier `,(0,G.jsx)(qp,{children:`anthropic-key`}),`, lisible par vous seul) et jamais renvoyée au navigateur.`,` `,(0,G.jsx)(qp,{children:`ANTHROPIC_API_KEY`}),` la remplace si elle est définie.`]})]})]})}var Lz=[{id:`core`,label:`Cœur du changement`,hint:`attention élevée, comportement modifié ou code sensible`},{id:`contract`,label:`Contrats et API`,hint:`API publique, types partagés, schémas, formats de données`},{id:`other`,label:`Autres changements de code`,hint:`sans changement de comportement probable`},{id:`tests`,label:`Tests`,hint:`tests, fixtures, snapshots`},{id:`support`,label:`Docs et configuration`,hint:`documentation, build, outillage, CI`},{id:`mechanical`,label:`Mécanique`,hint:`renommages, mise en forme, dépendances, fichiers générés`}],Rz={logic:`Logique`,contract:`Contrat`,ui:`UI`,tests:`Tests`,config:`Config`,docs:`Docs`,generated:`Généré`},zz={feature:`Ajout`,fix:`Correctif`,refactor:`Refactor`,rename:`Renommage`,format:`Forme`,deps:`Dépendances`},Bz=[`Mécanique`,`Faible risque`,`À lire`,`Critique`],Vz=.5,Hz=[`rename`,`format`,`deps`];function Uz(e){let t=e.role.value,n=e.attention.value;return t===`generated`||Hz.includes(e.nature.value)&&n<1?`mechanical`:t===`tests`?`tests`:t===`docs`||t===`config`?`support`:n>=1.5||e.sensitive>=.5?`core`:t===`contract`||e.api>=.5?`contract`:e.behaviour>=.5?`core`:`other`}function Wz(e,t,n){let r=new Map;for(let[e,n]of t)r.set(e,Uz(n));return FI(Lz.map(t=>({items:e.filter(e=>r.get(e)===t.id)})),e,n)}var Gz=e=>e.split(`/`).at(-1)??e,Kz=e=>e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``,qz=e=>`${Math.round(e*100)} %`,Jz=1e4,Yz=e=>({key:e,intents:new Map,failed:new Map,total:null,concurrency:1,done:!1,modelMs:0,modelFiles:0,error:null});function Xz(e,t){switch(t.type){case`start`:return{...e,total:t.total,concurrency:t.concurrency,error:null};case`file`:{let n=new Map(e.failed);return n.delete(t.path),{...e,intents:new Map(e.intents).set(t.path,t.intent),failed:n,modelMs:e.modelMs+(t.ms??0),modelFiles:e.modelFiles+(t.ms===null?0:1)}}case`failed`:return{...e,failed:new Map(e.failed).set(t.path,t.message)};case`done`:return{...e,done:!0}}}function Zz(e,t,n){let r=ED(),i=W_(),a=dy({...r.ai.status.queryOptions(),enabled:n,staleTime:0,refetchInterval:e=>e.state.data?.state!==`ready`&&e.state.data?.kind===`local`&&3e3}),o=a.data?.state===`ready`?a.data.kind:null,s=`${e.owner}/${e.repo}#${e.number}:${t.base}...${t.head}:${o}`,[c,l]=(0,C.useState)(()=>Yz(s)),u=c.key===s?c:Yz(s),d=e=>l(t=>e(t.key===s?t:Yz(s)));return xD(r.pr.intent.subscriptionOptions({ref:e,base:t.base,head:t.head,fullPr:t.fullPr,model:o??`local`},{enabled:n&&o!==null,onData:e=>{d(t=>Xz(t,e)),o===`claude`&&e.type!==`start`&&i.invalidateQueries({queryKey:r.ai.usage.queryKey()})},onError:e=>{d(t=>({...t,error:e.message})),a.refetch()}})),{status:a,progress:u}}var Qz={logic:`blue`,contract:`grape`,ui:`cyan`,tests:`teal`,config:`gray`,docs:`gray`,generated:`dark`};function $z({value:e}){let t=Math.round(e);return(0,G.jsxs)(Z,{span:!0,size:`xs`,ff:`monospace`,c:t>=3?`red`:t===2?`orange`:`dimmed`,children:[`●`.repeat(t+1),`○`.repeat(3-t)]})}function eB(e){let t=t=>e.ruled.includes(t)?` (règle de chemin)`:``;return[`Rôle : ${Rz[e.role.value]} — confiance ${qz(e.role.confidence)}${t(`role`)}`,`Nature : ${zz[e.nature.value]} — confiance ${qz(e.nature.confidence)}${t(`nature`)}`,`Attention : ${Bz[Math.round(e.attention.value)]} (${e.attention.value.toFixed(1)} / 3)${t(`attention`)}`,`Comportement modifié : ${qz(e.behaviour)}${t(`behaviour`)}`,`API / schéma / format modifié : ${qz(e.api)}${t(`api`)}`,`Code sensible (auth, secrets, SQL, fichiers, entrées) : ${qz(e.sensitive)}${t(`sensitive`)}`].join(`
|
|
113
|
+
`)}function tB({intent:e}){let t=e.role.confidence>=Vz,n=e.nature.confidence>=Vz;return(0,G.jsxs)(X,{gap:4,wrap:`nowrap`,children:[e.sensitive>=.5&&(0,G.jsx)(Ep,{size:`xs`,color:`red`,variant:`filled`,radius:`sm`,children:`sensible`}),e.api>=.5&&!(t&&e.role.value===`contract`)&&(0,G.jsx)(Ep,{size:`xs`,color:`grape`,variant:`outline`,radius:`sm`,children:`API`}),t&&(0,G.jsx)(Ep,{size:`xs`,radius:`sm`,variant:`light`,color:Qz[e.role.value],children:Rz[e.role.value]}),n&&(0,G.jsx)(Ep,{size:`xs`,radius:`sm`,variant:`outline`,color:`gray`,children:zz[e.nature.value]}),(0,G.jsx)($z,{value:e.attention.value}),(0,G.jsx)(Gh,{multiline:!0,w:360,withArrow:!0,position:`right`,label:(0,G.jsx)(`span`,{style:{whiteSpace:`pre-line`},children:eB(e)}),children:(0,G.jsx)(`span`,{className:`intent-help`,"aria-label":`Détail du classement`,title:``,children:`?`})})]})}function nB(e){let t=Math.round(e/1e3);return t<90?`${t} s`:`${Math.round(t/60)} min`}function rB(e){let{status:t,progress:n}=e.intents,[r,i]=Ge({key:`br:intentHideMechanical`,defaultValue:!1});if(t.isPending)return(0,G.jsx)(X,{justify:`center`,p:`md`,children:(0,G.jsx)(El,{size:`sm`})});if(t.isError)return(0,G.jsx)(Jd,{color:`red`,m:`xs`,title:`Statut du modèle indisponible`,children:t.error.message});if(t.data.state!==`ready`)return(0,G.jsx)(cB,{status:t.data,onRetry:()=>void t.refetch()});let a=n.intents.size+n.failed.size,o=n.total,s=n.modelFiles>0?n.modelMs/n.modelFiles:null,c=e=>{let t=n.intents.get(e);return t?Uz(t):null},l=t=>{let r=n.intents.get(t.path),i=n.failed.get(t.path);return(0,G.jsxs)(`div`,{className:`tree-node intent-node`,"data-current":t.path===e.currentPath||void 0,"data-viewed":t.state===`viewed`||void 0,title:t.path,onClick:()=>e.onSelect(t.path),children:[n.done&&(0,G.jsx)(`span`,{className:`link-rank`,children:e.stats.indexOf(t)+1}),(0,G.jsx)(gz,{state:t.state}),(0,G.jsxs)(`span`,{className:`tree-name`,children:[Gz(t.path),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,ml:6,children:Kz(t.path)})]}),(0,G.jsx)(`div`,{className:`intent-tags`,children:r?(0,G.jsx)(tB,{intent:r}):i?(0,G.jsx)(Gh,{label:i,children:(0,G.jsx)(Ep,{size:`xs`,color:`red`,variant:`outline`,radius:`sm`,children:`échec`})}):(0,G.jsx)(El,{size:10})})]},t.path)},u=e.stats.filter(e=>c(e.path)===null);return(0,G.jsxs)(`div`,{className:`links-view`,children:[(0,G.jsxs)(tg,{gap:4,px:10,pb:6,children:[n.error&&(0,G.jsx)(Jd,{color:`red`,p:6,title:`Classement interrompu`,children:(0,G.jsx)(Z,{size:`xs`,children:n.error})}),!n.done&&!n.error&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Classement : `,a,`/`,o??`…`,s!==null&&o!==null?` · ≈ ${nB(s)} / fichier · reste ≈ ${nB((o-a)*s/n.concurrency)}`:``]}),(0,G.jsx)(gh,{size:`xs`,value:o?a/o*100:0,animated:!0})]}),t.data.kind===`local`&&s!==null&&s>Jz&&(0,G.jsxs)(Z,{size:`xs`,c:`orange`,children:[`Machine lente pour ce modèle (`,nB(s),` par fichier) : un GPU est recommandé. Les fichiers déjà classés restent en cache.`]}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:n.done?`Ordre de lecture : du cœur du changement au mécanique, la base d’abord dans chaque groupe.`:`L’ordre de lecture passe par intention quand tous les fichiers sont classés.`}),(0,G.jsx)(ip,{size:`xs`,label:`Masquer le mécanique`,checked:r,onChange:e=>i(e.currentTarget.checked)}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Modèle : `,Pz[t.data.kind],` ·`,` `,(0,G.jsx)(tf,{component:bC,to:`/settings`,size:`xs`,children:`changer`})]})]}),(0,G.jsxs)(`div`,{className:`file-nav-scroll`,children:[Lz.map(t=>{if(r&&t.id===`mechanical`)return null;let n=e.stats.filter(e=>c(e.path)===t.id);return n.length===0?null:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Gh,{label:t.hint,children:(0,G.jsxs)(`div`,{className:`pkg-head`,children:[(0,G.jsx)(Z,{span:!0,size:`xs`,fw:700,style:{flex:1},children:t.label}),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,children:n.length})]})}),n.map(l)]},t.id)}),u.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`pkg-head`,children:[(0,G.jsx)(Z,{span:!0,size:`xs`,fw:700,style:{flex:1},children:n.done?`Non classés`:`En cours de classement`}),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,children:u.length})]}),u.map(l)]})]})]})}var iB={absent:e=>`Aucun serveur ne répond sur ${e.url}.`,loading:()=>`llama-server charge le modèle…`,"no-key":e=>`${e.url} demande une clé.`,unauthorized:e=>`${e.url} refuse la clé de better-review : relancer llama-server avec la commande ci-dessous (option --api-key).`,"not-decision":e=>`${e.url} répond, mais ne sert pas de modèle de décision${e.model?` (${e.model})`:``} : vérifier le modèle et la version de llama.cpp (≥ 0.7.0).`},aB={absent:()=>`API Anthropic injoignable, ou Claude Haiku 5.5 indisponible pour ce compte.`,loading:()=>`API Anthropic en cours de vérification…`,"no-key":()=>`Clé API Anthropic requise.`,unauthorized:()=>`La clé Anthropic est refusée : en enregistrer une autre.`,"not-decision":()=>`Réponse inattendue de l’API Anthropic.`},oB=`https://github.com/ggml-org/llama.cpp/releases`;function sB({platform:e}){return e===`darwin`?(0,G.jsxs)(Z,{size:`xs`,children:[(0,G.jsx)(qp,{children:`brew install llama.cpp`}),` puis vérifier `,(0,G.jsx)(qp,{children:`llama-server --version`}),` ≥ 0.7.0 (la 0.6.0 ne charge pas d1), ou l’archive `,(0,G.jsx)(qp,{children:`macos-arm64`}),` des`,` `,(0,G.jsx)(tf,{href:oB,children:`releases`}),` (Apple Silicon : accélération Metal).`]}):e===`win32`?(0,G.jsxs)(Z,{size:`xs`,children:[`Archive des `,(0,G.jsx)(tf,{href:oB,children:`releases llama.cpp`}),` selon le GPU :`,` `,(0,G.jsx)(qp,{children:`win-cuda-13.4-x64`}),` ou `,(0,G.jsx)(qp,{children:`win-cuda-12.4-x64`}),` (NVIDIA), `,(0,G.jsx)(qp,{children:`win-rocm`}),` `,`(AMD), `,(0,G.jsx)(qp,{children:`win-vulkan-x64`}),` (autres) ; l’extraire et ajouter le dossier au `,(0,G.jsx)(qp,{children:`PATH`}),`.`]}):(0,G.jsxs)(Z,{size:`xs`,children:[`Archive des `,(0,G.jsx)(tf,{href:oB,children:`releases llama.cpp`}),` selon le GPU :`,` `,(0,G.jsx)(qp,{children:`ubuntu-cuda-13.4-x64`}),` ou `,(0,G.jsx)(qp,{children:`ubuntu-cuda-12.8-x64`}),` (NVIDIA),`,` `,(0,G.jsx)(qp,{children:`ubuntu-rocm`}),` (AMD), `,(0,G.jsx)(qp,{children:`ubuntu-vulkan-x64`}),` (autres), `,(0,G.jsx)(qp,{children:`ubuntu-x64`}),` (CPU seul) ; l’extraire et ajouter le dossier au `,(0,G.jsx)(qp,{children:`PATH`}),`.`]})}function cB(e){let{status:t}=e,n=t.kind===`claude`?aB:iB,r=t.state===`ready`?null:n[t.state](t);return(0,G.jsx)(`div`,{className:`file-nav-scroll`,children:(0,G.jsxs)(tg,{gap:`xs`,px:10,pb:`md`,children:[(0,G.jsx)(Z,{size:`sm`,fw:600,children:`Vue Intention : modèle requis`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Chaque fichier est classé (rôle, nature du changement, attention requise, API, code sensible) par un modèle, au choix :`}),(0,G.jsx)(Iz,{}),(0,G.jsx)(Jd,{color:t.state===`loading`?`blue`:`orange`,p:6,children:(0,G.jsxs)(X,{gap:6,wrap:`nowrap`,children:[t.state===`loading`&&(0,G.jsx)(El,{size:12}),(0,G.jsx)(Z,{size:`xs`,children:r})]})}),t.kind===`local`&&(0,G.jsx)(lB,{status:t,onRetry:e.onRetry})]})})}function lB(e){let{status:t}=e;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z,{size:`xs`,fw:600,children:`Prérequis`}),(0,G.jsxs)(Nm,{size:`xs`,spacing:2,children:[(0,G.jsx)(Nm.Item,{children:`GPU avec ≥ 6 Go de VRAM (NVIDIA, AMD, Vulkan) ou Apple Silicon 16 Go`}),(0,G.jsx)(Nm.Item,{children:`≈ 3 Go de disque pour le modèle (téléchargé au premier lancement)`}),(0,G.jsx)(Nm.Item,{children:`Sans GPU : fonctionne, mais ≈ 30 s par fichier`})]}),(0,G.jsx)(Z,{size:`xs`,fw:600,children:`1. Installer llama.cpp ≥ 0.7.0`}),(0,G.jsx)(sB,{platform:t.platform}),(0,G.jsx)(Z,{size:`xs`,fw:600,children:`2. Lancer le modèle (laisser tourner)`}),(0,G.jsx)(qp,{block:!0,style:{whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:t.command}),(0,G.jsx)($p,{value:t.command,children:({copied:e,copy:t})=>(0,G.jsx)(Fp,{size:`compact-xs`,variant:`light`,onClick:t,w:`fit-content`,children:e?`Copié`:`Copier la commande`})}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`La clé protège le serveur des autres sites ouverts dans le navigateur (llama-server accepte toutes les origines). Autre adresse : `,(0,G.jsx)(qp,{children:`BR_AI_URL`}),` ; clé imposée : `,(0,G.jsx)(qp,{children:`BR_AI_KEY`}),`.`]}),(0,G.jsx)(Z,{size:`xs`,fw:600,children:`3. Détection`}),(0,G.jsxs)(X,{gap:6,children:[(0,G.jsx)(El,{size:10}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Vérifié toutes les 3 s`}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:`subtle`,onClick:e.onRetry,children:`Tester maintenant`})]})]})}var uB=Object.defineProperty,dB=(e,t,n)=>t in e?uB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fB=(e,t)=>{for(var n in t)uB(e,n,{get:t[n],enumerable:!0})},pB=(e,t,n)=>dB(e,typeof t==`symbol`?t:t+``,n),mB={};fB(mB,{Graph:()=>$B,alg:()=>DB});var hB=Object.defineProperty,gB=(e,t)=>{for(var n in t)hB(e,n,{get:t[n],enumerable:!0})},_B=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=bB(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=xB(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,vB(this._preds[a],i),vB(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?SB(this._isDirected,e):bB(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?SB(this._isDirected,e):bB(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?SB(this._isDirected,e):bB(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],yB(this._preds[t],e),yB(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function vB(e,t){e[t]?e[t]++:e[t]=1}function yB(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function bB(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function xB(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function SB(e,t){return bB(e,t.v,t.w,t.name)}gB({},{read:()=>EB,write:()=>CB});function CB(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:wB(e),edges:TB(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function wB(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function TB(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function EB(e){let t=new _B(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var DB={};gB(DB,{CycleException:()=>HB,bellmanFord:()=>kB,components:()=>jB,dijkstra:()=>PB,dijkstraAll:()=>IB,findCycles:()=>RB,floydWarshall:()=>BB,isAcyclic:()=>WB,postorder:()=>JB,preorder:()=>YB,prim:()=>XB,shortestPaths:()=>ZB,tarjan:()=>LB,topsort:()=>UB});var OB=()=>1;function kB(e,t,n,r){return AB(e,String(t),n||OB,r||function(t){return e.outEdges(t)??[]})}function AB(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function jB(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var MB=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},NB=()=>1;function PB(e,t,n,r){return FB(e,String(t),n||NB,r||function(t){return e.outEdges(t)??[]})}function FB(e,t,n,r){let i={},a=new MB,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function IB(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=PB(e,i,t,n),r},{})}function LB(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function RB(e){return LB(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var zB=()=>1;function BB(e,t,n){return VB(e,t||zB,n||function(t){return e.outEdges(t)??[]})}function VB(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var HB=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function UB(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new HB;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new HB;return r}function WB(e){try{UB(e)}catch(e){if(e instanceof HB)return!1;throw e}return!0}function GB(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=KB(e,t,n===`post`,o,a,r,i)}),i}function KB(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=KB(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function qB(e,t,n){return GB(e,t,n,function(e,t){return e.push(t),e},[])}function JB(e,t){return qB(e,t,`post`)}function YB(e,t){return qB(e,t,`pre`)}function XB(e,t){var n;let r=new _B,i={},a=new MB,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function ZB(e,t,n,r){return QB(e,t,n,r??(t=>e.outEdges(t)??[]))}function QB(e,t,n,r){if(n===void 0)return PB(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return kB(e,t,n,r)}return PB(e,t,n,r)}var $B=_B;function eV(e,t,n,r){let i=r;for(;e.hasNode(i);)i=gV(r);return n.dummy=t,e.setNode(i,n),i}function tV(e){let t=new $B().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function nV(e){let t=new $B({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function rV(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function iV(e){let t=_V(dV(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function aV(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=uV(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function oV(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=uV(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function sV(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),eV(e,`border`,i,t)}function cV(e,t=lV){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var lV=65535;function uV(e,t){return t.length>lV?e(...cV(t).map(t=>e(...t))):e(...t)}function dV(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return uV(Math.max,t)}function fV(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function pV(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function mV(e,t){return t()}var hV=0;function gV(e){return e+(``+ ++hV)}function _V(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function vV(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function yV(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function bV(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var xV=`\0`;function SV(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var CV=`3.1.1`,wV=class{constructor(){pB(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return TV(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&TV(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,EV)),n=n._prev;return`[`+e.join(`, `)+`]`}};function TV(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function EV(e,t){if(e!==`_next`&&e!==`_prev`)return t}var DV=wV,OV=()=>1;function kV(e,t){if(e.nodeCount()<=1)return[];let n=MV(e,t||OV);return AV(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function AV(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)jV(e,t,n,o);for(;o=i.dequeue();)jV(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(jV(e,t,n,o,!0)||[]);break}}}return r}function jV(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,NV(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,NV(t,n,o)}),e.removeNode(r.v),o}function MV(e,t){let n=new $B,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=PV(i+r+3).map(()=>new DV),o=r+1;return n.nodes().forEach(e=>{NV(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function NV(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function PV(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function FV(e,t){(e.graph().acyclicer===`greedy`?kV(e,n(e)):IV(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,gV(`rev`))});function n(e){return t=>e.edge(t).weight}}function IV(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&RV(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function LV(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function RV(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function zV(e){e.graph().dummyChains=[],e.edges().forEach(t=>BV(e,t))}function BV(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=eV(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function VV(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function HV(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=uV(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function UV(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var WV=GV;function GV(e){let t=new $B({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;KV(t,e)<i&&(a=qV(t,e),a);)o=t.hasNode(a.v)?UV(e,a):-UV(e,a),JV(t,e,o);return t}function KV(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!UV(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function qV(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=UV(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function JV(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:YV,postorder:XV}=DB,ZV=QV;QV.initLowLimValues=nH,QV.initCutValues=$V,QV.calcCutValue=tH,QV.leaveEdge=iH,QV.enterEdge=aH,QV.exchangeEdges=oH;function QV(e){e=tV(e),HV(e);let t=WV(e);nH(t),$V(t,e);let n,r;for(;n=iH(t);)r=aH(t,e,n),oH(t,e,n,r)}function $V(e,t){let n=XV(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>eH(e,t,n))}function eH(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=tH(e,t,n)}function tH(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,cH(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function nH(e,t){arguments.length<2&&(t=e.nodes()[0]),rH(e,{},1,t)}function rH(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=rH(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function iH(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function aH(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===lH(e,e.node(t.v),s)&&c!==lH(e,e.node(t.w),s)).reduce((e,n)=>UV(t,n)<UV(t,e)?n:e)}function oH(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),nH(e),$V(e,t),sH(e,t)}function sH(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=YV(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function cH(e,t,n){return e.hasEdge(t,n)}function lH(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var uH=dH;function dH(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:mH(e);break;case`tight-tree`:pH(e);break;case`longest-path`:fH(e);break;case`none`:break;default:mH(e)}}var fH=HV;function pH(e){HV(e),WV(e)}function mH(e){ZV(e)}var hH=gH;function gH(e){let t=vH(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=_H(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function _H(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function vH(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(xV).forEach(r),t}function yH(e){let t=eV(e,`root`,{},`_root`),n=xH(e),r=Object.values(n),i=uV(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=SH(e)+1;e.children(xV).forEach(r=>{bH(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function bH(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=sV(e,`_bt`),l=sV(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{bH(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function xH(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(xV).forEach(e=>n(e,1)),t}function SH(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function CH(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var wH=TH;function TH(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)EH(e,`borderLeft`,`_bl`,n,i,t),EH(e,`borderRight`,`_br`,n,i,t)}}e.children(xV).forEach(t)}function EH(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=eV(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function DH(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&kH(e)}function OH(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&jH(e),(t===`lr`||t===`rl`)&&(NH(e),kH(e))}function kH(e){e.nodes().forEach(t=>AH(e.node(t))),e.edges().forEach(t=>AH(e.edge(t)))}function AH(e){let t=e.width;e.width=e.height,e.height=t}function jH(e){e.nodes().forEach(t=>MH(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(MH),Object.hasOwn(r,`y`)&&MH(r)})}function MH(e){e.y=-e.y}function NH(e){e.nodes().forEach(t=>PH(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(PH),Object.hasOwn(r,`x`)&&PH(r)})}function PH(e){let t=e.x;e.x=e.y,e.y=t}function FH(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=_V(uV(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return SV(t,e.node(n),e.node(r))}return a}function IH(e,t){let n=0;for(let r=1;r<t.length;++r)n+=LH(e,t[r-1],t[r]);return n}function LH(e,t,n){let r=bV(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function RH(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function zH(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),BH(Object.values(n).filter(e=>!e.indegree))}function BH(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&VH(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>vV(e,[`vs`,`i`,`barycenter`,`weight`]))}function VH(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function HH(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=fV(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(WH(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=UH(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=UH(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function UH(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function WH(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=SV(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function GH(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=RH(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=GH(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&qH(t,r)}});let h=zH(m,n);KH(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=HH(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function KH(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function qH(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function JH(e,t,n,r){r||=e.nodes();let i=YH(e),a=new $B({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function YH(e){let t;for(;e.hasNode(t=gV(`_root`)););return t}function XH(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ZH(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,ZH);return}let r=dV(e),i=QH(e,_V(1,r+1),`inEdges`),a=QH(e,_V(r-1,-1,-1),`outEdges`),o=FH(e,n);if(eU(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){$H(t%2?i:a,t%4>=2,l,n),o=iV(e);let u=IH(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}eU(e,c)}function QH(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return JH(e,t,n,r.get(t)||[])})}function $H(e,t,n,r){let i=!0,a=new $B;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=GH(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),XH(e,a,s.vs)})}function eU(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function tU(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=rU(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&iU(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function nU(e,t){let n={};function r(t,r,i,a,o){_V(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&iU(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function rU(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function iU(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function aU(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function oU(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||hU(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>hU(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!aU(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function sU(e,t,n,r,i=!1){let a={},o=cU(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function cU(e,t,n,r){let i=new $B,a=e.graph(),o=pU(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function lU(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=mU(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function uU(e,t){let n=Object.values(t),r=uV(Math.min,n),i=uV(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-uV(Math.min,c);a!==`l`&&(l=i-uV(Math.max,c)),l&&(e[o]=yV(s,e=>e+l))})})}function dU(e,t=void 0){let n=e.ul;return n?yV(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function fU(e,t){let n=iV(e),r=Object.assign(tU(e,n),nU(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=oU(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=sU(e,a,s.root,s.align,n===`r`);n===`r`&&(c=yV(c,e=>-e)),i[o+n]=c})}),uU(i,lU(e,i)),dU(i,e.graph().align)}function pU(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function mU(e,t){return e.node(t).width}function hU(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function gU(e,t){e=nV(e),_U(e),Object.entries(fU(e,t)).forEach(([t,n])=>e.node(t).x=n)}function _U(e){let t=iV(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var vU=new WeakMap;function yU(e,t={}){return xU(e,mV,t),e}function bU(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function xU(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new $B({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=bU(e,t.v,r),i=bU(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),xU(o,t,n);let l=MU(o);SU(l,t,n,null),CU(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=MU(e),g=SU(h,t,n,vU.get(e)??null);vU.set(e,g),CU(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function SU(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>NU(e)),t(` removeSelfEdges`,()=>HU(e)),t(` acyclic`,()=>FV(e,s)),t(` nestingGraph.run`,()=>yH(e)),t(` rank`,()=>uH(nV(e))),t(` injectEdgeLabelProxies`,()=>PU(e)),t(` removeEmptyRanks`,()=>oV(e)),t(` nestingGraph.cleanup`,()=>CH(e)),t(` normalizeRanks`,()=>aV(e)),t(` assignRankMinMax`,()=>FU(e)),t(` removeEdgeLabelProxies`,()=>IU(e)),t(` normalize.run`,()=>zV(e)),t(` parentDummyChains`,()=>hH(e)),t(` addBorderSegments`,()=>wH(e)),t(` order`,()=>ZH(e,n,c)),t(` insertSelfEdges`,()=>UU(e)),t(` adjustCoordinateSystem`,()=>DH(e)),t(` position`,()=>gU(e,n.corePath)),t(` positionSelfEdges`,()=>WU(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>VU(e)),t(` normalize.undo`,()=>VV(e)),t(` fixupEdgeLabelCoords`,()=>zU(e)),t(` undoCoordinateSystem`,()=>OH(e)),t(` translateGraph`,()=>LU(e)),t(` assignNodeIntersects`,()=>RU(e)),t(` reversePoints`,()=>BU(e)),t(` acyclic.undo`,()=>LV(e)),{graph:e,rawNodes:l}}function CU(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var wU=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],TU={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},EU=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],DU=[`width`,`height`,`rank`],OU={width:0,height:0},kU=[`minlen`,`weight`,`width`,`height`,`labeloffset`],AU={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},jU=[`labelpos`];function MU(e){let t=new $B({multigraph:!0,compound:!0}),n=KU(e.graph());return t.setGraph(Object.assign({},TU,GU(n,wU),vV(n,EU))),e.nodes().forEach(n=>{let r=GU(KU(e.node(n)),DU);Object.keys(OU).forEach(e=>{r[e]===void 0&&(r[e]=OU[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=KU(e.edge(n));t.setEdge(n,Object.assign({},AU,GU(r,kU),vV(r,jU)))}),t}function NU(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function PU(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);eV(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function FU(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function IU(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function LU(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function RU(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(rV(r,a)),n.points.push(rV(i,o))})}function zU(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function BU(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function VU(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function HU(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function UU(e){iV(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{eV(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function WU(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function GU(e,t){return yV(vV(e,t),Number)}function KU(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function qU(e){let t=iV(e),n=new $B({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var JU={graphlib:mB,version:CV,layout:yU,debug:qU,util:{time:pV,notime:mV}},YU=7.2;function XU(e){let t=e.split(`/`).at(-1)??e,n=e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``;return Math.min(300,Math.max(110,Math.max(t.length,Math.min(n.length,36)*.85)*YU+28))}function ZU(e,t,n=[],r=null){let i=new JU.graphlib.Graph({multigraph:!0,compound:!0});i.setGraph({rankdir:`LR`,nodesep:n.length>0?44:16,ranksep:90,edgesep:10,marginx:24,marginy:24+(n.length>0?18:0)}),i.setDefaultEdgeLabel(()=>({}));for(let t of e)i.setNode(t,{width:XU(t),height:38});let a=new Set(e),o=[];for(let e of n){let t=e.members.filter(e=>a.has(e));if(t.length===0)continue;let n=`cluster:${e.id}`;i.setNode(n,{width:0,height:0});for(let e of t)i.setParent(e,n);o.push({id:e.id,label:e.label,key:n})}let s=new Map(o.map(e=>[e.id,e.key])),c=e=>`package:${e}`;for(let e of r?.packages??[]){i.setNode(c(e.id),{width:Math.max(110,e.label.length*YU+32),height:26});let t=s.get(e.id);t&&i.setParent(c(e.id),t)}let l=(r?.edges??[]).filter(e=>i.hasNode(c(e.from))&&i.hasNode(c(e.to)));l.forEach((e,t)=>i.setEdge(c(e.to),c(e.from),{},`pkg:${t}`)),t.forEach((e,t)=>i.setEdge(e.to,e.from,{},`${e.kind}:${t}`)),JU.layout(i);let u=e=>{let t=i.node(e);return{x:(t.x??0)-t.width/2,y:(t.y??0)-t.height/2,width:t.width,height:t.height}},d=e.map(e=>({path:e,...u(e)})),f=o.map(({id:e,label:t,key:n})=>({id:e,label:t,...u(n)})),p=t.map((e,t)=>({edge:e,points:i.edge({v:e.to,w:e.from,name:`${e.kind}:${t}`}).points??[]})),m=new Set((r?.packages??[]).filter(e=>e.touched).map(e=>e.id)),h=(r?.packages??[]).map(e=>({...e,...u(c(e.id))})),g=l.map((e,t)=>({from:e.from,to:e.to,touched:m.has(e.from)&&m.has(e.to),points:i.edge({v:c(e.to),w:c(e.from),name:`pkg:${t}`}).points??[]})),_=i.graph();return{nodes:d,edges:p,clusters:f,packageNodes:h,packageEdges:g,width:_.width??0,height:_.height??0}}var QU=6,$U=34;function eW(e,t,n,r){let i=new Map;for(let r of e){let e=n===`from`?r.from:r.to;(n===`from`?r.to:r.from)===t&&e!==t&&i.set(e,[...i.get(e)??[],r])}let a=e=>+!e.some(e=>e.kind===`import`);return[...i].sort(([e,t],[n,i])=>r(e)-r(n)||a(t)-a(i)||e.localeCompare(n))}function tW(e,t,n,r=()=>0){let i=eW(t,e,`from`,r),a=eW(t,e,`to`,r),o=Math.max(1,i.length,a.length),s=Math.max(38,o*26+(o-1)*QU),c=Math.min(Math.max(100,n*.3),200),l=+(i.length>0)+ +(a.length>0),u=l===0?0:Math.max(60,(n-c-l*$U)/l),d=(e,t)=>{let n=e.length*26+Math.max(0,e.length-1)*QU,r=(s-n)/2;return e.map(([e,n],i)=>({path:e,x:t,y:r+i*32,width:u,height:26,edges:n}))},f=a.length>0?u+$U:l===0?(n-c)/2:0;return{center:{path:e,x:f,y:(s-38)/2,width:c,height:38},outgoing:d(a,0),incoming:d(i,f+c+$U),width:n,height:s}}var nW=e=>e.split(`/`).at(-1)??e,rW=e=>e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``;function iW(e){if(e.length===0)return``;let t=`M${e[0].x},${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]??e[n],i=e[n],a=e[n+1],o=e[n+2]??a,s={x:i.x+(a.x-r.x)/6,y:i.y+(a.y-r.y)/6},c={x:a.x-(o.x-i.x)/6,y:a.y-(o.y-i.y)/6};t+=` C${s.x},${s.y} ${c.x},${c.y} ${a.x},${a.y}`}return t}function aW(e,t){let n=Math.max(3,Math.floor((t-14)/7.7));return e.length>n?`${e.slice(0,n-1)}…`:e}function oW(e,t,n,r){let i=(n-e)/2;return`M${e},${t} C${e+i},${t} ${n-i},${r} ${n},${r}`}var sW=`package:`;function cW(e){let{ref:t,width:n}=$e(),r=(0,C.useMemo)(()=>new Map(e.stats.map(e=>[e.path,e])),[e.stats]),i=e.packages,a=(0,C.useMemo)(()=>new Map(i?.context.packages.map(e=>[e.id,e])??[]),[i]),o=e.center,s=(0,C.useMemo)(()=>{if(!o||!i)return e.edges;let t=i.rootOf.get(o),n=new Set(e.edges.filter(e=>e.from===o).map(e=>i.rootOf.get(e.to))),r=new Set(e.edges.filter(e=>e.to===o).map(e=>i.rootOf.get(e.from))),a=[];for(let e of i.imports[o]??[])e!==t&&!n.has(e)&&a.push({from:o,to:sW+e,kind:`import`,detail:[]});if(t!==void 0)for(let e of i.context.edges)e.to===t&&e.from!==t&&!r.has(e.from)&&a.push({from:sW+e.from,to:o,kind:`import`,detail:[]});return[...e.edges,...a]},[o,i,e.edges]),c=o&&n>0?tW(o,s,n,e=>+!!e.startsWith(sW)):null,l=c?r.get(c.center.path):void 0,u=o&&i?a.get(i.rootOf.get(o)??``)?.label:void 0,d=(t,n)=>{let r=t.path.slice(8),s=a.get(r),c=i?.firstFile.get(r),l=s?.touched===!0&&c!==void 0,d=s?.label??(r||`(racine)`),f=n===`out`?`${nW(o??``)} importe le package ${d}`:`le package ${d} utilise ${u??`ce package`}`;return(0,G.jsxs)(`g`,{className:`link-pkg`,"data-touched":s?.touched||void 0,transform:`translate(${t.x} ${t.y})`,style:{cursor:l?`pointer`:`default`},onClick:()=>l&&e.onSelect(c),children:[(0,G.jsx)(`rect`,{width:t.width,height:t.height,rx:t.height/2}),(0,G.jsx)(`text`,{x:t.width/2,y:17,textAnchor:`middle`,children:aW(d,t.width+6)}),(0,G.jsx)(`title`,{children:`${f}${s?.touched?l?` · clic : ouvrir ses fichiers`:``:` · aucun fichier modifié`}`})]},`${n}:${t.path}`)},f=(t,n)=>{let s=r.get(t.path),c=t.edges.every(e=>e.kind===`mention`),l=n===`in`?c?`mentionne`:`importe`:c?`mentionné par`:`importé par`,d=[...new Set(t.edges.flatMap(e=>e.detail))].join(`, `),f=i?a.get(i.rootOf.get(t.path)??``)?.label:void 0;return(0,G.jsxs)(`g`,{className:`link-node`,"data-state":s?.state,transform:`translate(${t.x} ${t.y})`,onClick:()=>e.onSelect(t.path),children:[(0,G.jsx)(`rect`,{width:t.width,height:t.height,rx:5,fill:s?kz(s):`var(--br-surface)`}),(0,G.jsxs)(`text`,{x:7,y:17,className:`link-name`,children:[s?.state===`viewed`?`✓ `:``,aW(nW(t.path),t.width-(s?.state===`viewed`?14:0)),f&&f!==u&&(0,G.jsx)(`tspan`,{dx:6,className:`link-pkg-tag`,children:aW(f,t.width-(nW(t.path).length+2)*7.7)})]}),(0,G.jsx)(`title`,{children:`${t.path}${f?` (${f})`:``}\n${l} ${nW(o??``)}${d?` : ${d}`:``}`})]},`${n}:${t.path}`)},p=(e,t,n)=>{let r=t===`out`?oW(e.x+e.width,e.y+e.height/2,n.x,n.y+n.height/2):oW(n.x+n.width,n.y+n.height/2,e.x,e.y+e.height/2);if(e.path.startsWith(sW)){let n=a.get(e.path.slice(8))?.touched===!0;return(0,G.jsx)(`path`,{d:r,className:`link-pkg-edge`,"data-touched":n||void 0,markerEnd:n?`url(#ego-arrow-pkg)`:`url(#ego-arrow)`},`e:${t}:${e.path}`)}return(0,G.jsx)(`path`,{d:r,className:`link-edge`,"data-kind":e.edges.every(e=>e.kind===`mention`)?`mention`:`import`,markerEnd:`url(#ego-arrow)`},`e:${t}:${e.path}`)},m=(e,t)=>e.path.startsWith(sW)?d(e,t):f(e,t);return(0,G.jsxs)(`div`,{className:`ego`,ref:t,children:[(0,G.jsxs)(X,{gap:6,py:4,wrap:`nowrap`,children:[(0,G.jsxs)(Z,{size:`xs`,fw:600,truncate:!0,style:{flex:1},children:[o?nW(o):``,u&&(0,G.jsx)(Z,{span:!0,size:`xs`,c:`violet.3`,fw:500,ml:6,children:u})]}),c&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`utilise `,c.outgoing.length,` · utilisé par `,c.incoming.length]})]}),!o&&(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,pb:8,children:`Ouvrez un fichier pour voir ce qui l’utilise et ce qu’il utilise.`}),c&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(X,{justify:`space-between`,mb:2,children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`ce qu’il utilise`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`ce qui l’utilise →`})]}),c.incoming.length+c.outgoing.length===0?(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Aucun lien avec les autres fichiers`,i?` ou packages`:``,` de la PR.`]}):(0,G.jsxs)(`svg`,{width:`100%`,viewBox:`0 0 ${c.width} ${c.height}`,children:[(0,G.jsxs)(`defs`,{children:[(0,G.jsx)(`marker`,{id:`ego-arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-gray-5)`})}),(0,G.jsx)(`marker`,{id:`ego-arrow-pkg`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-violet-4)`})})]}),c.incoming.map(e=>p(e,`in`,c.center)),c.outgoing.map(e=>p(e,`out`,c.center)),c.incoming.map(e=>m(e,`in`)),c.outgoing.map(e=>m(e,`out`)),(0,G.jsxs)(`g`,{className:`link-node`,"data-current":!0,"data-state":l?.state,transform:`translate(${c.center.x} ${c.center.y})`,children:[(0,G.jsx)(`rect`,{width:c.center.width,height:38,rx:6,fill:l?kz(l):`var(--br-surface)`}),(0,G.jsx)(`text`,{x:9,y:16,className:`link-name`,children:aW(nW(c.center.path),c.center.width)}),(0,G.jsx)(`text`,{x:9,y:30,className:`link-dir`,children:aW(rW(c.center.path)||`/`,c.center.width+10)}),(0,G.jsx)(`title`,{children:`${c.center.path}${u?` (${u})`:``}`})]})]})]})]})}function lW(e){let{ref:t,width:n,height:r}=$e(),[i,a]=(0,C.useState)(null),[o,s]=(0,C.useState)(null),c=(0,C.useRef)(null),l=(0,C.useMemo)(()=>new Map(e.stats.map(e=>[e.path,e])),[e.stats]),u=(0,C.useMemo)(()=>ZU(e.stats.map(e=>e.path),e.edges,e.groups,e.context),[e.stats,e.edges,e.groups,e.context]),d=n>0&&u.width>0?Math.min(1.4,n/u.width,r/u.height):1,f=o??{k:d,x:(n-u.width*d)/2,y:(r-u.height*d)/2},p=new Map(u.packageNodes.map(e=>[e.id,e.label])),m=t=>i===null||t===i||e.edges.some(e=>e.from===i&&e.to===t||e.to===i&&e.from===t);return(0,G.jsxs)(`div`,{ref:t,className:`link-graph`,onWheel:e=>{let t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=Math.min(4,Math.max(.15,f.k*(e.deltaY<0?1.15:1/1.15)));s({k:i,x:n-(n-f.x)*i/f.k,y:r-(r-f.y)*i/f.k})},onMouseDown:e=>c.current={x:e.clientX-f.x,y:e.clientY-f.y},onMouseMove:e=>c.current&&s({k:f.k,x:e.clientX-c.current.x,y:e.clientY-c.current.y}),onMouseUp:()=>c.current=null,onMouseLeave:()=>c.current=null,children:[(0,G.jsxs)(`svg`,{width:n,height:r,children:[(0,G.jsxs)(`defs`,{children:[(0,G.jsx)(`marker`,{id:`arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-gray-5)`})}),(0,G.jsx)(`marker`,{id:`arrow-hl`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-blue-4)`})}),(0,G.jsx)(`marker`,{id:`arrow-pkg`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--mantine-color-violet-4)`})})]}),(0,G.jsxs)(`g`,{transform:`translate(${f.x} ${f.y}) scale(${f.k})`,children:[u.clusters.map(e=>(0,G.jsxs)(`g`,{className:`link-cluster`,transform:`translate(${e.x} ${e.y})`,children:[(0,G.jsx)(`rect`,{width:e.width,height:e.height,rx:10}),u.packageNodes.length===0&&(0,G.jsx)(`text`,{x:6,y:-6,children:e.label})]},e.id)),u.packageEdges.map(e=>{let t=i===`package:${e.from}`||i===`package:${e.to}`;return(0,G.jsx)(`path`,{d:iW(e.points),className:`link-pkg-edge`,"data-touched":e.touched||void 0,"data-active":t||void 0,markerEnd:e.touched?`url(#arrow-pkg)`:`url(#arrow)`,children:(0,G.jsx)(`title`,{children:`${p.get(e.from)??e.from} utilise ${p.get(e.to)??e.to}`})},`pkg:${e.from}:${e.to}`)}),u.packageNodes.map(e=>(0,G.jsxs)(`g`,{className:`link-pkg`,"data-touched":e.touched||void 0,transform:`translate(${e.x} ${e.y})`,onMouseEnter:()=>a(`package:${e.id}`),onMouseLeave:()=>a(null),children:[(0,G.jsx)(`rect`,{width:e.width,height:e.height,rx:e.height/2}),(0,G.jsx)(`text`,{x:e.width/2,y:17,textAnchor:`middle`,children:e.label}),(0,G.jsx)(`title`,{children:`${e.label} — ${e.id||`(racine)`}${e.touched?``:` · aucun fichier modifié`}`})]},`package:${e.id}`)),u.edges.map(({edge:e,points:t},n)=>{let r=i!==null&&(e.from===i||e.to===i),a=iW(t);return(0,G.jsx)(`path`,{d:a,className:`link-edge`,"data-kind":e.kind,"data-active":r||void 0,"data-dim":i!==null&&!r||void 0,markerEnd:r?`url(#arrow-hl)`:`url(#arrow)`,children:(0,G.jsxs)(`title`,{children:[e.from,` `,e.kind===`import`?`importe`:`mentionne`,` `,e.to,e.detail.length?` : ${e.detail.join(`, `)}`:``]})},n)}),u.nodes.map(t=>{let n=l.get(t.path);return(0,G.jsxs)(`g`,{className:`link-node`,"data-state":n?.state,"data-current":t.path===e.currentPath||void 0,"data-dim":!m(t.path)||void 0,transform:`translate(${t.x} ${t.y})`,onMouseEnter:()=>a(t.path),onMouseLeave:()=>a(null),onClick:()=>e.onSelect(t.path),children:[(0,G.jsx)(`rect`,{width:t.width,height:38,rx:6,fill:n?kz(n):`var(--br-surface)`}),(0,G.jsxs)(`text`,{x:10,y:16,className:`link-name`,children:[n?.state===`viewed`?`✓ `:``,nW(t.path)]}),(0,G.jsx)(`text`,{x:10,y:30,className:`link-dir`,children:rW(t.path)||`/`}),n&&n.openThreads>0&&(0,G.jsx)(`circle`,{cx:t.width-9,cy:9,r:4,className:`link-thread`,"data-unread":n.unreadThreads>0||void 0}),(0,G.jsx)(`title`,{children:`${t.path}\n+${n?.additions??0} −${n?.deletions??0}`})]},t.path)})]})]}),o&&(0,G.jsx)(Fp,{size:`compact-xs`,variant:`default`,className:`link-fit`,onClick:()=>s(null),children:`Recadrer`})]})}function uW(e){let t=fW(),[n,r]=Ge({key:`br:linksMentions`,defaultValue:!0}),[i,a]=Ge({key:`br:linksIsolated`,defaultValue:!1}),[o,s]=(0,C.useState)(!1),c=(0,C.useMemo)(()=>(t.data?.edges??[]).filter(e=>n||e.kind===`import`),[t.data,n]),l=(0,C.useMemo)(()=>new Set(e.stats.map(e=>e.path)),[e.stats]),u=(0,C.useMemo)(()=>(t.data?.packages??[]).map(e=>({id:e.root,label:e.name,members:e.files})),[t.data]),d=pW(t.data),[f,p]=Ge({key:`br:linksWorkspace`,defaultValue:!0}),m=(0,C.useMemo)(()=>c.filter(e=>l.has(e.from)&&l.has(e.to)),[c,l]),h=new Map,g=new Map;for(let e of c)h.set(e.from,(h.get(e.from)??0)+1),g.set(e.to,(g.get(e.to)??0)+1);let _=e=>(h.get(e)??0)+(g.get(e)??0),v=t.data?.packages??[],y=e.stats,b=y.filter(e=>_(e.path)>0),x=y.filter(e=>_(e.path)===0),S=new Map(v.flatMap(e=>e.files.map(t=>[t,e.root]))),w=new Map(v.map(e=>[e.root,e.name])),T=i?e.stats:e.stats.filter(e=>m.some(t=>t.from===e.path||t.to===e.path));if(t.isPending)return(0,G.jsx)(mW,{});if(t.isError)return(0,G.jsx)(hW,{message:t.error.message});let E=(n,r)=>{let i=t.data.languages[n.path],a=t.data.externalImports[n.path]??0;return(0,G.jsxs)(`div`,{className:`tree-node`,"data-current":n.path===e.currentPath||void 0,"data-viewed":n.state===`viewed`||void 0,title:n.path,onClick:()=>e.onSelect(n.path),children:[r!==void 0&&(0,G.jsx)(`span`,{className:`link-rank`,children:r}),(0,G.jsx)(gz,{state:n.state}),(0,G.jsxs)(`span`,{className:`tree-name`,children:[nW(n.path),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,ml:6,children:rW(n.path)})]}),i&&(0,G.jsx)(Ep,{size:`xs`,variant:`outline`,color:`gray`,radius:`sm`,children:SR(i)}),(0,G.jsx)(Gh,{label:`importe / mentionne ${h.get(n.path)??0} · utilisé par ${g.get(n.path)??0}${a?` · ${a} import(s) hors PR`:``}`,children:(0,G.jsxs)(Z,{span:!0,size:`xs`,ff:`monospace`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`→`,h.get(n.path)??0,` ←`,g.get(n.path)??0]})})]},n.path)};return(0,G.jsxs)(`div`,{className:`links-view`,children:[(0,G.jsxs)(X,{gap:6,px:10,pb:6,children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[c.length,` liens · `,b.length,` fichiers reliés`]}),(0,G.jsx)(Fp,{size:`compact-xs`,ml:`auto`,variant:`light`,onClick:()=>s(!0),disabled:T.length===0,children:`Graphe ⤢`})]}),(0,G.jsx)(ip,{size:`xs`,px:10,pb:6,label:`Inclure les mentions (noms ou chemins cités dans le texte)`,checked:n,onChange:e=>r(e.currentTarget.checked)}),t.data.unreadable.length>0&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,px:10,pb:4,children:[`Non analysés (binaires / trop gros) : `,t.data.unreadable.length]}),(0,G.jsxs)(`div`,{className:`file-nav-scroll`,children:[(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,px:10,pt:6,pb:2,children:v.length>0?`Ordre de lecture : packages les plus utilisés en premier, puis la base d’abord dans chaque package.`:`Ordre de lecture : la base d’abord (fichiers utilisés par les autres), puis ce qui les assemble.`}),v.length>0?(0,G.jsxs)(G.Fragment,{children:[v.map(e=>{let t=y.filter(t=>S.get(t.path)===e.root);if(t.length===0)return null;let n=e=>e.map(e=>w.get(e)??e).join(`, `);return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Gh,{multiline:!0,w:320,label:`${e.root||`(racine)`} · utilise : ${n(e.dependsOn)||`—`} · utilisé par : ${n(e.usedBy)||`—`}`,children:(0,G.jsxs)(`div`,{className:`pkg-head`,children:[(0,G.jsx)(Ep,{size:`xs`,variant:`light`,color:`violet`,radius:`sm`,children:e.ecosystem}),(0,G.jsx)(Z,{span:!0,size:`xs`,fw:700,truncate:!0,children:e.name}),(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,truncate:!0,style:{flex:1},children:e.root?`${e.root}/`:``}),(0,G.jsxs)(Z,{span:!0,size:`xs`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:[`utilisé par `,e.usedBy.length,` · utilise `,e.dependsOn.length]})]})}),t.map(e=>E(e,y.indexOf(e)+1))]},e.root)}),y.some(e=>!S.has(e.path))&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`tree-dir`,children:`Hors des packages`}),y.filter(e=>!S.has(e.path)).map(e=>E(e,y.indexOf(e)+1))]})]}):(0,G.jsxs)(G.Fragment,{children:[b.map((e,t)=>E(e,t+1)),x.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`tree-dir`,children:[`Sans lien avec les autres fichiers de la PR (`,x.length,`)`]}),x.map(e=>E(e))]})]})]}),(0,G.jsx)(Xm,{opened:o,onClose:()=>s(!1),fullScreen:!0,title:(0,G.jsxs)(X,{gap:`md`,children:[(0,G.jsx)(Z,{fw:600,children:`Liens entre les fichiers modifiés`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`à gauche la base (fichiers utilisés par les autres), à droite ce qui les utilise · flèche = « est utilisé par » · trait plein = import, pointillé = mention · glisser pour déplacer, molette pour zoomer, clic pour ouvrir le fichier`})]}),styles:{body:{height:`calc(100vh - 60px)`,padding:0}},children:(0,G.jsxs)(tg,{gap:0,h:`100%`,children:[(0,G.jsxs)(X,{gap:`lg`,px:`md`,py:6,children:[(0,G.jsx)(ip,{size:`xs`,label:`Mentions`,checked:n,onChange:e=>r(e.currentTarget.checked)}),(0,G.jsx)(ip,{size:`xs`,label:`Fichiers sans lien`,checked:i,onChange:e=>a(e.currentTarget.checked)}),d&&(0,G.jsx)(ip,{size:`xs`,label:`Autres packages du monorepo (${d.packages.filter(e=>!e.touched).length})`,checked:f,onChange:e=>p(e.currentTarget.checked)})]}),(0,G.jsx)(lW,{stats:T,groups:u,context:f?d:null,edges:m,currentPath:e.currentPath,onSelect:t=>{s(!1),e.onSelect(t)}})]})})]})}function dW(e){let t=fW(),[n,r]=Ge({key:`br:linksMentions`,defaultValue:!0}),i=(0,C.useMemo)(()=>(t.data?.edges??[]).filter(e=>n||e.kind===`import`),[t.data,n]),a=pW(t.data),o=(0,C.useMemo)(()=>{if(!t.data||!a)return null;let n=new Map(t.data.packages.flatMap(e=>e.files.map(t=>[t,e.root]))),r=new Map;for(let t of e.stats){let e=n.get(t.path);e!==void 0&&!r.has(e)&&r.set(e,t.path)}return{context:a,rootOf:n,firstFile:r,imports:t.data.packageImports}},[t.data,a,e.stats]);return t.isPending?(0,G.jsx)(mW,{}):t.isError?(0,G.jsx)(hW,{message:t.error.message}):(0,G.jsxs)(`div`,{className:`panel-body`,children:[(0,G.jsx)(ip,{size:`xs`,pb:6,label:`Inclure les mentions (noms ou chemins cités dans le texte)`,checked:n,onChange:e=>r(e.currentTarget.checked)}),(0,G.jsx)(cW,{center:e.currentPath,edges:i,stats:e.stats,onSelect:e.onSelect,packages:o})]})}function fW(){let e=zI();return dy({...ED().pr.links.queryOptions({ref:e.ref,base:e.range.base,head:e.range.head,fullPr:e.range.fullPr}),staleTime:1/0})}function pW(e){return(0,C.useMemo)(()=>e&&e.workspace.length>0?{packages:e.workspace.map(e=>({id:e.root,label:e.name,touched:e.touched})),edges:e.packageEdges}:null,[e])}function mW(){return(0,G.jsxs)(X,{p:`md`,gap:`xs`,children:[(0,G.jsx)(El,{size:`xs`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:`Analyse des imports…`})]})}function hW({message:e}){return(0,G.jsx)(Jd,{color:`red`,m:`xs`,title:`Liens indisponibles`,children:e})}function gW(e){let t=e.width??48,n=Oz(e),r=e.max>0?Math.max(n>0?2:0,n/e.max*t):0,i=n>0?e.additions/n*r:0;return(0,G.jsxs)(`span`,{className:`churn-bar`,style:{width:t},children:[(0,G.jsx)(`i`,{className:`add`,style:{width:i}}),(0,G.jsx)(`i`,{className:`del`,style:{width:r-i}})]})}function _W({additions:e,deletions:t}){return(0,G.jsxs)(Z,{span:!0,size:`xs`,ff:`monospace`,style:{whiteSpace:`nowrap`},children:[e>0&&(0,G.jsxs)(Z,{span:!0,c:`green.4`,inherit:!0,children:[`+`,e]}),` `,t>0&&(0,G.jsxs)(Z,{span:!0,c:`red.4`,inherit:!0,children:[`−`,t]})]})}function vW(e){let{stat:t}=e,n=(0,C.useRef)(null),r=e.current;return(0,C.useEffect)(()=>{r&&n.current?.scrollIntoView({block:`nearest`})},[r]),(0,G.jsxs)(`div`,{ref:n,className:`tree-node`,"data-current":r||void 0,"data-viewed":t.state===`viewed`||void 0,onClick:e.onSelect,title:t.path,style:{paddingLeft:10+e.depth*14},children:[(0,G.jsx)(gz,{state:t.state}),(0,G.jsxs)(`span`,{className:`tree-name`,children:[t.path.split(`/`).at(-1),e.dir&&(0,G.jsx)(Z,{span:!0,size:`xs`,c:`dimmed`,ml:6,children:e.dir})]}),t.openThreads>0&&(0,G.jsxs)(Z,{span:!0,size:`xs`,c:t.unreadThreads>0?`orange.4`:`yellow.4`,children:[(0,G.jsx)(`i`,{className:`ico-c`}),t.openThreads]}),(0,G.jsx)(gW,{additions:t.additions,deletions:t.deletions,max:e.maxChurn,width:36}),(0,G.jsx)(_W,{additions:t.additions,deletions:t.deletions})]})}function yW(e){let t=Math.max(0,...e.stats.map(Oz));if(e.sort===`churn`)return(0,G.jsx)(G.Fragment,{children:e.stats.map(n=>(0,G.jsx)(vW,{stat:n,depth:0,dir:n.path.includes(`/`)?n.path.slice(0,n.path.lastIndexOf(`/`)):void 0,current:n.path===e.currentPath,maxChurn:t,onSelect:()=>e.onSelect(n.path)},n.path))});let n=[];for(let t of e.stats){let e=t.path.includes(`/`)?t.path.slice(0,t.path.lastIndexOf(`/`)):``,r=n.at(-1);r&&r.dir===e?r.stats.push(t):n.push({dir:e,stats:[t]})}return(0,G.jsx)(G.Fragment,{children:n.map((n,r)=>(0,G.jsxs)(`div`,{children:[n.dir&&(0,G.jsxs)(`div`,{className:`tree-dir`,children:[n.dir,`/`]}),n.stats.map(n=>(0,G.jsx)(vW,{stat:n,depth:1,current:n.path===e.currentPath,maxChurn:t,onSelect:()=>e.onSelect(n.path)},n.path))]},`${n.dir}:${r}`))})}function bW(e){let[t,n]=(0,C.useState)(new Set),r=Mz(e.root,t),i=Oz(e.root),a=Math.max(0,...r.flatMap(e=>e.kind===`file`?[Oz(e.stat)]:[])),o=e=>n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,G.jsx)(G.Fragment,{children:r.map(n=>n.kind===`dir`?(0,G.jsxs)(`div`,{className:`tree-node tree-folder`,style:{paddingLeft:6+n.depth*14},onClick:()=>o(n.path),title:`${n.path}/ · ${n.fileCount} fichiers · ${n.viewedCount} vus`,children:[(0,G.jsx)(`span`,{className:`tree-chevron`,children:t.has(n.path)?`▸`:`▾`}),(0,G.jsxs)(`span`,{className:`tree-name`,children:[n.name,`/`]}),n.openThreads>0&&(0,G.jsxs)(Z,{span:!0,size:`xs`,c:`yellow.4`,children:[(0,G.jsx)(`i`,{className:`ico-c`}),n.openThreads]}),(0,G.jsxs)(Z,{span:!0,size:`xs`,c:n.viewedCount===n.fileCount?`green.5`:`dimmed`,children:[n.viewedCount,`/`,n.fileCount]}),(0,G.jsx)(gW,{additions:n.additions,deletions:n.deletions,max:i,width:36}),(0,G.jsx)(_W,{additions:n.additions,deletions:n.deletions})]},`d:${n.path}`):(0,G.jsx)(vW,{stat:n.stat,depth:n.depth+.6,current:n.path===e.currentPath,maxChurn:a,onSelect:()=>e.onSelect(n.path)},n.path))})}function xW(e){let{stats:t}=e,[n,r]=(0,C.useState)([]),[i,a]=(0,C.useState)(``),o=(0,C.useMemo)(()=>t.filter(e=>(!n.includes(`unviewed`)||e.state!==`viewed`)&&(!n.includes(`threads`)||e.openThreads>0)&&(i===``||e.path.toLowerCase().includes(i.toLowerCase()))),[t,n,i]),s=(0,C.useMemo)(()=>jz(o),[o]),c=t.filter(e=>e.state===`viewed`).length;return(0,G.jsxs)(`div`,{className:`file-nav`,children:[(0,G.jsx)(Yh,{size:`xs`,mx:10,mb:6,value:e.nav,onChange:t=>e.onNavChange(t===`list`||t===`links`||t===`intent`?t:`tree`),data:[{value:`list`,label:`Liste`},{value:`tree`,label:`Arbre`},{value:`links`,label:`Liens`},{value:`intent`,label:`Intention`}]}),(0,G.jsxs)(X,{gap:4,px:10,pb:6,children:[(0,G.jsxs)(Wp.Group,{multiple:!0,value:n,onChange:r,children:[(0,G.jsx)(Wp,{size:`xs`,value:`unviewed`,children:`Non vus`}),(0,G.jsx)(Wp,{size:`xs`,value:`threads`,children:`Threads ouverts`})]}),(e.nav===`list`||e.nav===`tree`)&&(0,G.jsx)(Yh,{size:`xs`,ml:`auto`,value:e.sort,onChange:t=>e.onSortChange(t===`churn`?`churn`:`name`),data:[{value:`name`,label:`A→Z`},{value:`churn`,label:`Taille`}]})]}),(0,G.jsx)(jg,{size:`xs`,px:10,pb:6,placeholder:`Filtrer les fichiers…`,value:i,onChange:e=>a(e.currentTarget.value)}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,px:10,pb:4,children:[c,`/`,t.length,` fichiers vus · `,Oz(s),` lignes modifiées`,o.length===t.length?``:` · ${o.length} affichés`]}),o.length===0?(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,px:10,children:`Aucun fichier.`}):e.nav===`links`?(0,G.jsx)(uW,{stats:o,currentPath:e.currentPath,onSelect:e.onSelect}):e.nav===`intent`?(0,G.jsx)(rB,{stats:o,intents:e.intents,currentPath:e.currentPath,onSelect:e.onSelect}):(0,G.jsx)(`div`,{className:`file-nav-scroll`,children:e.nav===`tree`?(0,G.jsx)(bW,{root:s,currentPath:e.currentPath,onSelect:e.onSelect}):(0,G.jsx)(yW,{stats:o,sort:e.sort,currentPath:e.currentPath,onSelect:e.onSelect})})]})}var SW=/^[0-9a-f]{7,40}$/i;function CW(e){let t;try{t=new URL(e)}catch{return null}if(t.hostname!==`github.com`&&t.hostname!==`www.github.com`)return null;let n;try{n=t.pathname.split(`/`).filter(Boolean).map(decodeURIComponent)}catch{return null}let[r,i,a,...o]=n;if(!r||!i)return null;let s=t.hash.slice(1);if(a===`pull`&&/^\d+$/.test(o[0]??``)){let e=o[1]===`commits`&&SW.test(o[2]??``)?o[2].toLowerCase():null,t=/^diff-([0-9a-f]{64})(?:([LR])(\d+)(?:-([LR])(\d+))?)?$/.exec(s),n=null;if(t?.[2]){let e=Number(t[3]),r=t[4]===t[2]?Number(t[5]):e;n={side:t[2]===`L`?`LEFT`:`RIGHT`,start:Math.min(e,r),end:Math.max(e,r)}}let a=/^discussion_r(\d+)$/.exec(s);return{kind:`pr`,owner:r,repo:i,number:Number(o[0]),commit:e,fileHash:t?.[1]??null,lines:n,discussion:a?Number(a[1]):null}}if(a===`blob`&&o.length>=2){let e=/^L(\d+)(?:C\d+)?(?:-L(\d+)(?:C\d+)?)?$/.exec(s),t=e?{start:Number(e[1]),end:Number(e[2]??e[1])}:null;return{kind:`blob`,owner:r,repo:i,refAndPath:o.join(`/`),lines:t}}return a===`commit`&&SW.test(o[0]??``)?{kind:`commit`,owner:r,repo:i,sha:o[0].toLowerCase()}:null}var wW=(e,t)=>e.toLowerCase()===t.toLowerCase();function TW(e,t){if(!wW(e.owner,t.owner)||!wW(e.repo,t.repo))return e.kind===`pr`?{kind:`otherPr`,owner:e.owner,repo:e.repo,number:e.number}:null;let n=e=>{let n=t.commits.find(t=>t.oid.startsWith(e));return n?.parentOid?`${n.parentOid}..${n.oid}`:null};if(e.kind===`pr`){if(e.number!==t.number)return{kind:`otherPr`,owner:t.owner,repo:t.repo,number:e.number};if(e.discussion!==null){let n=t.threads.find(t=>t.comments.some(t=>t.databaseId===e.discussion));return n?{kind:`thread`,threadId:n.id}:null}let r=e.fileHash===null?null:t.pathByHash.get(e.fileHash);if(r===void 0)return null;let i=r===null?null:{path:r,lines:e.lines};if(e.commit!==null){let t=n(e.commit);return t?{kind:`commit`,range:t,file:i}:null}return i?{kind:`file`,file:i}:{kind:`pr`}}if(e.kind===`commit`){let t=n(e.sha);return t?{kind:`commit`,range:t,file:null}:null}let r=e.refAndPath.split(`/`);for(let n=1;n<r.length;n++){let i=r.slice(n).join(`/`);if(!t.files.includes(i))continue;let a=r.slice(0,n).join(`/`);return{kind:`file`,file:{path:i,lines:(a===t.headRefName||SW.test(a)&&t.headRefOid.toLowerCase().startsWith(a.toLowerCase()))&&e.lines?{side:`RIGHT`,...e.lines}:null}}}return null}async function EW(e){let t=new TextEncoder,n=await Promise.all(e.map(async e=>{let n=await crypto.subtle.digest(`SHA-256`,t.encode(e));return[[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,`0`)).join(``),e]}));return new Map(n)}function DW(e,t,n){if(t.length===0&&n.length===0)return e;let r=new Map(t.map(e=>[e.path,e.viewed])),i=new Set(e.seenHunks);for(let e of n)for(let t of e.hunks){let n=`${t.path}\n${t.hash}`;e.seen?i.add(n):i.delete(n)}return{...e,files:e.files.map(e=>{let t=r.get(e.path);return t===void 0?e:{...e,viewed:t?`VIEWED`:`UNVIEWED`}}),seenHunks:[...i]}}function OW(e){let t=zI(),n=aC({from:`/$owner/$repo/pull/$number`}),[r,i]=(0,C.useState)(!1),[a,o]=(0,C.useState)(null),s=t.detail.commits,c=t.detail.pr.headRefOid,l=t.detail.myReview?.commitOid??null,u=e.visitHead!==null&&!LI(t.detail,e.visitHead),d=l!==null&&!LI(t.detail,l),f=e=>{n({search:t=>({...t,range:e})}),i(!1)},p=new Set;if(t.range.kind===`commits`){let e=s.findIndex(e=>e.parentOid===t.range.base),n=s.findIndex(e=>e.oid===t.range.head);if(e!==-1&&n>=e)for(let t of s.slice(e,n+1))p.add(t.oid)}let m=(e,t,n,r=!1)=>(0,G.jsx)(jh,{value:e,disabled:r,label:(0,G.jsxs)(X,{gap:8,justify:`space-between`,wrap:`nowrap`,w:380,children:[(0,G.jsx)(Z,{size:`sm`,children:t}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:n})]})},e);return(0,G.jsxs)(vl,{opened:r,onChange:i,position:`bottom-start`,shadow:`lg`,width:460,trapFocus:!0,children:[(0,G.jsx)(vl.Target,{children:(0,G.jsxs)(Fp,{size:`compact-sm`,variant:`light`,onClick:()=>i(e=>!e),rightSection:`▾`,children:[`Plage : `,t.range.label]})}),(0,G.jsxs)(vl.Dropdown,{p:`sm`,children:[(0,G.jsx)(Z,{size:`xs`,tt:`uppercase`,fw:600,c:`dimmed`,mb:6,children:`Plage de comparaison`}),(0,G.jsx)(jh.Group,{value:t.range.kind===`commits`?``:t.range.kind,onChange:f,children:(0,G.jsxs)(tg,{gap:8,children:[m(`all`,`Tous les changements`,`${s.length} commits · ${t.detail.files.length} fichiers`),m(`visit`,`Depuis ma dernière visite`,e.visitAt?e.visitHead===c?`aucun nouveau commit`:u?`branche rebasée depuis`:new Date(e.visitAt).toLocaleString(`fr`):`jamais visitée`,!e.visitAt||e.visitHead===c||u),m(`review`,`Depuis ma dernière review`,l?l===c?`à jour`:d?`branche rebasée depuis`:l.slice(0,7):`jamais reviewée`,!l||l===c||d)]})}),(0,G.jsx)(rm,{my:`sm`}),(0,G.jsx)(Z,{size:`xs`,tt:`uppercase`,fw:600,c:`dimmed`,mb:6,children:`Commits (clic : un commit · Maj+clic : intervalle)`}),(0,G.jsx)(tg,{gap:2,mah:320,style:{overflow:`auto`},children:s.map((e,t)=>(0,G.jsxs)(X,{gap:8,wrap:`nowrap`,px:4,py:2,style:{cursor:`pointer`,borderRadius:4,background:e.seen?void 0:`rgba(255,146,43,.08)`},onClick:e=>{let n=e.shiftKey&&a!==null?Math.min(a,t):t,r=e.shiftKey&&a!==null?Math.max(a,t):t;o(t);let i=s[n],c=s[r];i.parentOid&&f(`${i.parentOid}..${c.oid}`)},children:[(0,G.jsx)(ip,{size:`xs`,readOnly:!0,checked:p.has(e.oid)}),(0,G.jsx)(Z,{ff:`monospace`,size:`xs`,c:`dimmed`,children:e.shortOid}),(0,G.jsx)(Z,{size:`sm`,truncate:!0,style:{flex:1},children:e.headline}),!e.seen&&(0,G.jsx)(Ep,{size:`xs`,color:`orange`,variant:`light`,children:`nouveau`}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,children:UD(e.date)})]},e.oid))}),(0,G.jsx)(Z,{size:`xs`,c:`dimmed`,mt:`sm`,children:`Hors « tous les changements », seuls les commentaires côté nouveau code sont possibles (numéros de ligne de la PR).`})]})]})}function kW(e){let t=zI(),n=iL(t.ref),[r,i]=(0,C.useState)(``),a=t.detail.pr.author?.login===t.me,[o,s]=(0,C.useState)(`COMMENT`),c=t.detail.pendingReview,l=async()=>{await n.submitReview.mutateAsync({prId:t.detail.pr.id,pendingReviewId:c?.id??null,event:o,body:r}),i(``),e.onChange(!1)};return(0,G.jsxs)(vl,{opened:e.opened,onChange:e.onChange,position:`bottom-end`,shadow:`lg`,width:400,trapFocus:!0,children:[(0,G.jsx)(vl.Target,{children:(0,G.jsx)(Fp,{size:`compact-sm`,onClick:()=>e.onChange(!e.opened),rightSection:(0,G.jsx)(Em,{size:`xs`,children:`⇧S`}),children:c?`Soumettre la review (${c.comments})`:`Review`})}),(0,G.jsxs)(vl.Dropdown,{children:[(0,G.jsx)(Z,{fw:600,mb:6,children:c?`Review en attente · ${c.comments} commentaire${c.comments>1?`s`:``}`:`Nouvelle review`}),(0,G.jsx)(Cm,{autosize:!0,minRows:3,placeholder:`Résumé (optionnel)`,value:r,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&l()}}),(0,G.jsx)(jh.Group,{value:o,onChange:e=>s(e),my:`sm`,children:(0,G.jsxs)(tg,{gap:6,children:[(0,G.jsx)(jh,{value:`COMMENT`,label:`Commenter`}),(0,G.jsx)(Gh,{label:`Impossible d’approuver sa propre PR`,disabled:!a,children:(0,G.jsx)(jh,{value:`APPROVE`,label:`Approuver`,disabled:a})}),(0,G.jsx)(Gh,{label:`Impossible sur sa propre PR`,disabled:!a,children:(0,G.jsx)(jh,{value:`REQUEST_CHANGES`,label:`Demander des changements`,disabled:a})})]})}),(0,G.jsxs)(X,{justify:`flex-end`,gap:6,children:[c&&(0,G.jsx)(Fp,{size:`compact-sm`,variant:`subtle`,color:`red`,loading:n.discardReview.isPending,onClick:()=>n.discardReview.mutate({reviewId:c.id}),children:`Abandonner la review`}),(0,G.jsx)(Fp,{size:`compact-sm`,color:o===`APPROVE`?`green`:o===`REQUEST_CHANGES`?`red`:`blue`,loading:n.submitReview.isPending,disabled:!c&&o===`COMMENT`&&r.trim()===``,onClick:()=>void l(),children:`Soumettre`})]})]})]})}function AW(e){let t=zI(),{pr:n,reviewers:r,requestedTeams:i}=t.detail;return(0,G.jsxs)(`div`,{className:`pr-head`,children:[(0,G.jsxs)(X,{gap:8,wrap:`nowrap`,align:`baseline`,children:[(0,G.jsxs)(Rg,{order:3,fw:600,style:{minWidth:0},lineClamp:1,children:[n.title,` `,(0,G.jsxs)(Z,{span:!0,c:`dimmed`,fw:400,inherit:!0,children:[n.owner,`/`,n.repo,` #`,n.number]})]}),(0,G.jsx)(tf,{href:n.url,target:`_blank`,size:`sm`,c:`dimmed`,style:{whiteSpace:`nowrap`},children:`GitHub ↗`})]}),(0,G.jsxs)(X,{gap:8,mt:4,wrap:`wrap`,children:[(0,G.jsx)(Ep,{color:n.state===`OPEN`?n.isDraft?`gray`:`green`:n.state===`MERGED`?`violet`:`red`,variant:`light`,children:n.isDraft?`Brouillon`:n.state===`OPEN`?`Ouverte`:n.state===`MERGED`?`Mergée`:`Fermée`}),(0,G.jsx)(Cp,{src:n.author?.avatarUrl,size:20}),(0,G.jsxs)(Z,{size:`sm`,c:`dimmed`,children:[n.author?.login??`ghost`,` · `,t.detail.commits.length,` commits de`,` `,(0,G.jsx)(Z,{span:!0,ff:`monospace`,c:`blue.4`,inherit:!0,children:n.headRefName}),` `,`vers`,` `,(0,G.jsx)(Z,{span:!0,ff:`monospace`,c:`blue.4`,inherit:!0,children:n.baseRefName}),` `,`· ouverte `,UD(n.createdAt)]}),(0,G.jsx)(NW,{}),n.mergeable===`CONFLICTING`&&(0,G.jsx)(Ep,{color:`red`,variant:`light`,children:`conflits`}),r.map(e=>(0,G.jsxs)(Ep,{variant:`outline`,color:GD[e.state]?.color??`gray`,leftSection:(0,G.jsx)(Cp,{src:e.avatarUrl,size:14}),children:[e.login,` : `,GD[e.state]?.label??e.state]},e.login)),i.map(e=>(0,G.jsxs)(Ep,{variant:`outline`,color:`yellow`,children:[`@`,e,` : demandé`]},e))]}),(0,G.jsxs)(`div`,{className:`pr-bar`,children:[(0,G.jsx)(OW,{visitAt:e.visitAt,visitHead:e.visitHead}),e.children]})]})}var jW=15e3,MW={failure:{label:`En échec`,color:`red`},pending:{label:`En cours`,color:`yellow`},success:{label:`Réussis`,color:`green`},skipped:{label:`Ignorés`,color:`gray`}};function NW(){let e=zI(),t=dy(ED().pr.checks.queryOptions(e.ref,{refetchInterval:e=>e.state.data?.checks.some(e=>e.outcome===`pending`)?jW:!1})).data;if(!t||t.checks.length===0)return null;let n=e=>t.checks.filter(t=>t.outcome===e),r=n(`failure`),i=n(`pending`),a=t.checks.length-i.length,o=r.length===1?`✕ CI : ${r[0].name}`:r.length>1?`✕ CI : ${r.length} en échec`:i.length>0?`● CI en cours ${a}/${t.checks.length}`:`✓ CI ok · ${t.checks.length}`;return(0,G.jsxs)(vl,{position:`bottom-start`,shadow:`md`,width:440,children:[(0,G.jsx)(vl.Target,{children:(0,G.jsxs)(Ep,{color:r.length>0?`red`:i.length>0?`yellow`:`green`,variant:r.length>0?`filled`:`light`,style:{cursor:`pointer`,textTransform:`none`,maxWidth:420},title:r.length>0?`${r.length} check(s) en échec`:void 0,children:[o,r.length>0&&i.length>0?` · ${i.length} en cours`:``]})}),(0,G.jsx)(vl.Dropdown,{mah:420,style:{overflowY:`auto`},children:(0,G.jsx)(tg,{gap:8,children:[`failure`,`pending`,`success`,`skipped`].map(e=>{let t=n(e);if(t.length===0)return null;let a=e===`failure`||e===`pending`||r.length+i.length===0;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(Z,{size:`xs`,fw:600,c:`${MW[e].color}.4`,mb:2,children:[MW[e].label,` · `,t.length]}),a&&t.map(t=>(0,G.jsxs)(`div`,{className:`check-row`,children:[t.url?(0,G.jsx)(tf,{href:t.url,target:`_blank`,size:`sm`,truncate:!0,children:t.name}):(0,G.jsx)(Z,{size:`sm`,truncate:!0,children:t.name}),(t.summary||e===`failure`)&&(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,truncate:!0,children:[t.state,t.summary?` · ${t.summary}`:``]})]},t.name))]},e)})})})]})}function PW(){let e=KW.useParams(),t=(0,C.useMemo)(()=>({owner:e.owner,repo:e.repo,number:Number(e.number)}),[e.owner,e.repo,e.number]),n=ED(),r=W_(),i=dy(n.pr.get.queryOptions(t)),a=hy({filters:{mutationKey:n.pr.setFileViewed.mutationKey(),status:`pending`},select:e=>e.state.variables}),o=hy({filters:{mutationKey:n.pr.setHunksSeen.mutationKey(),status:`pending`},select:e=>e.state.variables}),s=(0,C.useMemo)(()=>i.data&&DW(i.data,a,o),[i.data,a,o]);return xD(n.pr.onChange.subscriptionOptions(t,{onData:()=>{r.invalidateQueries({queryKey:n.pr.get.queryKey(t)}),r.invalidateQueries({queryKey:n.pr.checks.queryKey(t)})}})),i.isPending?(0,G.jsx)(Rp,{style:{flex:1},children:(0,G.jsx)(El,{})}):i.isError?(0,G.jsx)(Jd,{color:`red`,m:`lg`,title:`PR introuvable ou inaccessible`,children:i.error.message}):(0,G.jsx)(IW,{ref_:t,detail:s},`${t.owner}/${t.repo}#${t.number}`)}function FW(e,t,n){let{baseRefOid:r,headRefOid:i}=t.pr,a={kind:`all`,base:r,head:i,fullPr:!0,label:`Tous les changements`};if(e===`visit`&&n&&n!==i&&LI(t,n))return{kind:`visit`,base:n,head:i,fullPr:!1,label:`Depuis ma dernière visite`};let o=t.myReview?.commitOid;if(e===`review`&&o&&o!==i&&LI(t,o))return{kind:`review`,base:o,head:i,fullPr:!1,label:`Depuis ma dernière review`};let s=/^([0-9a-f]{7,40})\.\.([0-9a-f]{7,40})$/.exec(e);if(s){let[,e,n]=s,r=t.commits.find(t=>t.parentOid===e),i=t.commits.find(e=>e.oid===n);return{kind:`commits`,base:e,head:n,fullPr:!1,label:r&&i&&r.oid===i.oid?`Commit ${i.shortOid}`:`Commits ${r?.shortOid??e.slice(0,7)}…${i?.shortOid??n.slice(0,7)}`}}return a}function IW({ref_:e,detail:t}){let n=ED(),r=aC({from:`/$owner/$repo/pull/$number`}),i=KW.useSearch(),a=iL(e),[o]=(0,C.useState)(()=>Date.now()),[s]=(0,C.useState)(()=>t.pr.headRefOid),[c,l]=Ge({key:`br:layout`,defaultValue:`split`}),[u,d]=Ge({key:`br:panel`,defaultValue:!0}),[f,p]=Ge({key:`br:panelTab`,defaultValue:`conversations`}),m=e=>{u&&f===e?d(!1):(p(e),d(!0))},[h,g]=Ge({key:`br:tree`,defaultValue:!0}),[_,v]=Ge({key:`br:nav`,defaultValue:`tree`}),y=_===`list`||_===`links`||_===`intent`?_:`tree`,[b,x]=Ge({key:`br:navSort`,defaultValue:`name`}),[S]=Ge({key:`br:linksMentions`,defaultValue:!0}),[w,T]=(0,C.useState)(null),[E,D]=(0,C.useState)(null),[O,k]=(0,C.useState)(null),[A,j]=(0,C.useState)(new Set),[M,N]=(0,C.useState)({fileIdx:null,hunkIdx:null}),[ee,P]=(0,C.useState)(!1),[F,I]=(0,C.useState)(!1),L=(0,C.useRef)(null),[R,te]=(0,C.useState)(null),ne=t.pr.headRefOid,re=t.visits.find(e=>e.visitedAt<o)??null,ie=re?.headOid??null,ae=FW(i.range??`all`,t,ie),oe=i.mode??`continuous`,se=dy({...n.pr.diff.queryOptions({ref:e,base:ae.base,head:ae.head,fullPr:ae.fullPr}),staleTime:1/0}),ce=t.pr.state===`OPEN`,le=dy({...n.pr.diff.queryOptions({ref:e,base:t.pr.baseRefOid,head:ne,fullPr:!0}),staleTime:1/0,enabled:ce}),z=(0,C.useMemo)(()=>ce&&le.data?JR(le.data.files):null,[ce,le.data]),B=dy({...n.pr.links.queryOptions({ref:e,base:ae.base,head:ae.head,fullPr:ae.fullPr}),staleTime:1/0,enabled:y===`links`||y===`intent`}),V=Zz(e,ae,y===`intent`),ue=V.progress.done?V.progress.intents:null,H=(0,C.useMemo)(()=>{let e=se.data?.files??[],t=new Map(e.map(e=>[e.path,e])),n=e.map(e=>e.path),r;if(y===`list`||y===`tree`)r=Nz(e,y,b);else if(y===`intent`&&ue){let e=(B.data?.edges??[]).filter(e=>S||e.kind===`import`);r=Wz(n,ue,e)}else if(B.data){let e=B.data.edges.filter(e=>S||e.kind===`import`);r=B.data.packages.length>0?FI(B.data.packages.map(e=>({items:e.files})),n,e):PI(n,e)}else return e;return r.flatMap(e=>t.get(e)??[])},[se.data,y,b,B.data,S,ue]),de=(0,C.useMemo)(()=>t.files.map(e=>e.path),[t.files]),fe=dy({queryKey:[`pathHashes`,de],queryFn:()=>EW(de),staleTime:1/0}),pe=n=>{let r=CW(n);return!r||!fe.data?null:TW(r,{...e,headRefOid:ne,headRefName:t.pr.headRefName,files:de,pathByHash:fe.data,threads:t.threads,commits:t.commits})},me=a.visit.mutate,he=(0,C.useRef)(!1);(0,C.useEffect)(()=>{he.current||(he.current=!0,me({ref:e,headOid:ne,commitOids:t.commits.map(e=>e.oid)}))},[me,e,ne,t.commits]);let ge=(0,C.useMemo)(()=>new Set(t.seenHunks),[t.seenHunks]),_e=(0,C.useMemo)(()=>{let e=new Map(t.files.map(e=>[e.path,e.viewed]));return H.map(n=>{let r=t.threads.filter(e=>e.path===n.path&&!e.isResolved);return{path:n.path,additions:n.additions,deletions:n.deletions,state:fz(n,e.get(n.path),ge).state,openThreads:r.length,unreadThreads:r.filter(e=>e.unread>0).length}})},[H,t.files,t.threads,ge]),ve=oe===`focus`?H.find(e=>e.path===i.file)??H.find(e=>t.files.find(t=>t.path===e.path)?.viewed!==`VIEWED`)??H[0]??null:null,ye=oe===`focus`?ve?.path??null:H[M.fileIdx??-1]?.path??null,U=`${ae.base}..${ae.head}`,be=e=>{k(e);let n=t.threads.find(t=>t.id===e);oe===`focus`&&n&&n.path!==ve?.path&&H.some(e=>e.path===n.path)?(r({search:e=>({...e,file:n.path})}),requestAnimationFrame(()=>L.current?.scrollToThread(e))):L.current?.scrollToThread(e)},xe=(0,C.useEffectEvent)(e=>{let t=()=>void r({search:({goto:e,...t})=>t,replace:!0}),n=e=>void r({search:t=>({...t,...e}),replace:!0}),a=pe(e);if(!a||a.kind===`pr`)return t();if(a.kind===`otherPr`){let{owner:t,repo:n,number:i}=a;r({to:`/$owner/$repo/pull/$number`,params:{owner:t,repo:n,number:String(i)},search:{goto:e},replace:!0});return}if(a.kind===`thread`){let e=a.threadId;requestAnimationFrame(()=>{if(oe!==`focus`&&!L.current?.scrollToThread(e)&&ae.kind!==`all`)return n({range:`all`});be(e),t()});return}let o;if(a.kind===`commit`){if(i.range!==a.range)return n({range:a.range});o=a.file}else o=a.file;if(!o)return t();let s=o;if(!H.some(e=>e.path===s.path))return a.kind===`file`&&ae.kind!==`all`?n({range:`all`}):t();if(oe===`focus`&&ve?.path!==s.path)return n({file:s.path});requestAnimationFrame(()=>{if(A.has(s.path)){j(e=>new Set([...e].filter(e=>e!==s.path)));return}let e=s.lines;if(e&&L.current?.scrollToLine(s.path,e.side,e.start))te({range:U,lines:{path:s.path,...e}});else if(e&&a.kind===`file`&&ae.kind!==`all`)return n({range:`all`});else L.current?.scrollToFile(s.path),te(null);t()})}),Se=se.data!==void 0&&fe.data!==void 0;(0,C.useEffect)(()=>{i.goto&&Se&&xe(i.goto)},[i.goto,Se,U,A,ve?.path,oe]);let Ce={ref:e,detail:t,diff:se.data??null,me:t.viewer.login,range:ae,layout:c,mode:oe,pendingReviewId:t.pendingReview?.id??null,seenHunks:ge,selection:w,setSelection:e=>{T(e),e&&D(null)},fileComposer:E,setFileComposer:e=>{D(e),e&&T(null)},focusedThread:O,setFocusedThread:k,commentHunk:(e,t,n)=>ae.head!==ne||t===`LEFT`&&!ae.fullPr?null:z?.get(e)?.[t].get(n)??null,canCommentFile:e=>z?.has(e)??!1,scrollToThread:be,scrollToFile:e=>{oe===`focus`?r({search:t=>({...t,file:e})}):L.current?.scrollToFile(e)},linkTarget:R?.range===U?R.lines:null,onMarkdownClick:e=>{let t=e.target instanceof Element?e.target.closest(`a[href]`):null;if(!(t instanceof HTMLAnchorElement)||e.defaultPrevented||t.origin===window.location.origin||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;e.preventDefault();let n=pe(t.href);if(!n)window.open(t.href,`_blank`,`noopener`);else if(n.kind===`otherPr`){let{owner:e,repo:i,number:a}=n;r({to:`/$owner/$repo/pull/$number`,params:{owner:e,repo:i,number:String(a)},search:{goto:t.href}})}else r({search:e=>({...e,goto:t.href})})},advanceFrom:e=>{if(oe===`focus`){let n=LW(H,t,e);n&&r({search:e=>({...e,file:n.path})});return}let n=H[H.findIndex(t=>t.path===e)+1];n&&L.current?.scrollToFile(n.path)}},we=t.files.filter(e=>e.viewed===`VIEWED`).length,Te=H.reduce((e,t)=>e+t.hunks.length,0),Ee=H.reduce((e,t)=>e+t.hunks.filter(e=>ge.has(`${t.path}\n${e.hash}`)).length,0);return(0,G.jsx)(RI,{value:Ce,children:(0,G.jsxs)(`div`,{className:`pr-page`,children:[(0,G.jsxs)(AW,{visitAt:re?.visitedAt??null,visitHead:ie,children:[(0,G.jsx)(Yh,{size:`xs`,value:oe,onChange:e=>void r({search:t=>({...t,mode:e===`focus`?`focus`:`continuous`})}),data:[{value:`continuous`,label:`Continu`},{value:`focus`,label:`Focus`}]}),(0,G.jsx)(Yh,{size:`xs`,value:c,onChange:e=>l(e===`unified`?`unified`:`split`),data:[{value:`split`,label:`Côte à côte`},{value:`unified`,label:`Unifié`}]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsx)(Gh,{label:`${Ee}/${Te} hunks vus dans la plage`,children:(0,G.jsxs)(X,{gap:6,children:[(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`Vu `,we,`/`,t.files.length,` fichiers`]}),(0,G.jsx)(gh,{w:90,size:`sm`,color:`green`,value:t.files.length?we/t.files.length*100:0})]})}),(0,G.jsx)(Fp,{size:`compact-sm`,variant:h?`light`:`default`,onClick:()=>g(!h),children:`Fichiers`}),(0,G.jsx)(Fp,{size:`compact-sm`,variant:u&&f===`description`?`light`:`default`,onClick:()=>m(`description`),children:`Description`}),(0,G.jsxs)(Fp,{size:`compact-sm`,variant:u&&f===`conversations`?`light`:`default`,onClick:()=>m(`conversations`),children:[`Conversations `,t.threads.filter(e=>!e.isResolved).length]}),(0,G.jsx)(Fp,{size:`compact-sm`,variant:u&&f===`neighbors`?`light`:`default`,onClick:()=>m(`neighbors`),children:`Voisinage`}),(0,G.jsx)(kW,{opened:ee,onChange:P})]}),s!==ne&&ae.base!==s&&(0,G.jsx)(Jd,{color:`orange`,variant:`light`,radius:0,py:6,children:(0,G.jsxs)(X,{gap:`sm`,children:[(0,G.jsx)(Z,{size:`sm`,children:`Nouveaux commits poussés pendant votre lecture.`}),(0,G.jsx)(Fp,{size:`compact-xs`,variant:`light`,color:`orange`,onClick:()=>void r({search:e=>({...e,range:`${s}..${ne}`})}),children:`Voir uniquement ces changements`})]})}),oe===`focus`&&ve&&(0,G.jsx)(RW,{files:H,current:ve}),(0,G.jsxs)(`div`,{className:`pr-body`,"data-tree":h?`open`:`closed`,"data-panel":u?`open`:`closed`,children:[h&&(0,G.jsx)(`aside`,{className:`pr-tree`,children:(0,G.jsx)(xW,{stats:_e,nav:y,onNavChange:v,sort:b,onSortChange:x,currentPath:ye,onSelect:Ce.scrollToFile,intents:V})}),(0,G.jsxs)(`main`,{style:{minWidth:0,minHeight:0},children:[se.isPending&&(0,G.jsx)(Rp,{h:`100%`,children:(0,G.jsx)(El,{})}),se.isError&&(0,G.jsxs)(Jd,{color:`red`,m:`md`,title:`Diff indisponible pour cette plage`,children:[se.error.message,(0,G.jsx)(Fp,{mt:`sm`,size:`xs`,onClick:()=>void r({search:e=>({...e,range:`all`})}),children:`Revenir à tous les changements`})]}),se.data&&(0,G.jsx)(Dz,{files:H,onlyFile:ve?.path??null,collapsed:A,onToggleCollapse:e=>j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onCurrentChange:(e,t)=>N({fileIdx:e,hunkIdx:t}),handleRef:L})]}),u&&(0,G.jsxs)(`aside`,{className:`pr-panel`,children:[(0,G.jsx)(Yh,{className:`panel-tabs`,size:`xs`,fullWidth:!0,value:f,onChange:e=>p(e===`description`||e===`neighbors`?e:`conversations`),data:[{value:`conversations`,label:`Conversations ${t.threads.filter(e=>!e.isResolved).length}`},{value:`description`,label:`Description`},{value:`neighbors`,label:`Voisinage`}]}),(0,G.jsx)(`div`,{className:`panel-scroll`,children:f===`description`?(0,G.jsx)(sL,{}):f===`neighbors`?(0,G.jsx)(dW,{stats:_e,currentPath:ye,onSelect:Ce.scrollToFile}):(0,G.jsx)(oL,{})})]})]}),(0,G.jsx)(zW,{files:H,focusFile:ve,current:M,listRef:L,onToggleReview:()=>P(e=>!e),onToggleConversations:()=>m(`conversations`),onToggleDescription:()=>m(`description`),onToggleTree:()=>g(!h),onToggleLayout:()=>l(c===`split`?`unified`:`split`),onHelp:()=>I(!0)}),(0,G.jsx)(VW,{opened:F,onClose:()=>I(!1)})]})})}function LW(e,t,n){let r=e.findIndex(e=>e.path===n);return[...e.slice(r+1),...e.slice(0,r)].find(e=>t.files.find(t=>t.path===e.path)?.viewed!==`VIEWED`)}function RW({files:e,current:t}){let n=aC({from:`/$owner/$repo/pull/$number`}),r=hz(),i=zI(),a=e.indexOf(t),o=e=>e&&void n({search:t=>({...t,file:e.path})}),s=e.filter(e=>i.detail.files.find(t=>t.path===e.path)?.viewed!==`VIEWED`).length;return(0,G.jsxs)(X,{className:`focus-bar`,gap:`sm`,px:`md`,py:6,children:[(0,G.jsxs)(Fp,{size:`compact-xs`,variant:`default`,onClick:()=>o(e[a-1]),disabled:a<=0,children:[`←`,` `,(0,G.jsx)(Em,{size:`xs`,ml:4,children:`k`})]}),(0,G.jsx)(Z,{ff:`monospace`,fw:600,size:`sm`,children:t.path}),(0,G.jsxs)(Z,{size:`xs`,c:`dimmed`,children:[`fichier `,a+1,`/`,e.length,` · `,s,` non vu`,s>1?`s`:``]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsx)(`div`,{className:`steps`,children:e.map(e=>{let n=i.detail.files.find(t=>t.path===e.path)?.viewed;return(0,G.jsx)(`i`,{title:e.path,"data-state":e===t?`current`:n===`VIEWED`?`viewed`:`none`,onClick:()=>o(e)},e.path)})}),(0,G.jsx)(Fp,{size:`compact-xs`,color:`green`,onClick:()=>{r.toggleFile(t,!0),i.advanceFrom(t.path)},rightSection:(0,G.jsx)(Em,{size:`xs`,children:`v`}),children:`✓ Vu, suivant non vu`}),(0,G.jsxs)(Fp,{size:`compact-xs`,variant:`default`,onClick:()=>o(e[a+1]),disabled:a>=e.length-1,children:[(0,G.jsx)(Em,{size:`xs`,mr:4,children:`j`}),` `,`→`]})]})}function zW(e){let t=zI(),n=iL(t.ref),r=hz(),i=aC({from:`/$owner/$repo/pull/$number`}),{files:a,focusFile:o,listRef:s}=e,c=o??a[e.current.fileIdx??-1]??null,l=c&&e.current.hunkIdx!==null?c.hunks[e.current.hunkIdx]:void 0,u=e=>{if(o){let t=a[a.indexOf(o)+e];t&&i({search:e=>({...e,file:t.path})})}else s.current?.step(`file`,e)},d=t.detail.threads.find(e=>e.id===t.focusedThread);return lt([[`j`,()=>u(1)],[`k`,()=>u(-1)],[`n`,()=>s.current?.step(`hunk`,1)],[`p`,()=>s.current?.step(`hunk`,-1)],[`]`,()=>s.current?.step(`thread`,1)],[`v`,()=>{if(!c)return;let e=t.detail.files.find(e=>e.path===c.path)?.viewed===`VIEWED`;r.toggleFile(c,!e),e||t.advanceFrom(c.path)}],[`h`,()=>{c&&l&&(r.toggleHunk(c,l,!t.seenHunks.has(`${c.path}\n${l.hash}`)),s.current?.step(`hunk`,1))}],[`r`,()=>{document.querySelector(`[data-thread="${t.focusedThread}"] [data-reply]`)?.click()}],[`x`,()=>d&&(d.isResolved?d.canUnresolve:d.canResolve)&&n.setResolved.mutate({threadId:d.id,resolved:!d.isResolved})],[`m`,()=>void i({search:e=>({...e,mode:t.mode===`focus`?`continuous`:`focus`})})],[`u`,e.onToggleLayout],[`t`,e.onToggleConversations],[`d`,e.onToggleDescription],[`f`,e.onToggleTree],[`shift+S`,e.onToggleReview],[`i`,()=>void i({to:`/`})],[`Escape`,()=>{t.setSelection(null),t.setFileComposer(null)}],[`shift+?`,e.onHelp]]),(0,G.jsxs)(`div`,{className:`statusbar`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`j`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`k`}),` fichier`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`n`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`p`}),` hunk`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`]`}),`/`,(0,G.jsx)(Em,{size:`xs`,children:`[`}),` thread ouvert`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`v`}),` fichier vu · `,(0,G.jsx)(Em,{size:`xs`,children:`h`}),` hunk vu`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`r`}),` répondre · `,(0,G.jsx)(Em,{size:`xs`,children:`x`}),` résoudre`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Em,{size:`xs`,children:`?`}),` aide`]}),(0,G.jsx)(`div`,{style:{flex:1}}),(0,G.jsxs)(`span`,{children:[c?c.path:``,c&&l?` · hunk ${(e.current.hunkIdx??0)+1}/${c.hunks.length}`:``]})]})}var BW=[[`j / k`,`fichier suivant / précédent`],[`n / p`,`hunk suivant / précédent`],[`] / [`,`thread non résolu suivant / précédent`],[`v`,`marquer le fichier vu, puis fichier suivant (focus : fichier non vu suivant)`],[`h`,`marquer le hunk courant vu, puis hunk suivant`],[`r`,`répondre au thread sélectionné`],[`x`,`résoudre / rouvrir le thread sélectionné`],[`clic n° de ligne`,`commenter (Maj+clic : plage)`],[`m`,`mode continu / focus`],[`u`,`côte à côte / unifié`],[`t`,`panneau conversations`],[`d`,`description de la PR`],[`f`,`arbre des fichiers`],[`Maj+S`,`soumettre la review`],[`i`,`retour à l’inbox`],[`Ctrl+K`,`aller à une PR`],[`Échap`,`fermer le commentaire en cours`]];function VW(e){return(0,G.jsx)(Xm,{opened:e.opened,onClose:e.onClose,title:`Raccourcis clavier`,size:`md`,children:(0,G.jsx)(bg,{children:(0,G.jsx)(bg.Tbody,{children:BW.map(([e,t])=>(0,G.jsxs)(bg.Tr,{children:[(0,G.jsx)(bg.Td,{children:(0,G.jsx)(Em,{children:e})}),(0,G.jsx)(bg.Td,{children:t})]},e))})})})}function HW(){let e=ED(),t=W_(),n=dy(e.config.get.queryOptions()),[r,i]=(0,C.useState)(`repo`),[a,o]=(0,C.useState)(``),s=()=>{t.invalidateQueries({queryKey:e.config.get.queryKey()}),t.invalidateQueries({queryKey:e.inbox.get.queryKey()})},c=gy(e.config.add.mutationOptions({onSuccess:()=>{o(``),s()},onError:e=>t_.show({color:`red`,title:`Ajout impossible`,message:e.message})})),l=gy(e.config.remove.mutationOptions({onSuccess:s})),u=[...n.data?.orgs.map(e=>({kind:`org`,name:e}))??[],...n.data?.repos.map(e=>({kind:`repo`,name:e}))??[]];return(0,G.jsxs)(Zp,{size:`sm`,py:`xl`,children:[(0,G.jsx)(Rg,{order:2,mb:`xs`,children:`Repos et orgs suivis`}),(0,G.jsx)(Z,{c:`dimmed`,size:`sm`,mb:`lg`,children:`L’inbox ne montre que les PR de cette liste. Une org (ou un compte) suivie inclut tous ses repos. Le fichier de config peut aussi être édité à la main : les modifications sont prises en compte à chaud.`}),(0,G.jsx)(`form`,{onSubmit:e=>{e.preventDefault();let t=a.trim();t&&c.mutate({kind:r,name:t})},children:(0,G.jsxs)(X,{align:`flex-end`,mb:`lg`,children:[(0,G.jsx)(Yh,{value:r,onChange:e=>i(e===`org`?`org`:`repo`),data:[{value:`repo`,label:`Repo`},{value:`org`,label:`Org / compte`}]}),(0,G.jsx)(jg,{style:{flex:1},placeholder:r===`repo`?`owner/repo`:`nom-de-l-org`,value:a,onChange:e=>o(e.currentTarget.value),"data-autofocus":!0}),(0,G.jsx)(Fp,{type:`submit`,loading:c.isPending,children:`Suivre`})]})}),(0,G.jsxs)(tg,{gap:`xs`,children:[u.length===0&&(0,G.jsx)(Z,{c:`dimmed`,children:`Aucun repo suivi pour l’instant.`}),u.map(e=>(0,G.jsx)(Ac,{withBorder:!0,p:`xs`,px:`sm`,children:(0,G.jsxs)(X,{justify:`space-between`,children:[(0,G.jsxs)(X,{gap:`xs`,children:[(0,G.jsx)(Ep,{variant:`light`,color:e.kind===`org`?`violet`:`blue`,children:e.kind===`org`?`org`:`repo`}),(0,G.jsx)(Z,{ff:`monospace`,size:`sm`,children:e.name})]}),(0,G.jsx)(Pl,{variant:`subtle`,color:`red`,"aria-label":`Ne plus suivre ${e.name}`,onClick:()=>l.mutate(e),children:`✕`})]})},`${e.kind}:${e.name}`))]}),(0,G.jsx)(Rg,{order:2,mt:`xl`,mb:`xs`,children:`Modèle de la vue Intention`}),(0,G.jsx)(Iz,{})]})}var UW=TC({component:BD}),WW=CC({getParentRoute:()=>UW,path:`/`,component:tO}),GW=CC({getParentRoute:()=>UW,path:`/settings`,component:HW}),KW=CC({getParentRoute:()=>UW,path:`/$owner/$repo/pull/$number`,validateSearch:e=>({...typeof e.range==`string`?{range:e.range}:{},...e.mode===`focus`||e.mode===`continuous`?{mode:e.mode}:{},...typeof e.file==`string`?{file:e.file}:{},...typeof e.goto==`string`?{goto:e.goto}:{}}),component:PW}),qW=VC({routeTree:UW.addChildren([WW,GW,KW]),defaultPreload:`intent`,scrollRestoration:!1}),JW=Zn({primaryColor:`blue`,defaultRadius:`sm`,fontFamilyMonospace:`ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace`,cursorType:`pointer`});(0,Gw.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(C.StrictMode,{children:(0,G.jsxs)(Xn,{theme:JW,defaultColorScheme:`dark`,forceColorScheme:`dark`,children:[(0,G.jsx)(H_,{position:`bottom-left`,limit:4}),(0,G.jsx)(G_,{client:OD,children:(0,G.jsx)(TD,{trpcClient:kD,queryClient:OD,children:(0,G.jsx)(WC,{router:qW})})})]})}));
|