@seaveyon/harness-switch 0.30.1 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/harness-switch.js +2764 -296
- package/package.json +1 -1
- package/public/assets/38.12ddaa3e.js +1 -0
- package/public/assets/main.2a32cf81.js +63 -0
- package/public/assets/main.729e43ad.css +2 -0
- package/public/index.html +1 -1
- package/public/assets/38.4f37f008.js +0 -1
- package/public/assets/main.21da1831.js +0 -62
- package/public/assets/main.ffeca79a.css +0 -2
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
(()=>{"use strict";var e,t,n,r,o,a,i,l,s,c={6974(e,t,n){var r,o=n(7967),a=n(4041),i=n(3144);function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do 0!=(4098&(t=e).flags)&&(n=t.return),e=t.return;while(e)}return 3===t.tag?n:null}function c(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function u(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function d(e){if(s(e)!==e)throw Error(l(188))}var f=Object.assign,p=Symbol.for("react.element"),h=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),x=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),O=Symbol.for("react.lazy");Symbol.for("react.scope");var C=Symbol.for("react.activity");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var N=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var P=Symbol.iterator;function E(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=P&&e[P]||e["@@iterator"])?e:null}var _=Symbol.for("react.client.reference"),A=Array.isArray,I=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},M=[],z=-1;function D(e){return{current:e}}function L(e){0>z||(e.current=M[z],M[z]=null,z--)}function F(e,t){M[++z]=e.current,e.current=t}var $=D(null),U=D(null),H=D(null),B=D(null);function V(e,t){switch(F(H,t),F(U,e),F($,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=cy(t=cv(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L($),F($,e)}function K(){L($),L(U),L(H)}function q(e){null!==e.memoizedState&&F(B,e);var t=$.current,n=cy(t,e.type);t!==n&&(F(U,e),F($,n))}function W(e){U.current===e&&(L($),L(U)),B.current===e&&(L(B),ue._currentValue=R)}function G(e){if(void 0===tz)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);tz=t&&t[1]||"",tD=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+tz+e+tD}var Z=!1;function Y(e,t){if(!e||Z)return"";Z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(e){if(e&&r&&"string"==typeof e.stack)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),i=a[0],l=a[1];if(i&&l){var s=i.split("\n"),c=l.split("\n");for(o=r=0;r<s.length&&!s[r].includes("DetermineComponentFrameRoot");)r++;for(;o<c.length&&!c[o].includes("DetermineComponentFrameRoot");)o++;if(r===s.length||o===c.length)for(r=s.length-1,o=c.length-1;1<=r&&0<=o&&s[r]!==c[o];)o--;for(;1<=r&&0<=o;r--,o--)if(s[r]!==c[o]){if(1!==r||1!==o)do if(r--,o--,0>o||s[r]!==c[o]){var u="\n"+s[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=r&&0<=o);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?G(n):""}function X(e){try{var t="",n=null;do t+=function(e,t){switch(e.tag){case 26:case 27:case 5:return G(e.type);case 16:return G("Lazy");case 13:return e.child!==t&&null!==t?G("Suspense Fallback"):G("Suspense");case 19:return G("SuspenseList");case 0:case 15:return Y(e.type,!1);case 11:return Y(e.type.render,!1);case 1:return Y(e.type,!0);case 31:return G("Activity");default:return""}}(e,n),n=e,e=e.return;while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var J=Object.prototype.hasOwnProperty,Q=o.unstable_scheduleCallback,ee=o.unstable_cancelCallback,et=o.unstable_shouldYield,en=o.unstable_requestPaint,er=o.unstable_now,eo=o.unstable_getCurrentPriorityLevel,ea=o.unstable_ImmediatePriority,ei=o.unstable_UserBlockingPriority,el=o.unstable_NormalPriority,es=o.unstable_LowPriority,ec=o.unstable_IdlePriority,eu=o.log,ed=o.unstable_setDisableYieldValue,ef=null,ep=null;function eh(e){if("function"==typeof eu&&ed(e),ep&&"function"==typeof ep.setStrictMode)try{ep.setStrictMode(ef,e)}catch(e){}}var em=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(eg(e)/ev|0)|0},eg=Math.log,ev=Math.LN2,ey=256,eb=262144,ex=4194304;function ew(e){var t=42&e;if(0!==t)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 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 0x1000000:case 0x2000000:return 0x3c00000&e;case 0x4000000:return 0x4000000;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0;default:return e}}function ek(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var o=0,a=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var l=0x7ffffff&r;return 0!==l?0!=(r=l&~a)?o=ew(r):0!=(i&=l)?o=ew(i):n||0!=(n=l&~e)&&(o=ew(n)):0!=(l=r&~a)?o=ew(l):0!==i?o=ew(i):n||0!=(n=r&~e)&&(o=ew(n)),0===o?0:0!==t&&t!==o&&0==(t&a)&&((a=o&-o)>=(n=t&-t)||32===a&&0!=(4194048&n))?t:o}function ej(e,t){return 0==(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function eS(){var e=ex;return 0==(0x3c00000&(ex<<=1))&&(ex=4194304),e}function eO(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function eC(e,t){e.pendingLanes|=t,0x10000000!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function eN(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-em(t);e.entangledLanes|=t,e.entanglements[r]=0x40000000|e.entanglements[r]|261930&n}function eP(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-em(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function eE(e,t){var n=t&-t;return 0!=((n=0!=(42&n)?1:e_(n))&(e.suspendedLanes|t))?0:n}function e_(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 0x1000000:case 0x2000000:e=128;break;case 0x10000000:e=0x8000000;break;default:e=0}return e}function eA(e){return 2<(e&=-e)?8<e?0!=(0x7ffffff&e)?32:0x10000000:8:2}function eI(){var e=T.p;return 0!==e?e:void 0===(e=window.event)?32:uh(e.type)}function eT(e,t){var n=T.p;try{return T.p=e,t()}finally{T.p=n}}var eR=Math.random().toString(36).slice(2),eM="__reactFiber$"+eR,ez="__reactProps$"+eR,eD="__reactContainer$"+eR,eL="__reactEvents$"+eR,eF="__reactListeners$"+eR,e$="__reactHandles$"+eR,eU="__reactResources$"+eR,eH="__reactMarker$"+eR;function eB(e){delete e[eM],delete e[ez],delete e[eL],delete e[eF],delete e[e$]}function eV(e){var t=e[eM];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eD]||n[eM]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=cz(e);null!==e;){if(n=e[eM])return n;e=cz(e)}return t}n=(e=n).parentNode}return null}function eK(e){if(e=e[eM]||e[eD]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function eq(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(l(33))}function eW(e){var t=e[eU];return t||(t=e[eU]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function eG(e){e[eH]=!0}var eZ=new Set,eY={};function eX(e,t){eJ(e,t),eJ(e+"Capture",t)}function eJ(e,t){for(eY[e]=t,e=0;e<t.length;e++)eZ.add(t[e])}var eQ=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]*$"),e0={},e1={};function e2(e,t,n){if(J.call(e1,t)||!J.call(e0,t)&&(eQ.test(t)?e1[t]=!0:(e0[t]=!0,!1)))if(null===n)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("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function e4(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function e3(e,t,n,r){if(null===r)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 e5(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function e6(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function e8(e){if(!e._valueTracker){var t=e6(e)?"checked":"value";e._valueTracker=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var o=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.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]}}}}(e,t,""+e[t])}}function e9(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=e6(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function e7(e){if(void 0===(e=e||("u">typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var te=/[\n"\\]/g;function tt(e){return e.replace(te,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function tn(e,t,n,r,o,a,i,l){e.name="",null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i?e.type=i:e.removeAttribute("type"),null!=t?"number"===i?(0===t&&""===e.value||e.value!=t)&&(e.value=""+e5(t)):e.value!==""+e5(t)&&(e.value=""+e5(t)):"submit"!==i&&"reset"!==i||e.removeAttribute("value"),null!=t?to(e,i,e5(t)):null!=n?to(e,i,e5(n)):null!=r&&e.removeAttribute("value"),null==o&&null!=a&&(e.defaultChecked=!!a),null!=o&&(e.checked=o&&"function"!=typeof o&&"symbol"!=typeof o),null!=l&&"function"!=typeof l&&"symbol"!=typeof l&&"boolean"!=typeof l?e.name=""+e5(l):e.removeAttribute("name")}function tr(e,t,n,r,o,a,i,l){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(("submit"===a||"reset"===a)&&null==t)return void e8(e);n=null!=n?""+e5(n):"",t=null!=t?""+e5(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:o)&&"symbol"!=typeof r&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i&&(e.name=i),e8(e)}function to(e,t,n){"number"===t&&e7(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function ta(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(o=0,n=""+e5(n),t=null;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function ti(e,t,n){if(null!=t&&((t=""+e5(t))!==e.value&&(e.value=t),null==n)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=null!=n?""+e5(n):""}function tl(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(l(92));if(A(r)){if(1<r.length)throw Error(l(93));r=r[0]}n=r}null==n&&(n=""),t=n}e.defaultValue=n=e5(t),(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r),e8(e)}function ts(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var tc=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 tu(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||tc.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function td(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(l(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var o in t)r=t[o],t.hasOwnProperty(o)&&n[o]!==r&&tu(e,o,r)}else for(var a in t)t.hasOwnProperty(a)&&tu(e,a,t[a])}function tf(e){if(-1===e.indexOf("-"))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 tp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),th=/^[\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 tm(e){return th.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function tg(){}var tv=null;function ty(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var tb=null,tx=null;function tw(e){var t=eK(e);if(t&&(e=t.stateNode)){var n=e[ez]||null;switch(e=t.stateNode,t.type){case"input":if(tn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+tt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[ez]||null;if(!o)throw Error(l(90));tn(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&e9(r)}break;case"textarea":ti(e,n.value,n.defaultValue);break;case"select":null!=(t=n.value)&&ta(e,!!n.multiple,t,!1)}}}var tk=!1;function tj(e,t,n){if(tk)return e(t,n);tk=!0;try{return e(t)}finally{if(tk=!1,(null!==tb||null!==tx)&&(sd(),tb&&(t=tb,e=tx,tx=tb=null,tw(t),e)))for(t=0;t<e.length;t++)tw(e[t])}}function tS(e,t){var n=e.stateNode;if(null===n)return null;var r=n[ez]||null;if(null===r)return null;switch(n=r[t],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)||(r="button"!==(e=e.type)&&"input"!==e&&"select"!==e&&"textarea"!==e),e=!r;break;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(l(231,t,typeof n));return n}var tO="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,tC=!1;if(tO)try{var tN={};Object.defineProperty(tN,"passive",{get:function(){tC=!0}}),window.addEventListener("test",tN,tN),window.removeEventListener("test",tN,tN)}catch(e){tC=!1}var tP=null,tE=null,t_=null;function tA(){if(t_)return t_;var e,t,n=tE,r=n.length,o="value"in tP?tP.value:tP.textContent,a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);return t_=o.slice(e,1<t?1-t:void 0)}function tI(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function tT(){return!0}function tR(){return!1}function tM(e){function t(t,n,r,o,a){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(o):o[i]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?tT:tR,this.isPropagationStopped=tR,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=tT)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=tT)},persist:function(){},isPersistent:tT}),t}var tz,tD,tL,tF,t$,tU={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tH=tM(tU),tB=f({},tU,{view:0,detail:0}),tV=tM(tB),tK=f({},tB,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:t2,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==t$&&(t$&&"mousemove"===e.type?(tL=e.screenX-t$.screenX,tF=e.screenY-t$.screenY):tF=tL=0,t$=e),tL)},movementY:function(e){return"movementY"in e?e.movementY:tF}}),tq=tM(tK),tW=tM(f({},tK,{dataTransfer:0})),tG=tM(f({},tB,{relatedTarget:0})),tZ=tM(f({},tU,{animationName:0,elapsedTime:0,pseudoElement:0})),tY=tM(f({},tU,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),tX=tM(f({},tU,{data:0})),tJ={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tQ={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"},t0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function t1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=t0[e])&&!!t[e]}function t2(){return t1}var t4=tM(f({},tB,{key:function(e){if(e.key){var t=tJ[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tI(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?tQ[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:t2,charCode:function(e){return"keypress"===e.type?tI(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tI(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),t3=tM(f({},tK,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),t5=tM(f({},tB,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:t2})),t6=tM(f({},tU,{propertyName:0,elapsedTime:0,pseudoElement:0})),t8=tM(f({},tK,{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})),t9=tM(f({},tU,{newState:0,oldState:0})),t7=[9,13,27,32],ne=tO&&"CompositionEvent"in window,nt=null;tO&&"documentMode"in document&&(nt=document.documentMode);var nn=tO&&"TextEvent"in window&&!nt,nr=tO&&(!ne||nt&&8<nt&&11>=nt),no=!1;function na(e,t){switch(e){case"keyup":return -1!==t7.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ni(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var nl=!1,ns={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 nc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ns[e.type]:"textarea"===t}function nu(e,t,n,r){tb?tx?tx.push(r):tx=[r]:tb=r,0<(t=cr(t,"onChange")).length&&(n=new tH("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var nd=null,nf=null;function np(e){s5(e,0)}function nh(e){if(e9(eq(e)))return e}function nm(e,t){if("change"===e)return t}var ng=!1;if(tO){if(tO){var nv="oninput"in document;if(!nv){var ny=document.createElement("div");ny.setAttribute("oninput","return;"),nv="function"==typeof ny.oninput}r=nv}else r=!1;ng=r&&(!document.documentMode||9<document.documentMode)}function nb(){nd&&(nd.detachEvent("onpropertychange",nx),nf=nd=null)}function nx(e){if("value"===e.propertyName&&nh(nf)){var t=[];nu(t,nf,e,ty(e)),tj(np,t)}}function nw(e,t,n){"focusin"===e?(nb(),nd=t,nf=n,nd.attachEvent("onpropertychange",nx)):"focusout"===e&&nb()}function nk(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return nh(nf)}function nj(e,t){if("click"===e)return nh(t)}function nS(e,t){if("input"===e||"change"===e)return nh(t)}var nO="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function nC(e,t){if(nO(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===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 o=n[r];if(!J.call(t,o)||!nO(e[o],t[o]))return!1}return!0}function nN(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nP(e,t){var n,r=nN(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=nN(r)}}function nE(e){e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;for(var t=e7(e.document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=e7(e.document)}return t}function n_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var nA=tO&&"documentMode"in document&&11>=document.documentMode,nI=null,nT=null,nR=null,nM=!1;function nz(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;nM||null==nI||nI!==e7(r)||(r="selectionStart"in(r=nI)&&n_(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},nR&&nC(nR,r)||(nR=r,0<(r=cr(nT,"onSelect")).length&&(t=new tH("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=nI)))}function nD(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var nL={animationend:nD("Animation","AnimationEnd"),animationiteration:nD("Animation","AnimationIteration"),animationstart:nD("Animation","AnimationStart"),transitionrun:nD("Transition","TransitionRun"),transitionstart:nD("Transition","TransitionStart"),transitioncancel:nD("Transition","TransitionCancel"),transitionend:nD("Transition","TransitionEnd")},nF={},n$={};function nU(e){if(nF[e])return nF[e];if(!nL[e])return e;var t,n=nL[e];for(t in n)if(n.hasOwnProperty(t)&&t in n$)return nF[e]=n[t];return e}tO&&(n$=document.createElement("div").style,"AnimationEvent"in window||(delete nL.animationend.animation,delete nL.animationiteration.animation,delete nL.animationstart.animation),"TransitionEvent"in window||delete nL.transitionend.transition);var nH=nU("animationend"),nB=nU("animationiteration"),nV=nU("animationstart"),nK=nU("transitionrun"),nq=nU("transitionstart"),nW=nU("transitioncancel"),nG=nU("transitionend"),nZ=new Map,nY="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function nX(e,t){nZ.set(e,t),eX(t,[e])}nY.push("scrollEnd");var nJ="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},nQ=[],n0=0,n1=0;function n2(){for(var e=n0,t=n1=n0=0;t<e;){var n=nQ[t];nQ[t++]=null;var r=nQ[t];nQ[t++]=null;var o=nQ[t];nQ[t++]=null;var a=nQ[t];if(nQ[t++]=null,null!==r&&null!==o){var i=r.pending;null===i?o.next=o:(o.next=i.next,i.next=o),r.pending=o}0!==a&&n6(n,o,a)}}function n4(e,t,n,r){nQ[n0++]=e,nQ[n0++]=t,nQ[n0++]=n,nQ[n0++]=r,n1|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function n3(e,t,n,r){return n4(e,t,n,r),n8(e)}function n5(e,t){return n4(e,null,null,t),n8(e)}function n6(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var o=!1,a=e.return;null!==a;)a.childLanes|=n,null!==(r=a.alternate)&&(r.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(o=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,o&&null!==t&&(o=31-em(n),null===(r=(e=a.hiddenUpdates)[o])?e[o]=[t]:r.push(t),t.lane=0x20000000|n),a):null}function n8(e){if(50<sr)throw sr=0,so=null,Error(l(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var n9={};function n7(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 re(e,t,n,r){return new n7(e,t,n,r)}function rt(e){return!(!(e=e.prototype)||!e.isReactComponent)}function rn(e,t){var n=e.alternate;return null===n?((n=re(e.tag,t,e.key,e.mode)).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=0x3e00000&e.flags,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=null===t?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 rr(e,t){e.flags&=0x3e00002;var n=e.alternate;return null===n?(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,e.dependencies=null===(t=n.dependencies)?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ro(e,t,n,r,o,a){var i=0;if(r=e,"function"==typeof e)rt(e)&&(i=1);else if("string"==typeof e)i=!function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;if("stylesheet"===t.rel)return e=t.disabled,"string"==typeof t.precedence&&null==e;return!0;case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,$.current)?"html"===e||"head"===e||"body"===e?27:5:26;else e:switch(e){case C:return(e=re(31,n,t,o)).elementType=C,e.lanes=a,e;case g:return ra(n.children,o,a,t);case v:i=8,o|=24;break;case y:return(e=re(12,n,t,2|o)).elementType=y,e.lanes=a,e;case k:return(e=re(13,n,t,o)).elementType=k,e.lanes=a,e;case j:return(e=re(19,n,t,o)).elementType=j,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case x:i=10;break e;case b:i=9;break e;case w:i=11;break e;case S:i=14;break e;case O:i=16,r=null;break e}i=29,n=Error(l(130,null===e?"null":typeof e,"")),r=null}return(t=re(i,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function ra(e,t,n,r){return(e=re(7,e,r,t)).lanes=n,e}function ri(e,t,n){return(e=re(6,e,null,t)).lanes=n,e}function rl(e){var t=re(18,null,null,0);return t.stateNode=e,t}function rs(e,t,n){return(t=re(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var rc=new WeakMap;function ru(e,t){if("object"==typeof e&&null!==e){var n=rc.get(e);return void 0!==n?n:(t={value:e,source:t,stack:X(t)},rc.set(e,t),t)}return{value:e,source:t,stack:X(t)}}var rd=[],rf=0,rp=null,rh=0,rm=[],rg=0,rv=null,ry=1,rb="";function rx(e,t){rd[rf++]=rh,rd[rf++]=rp,rp=e,rh=t}function rw(e,t,n){rm[rg++]=ry,rm[rg++]=rb,rm[rg++]=rv,rv=e;var r=ry;e=rb;var o=32-em(r)-1;r&=~(1<<o),n+=1;var a=32-em(t)+o;if(30<a){var i=o-o%5;a=(r&(1<<i)-1).toString(32),r>>=i,o-=i,ry=1<<32-em(t)+o|n<<o|r,rb=a+e}else ry=1<<a|n<<o|r,rb=e}function rk(e){null!==e.return&&(rx(e,1),rw(e,1,0))}function rj(e){for(;e===rp;)rp=rd[--rf],rd[rf]=null,rh=rd[--rf],rd[rf]=null;for(;e===rv;)rv=rm[--rg],rm[rg]=null,rb=rm[--rg],rm[rg]=null,ry=rm[--rg],rm[rg]=null}function rS(e,t){rm[rg++]=ry,rm[rg++]=rb,rm[rg++]=rv,ry=t.id,rb=t.overflow,rv=e}var rO=null,rC=null,rN=!1,rP=null,rE=!1,r_=Error(l(519));function rA(e){var t=Error(l(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML",""));throw rD(ru(t,e)),r_}function rI(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[eM]=e,t[ez]=r,n){case"dialog":s6("cancel",t),s6("close",t);break;case"iframe":case"object":case"embed":s6("load",t);break;case"video":case"audio":for(n=0;n<s4.length;n++)s6(s4[n],t);break;case"source":s6("error",t);break;case"img":case"image":case"link":s6("error",t),s6("load",t);break;case"details":s6("toggle",t);break;case"input":s6("invalid",t),tr(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":s6("invalid",t);break;case"textarea":s6("invalid",t),tl(t,r.value,r.defaultValue,r.children)}"string"!=typeof(n=r.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||cc(t.textContent,n)?(null!=r.popover&&(s6("beforetoggle",t),s6("toggle",t)),null!=r.onScroll&&s6("scroll",t),null!=r.onScrollEnd&&s6("scrollend",t),null!=r.onClick&&(t.onclick=tg),t=!0):t=!1,t||rA(e,!0)}function rT(e){for(rO=e.return;rO;)switch(rO.tag){case 5:case 31:case 13:rE=!1;return;case 27:case 3:rE=!0;return;default:rO=rO.return}}function rR(e){if(e!==rO)return!1;if(!rN)return rT(e),rN=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t="form"===(t=e.type)||"button"===t||cb(e.type,e.memoizedProps)),t=!t),t&&rC&&rA(e),rT(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(l(317));rC=cM(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(l(317));rC=cM(e)}else 27===n?(n=rC,cC(e.type)?(e=cR,cR=null,rC=e):rC=n):rC=rO?cT(e.stateNode.nextSibling):null;return!0}function rM(){rC=rO=null,rN=!1}function rz(){var e=rP;return null!==e&&(null===lQ?lQ=e:lQ.push.apply(lQ,e),rP=null),e}function rD(e){null===rP?rP=[e]:rP.push(e)}var rL=D(null),rF=null,r$=null;function rU(e,t,n){F(rL,t._currentValue),t._currentValue=n}function rH(e){e._currentValue=rL.current,L(rL)}function rB(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function rV(e,t,n,r){var o=e.child;for(null!==o&&(o.return=e);null!==o;){var a=o.dependencies;if(null!==a){var i=o.child;a=a.firstContext;e:for(;null!==a;){var s=a;a=o;for(var c=0;c<t.length;c++)if(s.context===t[c]){a.lanes|=n,null!==(s=a.alternate)&&(s.lanes|=n),rB(a.return,n,e),r||(i=null);break e}a=s.next}}else if(18===o.tag){if(null===(i=o.return))throw Error(l(341));i.lanes|=n,null!==(a=i.alternate)&&(a.lanes|=n),rB(i,n,e),i=null}else i=o.child;if(null!==i)i.return=o;else for(i=o;null!==i;){if(i===e){i=null;break}if(null!==(o=i.sibling)){o.return=i.return,i=o;break}i=i.return}o=i}}function rK(e,t,n,r){e=null;for(var o=t,a=!1;null!==o;){if(!a){if(0!=(524288&o.flags))a=!0;else if(0!=(262144&o.flags))break}if(10===o.tag){var i=o.alternate;if(null===i)throw Error(l(387));if(null!==(i=i.memoizedProps)){var s=o.type;nO(o.pendingProps.value,i.value)||(null!==e?e.push(s):e=[s])}}else if(o===B.current){if(null===(i=o.alternate))throw Error(l(387));i.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(null!==e?e.push(ue):e=[ue])}o=o.return}null!==e&&rV(t,e,n,r),t.flags|=262144}function rq(e){for(e=e.firstContext;null!==e;){if(!nO(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function rW(e){rF=e,r$=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function rG(e){return rY(rF,e)}function rZ(e,t){return null===rF&&rW(e),rY(e,t)}function rY(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===r$){if(null===e)throw Error(l(308));r$=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else r$=r$.next=t;return n}var rX="u">typeof AbortController?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()})}},rJ=o.unstable_scheduleCallback,rQ=o.unstable_NormalPriority,r0={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function r1(){return{controller:new rX,data:new Map,refCount:0}}function r2(e){e.refCount--,0===e.refCount&&rJ(rQ,function(){e.controller.abort()})}var r4=null,r3=0,r5=0,r6=null;function r8(){if(0==--r3&&null!==r4){null!==r6&&(r6.status="fulfilled");var e=r4;r4=null,r5=0,r6=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var r9=I.S;I.S=function(e,t){l2=er(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e){if(null===r4){var t=r4=[];r3=0,r5=sJ(),r6={status:"pending",value:void 0,then:function(e){t.push(e)}}}r3++,e.then(r8,r8)}(t),null!==r9&&r9(e,t)};var r7=D(null);function oe(){var e=r7.current;return null!==e?e:lD.pooledCache}function ot(e,t){null===t?F(r7,r7.current):F(r7,t.pool)}function on(){var e=oe();return null===e?null:{parent:r0._currentValue,pool:e}}var or=Error(l(460)),oo=Error(l(474)),oa=Error(l(542)),oi={then:function(){}};function ol(e){return"fulfilled"===(e=e.status)||"rejected"===e}function os(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(tg,tg),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw of(e=t.reason),e;default:if("string"==typeof t.status)t.then(tg,tg);else{if(null!==(e=lD)&&100<e.shellSuspendCounter)throw Error(l(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw of(e=t.reason),e}throw ou=t,or}}function oc(e){try{return(0,e._init)(e._payload)}catch(e){if(null!==e&&"object"==typeof e&&"function"==typeof e.then)throw ou=e,or;throw e}}var ou=null;function od(){if(null===ou)throw Error(l(459));var e=ou;return ou=null,e}function of(e){if(e===or||e===oa)throw Error(l(483))}var op=null,oh=0;function om(e){var t=oh;return oh+=1,null===op&&(op=[]),os(op,e,t)}function og(e,t){e.ref=void 0!==(t=t.props.ref)?t:null}function ov(e,t){if(t.$$typeof===p)throw Error(l(525));throw Error(l(31,"[object Object]"===(e=Object.prototype.toString.call(t))?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function oy(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function o(e,t){return(e=rn(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return(t.index=r,e)?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=0x4000002,n):r:(t.flags|=0x4000002,n):(t.flags|=1048576,n)}function i(t){return e&&null===t.alternate&&(t.flags|=0x4000002),t}function s(e,t,n,r){return null===t||6!==t.tag?(t=ri(n,e.mode,r)).return=e:(t=o(t,n)).return=e,t}function c(e,t,n,r){var a=n.type;return a===g?d(e,t,n.props.children,r,n.key):(null!==t&&(t.elementType===a||"object"==typeof a&&null!==a&&a.$$typeof===O&&oc(a)===t.type)?og(t=o(t,n.props),n):og(t=ro(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=rs(n,e.mode,r)).return=e:(t=o(t,n.children||[])).return=e,t}function d(e,t,n,r,a){return null===t||7!==t.tag?(t=ra(n,e.mode,r,a)).return=e:(t=o(t,n)).return=e,t}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=ri(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case h:return og(n=ro(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case m:return(t=rs(t,e.mode,n)).return=e,t;case O:return f(e,t=oc(t),n)}if(A(t)||E(t))return(t=ra(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return f(e,om(t),n);if(t.$$typeof===x)return f(e,rZ(e,t),n);ov(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==o?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case h:return n.key===o?c(e,t,n,r):null;case m:return n.key===o?u(e,t,n,r):null;case O:return p(e,t,n=oc(n),r)}if(A(n)||E(n))return null!==o?null:d(e,t,n,r,null);if("function"==typeof n.then)return p(e,t,om(n),r);if(n.$$typeof===x)return p(e,t,rZ(e,n),r);ov(e,n)}return null}function v(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return s(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case h:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case m:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case O:return v(e,t,n,r=oc(r),o)}if(A(r)||E(r))return d(t,e=e.get(n)||null,r,o,null);if("function"==typeof r.then)return v(e,t,n,om(r),o);if(r.$$typeof===x)return v(e,t,n,rZ(t,r),o);ov(t,r)}return null}return function(s,c,u,d){try{oh=0;var y=function s(c,u,d,y){if("object"==typeof d&&null!==d&&d.type===g&&null===d.key&&(d=d.props.children),"object"==typeof d&&null!==d){switch(d.$$typeof){case h:e:{for(var b=d.key;null!==u;){if(u.key===b){if((b=d.type)===g){if(7===u.tag){n(c,u.sibling),(y=o(u,d.props.children)).return=c,c=y;break e}}else if(u.elementType===b||"object"==typeof b&&null!==b&&b.$$typeof===O&&oc(b)===u.type){n(c,u.sibling),og(y=o(u,d.props),d),y.return=c,c=y;break e}n(c,u);break}t(c,u),u=u.sibling}d.type===g?(y=ra(d.props.children,c.mode,y,d.key)).return=c:(og(y=ro(d.type,d.key,d.props,null,c.mode,y),d),y.return=c),c=y}return i(c);case m:e:{for(b=d.key;null!==u;){if(u.key===b)if(4===u.tag&&u.stateNode.containerInfo===d.containerInfo&&u.stateNode.implementation===d.implementation){n(c,u.sibling),(y=o(u,d.children||[])).return=c,c=y;break e}else{n(c,u);break}t(c,u),u=u.sibling}(y=rs(d,c.mode,y)).return=c,c=y}return i(c);case O:return s(c,u,d=oc(d),y)}if(A(d))return function(o,i,l,s){for(var c=null,u=null,d=i,h=i=0,m=null;null!==d&&h<l.length;h++){d.index>h?(m=d,d=null):m=d.sibling;var g=p(o,d,l[h],s);if(null===g){null===d&&(d=m);break}e&&d&&null===g.alternate&&t(o,d),i=a(g,i,h),null===u?c=g:u.sibling=g,u=g,d=m}if(h===l.length)return n(o,d),rN&&rx(o,h),c;if(null===d){for(;h<l.length;h++)null!==(d=f(o,l[h],s))&&(i=a(d,i,h),null===u?c=d:u.sibling=d,u=d);return rN&&rx(o,h),c}for(d=r(d);h<l.length;h++)null!==(m=v(d,o,h,l[h],s))&&(e&&null!==m.alternate&&d.delete(null===m.key?h:m.key),i=a(m,i,h),null===u?c=m:u.sibling=m,u=m);return e&&d.forEach(function(e){return t(o,e)}),rN&&rx(o,h),c}(c,u,d,y);if(E(d)){if("function"!=typeof(b=E(d)))throw Error(l(150));return function(o,i,s,c){if(null==s)throw Error(l(151));for(var u=null,d=null,h=i,m=i=0,g=null,y=s.next();null!==h&&!y.done;m++,y=s.next()){h.index>m?(g=h,h=null):g=h.sibling;var b=p(o,h,y.value,c);if(null===b){null===h&&(h=g);break}e&&h&&null===b.alternate&&t(o,h),i=a(b,i,m),null===d?u=b:d.sibling=b,d=b,h=g}if(y.done)return n(o,h),rN&&rx(o,m),u;if(null===h){for(;!y.done;m++,y=s.next())null!==(y=f(o,y.value,c))&&(i=a(y,i,m),null===d?u=y:d.sibling=y,d=y);return rN&&rx(o,m),u}for(h=r(h);!y.done;m++,y=s.next())null!==(y=v(h,o,m,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?m:y.key),i=a(y,i,m),null===d?u=y:d.sibling=y,d=y);return e&&h.forEach(function(e){return t(o,e)}),rN&&rx(o,m),u}(c,u,d=b.call(d),y)}if("function"==typeof d.then)return s(c,u,om(d),y);if(d.$$typeof===x)return s(c,u,rZ(c,d),y);ov(c,d)}return"string"==typeof d&&""!==d||"number"==typeof d||"bigint"==typeof d?(d=""+d,null!==u&&6===u.tag?(n(c,u.sibling),(y=o(u,d)).return=c):(n(c,u),(y=ri(d,c.mode,y)).return=c),i(c=y)):n(c,u)}(s,c,u,d);return op=null,y}catch(e){if(e===or||e===oa)throw e;var b=re(29,e,null,s.mode);return b.lanes=d,b.return=s,b}finally{}}}var ob=oy(!0),ox=oy(!1),ow=!1;function ok(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oj(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 oS(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function oO(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&lz)){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=n8(e),n6(e,null,n),t}return n4(e,r,t,n),n8(e)}function oC(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194048&n))){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eP(e,n)}}function oN(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?o=a=i:a=a.next=i,n=n.next}while(null!==n);null===a?o=a=t:a=a.next=t}else o=a=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var oP=!1;function oE(){if(oP){var e=r6;if(null!==e)throw e}}function o_(e,t,n,r){oP=!1;var o=e.updateQueue;ow=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var s=l,c=s.next;s.next=null,null===i?a=c:i.next=c,i=s;var u=e.alternate;null!==u&&(l=(u=u.updateQueue).lastBaseUpdate)!==i&&(null===l?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=s)}if(null!==a){var d=o.baseState;for(i=0,u=c=s=null,l=a;;){var p=-0x20000001&l.lane,h=p!==l.lane;if(h?(lF&p)===p:(r&p)===p){0!==p&&p===r5&&(oP=!0),null!==u&&(u=u.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,g=l;switch(p=t,g.tag){case 1:if("function"==typeof(m=g.payload)){d=m.call(n,d,p);break e}d=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(p="function"==typeof(m=g.payload)?m.call(n,d,p):m))break e;d=f({},d,p);break e;case 2:ow=!0}}null!==(p=l.callback)&&(e.flags|=64,h&&(e.flags|=8192),null===(h=o.callbacks)?o.callbacks=[p]:h.push(p))}else h={lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===u?(c=u=h,s=d):u=u.next=h,i|=p;if(null===(l=l.next))if(null===(l=o.shared.pending))break;else l=(h=l).next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}null===u&&(s=d),o.baseState=s,o.firstBaseUpdate=c,o.lastBaseUpdate=u,null===a&&(o.shared.lanes=0),lW|=i,e.lanes=i,e.memoizedState=d}}function oA(e,t){if("function"!=typeof e)throw Error(l(191,e));e.call(t)}function oI(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)oA(n[e],t)}var oT=D(null),oR=D(0);function oM(e,t){F(oR,e=lK),F(oT,t),lK=e|t.baseLanes}function oz(){F(oR,lK),F(oT,oT.current)}function oD(){lK=oR.current,L(oT),L(oR)}var oL=D(null),oF=null;function o$(e){var t=e.alternate;F(oK,1&oK.current),F(oL,e),null===oF&&(null===t||null!==oT.current?oF=e:null!==t.memoizedState&&(oF=e))}function oU(e){F(oK,oK.current),F(oL,e),null===oF&&(oF=e)}function oH(e){22===e.tag?(F(oK,oK.current),F(oL,e),null===oF&&(oF=e)):oB(e)}function oB(){F(oK,oK.current),F(oL,oL.current)}function oV(e){L(oL),oF===e&&(oF=null),L(oK)}var oK=D(0);function oq(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||cA(n)||cI(n)))return t}else if(19===t.tag&&("forwards"===t.memoizedProps.revealOrder||"backwards"===t.memoizedProps.revealOrder||"unstable_legacy-backwards"===t.memoizedProps.revealOrder||"together"===t.memoizedProps.revealOrder)){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oW=0,oG=null,oZ=null,oY=null,oX=!1,oJ=!1,oQ=!1,o0=0,o1=0,o2=null,o4=0;function o3(){throw Error(l(321))}function o5(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!nO(e[n],t[n]))return!1;return!0}function o6(e,t,n,r,o,a){return oW=a,oG=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=null===e||null===e.memoizedState?ir:io,oQ=!1,a=n(r,o),oQ=!1,oJ&&(a=o9(t,n,r,o)),o8(e),a}function o8(e){I.H=it;var t=null!==oZ&&null!==oZ.next;if(oW=0,oY=oZ=oG=null,oX=!1,o1=0,o2=null,t)throw Error(l(300));null===e||iw||null!==(e=e.dependencies)&&rq(e)&&(iw=!0)}function o9(e,t,n,r){oG=e;var o=0;do{if(oJ&&(o2=null),o1=0,oJ=!1,25<=o)throw Error(l(301));if(o+=1,oY=oZ=null,null!=e.updateQueue){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,null!=a.memoCache&&(a.memoCache.index=0)}I.H=ia,a=t(n,r)}while(oJ);return a}function o7(){var e=I.H,t=e.useState()[0];return t="function"==typeof t.then?ai(t):t,e=e.useState()[0],(null!==oZ?oZ.memoizedState:null)!==e&&(oG.flags|=1024),t}function ae(){var e=0!==o0;return o0=0,e}function at(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function an(e){if(oX){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}oX=!1}oW=0,oY=oZ=oG=null,oJ=!1,o1=o0=0,o2=null}function ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===oY?oG.memoizedState=oY=e:oY=oY.next=e,oY}function ao(){if(null===oZ){var e=oG.alternate;e=null!==e?e.memoizedState:null}else e=oZ.next;var t=null===oY?oG.memoizedState:oY.next;if(null!==t)oY=t,oZ=e;else{if(null===e){if(null===oG.alternate)throw Error(l(467));throw Error(l(310))}e={memoizedState:(oZ=e).memoizedState,baseState:oZ.baseState,baseQueue:oZ.baseQueue,queue:oZ.queue,next:null},null===oY?oG.memoizedState=oY=e:oY=oY.next=e}return oY}function aa(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ai(e){var t=o1;return o1+=1,null===o2&&(o2=[]),e=os(o2,e,t),t=oG,null===(null===oY?t.memoizedState:oY.next)&&(I.H=null===(t=t.alternate)||null===t.memoizedState?ir:io),e}function al(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return ai(e);if(e.$$typeof===x)return rG(e)}throw Error(l(438,String(e)))}function as(e){var t=null,n=oG.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=oG.alternate;null!==r&&null!==(r=r.updateQueue)&&null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})}if(null==t&&(t={data:[],index:0}),null===n&&(n=aa(),oG.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=N;return t.index++,n}function ac(e,t){return"function"==typeof t?t(e):t}function au(e){return ad(ao(),oZ,e)}function ad(e,t,n){var r=e.queue;if(null===r)throw Error(l(311));r.lastRenderedReducer=n;var o=e.baseQueue,a=r.pending;if(null!==a){if(null!==o){var i=o.next;o.next=a.next,a.next=i}t.baseQueue=o=a,r.pending=null}if(a=e.baseState,null===o)e.memoizedState=a;else{t=o.next;var s=i=null,c=null,u=t,d=!1;do{var f=-0x20000001&u.lane;if(f!==u.lane?(lF&f)===f:(oW&f)===f){var p=u.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===r5&&(d=!0);else if((oW&p)===p){u=u.next,p===r5&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(s=c=f,i=a):c=c.next=f,oG.lanes|=p,lW|=p;f=u.action,oQ&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(s=c=p,i=a):c=c.next=p,oG.lanes|=f,lW|=f;u=u.next}while(null!==u&&u!==t);if(null===c?i=a:c.next=s,!nO(a,e.memoizedState)&&(iw=!0,d&&null!==(n=r6)))throw n;e.memoizedState=a,e.baseState=i,e.baseQueue=c,r.lastRenderedState=a}return null===o&&(r.lanes=0),[e.memoizedState,r.dispatch]}function af(e){var t=ao(),n=t.queue;if(null===n)throw Error(l(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(null!==o){n.pending=null;var i=o=o.next;do a=e(a,i.action),i=i.next;while(i!==o);nO(a,t.memoizedState)||(iw=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ap(e,t,n){var r=oG,o=ao(),a=rN;if(a){if(void 0===n)throw Error(l(407));n=n()}else n=t();var i=!nO((oZ||o).memoizedState,n);if(i&&(o.memoizedState=n,iw=!0),o=o.queue,aL(ag.bind(null,r,o,e),[e]),o.getSnapshot!==t||i||null!==oY&&1&oY.memoizedState.tag){if(r.flags|=2048,aT(9,{destroy:void 0},am.bind(null,r,o,n,t),null),null===lD)throw Error(l(349));a||0!=(127&oW)||ah(r,t,n)}return n}function ah(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=oG.updateQueue)?(t=aa(),oG.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function am(e,t,n,r){t.value=n,t.getSnapshot=r,av(t)&&ay(e)}function ag(e,t,n){return n(function(){av(t)&&ay(e)})}function av(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!nO(e,n)}catch(e){return!0}}function ay(e){var t=n5(e,2);null!==t&&sl(t,e,2)}function ab(e){var t=ar();if("function"==typeof e){var n=e;if(e=n(),oQ){eh(!0);try{n()}finally{eh(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ac,lastRenderedState:e},t}function ax(e,t,n,r){return e.baseState=n,ad(e,oZ,"function"==typeof r?r:ac)}function aw(e,t,n,r,o){if(a9(e))throw Error(l(485));if(null!==(e=t.action)){var a={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};null!==I.T?n(!0):a.isTransition=!1,r(a),null===(n=t.pending)?(a.next=t.pending=a,ak(t,a)):(a.next=n.next,t.pending=n.next=a)}}function ak(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var a=I.T,i={};I.T=i;try{var l=n(o,r),s=I.S;null!==s&&s(i,l),aj(e,t,l)}catch(n){aO(e,t,n)}finally{null!==a&&null!==i.types&&(a.types=i.types),I.T=a}}else try{a=n(o,r),aj(e,t,a)}catch(n){aO(e,t,n)}}function aj(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){aS(e,t,n)},function(n){return aO(e,t,n)}):aS(e,t,n)}function aS(e,t,n){t.status="fulfilled",t.value=n,aC(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,ak(e,n)))}function aO(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do t.status="rejected",t.reason=n,aC(t),t=t.next;while(t!==r)}e.action=null}function aC(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function aN(e,t){return t}function aP(e,t){if(rN){var n=lD.formState;if(null!==n){e:{var r=oG;if(rN){if(rC){t:{for(var o=rC,a=rE;8!==o.nodeType;)if(!a||null===(o=cT(o.nextSibling))){o=null;break t}o="F!"===(a=o.data)||"F"===a?o:null}if(o){rC=cT(o.nextSibling),r="F!"===o.data;break e}}rA(r)}r=!1}r&&(t=n[0])}}return(n=ar()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:aN,lastRenderedState:t},n.queue=r,n=a5.bind(null,oG,r),r.dispatch=n,r=ab(!1),a=a8.bind(null,oG,!1,r.queue),r=ar(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=aw.bind(null,oG,o,a,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function aE(e){return a_(ao(),oZ,e)}function a_(e,t,n){if(t=ad(e,t,aN)[0],e=au(ac)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var r=ai(t)}catch(e){if(e===or)throw oa;throw e}else r=t;var o=(t=ao()).queue,a=o.dispatch;return n!==t.memoizedState&&(oG.flags|=2048,aT(9,{destroy:void 0},aA.bind(null,o,n),null)),[r,a,e]}function aA(e,t){e.action=t}function aI(e){var t=ao(),n=oZ;if(null!==n)return a_(t,n,e);ao(),t=t.memoizedState;var r=(n=ao()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function aT(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=oG.updateQueue)&&(t=aa(),oG.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function aR(){return ao().memoizedState}function aM(e,t,n,r){var o=ar();oG.flags|=e,o.memoizedState=aT(1|t,{destroy:void 0},n,void 0===r?null:r)}function az(e,t,n,r){var o=ao();r=void 0===r?null:r;var a=o.memoizedState.inst;null!==oZ&&null!==r&&o5(r,oZ.memoizedState.deps)?o.memoizedState=aT(t,a,n,r):(oG.flags|=e,o.memoizedState=aT(1|t,a,n,r))}function aD(e,t){aM(8390656,8,e,t)}function aL(e,t){az(2048,8,e,t)}function aF(e){var t=ao().memoizedState,n={ref:t,nextImpl:e};oG.flags|=4;var r=oG.updateQueue;if(null===r)r=aa(),oG.updateQueue=r,r.events=[n];else{var o=r.events;null===o?r.events=[n]:o.push(n)}return function(){if(0!=(2&lz))throw Error(l(440));return t.impl.apply(void 0,arguments)}}function a$(e,t){return az(4,2,e,t)}function aU(e,t){return az(4,4,e,t)}function aH(e,t){if("function"==typeof t){var n=t(e=e());return function(){"function"==typeof n?n():t(null)}}if(null!=t)return t.current=e=e(),function(){t.current=null}}function aB(e,t,n){n=null!=n?n.concat([e]):null,az(4,4,aH.bind(null,t,e),n)}function aV(){}function aK(e,t){var n=ao();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&o5(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function aq(e,t){var n=ao();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&o5(t,r[1]))return r[0];if(r=e(),oQ){eh(!0);try{e()}finally{eh(!1)}}return n.memoizedState=[r,t],r}function aW(e,t,n){return void 0===n||0!=(0x40000000&oW)&&0==(261930&lF)?e.memoizedState=t:(e.memoizedState=n,e=si(),oG.lanes|=e,lW|=e,n)}function aG(e,t,n,r){return nO(n,t)?n:null!==oT.current?(nO(e=aW(e,n,r),t)||(iw=!0),e):0==(42&oW)||0!=(0x40000000&oW)&&0==(261930&lF)?(iw=!0,e.memoizedState=n):(e=si(),oG.lanes|=e,lW|=e,t)}function aZ(e,t,n,r,o){var a=T.p;T.p=0!==a&&8>a?a:8;var i=I.T,l={};I.T=l,a8(e,!1,t,n);try{var s=o(),c=I.S;if(null!==c&&c(l,s),null!==s&&"object"==typeof s&&"function"==typeof s.then){var u,d,f=(u=[],d={status:"pending",value:null,reason:null,then:function(e){u.push(e)}},s.then(function(){d.status="fulfilled",d.value=r;for(var e=0;e<u.length;e++)(0,u[e])(r)},function(e){for(d.status="rejected",d.reason=e,e=0;e<u.length;e++)(0,u[e])(void 0)}),d);a6(e,t,f,sa(e))}else a6(e,t,r,sa(e))}catch(n){a6(e,t,{then:function(){},status:"rejected",reason:n},sa())}finally{T.p=a,null!==i&&null!==l.types&&(i.types=l.types),I.T=i}}function aY(){}function aX(e,t,n,r){if(5!==e.tag)throw Error(l(476));var o=aJ(e).queue;aZ(e,o,t,R,null===n?aY:function(){return aQ(e),n(r)})}function aJ(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ac,lastRenderedState:R},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ac,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function aQ(e){var t=aJ(e);null===t.next&&(t=e.alternate.memoizedState),a6(e,t.next.queue,{},sa())}function a0(){return rG(ue)}function a1(){return ao().memoizedState}function a2(){return ao().memoizedState}function a4(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=sa(),r=oO(t,e=oS(n),n);null!==r&&(sl(r,t,n),oC(r,t,n)),t={cache:r1()},e.payload=t;return}t=t.return}}function a3(e,t,n){var r=sa();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},a9(e)?a7(t,n):null!==(n=n3(e,t,n,r))&&(sl(n,e,r),ie(n,t,r))}function a5(e,t,n){a6(e,t,n,sa())}function a6(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(a9(e))a7(t,o);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var i=t.lastRenderedState,l=a(i,n);if(o.hasEagerState=!0,o.eagerState=l,nO(l,i))return n4(e,t,o,0),null===lD&&n2(),!1}catch(e){}finally{}if(null!==(n=n3(e,t,o,r)))return sl(n,e,r),ie(n,t,r),!0}return!1}function a8(e,t,n,r){if(r={lane:2,revertLane:sJ(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},a9(e)){if(t)throw Error(l(479))}else null!==(t=n3(e,n,r,2))&&sl(t,e,2)}function a9(e){var t=e.alternate;return e===oG||null!==t&&t===oG}function a7(e,t){oJ=oX=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ie(e,t,n){if(0!=(4194048&n)){var r=t.lanes;r&=e.pendingLanes,t.lanes=n|=r,eP(e,n)}}var it={readContext:rG,use:al,useCallback:o3,useContext:o3,useEffect:o3,useImperativeHandle:o3,useLayoutEffect:o3,useInsertionEffect:o3,useMemo:o3,useReducer:o3,useRef:o3,useState:o3,useDebugValue:o3,useDeferredValue:o3,useTransition:o3,useSyncExternalStore:o3,useId:o3,useHostTransitionStatus:o3,useFormState:o3,useActionState:o3,useOptimistic:o3,useMemoCache:o3,useCacheRefresh:o3};it.useEffectEvent=o3;var ir={readContext:rG,use:al,useCallback:function(e,t){return ar().memoizedState=[e,void 0===t?null:t],e},useContext:rG,useEffect:aD,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,aM(4194308,4,aH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return aM(4194308,4,e,t)},useInsertionEffect:function(e,t){aM(4,2,e,t)},useMemo:function(e,t){var n=ar();t=void 0===t?null:t;var r=e();if(oQ){eh(!0);try{e()}finally{eh(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ar();if(void 0!==n){var o=n(t);if(oQ){eh(!0);try{n(t)}finally{eh(!1)}}}else o=t;return r.memoizedState=r.baseState=o,r.queue=e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},e=e.dispatch=a3.bind(null,oG,e),[r.memoizedState,e]},useRef:function(e){return ar().memoizedState={current:e}},useState:function(e){var t=(e=ab(e)).queue,n=a5.bind(null,oG,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:aV,useDeferredValue:function(e,t){return aW(ar(),e,t)},useTransition:function(){var e=ab(!1);return e=aZ.bind(null,oG,e.queue,!0,!1),ar().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=oG,o=ar();if(rN){if(void 0===n)throw Error(l(407));n=n()}else{if(n=t(),null===lD)throw Error(l(349));0!=(127&lF)||ah(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,aD(ag.bind(null,r,a,e),[e]),r.flags|=2048,aT(9,{destroy:void 0},am.bind(null,r,a,n,t),null),n},useId:function(){var e=ar(),t=lD.identifierPrefix;if(rN){var n=rb,r=ry;t="_"+t+"R_"+(n=(r&~(1<<32-em(r)-1)).toString(32)+n),0<(n=o0++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=o4++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:a0,useFormState:aP,useActionState:aP,useOptimistic:function(e){var t=ar();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=a8.bind(null,oG,!0,n),n.dispatch=t,[e,t]},useMemoCache:as,useCacheRefresh:function(){return ar().memoizedState=a4.bind(null,oG)},useEffectEvent:function(e){var t=ar(),n={impl:e};return t.memoizedState=n,function(){if(0!=(2&lz))throw Error(l(440));return n.impl.apply(void 0,arguments)}}},io={readContext:rG,use:al,useCallback:aK,useContext:rG,useEffect:aL,useImperativeHandle:aB,useInsertionEffect:a$,useLayoutEffect:aU,useMemo:aq,useReducer:au,useRef:aR,useState:function(){return au(ac)},useDebugValue:aV,useDeferredValue:function(e,t){return aG(ao(),oZ.memoizedState,e,t)},useTransition:function(){var e=au(ac)[0],t=ao().memoizedState;return["boolean"==typeof e?e:ai(e),t]},useSyncExternalStore:ap,useId:a1,useHostTransitionStatus:a0,useFormState:aE,useActionState:aE,useOptimistic:function(e,t){return ax(ao(),oZ,e,t)},useMemoCache:as,useCacheRefresh:a2};io.useEffectEvent=aF;var ia={readContext:rG,use:al,useCallback:aK,useContext:rG,useEffect:aL,useImperativeHandle:aB,useInsertionEffect:a$,useLayoutEffect:aU,useMemo:aq,useReducer:af,useRef:aR,useState:function(){return af(ac)},useDebugValue:aV,useDeferredValue:function(e,t){var n=ao();return null===oZ?aW(n,e,t):aG(n,oZ.memoizedState,e,t)},useTransition:function(){var e=af(ac)[0],t=ao().memoizedState;return["boolean"==typeof e?e:ai(e),t]},useSyncExternalStore:ap,useId:a1,useHostTransitionStatus:a0,useFormState:aI,useActionState:aI,useOptimistic:function(e,t){var n=ao();return null!==oZ?ax(n,oZ,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:as,useCacheRefresh:a2};function ii(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:f({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}ia.useEffectEvent=aF;var il={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=sa(),o=oS(r);o.payload=t,null!=n&&(o.callback=n),null!==(t=oO(e,o,r))&&(sl(t,e,r),oC(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=sa(),o=oS(r);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=oO(e,o,r))&&(sl(t,e,r),oC(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=sa(),r=oS(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=oO(e,r,n))&&(sl(t,e,n),oC(t,e,n))}};function is(e,t,n,r,o,a,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,i):!t.prototype||!t.prototype.isPureReactComponent||!nC(n,r)||!nC(o,a)}function ic(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&il.enqueueReplaceState(t,t.state,null)}function iu(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var o in n===t&&(n=f({},n)),e)void 0===n[o]&&(n[o]=e[o]);return n}function id(e){nJ(e)}function ip(e){console.error(e)}function ih(e){nJ(e)}function im(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ig(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function iv(e,t,n){return(n=oS(n)).tag=3,n.payload={element:null},n.callback=function(){im(e,t)},n}function iy(e){return(e=oS(e)).tag=3,e}function ib(e,t,n,r){var o=n.type.getDerivedStateFromError;if("function"==typeof o){var a=r.value;e.payload=function(){return o(a)},e.callback=function(){ig(t,n,r)}}var i=n.stateNode;null!==i&&"function"==typeof i.componentDidCatch&&(e.callback=function(){ig(t,n,r),"function"!=typeof o&&(null===l5?l5=new Set([this]):l5.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var ix=Error(l(461)),iw=!1;function ik(e,t,n,r){t.child=null===e?ox(t,null,n,r):ob(t,e.child,n,r)}function ij(e,t,n,r,o){n=n.render;var a=t.ref;if("ref"in r){var i={};for(var l in r)"ref"!==l&&(i[l]=r[l])}else i=r;return(rW(t),r=o6(e,t,n,i,a,o),l=ae(),null===e||iw)?(rN&&l&&rk(t),t.flags|=1,ik(e,t,r,o),t.child):(at(e,t,o),iq(e,t,o))}function iS(e,t,n,r,o){if(null===e){var a=n.type;return"function"!=typeof a||rt(a)||void 0!==a.defaultProps||null!==n.compare?((e=ro(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,iO(e,t,a,r,o))}if(a=e.child,!iW(e,o)){var i=a.memoizedProps;if((n=null!==(n=n.compare)?n:nC)(i,r)&&e.ref===t.ref)return iq(e,t,o)}return t.flags|=1,(e=rn(a,r)).ref=t.ref,e.return=t,t.child=e}function iO(e,t,n,r,o){if(null!==e){var a=e.memoizedProps;if(nC(a,r)&&e.ref===t.ref)if(iw=!1,t.pendingProps=r=a,!iW(e,o))return t.lanes=e.lanes,iq(e,t,o);else 0!=(131072&e.flags)&&(iw=!0)}return iI(e,t,n,r,o)}function iC(e,t,n,r){var o=r.children,a=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===r.mode){if(0!=(128&t.flags)){if(a=null!==a?a.baseLanes|n:n,null!==e){for(o=0,r=t.child=e.child;null!==r;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~a}else r=0,t.child=null;return iP(e,t,a,n,r)}if(0==(0x20000000&n))return r=t.lanes=0x20000000,iP(e,t,null!==a?a.baseLanes|n:n,n,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&ot(t,null!==a?a.cachePool:null),null!==a?oM(t,a):oz(),oH(t)}else null!==a?(ot(t,a.cachePool),oM(t,a),oB(t),t.memoizedState=null):(null!==e&&ot(t,null),oz(),oB(t));return ik(e,t,o,n),t.child}function iN(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function iP(e,t,n,r,o){var a=oe();return t.memoizedState={baseLanes:n,cachePool:a=null===a?null:{parent:r0._currentValue,pool:a}},null!==e&&ot(t,null),oz(),oH(t),null!==e&&rK(e,t,r,!0),t.childLanes=o,null}function iE(e,t){return(t=iU({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function i_(e,t,n){return ob(t,e.child,null,n),e=iE(t,t.pendingProps),e.flags|=2,oV(t),t.memoizedState=null,e}function iA(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(l(284));(null===e||e.ref!==n)&&(t.flags|=4194816)}}function iI(e,t,n,r,o){return(rW(t),n=o6(e,t,n,r,void 0,o),r=ae(),null===e||iw)?(rN&&r&&rk(t),t.flags|=1,ik(e,t,n,o),t.child):(at(e,t,o),iq(e,t,o))}function iT(e,t,n,r,o,a){return(rW(t),t.updateQueue=null,n=o9(t,r,n,o),o8(e),r=ae(),null===e||iw)?(rN&&r&&rk(t),t.flags|=1,ik(e,t,n,a),t.child):(at(e,t,a),iq(e,t,a))}function iR(e,t,n,r,o){if(rW(t),null===t.stateNode){var a=n9,i=n.contextType;"object"==typeof i&&null!==i&&(a=rG(i)),t.memoizedState=null!==(a=new n(r,a)).state&&void 0!==a.state?a.state:null,a.updater=il,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=r,a.state=t.memoizedState,a.refs={},ok(t),i=n.contextType,a.context="object"==typeof i&&null!==i?rG(i):n9,a.state=t.memoizedState,"function"==typeof(i=n.getDerivedStateFromProps)&&(ii(t,n,i,r),a.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(i=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),i!==a.state&&il.enqueueReplaceState(a,a.state,null),o_(t,r,a,o),oE(),a.state=t.memoizedState),"function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){a=t.stateNode;var l=t.memoizedProps,s=iu(n,l);a.props=s;var c=a.context,u=n.contextType;i=n9,"object"==typeof u&&null!==u&&(i=rG(u));var d=n.getDerivedStateFromProps;u="function"==typeof d||"function"==typeof a.getSnapshotBeforeUpdate,l=t.pendingProps!==l,u||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(l||c!==i)&&ic(t,a,r,i),ow=!1;var f=t.memoizedState;a.state=f,o_(t,r,a,o),oE(),c=t.memoizedState,l||f!==c||ow?("function"==typeof d&&(ii(t,n,d,r),c=t.memoizedState),(s=ow||is(t,n,s,r,f,c,i))?(u||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=i,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,oj(e,t),u=iu(n,i=t.memoizedProps),a.props=u,d=t.pendingProps,f=a.context,c=n.contextType,s=n9,"object"==typeof c&&null!==c&&(s=rG(c)),(c="function"==typeof(l=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(i!==d||f!==s)&&ic(t,a,r,s),ow=!1,f=t.memoizedState,a.state=f,o_(t,r,a,o),oE();var p=t.memoizedState;i!==d||f!==p||ow||null!==e&&null!==e.dependencies&&rq(e.dependencies)?("function"==typeof l&&(ii(t,n,l,r),p=t.memoizedState),(u=ow||is(t,n,u,r,f,p,s)||null!==e&&null!==e.dependencies&&rq(e.dependencies))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,s),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,s)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=s,r=u):("function"!=typeof a.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,iA(e,t),r=0!=(128&t.flags),a||r?(a=t.stateNode,n=r&&"function"!=typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&r?(t.child=ob(t,e.child,null,o),t.child=ob(t,null,n,o)):ik(e,t,n,o),t.memoizedState=a.state,e=t.child):e=iq(e,t,o),e}function iM(e,t,n,r){return rM(),t.flags|=256,ik(e,t,n,r),t.child}var iz={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function iD(e){return{baseLanes:e,cachePool:on()}}function iL(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=lY),e}function iF(e,t,n){var r,o=t.pendingProps,a=!1,i=0!=(128&t.flags);if((r=i)||(r=(null===e||null!==e.memoizedState)&&0!=(2&oK.current)),r&&(a=!0,t.flags&=-129),r=0!=(32&t.flags),t.flags&=-33,null===e){if(rN){if(a?o$(t):oB(t),(e=rC)?null!==(e=null!==(e=c_(e,rE))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==rv?{id:ry,overflow:rb}:null,retryLane:0x20000000,hydrationErrors:null},(n=rl(e)).return=t,t.child=n,rO=t,rC=null):e=null,null===e)throw rA(t);return cI(e)?t.lanes=32:t.lanes=0x20000000,null}var s=o.children;return(o=o.fallback,a)?(oB(t),s=iU({mode:"hidden",children:s},a=t.mode),o=ra(o,a,n,null),s.return=t,o.return=t,s.sibling=o,t.child=s,(o=t.child).memoizedState=iD(n),o.childLanes=iL(e,r,n),t.memoizedState=iz,iN(null,o)):(o$(t),i$(t,s))}var c=e.memoizedState;if(null!==c&&null!==(s=c.dehydrated)){if(i)256&t.flags?(o$(t),t.flags&=-257,t=iH(e,t,n)):null!==t.memoizedState?(oB(t),t.child=e.child,t.flags|=128,t=null):(oB(t),s=o.fallback,a=t.mode,o=iU({mode:"visible",children:o.children},a),s=ra(s,a,n,null),s.flags|=2,o.return=t,s.return=t,o.sibling=s,t.child=o,ob(t,e.child,null,n),(o=t.child).memoizedState=iD(n),o.childLanes=iL(e,r,n),t.memoizedState=iz,t=iN(null,o));else if(o$(t),cI(s)){if(r=s.nextSibling&&s.nextSibling.dataset)var u=r.dgst;r=u,(o=Error(l(419))).stack="",o.digest=r,rD({value:o,source:null,stack:null}),t=iH(e,t,n)}else if(iw||rK(e,t,n,!1),r=0!=(n&e.childLanes),iw||r){if(null!==(r=lD)&&0!==(o=eE(r,n))&&o!==c.retryLane)throw c.retryLane=o,n5(e,o),sl(r,e,o),ix;cA(s)||sy(),t=iH(e,t,n)}else cA(s)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,rC=cT(s.nextSibling),rO=t,rN=!0,rP=null,rE=!1,null!==e&&rS(t,e),t=i$(t,o.children),t.flags|=4096);return t}return a?(oB(t),s=o.fallback,a=t.mode,u=(c=e.child).sibling,(o=rn(c,{mode:"hidden",children:o.children})).subtreeFlags=0x3e00000&c.subtreeFlags,null!==u?s=rn(u,s):(s=ra(s,a,n,null),s.flags|=2),s.return=t,o.return=t,o.sibling=s,t.child=o,iN(null,o),o=t.child,null===(s=e.child.memoizedState)?s=iD(n):(null!==(a=s.cachePool)?(c=r0._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=on(),s={baseLanes:s.baseLanes|n,cachePool:a}),o.memoizedState=s,o.childLanes=iL(e,r,n),t.memoizedState=iz,iN(e.child,o)):(o$(t),e=(n=e.child).sibling,(n=rn(n,{mode:"visible",children:o.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function i$(e,t){return(t=iU({mode:"visible",children:t},e.mode)).return=e,e.child=t}function iU(e,t){return(e=re(22,e,null,t)).lanes=0,e}function iH(e,t,n){return ob(t,e.child,null,n),e=i$(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function iB(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),rB(e.return,t,n)}function iV(e,t,n,r,o,a){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o,i.treeForkCount=a)}function iK(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;r=r.children;var i=oK.current,l=0!=(2&i);if(l?(i=1&i|2,t.flags|=128):i&=1,F(oK,i),ik(e,t,r,n),r=rN?rh:0,!l&&null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&iB(e,n,t);else if(19===e.tag)iB(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(o=null,n=t.child;null!==n;)null!==(e=n.alternate)&&null===oq(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),iV(t,!1,o,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===oq(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}iV(t,!0,n,null,a,r);break;case"together":iV(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function iq(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),lW|=t.lanes,0==(n&t.childLanes)){if(null===e)return null;else if(rK(e,t,n,!1),0==(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(l(153));if(null!==t.child){for(n=rn(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=rn(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function iW(e,t){return 0!=(e.lanes&t)||!!(null!==(e=e.dependencies)&&rq(e))}function iG(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)iw=!0;else{if(!iW(e,n)&&0==(128&t.flags))return iw=!1,function(e,t,n){switch(t.tag){case 3:V(t,t.stateNode.containerInfo),rU(t,r0,e.memoizedState.cache),rM();break;case 27:case 5:q(t);break;case 4:V(t,t.stateNode.containerInfo);break;case 10:rU(t,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,oU(t),null;break;case 13:var r=t.memoizedState;if(null!==r){if(null!==r.dehydrated)return o$(t),t.flags|=128,null;if(0!=(n&t.child.childLanes))return iF(e,t,n);return o$(t),null!==(e=iq(e,t,n))?e.sibling:null}o$(t);break;case 19:var o=0!=(128&e.flags);if((r=0!=(n&t.childLanes))||(rK(e,t,n,!1),r=0!=(n&t.childLanes)),o){if(r)return iK(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),F(oK,oK.current),!r)return null;break;case 22:return t.lanes=0,iC(e,t,n,t.pendingProps);case 24:rU(t,r0,e.memoizedState.cache)}return iq(e,t,n)}(e,t,n);iw=0!=(131072&e.flags)}else iw=!1,rN&&0!=(1048576&t.flags)&&rw(t,rh,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=oc(t.elementType),t.type=e,"function"==typeof e)rt(e)?(r=iu(e,r),t.tag=1,t=iR(null,t,e,r,n)):(t.tag=0,t=iI(null,t,e,r,n));else{if(null!=e){var o=e.$$typeof;if(o===w){t.tag=11,t=ij(null,t,e,r,n);break e}if(o===S){t.tag=14,t=iS(null,t,e,r,n);break e}}throw Error(l(306,t=function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===_?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case g:return"Fragment";case y:return"Profiler";case v:return"StrictMode";case k:return"Suspense";case j:return"SuspenseList";case C:return"Activity"}if("object"==typeof t)switch(t.$$typeof){case m:return"Portal";case x:return t.displayName||"Context";case b:return(t._context.displayName||"Context")+".Consumer";case w:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case S:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case O:n=t._payload,t=t._init;try{return e(t(n))}catch(e){}}return null}(e)||e,""))}}return t;case 0:return iI(e,t,t.type,t.pendingProps,n);case 1:return o=iu(r=t.type,t.pendingProps),iR(e,t,r,o,n);case 3:e:{if(V(t,t.stateNode.containerInfo),null===e)throw Error(l(387));r=t.pendingProps;var a=t.memoizedState;o=a.element,oj(e,t),o_(t,r,null,n);var i=t.memoizedState;if(rU(t,r0,r=i.cache),r!==a.cache&&rV(t,[r0],n,!0),oE(),r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=iM(e,t,r,n);break e}else if(r!==o){rD(o=ru(Error(l(424)),t)),t=iM(e,t,r,n);break e}else for(rC=cT((e=9===(e=t.stateNode.containerInfo).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e).firstChild),rO=t,rN=!0,rP=null,rE=!0,n=ox(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling;else{if(rM(),r===o){t=iq(e,t,n);break e}ik(e,t,r,n)}t=t.child}return t;case 26:return iA(e,t),null===e?(n=cK(t.type,null,t.pendingProps,null))?t.memoizedState=n:rN||(n=t.type,e=t.pendingProps,(r=cg(H.current).createElement(n))[eM]=t,r[ez]=e,cf(r,n,e),eG(r),t.stateNode=r):t.memoizedState=cK(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return q(t),null===e&&rN&&(r=t.stateNode=cD(t.type,t.pendingProps,H.current),rO=t,rE=!0,o=rC,cC(t.type)?(cR=o,rC=cT(r.firstChild)):rC=o),ik(e,t,t.pendingProps.children,n),iA(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&rN&&((o=r=rC)&&(null!==(r=function(e,t,n,r){for(;1===e.nodeType;){if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[eH])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(o=e.getAttribute("rel"))&&e.hasAttribute("data-precedence")||o!==n.rel||e.getAttribute("href")!==(null==n.href||""===n.href?null:n.href)||e.getAttribute("crossorigin")!==(null==n.crossOrigin?null:n.crossOrigin)||e.getAttribute("title")!==(null==n.title?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((o=e.getAttribute("src"))!==(null==n.src?null:n.src)||e.getAttribute("type")!==(null==n.type?null:n.type)||e.getAttribute("crossorigin")!==(null==n.crossOrigin?null:n.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var o=null==n.name?null:""+n.name;if("hidden"===n.type&&e.getAttribute("name")===o)return e}if(null===(e=cT(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,rE))?(t.stateNode=r,rO=t,rC=cT(r.firstChild),rE=!1,o=!0):o=!1),o||rA(t)),q(t),o=t.type,a=t.pendingProps,i=null!==e?e.memoizedProps:null,r=a.children,cb(o,a)?r=null:null!==i&&cb(o,i)&&(t.flags|=32),null!==t.memoizedState&&(ue._currentValue=o=o6(e,t,o7,null,null,n)),iA(e,t),ik(e,t,r,n),t.child;case 6:return null===e&&rN&&((e=n=rC)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;)if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n||null===(e=cT(e.nextSibling)))return null;return e}(n,t.pendingProps,rE))?(t.stateNode=n,rO=t,rC=null,e=!0):e=!1),e||rA(t)),null;case 13:return iF(e,t,n);case 4:return V(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ob(t,null,r,n):ik(e,t,r,n),t.child;case 11:return ij(e,t,t.type,t.pendingProps,n);case 7:return ik(e,t,t.pendingProps,n),t.child;case 8:case 12:return ik(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,rU(t,t.type,r.value),ik(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,rW(t),r=r(o=rG(o)),t.flags|=1,ik(e,t,r,n),t.child;case 14:return iS(e,t,t.type,t.pendingProps,n);case 15:return iO(e,t,t.type,t.pendingProps,n);case 19:return iK(e,t,n);case 31:var s=e,c=t,u=n,d=c.pendingProps,f=0!=(128&c.flags);if(c.flags&=-129,null===s){if(rN){if("hidden"===d.mode)return s=iE(c,d),c.lanes=0x20000000,iN(null,s);if(oU(c),(s=rC)?null!==(s=null!==(s=c_(s,rE))&&"&"===s.data?s:null)&&(c.memoizedState={dehydrated:s,treeContext:null!==rv?{id:ry,overflow:rb}:null,retryLane:0x20000000,hydrationErrors:null},(u=rl(s)).return=c,c.child=u,rO=c,rC=null):s=null,null===s)throw rA(c);return c.lanes=0x20000000,null}return iE(c,d)}var p=s.memoizedState;if(null!==p){var h=p.dehydrated;if(oU(c),f)if(256&c.flags)c.flags&=-257,c=i_(s,c,u);else if(null!==c.memoizedState)c.child=s.child,c.flags|=128,c=null;else throw Error(l(558));else if(iw||rK(s,c,u,!1),f=0!=(u&s.childLanes),iw||f){if(null!==(d=lD)&&0!==(h=eE(d,u))&&h!==p.retryLane)throw p.retryLane=h,n5(s,h),sl(d,s,h),ix;sy(),c=i_(s,c,u)}else s=p.treeContext,rC=cT(h.nextSibling),rO=c,rN=!0,rP=null,rE=!1,null!==s&&rS(c,s),c=iE(c,d),c.flags|=4096;return c}return(s=rn(s.child,{mode:d.mode,children:d.children})).ref=c.ref,c.child=s,s.return=c,s;case 22:return iC(e,t,n,t.pendingProps);case 24:return rW(t),r=rG(r0),null===e?(null===(o=oe())&&(o=lD,a=r1(),o.pooledCache=a,a.refCount++,null!==a&&(o.pooledCacheLanes|=n),o=a),t.memoizedState={parent:r,cache:o},ok(t),rU(t,r0,o)):(0!=(e.lanes&n)&&(oj(e,t),o_(t,null,null,n),oE()),o=e.memoizedState,a=t.memoizedState,o.parent!==r?(o={parent:r,cache:r},t.memoizedState=o,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=o),rU(t,r0,r)):(rU(t,r0,r=a.cache),r!==o.cache&&rV(t,[r0],n,!0))),ik(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function iZ(e){e.flags|=4}function iY(e,t,n,r,o){if((t=0!=(32&e.mode))&&(t=!1),t){if(e.flags|=0x1000000,(0x13ffff40&o)===o)if(e.stateNode.complete)e.flags|=8192;else if(sm())e.flags|=8192;else throw ou=oi,oo}else e.flags&=-0x1000001}function iX(e,t){if("stylesheet"!==t.type||0!=(4&t.state.loading))e.flags&=-0x1000001;else if(e.flags|=0x1000000,!c3(t))if(sm())e.flags|=8192;else throw ou=oi,oo}function iJ(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?eS():0x20000000,e.lanes|=t,lX|=t)}function iQ(e,t){if(!rN)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function i0(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=0x3e00000&o.subtreeFlags,r|=0x3e00000&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function i1(e,t){switch(rj(t),t.tag){case 3:rH(r0),K();break;case 26:case 27:case 5:W(t);break;case 4:K();break;case 31:null!==t.memoizedState&&oV(t);break;case 13:oV(t);break;case 19:L(oK);break;case 10:rH(t.type);break;case 22:case 23:oV(t),oD(),null!==e&&L(r7);break;case 24:rH(r0)}}function i2(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var o=r.next;n=o;do{if((n.tag&e)===e){r=void 0;var a=n.create;n.inst.destroy=r=a()}n=n.next}while(n!==o)}}catch(e){sT(t,t.return,e)}}function i4(e,t,n){try{var r=t.updateQueue,o=null!==r?r.lastEffect:null;if(null!==o){var a=o.next;r=a;do{if((r.tag&e)===e){var i=r.inst,l=i.destroy;if(void 0!==l){i.destroy=void 0,o=t;try{l()}catch(e){sT(o,n,e)}}}r=r.next}while(r!==a)}}catch(e){sT(t,t.return,e)}}function i3(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{oI(t,n)}catch(t){sT(e,e.return,t)}}}function i5(e,t,n){n.props=iu(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){sT(e,t,n)}}function i6(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){sT(e,t,n)}}function i8(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){sT(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){sT(e,t,n)}else n.current=null}function i9(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){sT(e,e.return,t)}}function i7(e,t,n){try{var r=e.stateNode;(function(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 o=null,a=null,i=null,s=null,c=null,u=null,d=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&null!=f)switch(h){case"checked":case"value":break;case"defaultValue":c=f;default:r.hasOwnProperty(h)||cu(e,t,h,null,r,f)}}for(var p in r){var h=r[p];if(f=n[p],r.hasOwnProperty(p)&&(null!=h||null!=f))switch(p){case"type":a=h;break;case"name":o=h;break;case"checked":u=h;break;case"defaultChecked":d=h;break;case"value":i=h;break;case"defaultValue":s=h;break;case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(l(137,t));break;default:h!==f&&cu(e,t,p,h,r,f)}}tn(e,i,s,c,u,d,a,o);return;case"select":for(a in h=i=s=p=null,n)if(c=n[a],n.hasOwnProperty(a)&&null!=c)switch(a){case"value":break;case"multiple":h=c;default:r.hasOwnProperty(a)||cu(e,t,a,null,r,c)}for(o in r)if(a=r[o],c=n[o],r.hasOwnProperty(o)&&(null!=a||null!=c))switch(o){case"value":p=a;break;case"defaultValue":s=a;break;case"multiple":i=a;default:a!==c&&cu(e,t,o,a,r,c)}t=s,n=i,r=h,null!=p?ta(e,!!n,p,!1):!!r!=!!n&&(null!=t?ta(e,!!n,t,!0):ta(e,!!n,n?[]:"",!1));return;case"textarea":for(s in h=p=null,n)if(o=n[s],n.hasOwnProperty(s)&&null!=o&&!r.hasOwnProperty(s))switch(s){case"value":case"children":break;default:cu(e,t,s,null,r,o)}for(i in r)if(o=r[i],a=n[i],r.hasOwnProperty(i)&&(null!=o||null!=a))switch(i){case"value":p=o;break;case"defaultValue":h=o;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=o)throw Error(l(91));break;default:o!==a&&cu(e,t,i,o,r,a)}ti(e,p,h);return;case"option":for(var m in n)p=n[m],n.hasOwnProperty(m)&&null!=p&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:cu(e,t,m,null,r,p));for(c in r)p=r[c],h=n[c],r.hasOwnProperty(c)&&p!==h&&(null!=p||null!=h)&&("selected"===c?e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p:cu(e,t,c,p,r,h));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)&&null!=p&&!r.hasOwnProperty(g)&&cu(e,t,g,null,r,p);for(u in r)if(p=r[u],h=n[u],r.hasOwnProperty(u)&&p!==h&&(null!=p||null!=h))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(l(137,t));break;default:cu(e,t,u,p,r,h)}return;default:if(tf(t)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&void 0!==p&&!r.hasOwnProperty(v)&&cd(e,t,v,void 0,r,p);for(d in r)p=r[d],h=n[d],r.hasOwnProperty(d)&&p!==h&&(void 0!==p||void 0!==h)&&cd(e,t,d,p,r,h);return}}for(var y in n)p=n[y],n.hasOwnProperty(y)&&null!=p&&!r.hasOwnProperty(y)&&cu(e,t,y,null,r,p);for(f in r)p=r[f],h=n[f],r.hasOwnProperty(f)&&p!==h&&(null!=p||null!=h)&&cu(e,t,f,p,r,h)})(r,e.type,n,t),r[ez]=t}catch(t){sT(e,e.return,t)}}function le(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&cC(e.type)||4===e.tag}function lt(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||le(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&cC(e.type)||2&e.flags||null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ln(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&cC(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(ln(e,t,n),e=e.sibling;null!==e;)ln(e,t,n),e=e.sibling}function lr(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);cf(t,r,n),t[eM]=e,t[ez]=n}catch(t){sT(e,e.return,t)}}var lo=!1,la=!1,li=!1,ll="function"==typeof WeakSet?WeakSet:Set,ls=null;function lc(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:lw(e,n),4&r&&i2(5,n);break;case 1:if(lw(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){sT(n,n.return,e)}else{var o=iu(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){sT(n,n.return,e)}}64&r&&i3(n),512&r&&i6(n,n.return);break;case 3:if(lw(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{oI(e,t)}catch(e){sT(n,n.return,e)}}break;case 27:null===t&&4&r&&lr(n);case 26:case 5:lw(e,n),null===t&&4&r&&i9(n),512&r&&i6(n,n.return);break;case 12:default:lw(e,n);break;case 31:lw(e,n),4&r&&lh(e,n);break;case 13:lw(e,n),4&r&&lm(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=sD.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||lo)){t=null!==t&&null!==t.memoizedState||la,o=lo;var a=la;lo=r,(la=t)&&!a?function e(t,n,r){for(r=r&&0!=(8772&n.subtreeFlags),n=n.child;null!==n;){var o=n.alternate,a=t,i=n,l=i.flags;switch(i.tag){case 0:case 11:case 15:e(a,i,r),i2(4,i);break;case 1:if(e(a,i,r),"function"==typeof(a=(o=i).stateNode).componentDidMount)try{a.componentDidMount()}catch(e){sT(o,o.return,e)}if(null!==(a=(o=i).updateQueue)){var s=o.stateNode;try{var c=a.shared.hiddenCallbacks;if(null!==c)for(a.shared.hiddenCallbacks=null,a=0;a<c.length;a++)oA(c[a],s)}catch(e){sT(o,o.return,e)}}r&&64&l&&i3(i),i6(i,i.return);break;case 27:lr(i);case 26:case 5:e(a,i,r),r&&null===o&&4&l&&i9(i),i6(i,i.return);break;case 12:default:e(a,i,r);break;case 31:e(a,i,r),r&&4&l&&lh(a,i);break;case 13:e(a,i,r),r&&4&l&&lm(a,i);break;case 22:null===i.memoizedState&&e(a,i,r),i6(i,i.return);case 30:}n=n.sibling}}(e,n,0!=(8772&n.subtreeFlags)):lw(e,n),lo=o,la=a}case 30:}}var lu=null,ld=!1;function lf(e,t,n){for(n=n.child;null!==n;)lp(e,t,n),n=n.sibling}function lp(e,t,n){if(ep&&"function"==typeof ep.onCommitFiberUnmount)try{ep.onCommitFiberUnmount(ef,n)}catch(e){}switch(n.tag){case 26:la||i8(n,t),lf(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:la||i8(n,t);var r=lu,o=ld;cC(n.type)&&(lu=n.stateNode,ld=!1),lf(e,t,n),cL(n.stateNode),lu=r,ld=o;break;case 5:la||i8(n,t);case 6:if(r=lu,o=ld,lu=null,lf(e,t,n),lu=r,ld=o,null!==lu)if(ld)try{(9===lu.nodeType?lu.body:"HTML"===lu.nodeName?lu.ownerDocument.body:lu).removeChild(n.stateNode)}catch(e){sT(n,t,e)}else try{lu.removeChild(n.stateNode)}catch(e){sT(n,t,e)}break;case 18:null!==lu&&(ld?(cN(9===(e=lu).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),uI(e)):cN(lu,n.stateNode));break;case 4:r=lu,o=ld,lu=n.stateNode.containerInfo,ld=!0,lf(e,t,n),lu=r,ld=o;break;case 0:case 11:case 14:case 15:i4(2,n,t),la||i4(4,n,t),lf(e,t,n);break;case 1:la||(i8(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&i5(n,t,r)),lf(e,t,n);break;case 21:default:lf(e,t,n);break;case 22:la=(r=la)||null!==n.memoizedState,lf(e,t,n),la=r}}function lh(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{uI(e)}catch(e){sT(t,t.return,e)}}}function lm(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{uI(e)}catch(e){sT(t,t.return,e)}}function lg(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new ll),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new ll),t;default:throw Error(l(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=sL.bind(null,e,t);t.then(r,r)}})}function lv(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r],a=e,i=t,s=i;e:for(;null!==s;){switch(s.tag){case 27:if(cC(s.type)){lu=s.stateNode,ld=!1;break e}break;case 5:lu=s.stateNode,ld=!1;break e;case 3:case 4:lu=s.stateNode.containerInfo,ld=!0;break e}s=s.return}if(null===lu)throw Error(l(160));lp(a,i,o),lu=null,ld=!1,null!==(a=o.alternate)&&(a.return=null),o.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)lb(t,e),t=t.sibling}var ly=null;function lb(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:lv(t,e),lx(e),4&r&&(i4(3,e,e.return),i2(3,e),i4(5,e,e.return));break;case 1:lv(t,e),lx(e),512&r&&(la||null===n||i8(n,n.return)),64&r&&lo&&null!==(e=e.updateQueue)&&null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r));break;case 26:var o=ly;if(lv(t,e),lx(e),512&r&&(la||null===n||i8(n,n.return)),4&r){var a=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(r){case"title":(!(a=o.getElementsByTagName("title")[0])||a[eH]||a[eM]||"http://www.w3.org/2000/svg"===a.namespaceURI||a.hasAttribute("itemprop"))&&(a=o.createElement(r),o.head.insertBefore(a,o.querySelector("head > title"))),cf(a,r,n),a[eM]=e,eG(a),r=a;break e;case"link":var i=c2("link","href",o).get(r+(n.href||""));if(i){for(var s=0;s<i.length;s++)if((a=i[s]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&a.getAttribute("rel")===(null==n.rel?null:n.rel)&&a.getAttribute("title")===(null==n.title?null:n.title)&&a.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){i.splice(s,1);break t}}cf(a=o.createElement(r),r,n),o.head.appendChild(a);break;case"meta":if(i=c2("meta","content",o).get(r+(n.content||""))){for(s=0;s<i.length;s++)if((a=i[s]).getAttribute("content")===(null==n.content?null:""+n.content)&&a.getAttribute("name")===(null==n.name?null:n.name)&&a.getAttribute("property")===(null==n.property?null:n.property)&&a.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&a.getAttribute("charset")===(null==n.charSet?null:n.charSet)){i.splice(s,1);break t}}cf(a=o.createElement(r),r,n),o.head.appendChild(a);break;default:throw Error(l(468,r))}a[eM]=e,eG(a),r=a}e.stateNode=r}else c4(o,e.type,e.stateNode);else e.stateNode=cX(o,r,e.memoizedProps);else a!==r?(null===a?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):a.count--,null===r?c4(o,e.type,e.stateNode):cX(o,r,e.memoizedProps)):null===r&&null!==e.stateNode&&i7(e,e.memoizedProps,n.memoizedProps)}break;case 27:lv(t,e),lx(e),512&r&&(la||null===n||i8(n,n.return)),null!==n&&4&r&&i7(e,e.memoizedProps,n.memoizedProps);break;case 5:if(lv(t,e),lx(e),512&r&&(la||null===n||i8(n,n.return)),32&e.flags){o=e.stateNode;try{ts(o,"")}catch(t){sT(e,e.return,t)}}4&r&&null!=e.stateNode&&(o=e.memoizedProps,i7(e,o,null!==n?n.memoizedProps:o)),1024&r&&(li=!0);break;case 6:if(lv(t,e),lx(e),4&r){if(null===e.stateNode)throw Error(l(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){sT(e,e.return,t)}}break;case 3:if(c1=null,o=ly,ly=cU(t.containerInfo),lv(t,e),ly=o,lx(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{uI(t.containerInfo)}catch(t){sT(e,e.return,t)}li&&(li=!1,function e(t){if(1024&t.subtreeFlags)for(t=t.child;null!==t;){var n=t;e(n),5===n.tag&&1024&n.flags&&n.stateNode.reset(),t=t.sibling}}(e));break;case 4:r=ly,ly=cU(e.stateNode.containerInfo),lv(t,e),lx(e),ly=r;break;case 12:default:lv(t,e),lx(e);break;case 31:case 19:lv(t,e),lx(e),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,lg(e,r));break;case 13:lv(t,e),lx(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(l1=er()),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,lg(e,r));break;case 22:o=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=lo,d=la;if(lo=u||o,la=d||c,lv(t,e),la=d,lo=u,lx(e),8192&r)e:for((t=e.stateNode)._visibility=o?-2&t._visibility:1|t._visibility,o&&(null===n||c||lo||la||function e(t){for(t=t.child;null!==t;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:i4(4,n,n.return),e(n);break;case 1:i8(n,n.return);var r=n.stateNode;"function"==typeof r.componentWillUnmount&&i5(n,n.return,r),e(n);break;case 27:cL(n.stateNode);case 26:case 5:i8(n,n.return),e(n);break;case 22:null===n.memoizedState&&e(n);break;default:e(n)}t=t.sibling}}(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(a=c.stateNode,o)i=a.style,"function"==typeof i.setProperty?i.setProperty("display","none","important"):i.display="none";else{s=c.stateNode;var f=c.memoizedProps.style,p=null!=f&&f.hasOwnProperty("display")?f.display:null;s.style.display=null==p||"boolean"==typeof p?"":(""+p).trim()}}catch(e){sT(c,c.return,e)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=o?"":c.memoizedProps}catch(e){sT(c,c.return,e)}}}else if(18===t.tag){if(null===n){c=t;try{var h=c.stateNode;o?cP(h,!0):cP(c.stateNode,!1)}catch(e){sT(c,c.return,e)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&null!==(r=e.updateQueue)&&null!==(n=r.retryQueue)&&(r.retryQueue=null,lg(e,n));case 30:case 21:}}function lx(e){var t=e.flags;if(2&t){try{for(var n,r=e.return;null!==r;){if(le(r)){n=r;break}r=r.return}if(null==n)throw Error(l(160));switch(n.tag){case 27:var o=n.stateNode,a=lt(e);ln(e,a,o);break;case 5:var i=n.stateNode;32&n.flags&&(ts(i,""),n.flags&=-33);var s=lt(e);ln(e,s,i);break;case 3:case 4:var c=n.stateNode.containerInfo,u=lt(e);!function e(t,n,r){var o=t.tag;if(5===o||6===o)t=t.stateNode,n?(9===r.nodeType?r.body:"HTML"===r.nodeName?r.ownerDocument.body:r).insertBefore(t,n):((n=9===r.nodeType?r.body:"HTML"===r.nodeName?r.ownerDocument.body:r).appendChild(t),null!=(r=r._reactRootContainer)||null!==n.onclick||(n.onclick=tg));else if(4!==o&&(27===o&&cC(t.type)&&(r=t.stateNode,n=null),null!==(t=t.child)))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,u,c);break;default:throw Error(l(161))}}catch(t){sT(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function lw(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)lc(e,t.alternate,t),t=t.sibling}function lk(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&r2(n))}function lj(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&r2(e))}function lS(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)lO(e,t,n,r),t=t.sibling}function lO(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:lS(e,t,n,r),2048&o&&i2(9,t);break;case 1:case 31:case 13:default:lS(e,t,n,r);break;case 3:lS(e,t,n,r),2048&o&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&r2(e)));break;case 12:if(2048&o){lS(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,i=a.id,l=a.onPostCommit;"function"==typeof l&&l(i,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(e){sT(t,t.return,e)}}else lS(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,i=t.alternate,null!==t.memoizedState?2&a._visibility?lS(e,t,n,r):lC(e,t):2&a._visibility?lS(e,t,n,r):(a._visibility|=2,function e(t,n,r,o,a){for(a=a&&0!=(10256&n.subtreeFlags),n=n.child;null!==n;){var i=n,l=i.flags;switch(i.tag){case 0:case 11:case 15:e(t,i,r,o,a),i2(8,i);break;case 23:break;case 22:var s=i.stateNode;null!==i.memoizedState?2&s._visibility?e(t,i,r,o,a):lC(t,i):(s._visibility|=2,e(t,i,r,o,a)),a&&2048&l&&lk(i.alternate,i);break;case 24:e(t,i,r,o,a),a&&2048&l&&lj(i.alternate,i);break;default:e(t,i,r,o,a)}n=n.sibling}}(e,t,n,r,0!=(10256&t.subtreeFlags))),2048&o&&lk(i,t);break;case 24:lS(e,t,n,r),2048&o&&lj(t.alternate,t)}}function lC(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=t,r=n.flags;switch(n.tag){case 22:lC(e,n),2048&r&&lk(n.alternate,n);break;case 24:lC(e,n),2048&r&&lj(n.alternate,n);break;default:lC(e,n)}t=t.sibling}}var lN=8192;function lP(e,t,n){if(e.subtreeFlags&lN)for(e=e.child;null!==e;)lE(e,t,n),e=e.sibling}function lE(e,t,n){switch(e.tag){case 26:lP(e,t,n),e.flags&lN&&null!==e.memoizedState&&function(e,t,n,r){if("stylesheet"===n.type&&("string"!=typeof r.media||!1!==matchMedia(r.media).matches)&&0==(4&n.state.loading)){if(null===n.instance){var o=cq(r.href),a=t.querySelector(cW(o));if(a){null!==(t=a._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=c6.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,eG(a);return}a=t.ownerDocument||t,r=cG(r),(o=cF.get(o))&&cQ(r,o),eG(a=a.createElement("link"));var i=a;i._p=new Promise(function(e,t){i.onload=e,i.onerror=t}),cf(a,"link",r),n.instance=a}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&0==(3&n.state.loading)&&(e.count++,n=c6.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,ly,e.memoizedState,e.memoizedProps);break;case 5:default:lP(e,t,n);break;case 3:case 4:var r=ly;ly=cU(e.stateNode.containerInfo),lP(e,t,n),ly=r;break;case 22:null===e.memoizedState&&(null!==(r=e.alternate)&&null!==r.memoizedState?(r=lN,lN=0x1000000,lP(e,t,n),lN=r):lP(e,t,n))}}function l_(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(null!==e)}}function lA(e){var t=e.deletions;if(0!=(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];ls=r,lT(r,e)}l_(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)lI(e),e=e.sibling}function lI(e){switch(e.tag){case 0:case 11:case 15:lA(e),2048&e.flags&&i4(9,e,e.return);break;case 3:case 12:default:lA(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,function e(t){var n=t.deletions;if(0!=(16&t.flags)){if(null!==n)for(var r=0;r<n.length;r++){var o=n[r];ls=o,lT(o,t)}l_(t)}for(t=t.child;null!==t;){switch((n=t).tag){case 0:case 11:case 15:i4(8,n,n.return),e(n);break;case 22:2&(r=n.stateNode)._visibility&&(r._visibility&=-3,e(n));break;default:e(n)}t=t.sibling}}(e)):lA(e)}}function lT(e,t){for(;null!==ls;){var n=ls;switch(n.tag){case 0:case 11:case 15:i4(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:r2(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,ls=r;else for(n=e;null!==ls;){var o=(r=ls).sibling,a=r.return;if(!function e(t){var n=t.alternate;null!==n&&(t.alternate=null,e(n)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(n=t.stateNode)&&eB(n),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}(r),r===n){ls=null;break}if(null!==o){o.return=a,ls=o;break}ls=a}}}var lR={getCacheForType:function(e){var t=rG(r0),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return rG(r0).controller.signal}},lM="function"==typeof WeakMap?WeakMap:Map,lz=0,lD=null,lL=null,lF=0,l$=0,lU=null,lH=!1,lB=!1,lV=!1,lK=0,lq=0,lW=0,lG=0,lZ=0,lY=0,lX=0,lJ=null,lQ=null,l0=!1,l1=0,l2=0,l4=1/0,l3=null,l5=null,l6=0,l8=null,l9=null,l7=0,se=0,st=null,sn=null,sr=0,so=null;function sa(){return 0!=(2&lz)&&0!==lF?lF&-lF:null!==I.T?sJ():eI()}function si(){if(0===lY)if(0==(0x20000000&lF)||rN){var e=eb;0==(3932160&(eb<<=1))&&(eb=262144),lY=e}else lY=0x20000000;return null!==(e=oL.current)&&(e.flags|=32),lY}function sl(e,t,n){(e===lD&&(2===l$||9===l$)||null!==e.cancelPendingCommit)&&(sp(e,0),su(e,lF,lY,!1)),eC(e,n),(0==(2&lz)||e!==lD)&&(e===lD&&(0==(2&lz)&&(lG|=n),4===lq&&su(e,lF,lY,!1)),sK(e))}function ss(e,t,n){if(0!=(6&lz))throw Error(l(327));for(var r=!n&&0==(127&t)&&0==(t&e.expiredLanes)||ej(e,t),o=r?function(e,t){var n=lz;lz|=2;var r=sg(),o=sv();lD!==e||lF!==t?(l3=null,l4=er()+500,sp(e,t)):lB=ej(e,t);e:for(;;)try{if(0!==l$&&null!==lL){t=lL;var a=lU;t:switch(l$){case 1:l$=0,lU=null,sk(e,t,a,1);break;case 2:case 9:if(ol(a)){l$=0,lU=null,sw(t);break}t=function(){2!==l$&&9!==l$||lD!==e||(l$=7),sK(e)},a.then(t,t);break e;case 3:l$=7;break e;case 4:l$=5;break e;case 7:ol(a)?(l$=0,lU=null,sw(t)):(l$=0,lU=null,sk(e,t,a,7));break;case 5:var i=null;switch(lL.tag){case 26:i=lL.memoizedState;case 5:case 27:var s=lL;if(i?c3(i):s.stateNode.complete){l$=0,lU=null;var c=s.sibling;if(null!==c)lL=c;else{var u=s.return;null!==u?(lL=u,sj(u)):lL=null}break t}}l$=0,lU=null,sk(e,t,a,5);break;case 6:l$=0,lU=null,sk(e,t,a,6);break;case 8:sf(),lq=6;break e;default:throw Error(l(462))}}for(;null!==lL&&!et();)sx(lL);break}catch(t){sh(e,t)}return(r$=rF=null,I.H=r,I.A=o,lz=n,null!==lL)?0:(lD=null,lF=0,n2(),lq)}(e,t):sb(e,t,!0),a=r;;){if(0===o)lB&&!r&&su(e,t,0,!1);else{if(n=e.current.alternate,a&&!function(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],a=o.getSnapshot;o=o.value;try{if(!nO(a(),o))return!1}catch(e){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(n)){o=sb(e,t,!1),a=!1;continue}if(2===o){if(a=t,e.errorRecoveryDisabledLanes&a)var i=0;else i=0!=(i=-0x20000001&e.pendingLanes)?i:0x20000000&i?0x20000000:0;if(0!==i){t=i;e:{o=lJ;var s=e.current.memoizedState.isDehydrated;if(s&&(sp(e,i).flags|=256),2!==(i=sb(e,i,!1))){if(lV&&!s){e.errorRecoveryDisabledLanes|=a,lG|=a,o=4;break e}a=lQ,lQ=o,null!==a&&(null===lQ?lQ=a:lQ.push.apply(lQ,a))}o=i}if(a=!1,2!==o)continue}}if(1===o){sp(e,0),su(e,t,0,!0);break}e:{switch(r=e,a=o){case 0:case 1:throw Error(l(345));case 4:if((4194048&t)!==t)break;case 6:su(r,t,lY,!lH);break e;case 2:lQ=null;break;case 3:case 5:break;default:throw Error(l(329))}if((0x3c00000&t)===t&&10<(o=l1+300-er())){if(su(r,t,lY,!lH),0!==ek(r,0,!0))break e;l7=t,r.timeoutHandle=cw(sc.bind(null,r,n,lQ,l3,l0,t,lY,lG,lX,lH,a,"Throttled",-0,0),o);break e}sc(r,n,lQ,l3,l0,t,lY,lG,lX,lH,a,null,-0,0)}}break}sK(e)}function sc(e,t,n,r,o,a,i,l,s,c,u,d,f,p){if(e.timeoutHandle=-1,8192&(d=t.subtreeFlags)||0x1002000==(0x1002000&d)){lE(t,a,d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tg});var h,m,g=(0x3c00000&a)===a?l1-er():(4194048&a)===a?l2-er():0;if(null!==(h=d,m=g,h.stylesheets&&0===h.count&&c9(h,h.stylesheets),g=0<h.count||0<h.imgCount?function(e){var t=setTimeout(function(){if(h.stylesheets&&c9(h,h.stylesheets),h.unsuspend){var e=h.unsuspend;h.unsuspend=null,e()}},6e4+m);0<h.imgBytes&&0===c5&&(c5=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],a=o.transferSize,i=o.initiatorType,l=o.duration;if(a&&l&&cp(i)){for(i=0,l=o.responseEnd,r+=1;r<n.length;r++){var s=n[r],c=s.startTime;if(c>l)break;var u=s.transferSize,d=s.initiatorType;u&&cp(d)&&(i+=u*((s=s.responseEnd)<l?1:(l-c)/(s-c)))}if(--r,t+=8*(a+i)/(o.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var n=setTimeout(function(){if(h.waitingForImages=!1,0===h.count&&(h.stylesheets&&c9(h,h.stylesheets),h.unsuspend)){var e=h.unsuspend;h.unsuspend=null,e()}},(h.imgBytes>c5?50:800)+m);return h.unsuspend=e,function(){h.unsuspend=null,clearTimeout(t),clearTimeout(n)}}:null)){l7=a,e.cancelPendingCommit=g(sO.bind(null,e,t,a,n,r,o,i,l,s,u,d,null,f,p)),su(e,a,i,!c);return}}sO(e,t,a,n,r,o,i,l,s)}function su(e,t,n,r){t&=~lZ,t&=~lG,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var a=31-em(o),i=1<<a;r[a]=-1,o&=~i}0!==n&&eN(e,n,t)}function sd(){return 0!=(6&lz)||(sq(0,!1),!1)}function sf(){if(null!==lL){if(0===l$)var e=lL.return;else e=lL,r$=rF=null,an(e),op=null,oh=0,e=lL;for(;null!==e;)i1(e.alternate,e),e=e.return;lL=null}}function sp(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,ck(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),l7=0,sf(),lD=e,lL=n=rn(e.current,null),lF=t,l$=0,lU=null,lH=!1,lB=ej(e,t),lV=!1,lX=lY=lZ=lG=lW=lq=0,lQ=lJ=null,l0=!1,0!=(8&t)&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var o=31-em(r),a=1<<o;t|=e[o],r&=~a}return lK=t,n2(),n}function sh(e,t){oG=null,I.H=it,t===or||t===oa?(t=od(),l$=3):t===oo?(t=od(),l$=4):l$=t===ix?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,lU=t,null===lL&&(lq=1,im(e,ru(t,e.current)))}function sm(){var e=oL.current;return null===e||((4194048&lF)===lF?null===oF:((0x3c00000&lF)===lF||0!=(0x20000000&lF))&&e===oF)}function sg(){var e=I.H;return I.H=it,null===e?it:e}function sv(){var e=I.A;return I.A=lR,e}function sy(){lq=4,lH||(4194048&lF)!==lF&&null!==oL.current||(lB=!0),0==(0x7ffffff&lW)&&0==(0x7ffffff&lG)||null===lD||su(lD,lF,lY,!1)}function sb(e,t,n){var r=lz;lz|=2;var o=sg(),a=sv();(lD!==e||lF!==t)&&(l3=null,sp(e,t)),t=!1;var i=lq;e:for(;;)try{if(0!==l$&&null!==lL){var l=lL,s=lU;switch(l$){case 8:sf(),i=6;break e;case 3:case 2:case 9:case 6:null===oL.current&&(t=!0);var c=l$;if(l$=0,lU=null,sk(e,l,s,c),n&&lB){i=0;break e}break;default:c=l$,l$=0,lU=null,sk(e,l,s,c)}}(function(){for(;null!==lL;)sx(lL)})(),i=lq;break}catch(t){sh(e,t)}return t&&e.shellSuspendCounter++,r$=rF=null,lz=r,I.H=o,I.A=a,null===lL&&(lD=null,lF=0,n2()),i}function sx(e){var t=iG(e.alternate,e,lK);e.memoizedProps=e.pendingProps,null===t?sj(e):lL=t}function sw(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=iT(n,t,t.pendingProps,t.type,void 0,lF);break;case 11:t=iT(n,t,t.pendingProps,t.type.render,t.ref,lF);break;case 5:an(t);default:i1(n,t),t=iG(n,t=lL=rr(t,lK),lK)}e.memoizedProps=e.pendingProps,null===t?sj(e):lL=t}function sk(e,t,n,r){r$=rF=null,an(t),op=null,oh=0;var o=t.return;try{if(function(e,t,n,r,o){if(n.flags|=32768,null!==r&&"object"==typeof r&&"function"==typeof r.then){if(null!==(t=n.alternate)&&rK(t,n,o,!0),null!==(n=oL.current)){switch(n.tag){case 31:case 13:return null===oF?sy():null===n.alternate&&0===lq&&(lq=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===oi?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),sR(e,r,o)),!1;case 22:return n.flags|=65536,r===oi?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),sR(e,r,o)),!1}throw Error(l(435,n.tag))}return sR(e,r,o),sy(),!1}if(rN)return null!==(t=oL.current)?(0==(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==r_&&rD(ru(e=Error(l(422),{cause:r}),n))):(r!==r_&&rD(ru(t=Error(l(423),{cause:r}),n)),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=ru(r,n),o=iv(e.stateNode,r,o),oN(e,o),4!==lq&&(lq=2)),!1;var a=Error(l(520),{cause:r});if(a=ru(a,n),null===lJ?lJ=[a]:lJ.push(a),4!==lq&&(lq=2),null===t)return!0;r=ru(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=iv(n.stateNode,r,e),oN(n,e),!1;case 1:if(t=n.type,a=n.stateNode,0==(128&n.flags)&&("function"==typeof t.getDerivedStateFromError||null!==a&&"function"==typeof a.componentDidCatch&&(null===l5||!l5.has(a))))return n.flags|=65536,o&=-o,n.lanes|=o,ib(o=iy(o),e,n,r),oN(n,o),!1}n=n.return}while(null!==n);return!1}(e,o,t,n,lF)){lq=1,im(e,ru(n,e.current)),lL=null;return}}catch(t){if(null!==o)throw lL=o,t;lq=1,im(e,ru(n,e.current)),lL=null;return}32768&t.flags?(rN||1===r?e=!0:lB||0!=(0x20000000&lF)?e=!1:(lH=e=!0,(2===r||9===r||3===r||6===r)&&null!==(r=oL.current)&&13===r.tag&&(r.flags|=16384)),sS(t,e)):sj(t)}function sj(e){var t=e;do{if(0!=(32768&t.flags))return void sS(t,lH);e=t.return;var n=function(e,t,n){var r=t.pendingProps;switch(rj(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return i0(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),rH(r0),K(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(null===e||null===e.child)&&(rR(t)?iZ(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,rz())),i0(t),null;case 26:var o=t.type,a=t.memoizedState;return null===e?(iZ(t),null!==a?(i0(t),iX(t,a)):(i0(t),iY(t,o,null,r,n))):a?a!==e.memoizedState?(iZ(t),i0(t),iX(t,a)):(i0(t),t.flags&=-0x1000001):((e=e.memoizedProps)!==r&&iZ(t),i0(t),iY(t,o,e,r,n)),null;case 27:if(W(t),n=H.current,o=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&iZ(t);else{if(!r){if(null===t.stateNode)throw Error(l(166));return i0(t),null}e=$.current,rR(t)?rI(t,e):(t.stateNode=e=cD(o,r,n),iZ(t))}return i0(t),null;case 5:if(W(t),o=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&iZ(t);else{if(!r){if(null===t.stateNode)throw Error(l(166));return i0(t),null}if(a=$.current,rR(t))rI(t,a);else{var i=cg(H.current);switch(a){case 1:a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":(a=i.createElement("div")).innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a="string"==typeof r.is?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a="string"==typeof r.is?i.createElement(o,{is:r.is}):i.createElement(o)}}a[eM]=t,a[ez]=r;e:for(i=t.child;null!==i;){if(5===i.tag||6===i.tag)a.appendChild(i.stateNode);else if(4!==i.tag&&27!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(t.stateNode=a,cf(a,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break;case"img":r=!0;break;default:r=!1}r&&iZ(t)}}return i0(t),iY(t,t.type,null===e?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&iZ(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(l(166));if(e=H.current,rR(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(o=rO))switch(o.tag){case 27:case 5:r=o.memoizedProps}e[eM]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||cc(e.nodeValue,n)))||rA(t,!0)}else(e=cg(e).createTextNode(r))[eM]=t,t.stateNode=e}return i0(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=rR(t),null!==n){if(null===e){if(!r)throw Error(l(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(l(557));e[eM]=t}else rM(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;i0(t),e=!1}else n=rz(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e){if(256&t.flags)return oV(t),t;return oV(t),null}if(0!=(128&t.flags))throw Error(l(558))}return i0(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(o=rR(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(l(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(l(317));o[eM]=t}else rM(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;i0(t),o=!1}else o=rz(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o){if(256&t.flags)return oV(t),t;return oV(t),null}}if(oV(t),0!=(128&t.flags))return t.lanes=n,t;return n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(r=t.child,o=null,null!==r.alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(o=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),iJ(t,t.updateQueue),i0(t),null;case 4:return K(),null===e&&s7(t.stateNode.containerInfo),i0(t),null;case 10:return rH(t.type),i0(t),null;case 19:if(L(oK),null===(r=t.memoizedState))return i0(t),null;if(o=0!=(128&t.flags),null===(a=r.rendering))if(o)iQ(r,!1);else{if(0!==lq||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=oq(e))){for(t.flags|=128,iQ(r,!1),t.updateQueue=e=a.updateQueue,iJ(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)rr(n,e),n=n.sibling;return F(oK,1&oK.current|2),rN&&rx(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&er()>l4&&(t.flags|=128,o=!0,iQ(r,!1),t.lanes=4194304)}else{if(!o)if(null!==(e=oq(a))){if(t.flags|=128,o=!0,t.updateQueue=e=e.updateQueue,iJ(t,e),iQ(r,!0),null===r.tail&&"hidden"===r.tailMode&&!a.alternate&&!rN)return i0(t),null}else 2*er()-r.renderingStartTime>l4&&0x20000000!==n&&(t.flags|=128,o=!0,iQ(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=r.last)?e.sibling=a:t.child=a,r.last=a)}if(null!==r.tail)return e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=er(),e.sibling=null,n=oK.current,F(oK,o?1&n|2:1&n),rN&&rx(t,r.treeForkCount),e;return i0(t),null;case 22:case 23:return oV(t),oD(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!=(0x20000000&n)&&0==(128&t.flags)&&(i0(t),6&t.subtreeFlags&&(t.flags|=8192)):i0(t),null!==(n=t.updateQueue)&&iJ(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&L(r7),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),rH(r0),i0(t),null;case 25:case 30:return null}throw Error(l(156,t.tag))}(t.alternate,t,lK);if(null!==n){lL=n;return}if(null!==(t=t.sibling)){lL=t;return}lL=t=e}while(null!==t);0===lq&&(lq=5)}function sS(e,t){do{var n=function(e,t){switch(rj(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return rH(r0),K(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return W(t),null;case 31:if(null!==t.memoizedState){if(oV(t),null===t.alternate)throw Error(l(340));rM()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(oV(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(l(340));rM()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return L(oK),null;case 4:return K(),null;case 10:return rH(t.type),null;case 22:case 23:return oV(t),oD(),null!==e&&L(r7),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return rH(r0),null;default:return null}}(e.alternate,e);if(null!==n){n.flags&=32767,lL=n;return}if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling)){lL=e;return}lL=e=n}while(null!==e);lq=6,lL=null}function sO(e,t,n,r,o,a,i,s,c){e.cancelPendingCommit=null;do s_();while(0!==l6);if(0!=(6&lz))throw Error(l(327));if(null!==t){if(t===e.current)throw Error(l(177));if(!function(e,t,n,r,o,a){var i=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 l=e.entanglements,s=e.expirationTimes,c=e.hiddenUpdates;for(n=i&~n;0<n;){var u=31-em(n),d=1<<u;l[u]=0,s[u]=-1;var f=c[u];if(null!==f)for(c[u]=null,u=0;u<f.length;u++){var p=f[u];null!==p&&(p.lane&=-0x20000001)}n&=~d}0!==r&&eN(e,r,0),0!==a&&0===o&&0!==e.tag&&(e.suspendedLanes|=a&~(i&~t))}(e,n,a=t.lanes|t.childLanes|n1,i,s,c),e===lD&&(lL=lD=null,lF=0),l9=t,l8=e,l7=n,se=a,st=o,sn=r,0!=(10256&t.subtreeFlags)||0!=(10256&t.flags)?(e.callbackNode=null,e.callbackPriority=0,Q(el,function(){return sA(),null})):(e.callbackNode=null,e.callbackPriority=0),r=0!=(13878&t.flags),0!=(13878&t.subtreeFlags)||r){r=I.T,I.T=null,o=T.p,T.p=2,i=lz,lz|=4;try{!function(e,t){if(e=e.containerInfo,ch=ul,n_(e=nE(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o,a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch(e){n=null;break e}var s=0,c=-1,u=-1,d=0,f=0,p=e,h=null;t:for(;;){for(;p!==n||0!==a&&3!==p.nodeType||(c=s+a),p!==i||0!==r&&3!==p.nodeType||(u=s+r),3===p.nodeType&&(s+=p.nodeValue.length),null!==(o=p.firstChild);)h=p,p=o;for(;;){if(p===e)break t;if(h===n&&++d===a&&(c=s),h===i&&++f===r&&(u=s),null!==(o=p.nextSibling))break;h=(p=h).parentNode}p=o}n=-1===c||-1===u?null:{start:c,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(cm={focusedElem:e,selectionRange:n},ul=!1,ls=t;null!==ls;)if(e=(t=ls).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,ls=e;else for(;null!==ls;){switch(i=(t=ls).alternate,e=t.flags,t.tag){case 0:if(0!=(4&e)&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(n=0;n<e.length;n++)(a=e[n]).ref.impl=a.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!=(1024&e)&&null!==i){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var m=iu(n.type,a);e=r.getSnapshotBeforeUpdate(m,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){sT(n,n.return,e)}}break;case 3:if(0!=(1024&e)){if(9===(n=(e=t.stateNode.containerInfo).nodeType))cE(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":cE(e);break;default:e.textContent=""}}break;default:if(0!=(1024&e))throw Error(l(163))}if(null!==(e=t.sibling)){e.return=t.return,ls=e;break}ls=t.return}}(e,t)}finally{lz=i,T.p=o,I.T=r}}l6=1,sC(),sN(),sP()}}function sC(){if(1===l6){l6=0;var e=l8,t=l9,n=0!=(13878&t.flags);if(0!=(13878&t.subtreeFlags)||n){n=I.T,I.T=null;var r=T.p;T.p=2;var o=lz;lz|=4;try{lb(t,e);var a=cm,i=nE(e.containerInfo),l=a.focusedElem,s=a.selectionRange;if(i!==l&&l&&l.ownerDocument&&function e(t,n){return!!t&&!!n&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(l.ownerDocument.documentElement,l)){if(null!==s&&n_(l)){var c=s.start,u=s.end;if(void 0===u&&(u=c),"selectionStart"in l)l.selectionStart=c,l.selectionEnd=Math.min(u,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),h=l.textContent.length,m=Math.min(s.start,h),g=void 0===s.end?m:Math.min(s.end,h);!p.extend&&m>g&&(i=g,g=m,m=i);var v=nP(l,m),y=nP(l,g);if(v&&y&&(1!==p.rangeCount||p.anchorNode!==v.node||p.anchorOffset!==v.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var b=d.createRange();b.setStart(v.node,v.offset),p.removeAllRanges(),m>g?(p.addRange(b),p.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),p.addRange(b))}}}}for(d=[],p=l;p=p.parentNode;)1===p.nodeType&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof l.focus&&l.focus(),l=0;l<d.length;l++){var x=d[l];x.element.scrollLeft=x.left,x.element.scrollTop=x.top}}ul=!!ch,cm=ch=null}finally{lz=o,T.p=r,I.T=n}}e.current=t,l6=2}}function sN(){if(2===l6){l6=0;var e=l8,t=l9,n=0!=(8772&t.flags);if(0!=(8772&t.subtreeFlags)||n){n=I.T,I.T=null;var r=T.p;T.p=2;var o=lz;lz|=4;try{lc(e,t.alternate,t)}finally{lz=o,T.p=r,I.T=n}}l6=3}}function sP(){if(4===l6||3===l6){l6=0,en();var e=l8,t=l9,n=l7,r=sn;0!=(10256&t.subtreeFlags)||0!=(10256&t.flags)?l6=5:(l6=0,l9=l8=null,sE(e,e.pendingLanes));var o=e.pendingLanes;if(0===o&&(l5=null),eA(n),t=t.stateNode,ep&&"function"==typeof ep.onCommitFiberRoot)try{ep.onCommitFiberRoot(ef,t,void 0,128==(128&t.current.flags))}catch(e){}if(null!==r){t=I.T,o=T.p,T.p=2,I.T=null;try{for(var a=e.onRecoverableError,i=0;i<r.length;i++){var l=r[i];a(l.value,{componentStack:l.stack})}}finally{I.T=t,T.p=o}}0!=(3&l7)&&s_(),sK(e),o=e.pendingLanes,0!=(261930&n)&&0!=(42&o)?e===so?sr++:(sr=0,so=e):sr=0,sq(0,!1)}}function sE(e,t){0==(e.pooledCacheLanes&=t)&&null!=(t=e.pooledCache)&&(e.pooledCache=null,r2(t))}function s_(){return sC(),sN(),sP(),sA()}function sA(){if(5!==l6)return!1;var e=l8,t=se;se=0;var n=eA(l7),r=I.T,o=T.p;try{T.p=32>n?32:n,I.T=null,n=st,st=null;var a=l8,i=l7;if(l6=0,l9=l8=null,l7=0,0!=(6&lz))throw Error(l(331));var s=lz;if(lz|=4,lI(a.current),lO(a,a.current,i,n),lz=s,sq(0,!1),ep&&"function"==typeof ep.onPostCommitFiberRoot)try{ep.onPostCommitFiberRoot(ef,a)}catch(e){}return!0}finally{T.p=o,I.T=r,sE(e,t)}}function sI(e,t,n){t=ru(n,t),t=iv(e.stateNode,t,2),null!==(e=oO(e,t,2))&&(eC(e,2),sK(e))}function sT(e,t,n){if(3===e.tag)sI(e,e,n);else for(;null!==t;){if(3===t.tag){sI(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===l5||!l5.has(r))){e=ru(n,e),null!==(r=oO(t,n=iy(2),2))&&(ib(n,r,t,e),eC(r,2),sK(r));break}}t=t.return}}function sR(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new lM;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(lV=!0,o.add(n),e=sM.bind(null,e,t,n),t.then(e,e))}function sM(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,lD===e&&(lF&n)===n&&(4===lq||3===lq&&(0x3c00000&lF)===lF&&300>er()-l1?0==(2&lz)&&sp(e,0):lZ|=n,lX===lF&&(lX=0)),sK(e)}function sz(e,t){0===t&&(t=eS()),null!==(e=n5(e,t))&&(eC(e,t),sK(e))}function sD(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),sz(e,n)}function sL(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(l(314))}null!==r&&r.delete(t),sz(e,n)}var sF=null,s$=null,sU=!1,sH=!1,sB=!1,sV=0;function sK(e){e!==s$&&null===e.next&&(null===s$?sF=s$=e:s$=s$.next=e),sH=!0,sU||(sU=!0,cS(function(){0!=(6&lz)?Q(ea,sW):sG()}))}function sq(e,t){if(!sB&&sH){sB=!0;do for(var n=!1,r=sF;null!==r;){if(!t)if(0!==e){var o=r.pendingLanes;if(0===o)var a=0;else{var i=r.suspendedLanes,l=r.pingedLanes;a=0xc000095&(a=(1<<31-em(42|e)+1)-1&(o&~(i&~l)))?0xc000095&a|1:a?2|a:0}0!==a&&(n=!0,sX(r,a))}else a=lF,0==(3&(a=ek(r,r===lD?a:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||ej(r,a)||(n=!0,sX(r,a));r=r.next}while(n);sB=!1}}function sW(){sG()}function sG(){sH=sU=!1;var e,t=0;0===sV||((e=window.event)&&"popstate"===e.type?e===cx||(cx=e,0):(cx=null,1))||(t=sV);for(var n=er(),r=null,o=sF;null!==o;){var a=o.next,i=sZ(o,n);0===i?(o.next=null,null===r?sF=a:r.next=a,null===a&&(s$=r)):(r=o,(0!==t||0!=(3&i))&&(sH=!0)),o=a}0!==l6&&5!==l6||sq(t,!1),0!==sV&&(sV=0)}function sZ(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=-0x3c00001&e.pendingLanes;0<a;){var i=31-em(a),l=1<<i,s=o[i];-1===s?(0==(l&n)||0!=(l&r))&&(o[i]=function(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;default:return -1}}(l,t)):s<=t&&(e.expiredLanes|=l),a&=~l}if(t=lD,n=lF,n=ek(e,e===t?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===l$||9===l$)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&ee(r),e.callbackNode=null,e.callbackPriority=0;if(0==(3&n)||ej(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&ee(r),eA(n)){case 2:case 8:n=ei;break;case 32:default:n=el;break;case 0x10000000:n=ec}return n=Q(n,r=sY.bind(null,e)),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&ee(r),e.callbackPriority=2,e.callbackNode=null,2}function sY(e,t){if(0!==l6&&5!==l6)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(s_()&&e.callbackNode!==n)return null;var r=lF;return 0===(r=ek(e,e===lD?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(ss(e,r,t),sZ(e,er()),null!=e.callbackNode&&e.callbackNode===n?sY.bind(null,e):null)}function sX(e,t){if(s_())return null;ss(e,t,!0)}function sJ(){if(0===sV){var e=r5;0===e&&(e=ey,0==(261888&(ey<<=1))&&(ey=256)),sV=e}return sV}function sQ(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:tm(""+e)}function s0(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var s1=0;s1<nY.length;s1++){var s2=nY[s1];nX(s2.toLowerCase(),"on"+(s2[0].toUpperCase()+s2.slice(1)))}nX(nH,"onAnimationEnd"),nX(nB,"onAnimationIteration"),nX(nV,"onAnimationStart"),nX("dblclick","onDoubleClick"),nX("focusin","onFocus"),nX("focusout","onBlur"),nX(nK,"onTransitionRun"),nX(nq,"onTransitionStart"),nX(nW,"onTransitionCancel"),nX(nG,"onTransitionEnd"),eJ("onMouseEnter",["mouseout","mouseover"]),eJ("onMouseLeave",["mouseout","mouseover"]),eJ("onPointerEnter",["pointerout","pointerover"]),eJ("onPointerLeave",["pointerout","pointerover"]),eX("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),eX("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),eX("onBeforeInput",["compositionend","keypress","textInput","paste"]),eX("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),eX("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),eX("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var s4="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(" "),s3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(s4));function s5(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],s=l.instance,c=l.currentTarget;if(l=l.listener,s!==a&&o.isPropagationStopped())break e;a=l,o.currentTarget=c;try{a(o)}catch(e){nJ(e)}o.currentTarget=null,a=s}else for(i=0;i<r.length;i++){if(s=(l=r[i]).instance,c=l.currentTarget,l=l.listener,s!==a&&o.isPropagationStopped())break e;a=l,o.currentTarget=c;try{a(o)}catch(e){nJ(e)}o.currentTarget=null,a=s}}}}function s6(e,t){var n=t[eL];void 0===n&&(n=t[eL]=new Set);var r=e+"__bubble";n.has(r)||(ce(t,e,2,!1),n.add(r))}function s8(e,t,n){var r=0;t&&(r|=4),ce(n,e,r,t)}var s9="_reactListening"+Math.random().toString(36).slice(2);function s7(e){if(!e[s9]){e[s9]=!0,eZ.forEach(function(t){"selectionchange"!==t&&(s3.has(t)||s8(t,!1,e),s8(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[s9]||(t[s9]=!0,s8("selectionchange",!1,t))}}function ce(e,t,n,r){switch(uh(t)){case 2:var o=us;break;case 8:o=uc;break;default:o=uu}n=o.bind(null,t,n,e),o=void 0,tC&&("touchstart"===t||"touchmove"===t||"wheel"===t)&&(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function ct(e,t,n,r,o){var a=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var l=r.stateNode.containerInfo;if(l===o)break;if(4===i)for(i=r.return;null!==i;){var c=i.tag;if((3===c||4===c)&&i.stateNode.containerInfo===o)return;i=i.return}for(;null!==l;){if(null===(i=eV(l)))return;if(5===(c=i.tag)||6===c||26===c||27===c){r=a=i;continue e}l=l.parentNode}}r=r.return}tj(function(){var r=a,o=ty(n),i=[];e:{var l=nZ.get(e);if(void 0!==l){var c=tH,u=e;switch(e){case"keypress":if(0===tI(n))break e;case"keydown":case"keyup":c=t4;break;case"focusin":u="focus",c=tG;break;case"focusout":u="blur",c=tG;break;case"beforeblur":case"afterblur":c=tG;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=tq;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=tW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=t5;break;case nH:case nB:case nV:c=tZ;break;case nG:c=t6;break;case"scroll":case"scrollend":c=tV;break;case"wheel":c=t8;break;case"copy":case"cut":case"paste":c=tY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=t3;break;case"toggle":case"beforetoggle":c=t9}var d=0!=(4&t),f=!d&&("scroll"===e||"scrollend"===e),p=d?null!==l?l+"Capture":null:l;d=[];for(var h,m=r;null!==m;){var g=m;if(h=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===h||null===p||null!=(g=tS(m,p))&&d.push(cn(m,g,h)),f)break;m=m.return}0<d.length&&(l=new c(l,u,null,n,o),i.push({event:l,listeners:d}))}}if(0==(7&t)){if((l="mouseover"===e||"pointerover"===e,c="mouseout"===e||"pointerout"===e,!(l&&n!==tv&&(u=n.relatedTarget||n.fromElement)&&(eV(u)||u[eD])))&&(c||l)&&(l=o.window===o?o:(l=o.ownerDocument)?l.defaultView||l.parentWindow:window,c?(u=n.relatedTarget||n.toElement,c=r,null!==(u=u?eV(u):null)&&(f=s(u),d=u.tag,u!==f||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=r),c!==u)){if(d=tq,g="onMouseLeave",p="onMouseEnter",m="mouse",("pointerout"===e||"pointerover"===e)&&(d=t3,g="onPointerLeave",p="onPointerEnter",m="pointer"),f=null==c?l:eq(c),h=null==u?l:eq(u),(l=new d(g,m+"leave",c,n,o)).target=f,l.relatedTarget=h,g=null,eV(o)===r&&((d=new d(p,m+"enter",u,n,o)).target=h,d.relatedTarget=f,g=d),f=g,c&&u)t:{for(d=co,p=c,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var v,y=m;y;y=d(y))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||null!==m&&p===m.alternate){d=p;break t}p=d(p),m=d(m)}d=null}else d=null;null!==c&&ca(i,l,c,d,!1),null!==u&&null!==f&&ca(i,f,u,d,!0)}e:{if("select"===(c=(l=r?eq(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var b=nm;else if(nc(l))if(ng)b=nS;else{b=nk;var x=nw}else(c=l.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)?b=nj:r&&tf(r.elementType)&&(b=nm);if(b&&(b=b(e,r))){nu(i,b,n,o);break e}x&&x(e,l,r),"focusout"===e&&r&&"number"===l.type&&null!=r.memoizedProps.value&&to(l,"number",l.value)}switch(x=r?eq(r):window,e){case"focusin":(nc(x)||"true"===x.contentEditable)&&(nI=x,nT=r,nR=null);break;case"focusout":nR=nT=nI=null;break;case"mousedown":nM=!0;break;case"contextmenu":case"mouseup":case"dragend":nM=!1,nz(i,n,o);break;case"selectionchange":if(nA)break;case"keydown":case"keyup":nz(i,n,o)}if(ne)t:{switch(e){case"compositionstart":var w="onCompositionStart";break t;case"compositionend":w="onCompositionEnd";break t;case"compositionupdate":w="onCompositionUpdate";break t}w=void 0}else nl?na(e,n)&&(w="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(w="onCompositionStart");w&&(nr&&"ko"!==n.locale&&(nl||"onCompositionStart"!==w?"onCompositionEnd"===w&&nl&&(v=tA()):(tE="value"in(tP=o)?tP.value:tP.textContent,nl=!0)),0<(x=cr(r,w)).length&&(w=new tX(w,e,null,n,o),i.push({event:w,listeners:x}),v?w.data=v:null!==(v=ni(n))&&(w.data=v))),(v=nn?function(e,t){switch(e){case"compositionend":return ni(t);case"keypress":if(32!==t.which)return null;return no=!0," ";case"textInput":return" "===(e=t.data)&&no?null:e;default:return null}}(e,n):function(e,t){if(nl)return"compositionend"===e||!ne&&na(e,t)?(e=tA(),t_=tE=tP=null,nl=!1,e):null;switch(e){case"paste":default: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 nr&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(w=cr(r,"onBeforeInput")).length&&(x=new tX("onBeforeInput","beforeinput",null,n,o),i.push({event:x,listeners:w}),x.data=v);var k=e;if("submit"===k&&r&&r.stateNode===o){var j=sQ((o[ez]||null).action),S=n.submitter;S&&null!==(k=(k=S[ez]||null)?sQ(k.formAction):S.getAttribute("formAction"))&&(j=k,S=null);var O=new tH("action","action",null,n,o);i.push({event:O,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(0!==sV){var e=S?s0(o,S):new FormData(o);aX(r,{pending:!0,data:e,method:o.method,action:j},null,e)}}else"function"==typeof j&&(O.preventDefault(),aX(r,{pending:!0,data:e=S?s0(o,S):new FormData(o),method:o.method,action:j},j,e))},currentTarget:o}]})}}s5(i,t)})}function cn(e,t,n){return{instance:e,listener:t,currentTarget:n}}function cr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,a=o.stateNode;if(5!==(o=o.tag)&&26!==o&&27!==o||null===a||(null!=(o=tS(e,n))&&r.unshift(cn(e,o,a)),null!=(o=tS(e,t))&&r.push(cn(e,o,a))),3===e.tag)return r;e=e.return}return[]}function co(e){if(null===e)return null;do e=e.return;while(e&&5!==e.tag&&27!==e.tag);return e||null}function ca(e,t,n,r,o){for(var a=t._reactName,i=[];null!==n&&n!==r;){var l=n,s=l.alternate,c=l.stateNode;if(l=l.tag,null!==s&&s===r)break;5!==l&&26!==l&&27!==l||null===c||(s=c,o?null!=(c=tS(n,a))&&i.unshift(cn(n,c,s)):o||null!=(c=tS(n,a))&&i.push(cn(n,c,s))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var ci=/\r\n?/g,cl=/\u0000|\uFFFD/g;function cs(e){return("string"==typeof e?e:""+e).replace(ci,"\n").replace(cl,"")}function cc(e,t){return t=cs(t),cs(e)===t}function cu(e,t,n,r,o,a){switch(n){case"children":"string"==typeof r?"body"===t||"textarea"===t&&""===r||ts(e,r):("number"==typeof r||"bigint"==typeof r)&&"body"!==t&&ts(e,""+r);break;case"className":e4(e,"class",r);break;case"tabIndex":e4(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":e4(e,n,r);break;case"style":td(e,r,a);break;case"data":if("object"!==t){e4(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)||null==r||"function"==typeof r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=tm(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"==typeof r){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("function"==typeof a&&("formAction"===n?("input"!==t&&cu(e,t,"name",o.name,o,null),cu(e,t,"formEncType",o.formEncType,o,null),cu(e,t,"formMethod",o.formMethod,o,null),cu(e,t,"formTarget",o.formTarget,o,null)):(cu(e,t,"encType",o.encType,o,null),cu(e,t,"method",o.method,o,null),cu(e,t,"target",o.target,o,null))),null==r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=tm(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=tg);break;case"onScroll":null!=r&&s6("scroll",e);break;case"onScrollEnd":null!=r&&s6("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(l(61));if(null!=(n=r.__html)){if(null!=o.children)throw Error(l(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"muted":e.muted=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":case"innerText":case"textContent":break;case"xlinkHref":if(null==r||"function"==typeof r||"boolean"==typeof r||"symbol"==typeof r){e.removeAttribute("xlink:href");break}n=tm(""+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":null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!=typeof r&&"symbol"!=typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"==typeof r||"symbol"==typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":s6("beforetoggle",e),s6("toggle",e),e2(e,"popover",r);break;case"xlinkActuate":e3(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":e3(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":e3(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":e3(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":e3(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":e3(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":e3(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":e3(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":e3(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":e2(e,"is",r);break;default:2<n.length&&("o"===n[0]||"O"===n[0])&&("n"===n[1]||"N"===n[1])||e2(e,n=tp.get(n)||n,r)}}function cd(e,t,n,r,o,a){switch(n){case"style":td(e,r,a);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(l(61));if(null!=(n=r.__html)){if(null!=o.children)throw Error(l(60));e.innerHTML=n}}break;case"children":"string"==typeof r?ts(e,r):("number"==typeof r||"bigint"==typeof r)&&ts(e,""+r);break;case"onScroll":null!=r&&s6("scroll",e);break;case"onScrollEnd":null!=r&&s6("scrollend",e);break;case"onClick":null!=r&&(e.onclick=tg);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:if(!eY.hasOwnProperty(n))e:{if("o"===n[0]&&"n"===n[1]&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),"function"==typeof(a=null!=(a=e[ez]||null)?a[n]:null)&&e.removeEventListener(t,a,o),"function"==typeof r)){"function"!=typeof a&&null!==a&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,o);break e}n in e?e[n]=r:!0===r?e.setAttribute(n,""):e2(e,n,r)}}}function cf(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":s6("error",e),s6("load",e);var r,o=!1,a=!1;for(r in n)if(n.hasOwnProperty(r)){var i=n[r];if(null!=i)switch(r){case"src":o=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:cu(e,t,r,i,n,null)}}a&&cu(e,t,"srcSet",n.srcSet,n,null),o&&cu(e,t,"src",n.src,n,null);return;case"input":s6("invalid",e);var s=r=i=a=null,c=null,u=null;for(o in n)if(n.hasOwnProperty(o)){var d=n[o];if(null!=d)switch(o){case"name":a=d;break;case"type":i=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":r=d;break;case"defaultValue":s=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(l(137,t));break;default:cu(e,t,o,d,n,null)}}tr(e,r,s,c,u,i,a,!1);return;case"select":for(a in s6("invalid",e),o=i=r=null,n)if(n.hasOwnProperty(a)&&null!=(s=n[a]))switch(a){case"value":r=s;break;case"defaultValue":i=s;break;case"multiple":o=s;default:cu(e,t,a,s,n,null)}t=r,n=i,e.multiple=!!o,null!=t?ta(e,!!o,t,!1):null!=n&&ta(e,!!o,n,!0);return;case"textarea":for(i in s6("invalid",e),r=a=o=null,n)if(n.hasOwnProperty(i)&&null!=(s=n[i]))switch(i){case"value":o=s;break;case"defaultValue":a=s;break;case"children":r=s;break;case"dangerouslySetInnerHTML":if(null!=s)throw Error(l(91));break;default:cu(e,t,i,s,n,null)}tl(e,o,a,r);return;case"option":for(c in n)n.hasOwnProperty(c)&&null!=(o=n[c])&&("selected"===c?e.selected=o&&"function"!=typeof o&&"symbol"!=typeof o:cu(e,t,c,o,n,null));return;case"dialog":s6("beforetoggle",e),s6("toggle",e),s6("cancel",e),s6("close",e);break;case"iframe":case"object":s6("load",e);break;case"video":case"audio":for(o=0;o<s4.length;o++)s6(s4[o],e);break;case"image":s6("error",e),s6("load",e);break;case"details":s6("toggle",e);break;case"embed":case"source":case"link":s6("error",e),s6("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)&&null!=(o=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:cu(e,t,u,o,n,null)}return;default:if(tf(t)){for(d in n)n.hasOwnProperty(d)&&void 0!==(o=n[d])&&cd(e,t,d,o,n,void 0);return}}for(s in n)n.hasOwnProperty(s)&&null!=(o=n[s])&&cu(e,t,s,o,n,null)}function cp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var ch=null,cm=null;function cg(e){return 9===e.nodeType?e:e.ownerDocument}function cv(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 cy(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function cb(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var cx=null,cw="function"==typeof setTimeout?setTimeout:void 0,ck="function"==typeof clearTimeout?clearTimeout:void 0,cj="function"==typeof Promise?Promise:void 0,cS="function"==typeof queueMicrotask?queueMicrotask:void 0!==cj?function(e){return cj.resolve(null).then(e).catch(cO)}:cw;function cO(e){setTimeout(function(){throw e})}function cC(e){return"head"===e}function cN(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)||"/&"===n){if(0===r){e.removeChild(o),uI(t);return}r--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)r++;else if("html"===n)cL(e.ownerDocument.documentElement);else if("head"===n){cL(n=e.ownerDocument.head);for(var a=n.firstChild;a;){var i=a.nextSibling,l=a.nodeName;a[eH]||"SCRIPT"===l||"STYLE"===l||"LINK"===l&&"stylesheet"===a.rel.toLowerCase()||n.removeChild(a),a=i}}else"body"===n&&cL(e.ownerDocument.body);n=o}while(n);uI(t)}function cP(e,t){var n=e;e=0;do{var r=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&8===r.nodeType)if("/$"===(n=r.data))if(0===e)break;else e--;else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=r}while(n)}function cE(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":cE(n),eB(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function c_(e,t){for(;8!==e.nodeType;)if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t||null===(e=cT(e.nextSibling)))return null;return e}function cA(e){return"$?"===e.data||"$~"===e.data}function cI(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function cT(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var cR=null;function cM(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return cT(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function cz(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function cD(e,t,n){switch(t=cg(n),e){case"html":if(!(e=t.documentElement))throw Error(l(452));return e;case"head":if(!(e=t.head))throw Error(l(453));return e;case"body":if(!(e=t.body))throw Error(l(454));return e;default:throw Error(l(451))}}function cL(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);eB(e)}var cF=new Map,c$=new Set;function cU(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var cH=T.d;T.d={f:function(){var e=cH.f(),t=sd();return e||t},r:function(e){var t=eK(e);null!==t&&5===t.tag&&"form"===t.type?aQ(t):cH.r(e)},D:function(e){cH.D(e),cV("dns-prefetch",e,null)},C:function(e,t){cH.C(e,t),cV("preconnect",e,t)},L:function(e,t,n){if(cH.L(e,t,n),cB&&e&&t){var r='link[rel="preload"][as="'+tt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(r+='[imagesrcset="'+tt(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(r+='[imagesizes="'+tt(n.imageSizes)+'"]')):r+='[href="'+tt(e)+'"]';var o=r;switch(t){case"style":o=cq(e);break;case"script":o=cZ(e)}cF.has(o)||(e=f({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),cF.set(o,e),null!==cB.querySelector(r)||"style"===t&&cB.querySelector(cW(o))||"script"===t&&cB.querySelector(cY(o))||(cf(t=cB.createElement("link"),"link",e),eG(t),cB.head.appendChild(t)))}},m:function(e,t){if(cH.m(e,t),cB&&e){var n=t&&"string"==typeof t.as?t.as:"script",r='link[rel="modulepreload"][as="'+tt(n)+'"][href="'+tt(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=cZ(e)}if(!cF.has(o)&&(e=f({rel:"modulepreload",href:e},t),cF.set(o,e),null===cB.querySelector(r))){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(cB.querySelector(cY(o)))return}cf(n=cB.createElement("link"),"link",e),eG(n),cB.head.appendChild(n)}}},X:function(e,t){if(cH.X(e,t),cB&&e){var n=eW(cB).hoistableScripts,r=cZ(e),o=n.get(r);o||((o=cB.querySelector(cY(r)))||(e=f({src:e,async:!0},t),(t=cF.get(r))&&c0(e,t),eG(o=cB.createElement("script")),cf(o,"link",e),cB.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}},S:function(e,t,n){if(cH.S(e,t,n),cB&&e){var r=eW(cB).hoistableStyles,o=cq(e);t=t||"default";var a=r.get(o);if(!a){var i={loading:0,preload:null};if(a=cB.querySelector(cW(o)))i.loading=5;else{e=f({rel:"stylesheet",href:e,"data-precedence":t},n),(n=cF.get(o))&&cQ(e,n);var l=a=cB.createElement("link");eG(l),cf(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){i.loading|=1}),l.addEventListener("error",function(){i.loading|=2}),i.loading|=4,cJ(a,t,cB)}a={type:"stylesheet",instance:a,count:1,state:i},r.set(o,a)}}},M:function(e,t){if(cH.M(e,t),cB&&e){var n=eW(cB).hoistableScripts,r=cZ(e),o=n.get(r);o||((o=cB.querySelector(cY(r)))||(e=f({src:e,async:!0,type:"module"},t),(t=cF.get(r))&&c0(e,t),eG(o=cB.createElement("script")),cf(o,"link",e),cB.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}};var cB="u"<typeof document?null:document;function cV(e,t,n){if(cB&&"string"==typeof t&&t){var r=tt(t);r='link[rel="'+e+'"][href="'+r+'"]',"string"==typeof n&&(r+='[crossorigin="'+n+'"]'),c$.has(r)||(c$.add(r),e={rel:e,crossOrigin:n,href:t},null===cB.querySelector(r)&&(cf(t=cB.createElement("link"),"link",e),eG(t),cB.head.appendChild(t)))}}function cK(e,t,n,r){var o=(o=H.current)?cU(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=cq(n.href),(r=(n=eW(o).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=cq(n.href);var a,i,s,c,u=eW(o).hoistableStyles,d=u.get(e);if(d||(o=o.ownerDocument||o,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=o.querySelector(cW(e)))&&!u._p&&(d.instance=u,d.state.loading=5),cF.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},cF.set(e,n),u||(a=o,i=e,s=n,c=d.state,a.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(c.preload=i=a.createElement("link"),i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),cf(i,"link",s),eG(i),a.head.appendChild(i))))),t&&null===r)throw Error(l(528,""));return d}if(t&&null!==r)throw Error(l(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=cZ(n),(r=(n=eW(o).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function cq(e){return'href="'+tt(e)+'"'}function cW(e){return'link[rel="stylesheet"]['+e+"]"}function cG(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function cZ(e){return'[src="'+tt(e)+'"]'}function cY(e){return"script[async]"+e}function cX(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+tt(n.href)+'"]');if(r)return t.instance=r,eG(r),r;var o=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return eG(r=(e.ownerDocument||e).createElement("style")),cf(r,"style",o),cJ(r,n.precedence,e),t.instance=r;case"stylesheet":o=cq(n.href);var a=e.querySelector(cW(o));if(a)return t.state.loading|=4,t.instance=a,eG(a),a;r=cG(n),(o=cF.get(o))&&cQ(r,o),eG(a=(e.ownerDocument||e).createElement("link"));var i=a;return i._p=new Promise(function(e,t){i.onload=e,i.onerror=t}),cf(a,"link",r),t.state.loading|=4,cJ(a,n.precedence,e),t.instance=a;case"script":if(a=cZ(n.src),o=e.querySelector(cY(a)))return t.instance=o,eG(o),o;return r=n,(o=cF.get(a))&&c0(r=f({},n),o),eG(o=(e=e.ownerDocument||e).createElement("script")),cf(o,"link",r),e.head.appendChild(o),t.instance=o;case"void":return null;default:throw Error(l(443,t.type))}return"stylesheet"===t.type&&0==(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,cJ(r,n.precedence,e)),t.instance}function cJ(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,a=o,i=0;i<r.length;i++){var l=r[i];if(l.dataset.precedence===t)a=l;else if(a!==o)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function cQ(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function c0(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var c1=null;function c2(e,t,n){if(null===c1){var r=new Map,o=c1=new Map;o.set(n,r)}else(r=(o=c1).get(n))||(r=new Map,o.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var a=n[o];if(!(a[eH]||a[eM]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var i=a.getAttribute(t)||"";i=e+i;var l=r.get(i);l?l.push(a):r.set(i,[a])}}return r}function c4(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function c3(e){return"stylesheet"!==e.type||0!=(3&e.state.loading)}var c5=0;function c6(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages)){if(this.stylesheets)c9(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var c8=null;function c9(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,c8=new Map,t.forEach(c7,e),c8=null,c6.call(e))}function c7(e,t){if(!(4&t.state.loading)){var n=c8.get(e);if(n)var r=n.get(null);else{n=new Map,c8.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<o.length;a++){var i=o[a];("LINK"===i.nodeName||"not all"!==i.getAttribute("media"))&&(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}i=(o=t.instance).getAttribute("data-precedence"),(a=n.get(i)||r)===r&&n.set(null,o),n.set(i,o),this.count++,r=c6.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),a?a.parentNode.insertBefore(o,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(o,e.firstChild),t.state.loading|=4}}var ue={$$typeof:x,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function ut(e,t,n,r,o,a,i,l,s){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=eO(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eO(0),this.hiddenUpdates=eO(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=a,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function un(e,t,n,r,o,a){o=o?n9:n9,null===r.context?r.context=o:r.pendingContext=o,(r=oS(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(n=oO(e,r,t))&&(sl(n,e,t),oC(n,e,t))}function ur(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function uo(e,t){ur(e,t),(e=e.alternate)&&ur(e,t)}function ua(e){if(13===e.tag||31===e.tag){var t=n5(e,0x4000000);null!==t&&sl(t,e,0x4000000),uo(e,0x4000000)}}function ui(e){if(13===e.tag||31===e.tag){var t=sa(),n=n5(e,t=e_(t));null!==n&&sl(n,e,t),uo(e,t)}}var ul=!0;function us(e,t,n,r){var o=I.T;I.T=null;var a=T.p;try{T.p=2,uu(e,t,n,r)}finally{T.p=a,I.T=o}}function uc(e,t,n,r){var o=I.T;I.T=null;var a=T.p;try{T.p=8,uu(e,t,n,r)}finally{T.p=a,I.T=o}}function uu(e,t,n,r){if(ul){var o=ud(r);if(null===o)ct(e,t,r,uf,n),uj(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return ug=uS(ug,e,t,n,r,o),!0;case"dragenter":return uv=uS(uv,e,t,n,r,o),!0;case"mouseover":return uy=uS(uy,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return ub.set(a,uS(ub.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,ux.set(a,uS(ux.get(a)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(uj(e,r),4&t&&-1<uk.indexOf(e)){for(;null!==o;){var a=eK(o);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var i=ew(a.pendingLanes);if(0!==i){var l=a;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-em(i);l.entanglements[1]|=s,i&=~s}sK(a),0==(6&lz)&&(l4=er()+500,sq(0,!1))}}break;case 31:case 13:null!==(l=n5(a,2))&&sl(l,a,2),sd(),uo(a,2)}if(null===(a=ud(r))&&ct(e,t,r,uf,n),a===o)break;o=a}null!==o&&r.stopPropagation()}else ct(e,t,r,null,n)}}function ud(e){return up(e=ty(e))}var uf=null;function up(e){if(uf=null,null!==(e=eV(e))){var t=s(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=c(t)))return e;e=null}else if(31===n){if(null!==(e=u(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return uf=e,null}function uh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(eo()){case ea:return 2;case ei:return 8;case el:case es:return 32;case ec:return 0x10000000;default:return 32}default:return 32}}var um=!1,ug=null,uv=null,uy=null,ub=new Map,ux=new Map,uw=[],uk="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 uj(e,t){switch(e){case"focusin":case"focusout":ug=null;break;case"dragenter":case"dragleave":uv=null;break;case"mouseover":case"mouseout":uy=null;break;case"pointerover":case"pointerout":ub.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ux.delete(t.pointerId)}}function uS(e,t,n,r,o,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[o]},null!==t&&null!==(t=eK(t))&&ua(t)):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o)),e}function uO(e){var t=eV(e.target);if(null!==t){var n=s(t);if(null!==n){if(13===(t=n.tag)){if(null!==(t=c(n))){e.blockedOn=t,eT(e.priority,function(){ui(n)});return}}else if(31===t){if(null!==(t=u(n))){e.blockedOn=t,eT(e.priority,function(){ui(n)});return}}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=3===n.tag?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uC(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=ud(e.nativeEvent);if(null!==n)return null!==(t=eK(n))&&ua(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);tv=r,n.target.dispatchEvent(r),tv=null,t.shift()}return!0}function uN(e,t,n){uC(e)&&n.delete(t)}function uP(){um=!1,null!==ug&&uC(ug)&&(ug=null),null!==uv&&uC(uv)&&(uv=null),null!==uy&&uC(uy)&&(uy=null),ub.forEach(uN),ux.forEach(uN)}function uE(e,t){e.blockedOn===t&&(e.blockedOn=null,um||(um=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,uP)))}var u_=null;function uA(e){u_!==e&&(u_=e,o.unstable_scheduleCallback(o.unstable_NormalPriority,function(){u_===e&&(u_=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],o=e[t+2];if("function"!=typeof r)if(null===up(r||n))continue;else break;var a=eK(n);null!==a&&(e.splice(t,3),t-=3,aX(a,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function uI(e){function t(t){return uE(t,e)}null!==ug&&uE(ug,e),null!==uv&&uE(uv,e),null!==uy&&uE(uy,e),ub.forEach(t),ux.forEach(t);for(var n=0;n<uw.length;n++){var r=uw[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<uw.length&&null===(n=uw[0]).blockedOn;)uO(n),null===n.blockedOn&&uw.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var o=n[r],a=n[r+1],i=o[ez]||null;if("function"==typeof a)i||uA(n);else if(i){var l=null;if(a&&a.hasAttribute("formAction")){if(o=a,i=a[ez]||null)l=i.formAction;else if(null!==up(o))continue}else l=i.action;"function"==typeof l?n[r+1]=l:(n.splice(r,3),r-=3),uA(n)}}}function uT(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return o=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==o&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var r=!1,o=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),null!==o&&(o(),o=null)}}}function uR(e){this._internalRoot=e}function uM(e){this._internalRoot=e}uM.prototype.render=uR.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(l(409));un(t.current,sa(),e,t,null,null)},uM.prototype.unmount=uR.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;un(e.current,2,null,e,null,null),sd(),t[eD]=null}},uM.prototype.unstable_scheduleHydration=function(e){if(e){var t=eI();e={blockedOn:null,target:e,priority:t};for(var n=0;n<uw.length&&0!==t&&t<uw[n].priority;n++);uw.splice(n,0,e),0===n&&uO(e)}};var uz=a.version;if("19.2.8"!==uz)throw Error(l(527,uz,"19.2.8"));if(T.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(l(188));throw Error(l(268,e=Object.keys(e).join(",")))}return null===(e=null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=s(e)))throw Error(l(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(r=o.return)){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return d(o),e;if(a===r)return d(o),t;a=a.sibling}throw Error(l(188))}if(n.return!==r.return)n=o,r=a;else{for(var i=!1,c=o.child;c;){if(c===n){i=!0,n=o,r=a;break}if(c===r){i=!0,r=o,n=a;break}c=c.sibling}if(!i){for(c=a.child;c;){if(c===n){i=!0,n=a,r=o;break}if(c===r){i=!0,r=a,n=o;break}c=c.sibling}if(!i)throw Error(l(189))}}if(n.alternate!==r)throw Error(l(190))}if(3!==n.tag)throw Error(l(188));return n.stateNode.current===n?e:t}(t))?function e(t){var n=t.tag;if(5===n||26===n||27===n||6===n)return t;for(t=t.child;null!==t;){if(null!==(n=e(t)))return n;t=t.sibling}return null}(e):null)?null:e.stateNode},"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var uD=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uD.isDisabled&&uD.supportsFiber)try{ef=uD.inject({bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.8"}),ep=uD}catch(e){}}t.createRoot=function(e,t){if(!(n=e)||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(l(299));var n,r,o,a,i,s=!1,c="",u=id,d=ip,f=ih;return null!=t&&(!0===t.unstable_strictMode&&(s=!0),void 0!==t.identifierPrefix&&(c=t.identifierPrefix),void 0!==t.onUncaughtError&&(u=t.onUncaughtError),void 0!==t.onCaughtError&&(d=t.onCaughtError),void 0!==t.onRecoverableError&&(f=t.onRecoverableError)),r=e,o=1,a=!1,i=s,r=new ut(r,o,a,c,u,d,f,uT,null),o=1,!0===i&&(o|=24),i=re(3,null,null,o),r.current=i,i.stateNode=r,o=r1(),o.refCount++,r.pooledCache=o,o.refCount++,i.memoizedState={element:null,isDehydrated:a,cache:o},ok(i),t=r,e[eD]=t.current,s7(e),new uR(t)}},2310(e,t,n){var r=n(4041);function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(o(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal"),s=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(o(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:l,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},t.preconnect=function(e,t){"string"==typeof e&&(t=t?"string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:null,i.d.C(e,t))},t.prefetchDNS=function(e){"string"==typeof e&&i.d.D(e)},t.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,r=c(n,t.crossOrigin),o="string"==typeof t.integrity?t.integrity:void 0,a="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?i.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:o,fetchPriority:a}):"script"===n&&i.d.X(e,{crossOrigin:r,integrity:o,fetchPriority:a,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&i.d.M(e)},t.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else i.d.m(e)},t.requestFormReset=function(e){i.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},t.useFormStatus=function(){return s.H.useHostTransitionStatus()},t.version="19.2.8"},5873(e,t,n){!function e(){if("u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(6974)},3144(e,t,n){!function e(){if("u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(2310)},1197(e,t){var n=Symbol.for("react.transitional.element");function r(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return{$$typeof:n,type:e,key:o,ref:void 0!==(t=r.ref)?t:null,props:r}}t.Fragment=Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},2062(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator,m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||m}function b(){}function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||m}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=y.prototype;var w=x.prototype=new b;w.constructor=x,g(w,y.prototype),w.isPureReactComponent=!0;var k=Array.isArray;function j(){}var S={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function C(e,t,r){var o=r.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==o?o:null,props:r}}function N(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var P=/\/+/g;function E(e,t){var n,r;return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36)}function _(e,t,o){if(null==e)return e;var a=[],i=0;return!function e(t,o,a,i,l){var s,c,u,d=typeof t;("undefined"===d||"boolean"===d)&&(t=null);var p=!1;if(null===t)p=!0;else switch(d){case"bigint":case"string":case"number":p=!0;break;case"object":switch(t.$$typeof){case n:case r:p=!0;break;case f:return e((p=t._init)(t._payload),o,a,i,l)}}if(p)return l=l(t),p=""===i?"."+E(t,0):i,k(l)?(a="",null!=p&&(a=p.replace(P,"$&/")+"/"),e(l,o,a,"",function(e){return e})):null!=l&&(N(l)&&(s=l,c=a+(null==l.key||t&&t.key===l.key?"":(""+l.key).replace(P,"$&/")+"/")+p,l=C(s.type,c,s.props)),o.push(l)),1;p=0;var m=""===i?".":i+":";if(k(t))for(var g=0;g<t.length;g++)d=m+E(i=t[g],g),p+=e(i,o,a,d,l);else if("function"==typeof(g=null===(u=t)||"object"!=typeof u?null:"function"==typeof(u=h&&u[h]||u["@@iterator"])?u:null))for(t=g.call(t),g=0;!(i=t.next()).done;)d=m+E(i=i.value,g++),p+=e(i,o,a,d,l);else if("object"===d){if("function"==typeof t.then)return e(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(j,j):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(t),o,a,i,l);throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(o=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return p}(e,a,"","",function(e){return t.call(o,e,i++)}),a}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){(0===e._status||-1===e._status)&&(e._status=1,e._result=t)},function(t){(0===e._status||-1===e._status)&&(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};t.Activity=p,t.Children={map:_,forEach:function(e,t,n){_(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return _(e,function(){t++}),t},toArray:function(e){return _(e,function(e){return e})||[]},only:function(e){if(!N(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=o,t.Profiler=i,t.PureComponent=x,t.StrictMode=a,t.Suspense=u,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=g({},e.props),o=e.key;if(null!=t)for(a in void 0!==t.key&&(o=""+t.key),t)O.call(t,a)&&"key"!==a&&"__self"!==a&&"__source"!==a&&("ref"!==a||void 0!==t.ref)&&(r[a]=t[a]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var i=Array(a),l=0;l<a;l++)i[l]=arguments[l+2];r.children=i}return C(e.type,o,r)},t.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:l,_context:e},e},t.createElement=function(e,t,n){var r,o={},a=null;if(null!=t)for(r in void 0!==t.key&&(a=""+t.key),t)O.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var i=arguments.length-2;if(1===i)o.children=n;else if(1<i){for(var l=Array(i),s=0;s<i;s++)l[s]=arguments[s+2];o.children=l}if(e&&e.defaultProps)for(r in i=e.defaultProps)void 0===o[r]&&(o[r]=i[r]);return C(e,a,o)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=N,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:A}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=S.T,n={};S.T=n;try{var r=e(),o=S.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(j,I)}catch(e){I(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),S.T=t}},t.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},t.use=function(e){return S.H.use(e)},t.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},t.useCallback=function(e,t){return S.H.useCallback(e,t)},t.useContext=function(e){return S.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return S.H.useEffect(e,t)},t.useEffectEvent=function(e){return S.H.useEffectEvent(e)},t.useId=function(){return S.H.useId()},t.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return S.H.useMemo(e,t)},t.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},t.useRef=function(e){return S.H.useRef(e)},t.useState=function(e){return S.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return S.H.useTransition()},t.version="19.2.8"},4041(e,t,n){e.exports=n(2062)},1085(e,t,n){e.exports=n(1197)},6310(e,t){function n(e,t){var n=e.length;for(e.push(t);0<n;){var r=n-1>>>1,o=e[r];if(0<a(o,t))e[r]=t,e[n]=o,n=r;else break}}function r(e){return 0===e.length?null:e[0]}function o(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;for(var r=0,o=e.length,i=o>>>1;r<i;){var l=2*(r+1)-1,s=e[l],c=l+1,u=e[c];if(0>a(s,n))c<o&&0>a(u,s)?(e[r]=u,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else if(c<o&&0>a(u,n))e[r]=u,e[c]=n,r=c;else break}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var i,l=performance;t.unstable_now=function(){return l.now()}}else{var s=Date,c=s.now();t.unstable_now=function(){return s.now()-c}}var u=[],d=[],f=1,p=null,h=3,m=!1,g=!1,v=!1,y=!1,b="function"==typeof setTimeout?setTimeout:null,x="function"==typeof clearTimeout?clearTimeout:null,w="u">typeof setImmediate?setImmediate:null;function k(e){for(var t=r(d);null!==t;){if(null===t.callback)o(d);else if(t.startTime<=e)o(d),t.sortIndex=t.expirationTime,n(u,t);else break;t=r(d)}}function j(e){if(v=!1,k(e),!g)if(null!==r(u))g=!0,S||(S=!0,i());else{var t=r(d);null!==t&&I(j,t.startTime-e)}}var S=!1,O=-1,C=5,N=-1;function P(){return!!y||!(t.unstable_now()-N<C)}function E(){if(y=!1,S){var e=t.unstable_now();N=e;var n=!0;try{e:{g=!1,v&&(v=!1,x(O),O=-1),m=!0;var a=h;try{t:{for(k(e),p=r(u);null!==p&&!(p.expirationTime>e&&P());){var l=p.callback;if("function"==typeof l){p.callback=null,h=p.priorityLevel;var s=l(p.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof s){p.callback=s,k(e),n=!0;break t}p===r(u)&&o(u),k(e)}else o(u);p=r(u)}if(null!==p)n=!0;else{var c=r(d);null!==c&&I(j,c.startTime-e),n=!1}}break e}finally{p=null,h=a,m=!1}}}finally{n?i():S=!1}}}if("function"==typeof w)i=function(){w(E)};else if("u">typeof MessageChannel){var _=new MessageChannel,A=_.port2;_.port1.onmessage=E,i=function(){A.postMessage(null)}}else i=function(){b(E,0)};function I(e,n){O=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},t.unstable_scheduleCallback=function(e,o,a){var l=t.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?l+a:l,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=0x3fffffff;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,e={id:f++,callback:o,priorityLevel:e,startTime:a,expirationTime:s,sortIndex:-1},a>l?(e.sortIndex=a,n(d,e),null===r(u)&&e===r(d)&&(v?(x(O),O=-1):v=!0,I(j,a-l))):(e.sortIndex=s,n(u,e),g||m||(g=!0,S||(S=!0,i()))),e},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},7967(e,t,n){e.exports=n(6310)},3296(e,t,n){var r=n(4041),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,i=r.useEffect,l=r.useLayoutEffect,s=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return l(function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})},[e,n,t]),i(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},1435(e,t,n){var r=n(4041),o=n(8139),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useSyncExternalStore,l=r.useRef,s=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=l(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var p=i(e,(d=c(function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return l=t}return l=e}if(t=l,a(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(i=e,t):(i=e,l=n)}var i,l,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]))[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}},8139(e,t,n){e.exports=n(3296)},7121(e,t,n){e.exports=n(1435)},1434(e,t,n){let r;n.d(t,{Ru:()=>eb,CY:()=>eS,s9:()=>ej,Bd:()=>eh});var o,a=n(1085),i=n(4530);let l=e=>"string"==typeof e,s=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},c=e=>null==e?"":String(e),u=/###/g,d=e=>e&&e.includes("###")?e.replace(u,"."):e,f=e=>!e||l(e),p=(e,t,n)=>{let r=l(t)?t.split("."):t,o=0;for(;o<r.length-1;){if(f(e))return{};let t=d(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return f(e)?{}:{obj:e,k:d(r[o])}},h=(e,t,n)=>{let{obj:r,k:o}=p(e,t,Object);if(void 0!==r||1===t.length){r[o]=n;return}let a=t[t.length-1],i=t.slice(0,t.length-1),l=p(e,i,Object);for(;void 0===l.obj&&i.length;)a=`${i[i.length-1]}.${a}`,l=p(e,i=i.slice(0,i.length-1),Object),l?.obj&&void 0!==l.obj[`${l.k}.${a}`]&&(l.obj=void 0);l.obj[`${l.k}.${a}`]=n},m=(e,t)=>{let{obj:n,k:r}=p(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},g=(e,t,n)=>{for(let r in t)"__proto__"!==r&&"constructor"!==r&&(Object.prototype.hasOwnProperty.call(e,r)?l(e[r])||e[r]instanceof String||l(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):g(e[r],t[r],n):e[r]=t[r]);return e},v={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},y=e=>l(e)?e.replace(/[&<>"'\/]/g,e=>v[e]):e,b=[" ",",","?","!",";"],x=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),w=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let r=t.split(n),o=e;for(let e=0;e<r.length;){let t;if(!o||"object"!=typeof o)return;let a="";for(let i=e;i<r.length;++i)if(i!==e&&(a+=n),a+=r[i],void 0!==(t=o[a])){if(["string","number","boolean"].includes(typeof t)&&i<r.length-1)continue;e+=i-e+1;break}o=t}return o},k=e=>e?.replace(/_/g,"-"),j={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class S{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||j,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>l(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g," "):e),l(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new S(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new S(this.logger,e)}}var O=new S;class C{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n(e,...t)})}}class N extends C{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let o,a=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;e.includes(".")?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):l(n)&&a?o.push(...n.split(a)):o.push(n)));let s=m(this.data,o);return(!s&&!t&&!n&&e.includes(".")&&(e=o[0],t=o[1],n=o.slice(2).join(".")),!s&&i&&l(n))?w(this.data?.[e]?.[t],n,a):s}addResource(e,t,n,r,o={silent:!1}){let a=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,i=[e,t];n&&(i=i.concat(a?n.split(a):n)),e.includes(".")&&(i=e.split("."),r=t,t=i[1]),this.addNamespaces(t),h(this.data,i,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(l(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,a={silent:!1,skipCopy:!1}){let i=[e,t];e.includes(".")&&(i=e.split("."),r=n,n=t,t=i[1]),this.addNamespaces(t);let l=m(this.data,i)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?g(l,n,o):l={...l,...n},h(this.data,i,l),a.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var P={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,o)??t}),t}};let E=Symbol("i18next/PATH_KEY");function _(e,t){let n,r,o,{[E]:a}=e((r=[],(o=Object.create(null)).get=(e,t)=>(n?.revoke?.(),t===E)?r:(r.push(t),(n=Proxy.revocable(e,o)).proxy),Proxy.revocable(Object.create(null),o).proxy)),i=t?.keySeparator??".",l=t?.nsSeparator??":",s=t?.enableSelector==="strict";if(a.length>1&&l){let e=t?.ns,n=s?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(n&&(s?n:n.length>1?n.slice(1):[]).includes(a[0]))return`${a[0]}${l}${a.slice(1).join(i)}`}return a.join(i)}let A=e=>!l(e)&&"boolean"!=typeof e&&"number"!=typeof e;class I extends C{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=O.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(null==e)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let o=A(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),i=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";let r=b.filter(e=>!t.includes(e)&&!n.includes(e));if(0===r.length)return!0;let o=x.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),a=!o.test(e);if(!a){let t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(a=!0)}return a})(e,n,r);if(a&&!i){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:l(o)?[o]:o};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(o=a.shift()),e=a.join(r)}return{key:e,namespaces:l(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=_(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]),e=e.map(e=>"function"==typeof e?_(e,{...this.options,...r}):String(e));let o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,a=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:i,namespaces:s}=this.extractFromKey(e[e.length-1],r),c=s[s.length-1],u=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let d=r.lng||this.language,f=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()==="cimode")return f?o?{res:`${c}${u}${i}`,usedKey:i,exactUsedKey:i,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:`${c}${u}${i}`:o?{res:i,usedKey:i,exactUsedKey:i,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:i;let p=this.resolve(e,r),h=p?.res,m=p?.usedKey||i,g=p?.exactUsedKey||i,v=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==r.count&&!l(r.count),x=I.hasDefaultValue(r),w=b?this.pluralResolver.getSuffix(d,r.count,r):"",k=r.ordinal&&b?this.pluralResolver.getSuffix(d,r.count,{ordinal:!1}):"",j=b&&!r.ordinal&&0===r.count,S=j&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${k}`]||r.defaultValue,O=h;y&&!h&&x&&(O=S);let C=A(O),N=Object.prototype.toString.apply(O);if(y&&O&&C&&!["[object Number]","[object Function]","[object RegExp]"].includes(N)&&!(l(v)&&Array.isArray(O))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,O,{...r,ns:s}):`key '${i} (${this.language})' returned an object instead of string.`;return o?(p.res=e,p.usedParams=this.getUsedParamsDetails(r),p):e}if(a){let e=Array.isArray(O),t=e?[]:{},n=e?g:m;for(let e in O)if(Object.prototype.hasOwnProperty.call(O,e)){let o=`${n}${a}${e}`;x&&!h?t[e]=this.translate(o,{...r,defaultValue:A(S)?S[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(o,{...r,joinArrays:!1,ns:s}),t[e]===o&&(t[e]=O[e])}h=t}}else if(y&&l(v)&&Array.isArray(h))(h=h.join(v))&&(h=this.extendTranslation(h,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(h)&&x&&(t=!0,h=S),this.isValidLookup(h)||(o=!0,h=i);let l=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:h,s=x&&S!==h&&this.options.updateMissing;if(o||t||s){if(this.logger.log(s?"updateKey":"missingKey",d,c,b&&!s?`${i}${this.pluralResolver.getSuffix(d,r.count,r)}`:i,s?S:h),a){let e=this.resolve(i,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);let n=(e,t,n)=>{let o=x&&n!==h?n:l;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,o,s,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,c,t,o,s,r),this.emit("missingKey",e,c,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,r);j&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],i+t,r[`defaultValue${t}`]||S)})}):n(e,i,S))}h=this.extendTranslation(h,e,r,p,n),o&&h===i&&this.options.appendNamespaceToMissingKey&&(h=`${c}${u}${i}`),(o||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${i}`:i,t?h:void 0,r))}return o?(p.res=h,p.usedParams=this.getUsedParamsDetails(r),p):h}extendTranslation(e,t,n,r,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let a;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let i=l(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(i){let t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!l(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),i){let t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,i=l(a)?[a]:a;return null!=e&&i?.length&&!1!==n.applyPostProcessor&&(e=P.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,a,i;return l(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>"function"==typeof e?_(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let d=void 0!==t.count&&!l(t.count),f=d&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(l(t.context)||"number"==typeof t.context)&&""!==t.context,h=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(i=e,!this.checkedLoadedFor[`${h[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(i)&&(this.checkedLoadedFor[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${h.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(r=>{let i;if(this.isValidLookup(n))return;a=r;let l=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(l,c,r,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&e.startsWith(o)&&l.push(c+e.replace(o,this.options.pluralSeparator)),l.push(c+e),f&&l.push(c+n)),p){let r=`${c}${this.options.contextSeparator||"_"}${t.context}`;l.push(r),d&&(t.ordinal&&e.startsWith(o)&&l.push(r+e.replace(o,this.options.pluralSeparator)),l.push(r+e),f&&l.push(r+n))}}for(;i=l.pop();)this.isValidLookup(n)||(o=i,n=this.getResource(r,e,i,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:a,usedNS:i}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=e.replace&&!l(e.replace),n=t?e.replace:e;if(t&&void 0!==e.count&&(n={...n,count:e.count}),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class T{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=O.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(!(e=k(e))||!e.includes("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=k(e))||!e.includes("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(l(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r||(!!e.includes("-")||!!r.includes("-"))&&!!(e.includes("-")&&!r.includes("-")&&e.slice(0,e.indexOf("-"))===r||e.startsWith(r)&&r.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),l(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.options.fallbackLng,r=Array.isArray(n)?n.join("|"):n;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);let o=void 0===t||!1===t||l(t),a=void 0===t&&"function"==typeof this.options.fallbackLng,i=l(e)&&o&&!a,s=null;if(i){let n;n=void 0===t?"undefined":!1===t?"boolean:false":`string:${t}`,s=`${e.length}:${e}|${n}`}if(null!==s){let e=this.resolveHierarchyCache[s];if(void 0!==e)return e.slice()}let c=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),u=[],d=e=>{e&&(this.isSupportedCode(e)?u.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return(l(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&d(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&d(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&d(this.getLanguagePartFromCode(e))):l(e)&&d(this.formatLanguageCode(e)),c.forEach(e=>{u.includes(e)||d(this.formatLanguageCode(e))}),null!==s)?(this.resolveHierarchyCache[s]=u,u.slice()):u}}let R={zero:0,one:1,two:2,few:3,many:4,other:5},M={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class z{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=O.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n,r=k("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];try{n=new Intl.PluralRules(r,{type:o})}catch(o){if("u"<typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),M;if(!e.match(/-|_/))return M;let r=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(r,t)}return this.pluralRulesCache[a]=n,n}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return(n||(n=this.getRule("dev",t)),n)?n.resolvedOptions().pluralCategories.sort((e,t)=>R[e]-R[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}let D=(e,t,n,r=".",o=!0)=>{let a,i=void 0!==(a=m(e,n))?a:m(t,n);return!i&&o&&l(n)&&void 0===(i=w(e,n,r))&&(i=w(t,n,r)),i},L=e=>e.replace(/\$/g,"$$$$");class F{constructor(e={}){this.logger=O.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:a,suffix:i,suffixEscaped:l,formatSeparator:s,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:m,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:y,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):a||"{{",this.suffix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):l||"}}",this.formatSeparator=s||",",this.unescapePrefix=c?"":u?u.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"-",this.unescapeSuffix=this.unescapePrefix?"":c?c.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=g||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,a,i,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(!e.includes(this.formatSeparator)){let o=D(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),a=o.shift().trim(),i=o.join(this.formatSeparator).trim();return this.format(D(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&"string"==typeof e&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");let d=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}].forEach(t=>{for(i=0;o=t.regex.exec(e);){let n=o[1].trim();if(void 0===(a=u(n)))if("function"==typeof d){let t=d(e,o,r);a=l(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a="";else if(f){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a="";else l(a)||this.useRawValueToEscape||(a=c(a));let s=t.safeValue(a);if(e=e.replace(o[0],L(s)),f?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++i>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,a,i=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}[ ]*{`)),o=`{${r[1]}`;e=r[0];let i=(o=this.interpolate(o,a)).match(/'/g),l=o.match(/"/g);((i?.length??0)%2!=0||l)&&(l?.length??0)%2==0||(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];(a=(a={...n}).replace&&!l(a.replace)?a.replace:a).applyPostProcessor=!1,delete a.defaultValue;let u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==u&&(s=r[1].slice(u).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),(o=t(i.call(this,r[1].trim(),a),a))&&r[0]===e&&!l(o))return o;l(o)||(o=c(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),s.length&&(o=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}let $=e=>{let t={};return(n,r,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});let i=r+JSON.stringify(a),l=t[i];return l||(l=e(k(r),o),t[i]=l),l(n)}},U=e=>(t,n,r)=>e(k(n),r)(t);class H{constructor(e={}){this.logger=O.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let n=t.cacheInBuiltFormats?$:U;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=$(t)}format(e,t,n,r={}){if(!t||null==e)return e;let o=t.split(this.formatSeparator),a=[];for(let e=0;e<o.length;e++){let t=o[e];for(;t.indexOf("(")>-1&&!t.includes(")")&&e+1<o.length;)t=`${t}${this.formatSeparator}${o[++e]}`;a.push(t)}return a.reduce((e,t)=>{let{formatName:o,formatOptions:a}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.includes("(")){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].slice(0,-1);"currency"!==t||o.includes(":")?"relativetime"!==t||o.includes(":")?o.split(";").forEach(e=>{if(e){let[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),a=t.trim();n[a]||(n[a]=o),"false"===o&&(n[a]=!1),"true"===o&&(n[a]=!0),isNaN(o)||(n[a]=parseInt(o,10))}}):n.range||(n.range=o.trim()):n.currency||(n.currency=o.trim())}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{let i=r?.formatParams?.[r.interpolationkey]||{},l=i.locale||i.lng||r.locale||r.lng||n;t=this.formats[o](e,l,{...a,...r,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class B extends C{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=O.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let o={},a={},i={},l={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===a[i]&&(a[i]=!0):(this.state[i]=1,r=!1,void 0===a[i]&&(a[i]=!0),void 0===o[i]&&(o[i]=!0),void 0===l[t]&&(l[t]=!0)))}),r||(i[e]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){let r=e.split("|"),o=r[0],a=r[1];t&&this.emit("failedLoading",o,a,t),!t&&n&&this.store.addResourceBundle(o,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let i={};this.queue.forEach(n=>{((e,t,n,r)=>{let{obj:o,k:a}=p(e,t,Object);o[a]=o[a]||[],o[a].push(n)})(n.loaded,[o],a),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{i[e]||(i[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:a});this.readingCalls++;let i=(i,l)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&l&&r<this.maxRetries?setTimeout(()=>{this.read(e,t,n,r+1,2*o,a)},o):a(i,l)},l=this.backend[n].bind(this.backend);if(2===l.length){try{let n=l(e,t);n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}return}return l(e,t,i)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();l(e)&&(e=this.languageUtils.toResolveHierarchy(e)),l(t)&&(t=[t]);let o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){let n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,o,a={},i=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=n&&""!==n){if(this.backend?.create){let l={...a,isUpdate:o},s=this.backend.create.bind(this.backend);if(s.length<6)try{let o;(o=5===s.length?s(e,t,n,r,l):s(e,t,n,r))&&"function"==typeof o.then?o.then(e=>i(null,e)).catch(i):i(null,o)}catch(e){i(e)}else s(e,t,n,r,i,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}let V=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),l(e[1])&&(t.defaultValue=e[1]),l(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),K=e=>(l(e.ns)&&(e.ns=[e.ns]),l(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),l(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),q=()=>{};class W extends C{constructor(e={},t){if(super(),this.options=K(e),this.services={},this.logger=O,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(l(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));let n=V();this.options={...n,...this.options,...K(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?O.init(r(this.modules.logger),this.options):O.init(null,this.options),e=this.modules.formatter?this.modules.formatter:H;let t=new T(this.options);this.store=new N(this.options.resources,this.options);let n=this.services;n.logger=O,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new z(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new F(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new B(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new I(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=q),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=s(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(e,t=q){let n=t,r=l(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=s();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=q),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&P.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!["cimode","dev"].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=s();this.emit("languageChanging",e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},a=t=>{e||t||!this.services.languageDetector||(t=[]);let n=l(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(l(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{o(e,a)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),n}getFixedT(e,t,n,r){let o=r?.scopeNs,a=(e,t,...r)=>{let i,l;(i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(r)):{...t}).lng=i.lng||a.lng,i.lngs=i.lngs||a.lngs;let s=void 0!==i.ns&&null!==i.ns;i.ns=i.ns||a.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||a.keyPrefix);let c={...this.options,...i};Array.isArray(o)&&!s&&(c.ns=o),"function"==typeof i.keyPrefix&&(i.keyPrefix=_(i.keyPrefix,c));let u=this.options.keySeparator||".";return i.keyPrefix&&Array.isArray(e)?l=e.map(e=>("function"==typeof e&&(e=_(e,c)),`${i.keyPrefix}${u}${e}`)):("function"==typeof e&&(e=_(e,c)),l=i.keyPrefix?`${i.keyPrefix}${u}${e}`:e),this.t(l,i)};return l(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||0===n||2===n};if(t.precheck){let e=t.precheck(this,a);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(o,e)))}loadNamespaces(e,t){let n=s();return this.options.ns?(l(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=s();l(e)&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new T(V());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){let n=new W(e,t);return n.createInstance=W.createInstance,n}cloneInstance(e={},t=q){let n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},o=new W(r);if((void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new N(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),r),o.services.resourceStore=o.store),e.interpolation){let t={...V().interpolation,...this.options.interpolation,...e.interpolation},n={...r,interpolation:t};o.services.interpolator=new F(n)}return o.translator=new I(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let G=W.createInstance();G.createInstance,G.dir,G.init,G.loadResources,G.reloadResources,G.use,G.changeLanguage,G.getFixedT,G.t,G.exists,G.setDefaultNamespace,G.hasLoadedNamespace,G.loadNamespaces,G.loadLanguages;var Z=n(4041);Object.create(null);let Y=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,X={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xa9","©":"\xa9","®":"\xae","®":"\xae","…":"…","…":"…","/":"/","/":"/"},J=e=>X[e],Q={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Y,J),transDefaultProps:void 0},ee=(0,Z.createContext)();class et{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}let en=(e,t,n,r)=>{let o=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);es(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...o):console?.warn&&console.warn(...o)},er={},eo=(e,t,n,r)=>{es(n)&&er[n]||(es(n)&&(er[n]=new Date),en(e,t,n,r))},ea=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},ei=(e,t,n)=>{e.loadNamespaces(t,ea(e,n))},el=(e,t,n,r)=>{if(es(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return ei(e,n,r);n.forEach(t=>{0>e.options.ns.indexOf(t)&&e.options.ns.push(t)}),e.loadLanguages(t,ea(e,r))},es=e=>"string"==typeof e,ec={" ":"\xa0","&":"&","<":"<",">":">",""":'"',"'":"'","©":"\xa9","®":"\xae","™":"™","…":"…","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","′":"′","″":"″","‹":"‹","›":"›","§":"\xa7","¶":"\xb6","·":"\xb7"," ":" "," ":" "," ":" ","€":"€","£":"\xa3","¥":"\xa5","¢":"\xa2","¤":"\xa4","×":"\xd7","÷":"\xf7","−":"−","±":"\xb1","≠":"≠","≤":"≤","≥":"≥","≈":"≈","≡":"≡","∞":"∞","∫":"∫","∑":"∑","∏":"∏","√":"√","∂":"∂","‰":"‰","°":"\xb0","µ":"\xb5","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","À":"\xc0","Á":"\xc1","Â":"\xc2","Ã":"\xc3","Ä":"\xc4","Å":"\xc5","Æ":"\xc6","Ç":"\xc7","È":"\xc8","É":"\xc9","Ê":"\xca","Ë":"\xcb","Ì":"\xcc","Í":"\xcd","Î":"\xce","Ï":"\xcf","Ð":"\xd0","Ñ":"\xd1","Ò":"\xd2","Ó":"\xd3","Ô":"\xd4","Õ":"\xd5","Ö":"\xd6","Ø":"\xd8","Ù":"\xd9","Ú":"\xda","Û":"\xdb","Ü":"\xdc","Ý":"\xdd","Þ":"\xde","ß":"\xdf","à":"\xe0","á":"\xe1","â":"\xe2","ã":"\xe3","ä":"\xe4","å":"\xe5","æ":"\xe6","ç":"\xe7","è":"\xe8","é":"\xe9","ê":"\xea","ë":"\xeb","ì":"\xec","í":"\xed","î":"\xee","ï":"\xef","ð":"\xf0","ñ":"\xf1","ò":"\xf2","ó":"\xf3","ô":"\xf4","õ":"\xf5","ö":"\xf6","ø":"\xf8","ù":"\xf9","ú":"\xfa","û":"\xfb","ü":"\xfc","ý":"\xfd","þ":"\xfe","ÿ":"\xff","¡":"\xa1","¿":"\xbf","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ª":"\xaa","º":"\xba","¯":"\xaf","´":"\xb4","¸":"\xb8","¹":"\xb9","²":"\xb2","³":"\xb3","¼":"\xbc","½":"\xbd","¾":"\xbe","♠":"♠","♣":"♣","♥":"♥","♦":"♦","◊":"◊","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","ℵ":"ℵ"},eu=RegExp(Object.keys(ec).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),"g");var ed=n(8139);let ef={t:(e,t)=>{if(es(t))return t;if("object"==typeof t&&null!==t&&es(t.defaultValue))return t.defaultValue;if("function"==typeof e)return"";if(Array.isArray(e)){let t=e[e.length-1];return"function"==typeof t?"":t}return e},ready:!1},ep=()=>()=>{},eh=(e,t={})=>{let{i18n:n}=t,{i18n:o,defaultNS:a}=(0,Z.useContext)(ee)||{},i=n||o||r;i&&!i.reportNamespaces&&(i.reportNamespaces=new et),i||eo(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");let l=(0,Z.useMemo)(()=>({...Q,...i?.options?.react,...t}),[i,t]),{useSuspense:s,keyPrefix:c}=l,u=e||a||i?.options?.defaultNS,d=es(u)?[u]:u||["translation"],f=(0,Z.useMemo)(()=>d,d);i?.reportNamespaces?.addUsedNamespaces?.(f);let p=(0,Z.useRef)(0),h=(0,Z.useCallback)(e=>{if(!i)return ep;let{bindI18n:t,bindI18nStore:n}=l,r=()=>{p.current+=1,e()};return t&&i.on(t,r),n&&i.store.on(n,r),()=>{t&&t.split(" ").forEach(e=>i.off(e,r)),n&&n.split(" ").forEach(e=>i.store.off(e,r))}},[i,l]),m=(0,Z.useRef)(),g=(0,Z.useCallback)(()=>{if(!i)return ef;let e=!!(i.isInitialized||i.initializedStoreOnce)&&f.every(e=>((e,t,n={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):(eo(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,i,l)),n=t.lng||i.language,r=p.current,o=m.current;if(o&&o.ready===e&&o.lng===n&&o.keyPrefix===c&&o.revision===r)return o;let a={t:i.getFixedT(n,"fallback"===l.nsMode?f:f[0],c,{scopeNs:f}),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=a,a},[i,f,c,l,t.lng]),[v,y]=(0,Z.useState)(0),{t:b,ready:x}=(0,ed.useSyncExternalStore)(h,g,g);(0,Z.useEffect)(()=>{if(i&&!x&&!s){let e=()=>y(e=>e+1);t.lng?el(i,t.lng,f,e):ei(i,f,e)}},[i,t.lng,f,x,s,v]);let w=i||{},k=(0,Z.useRef)(null),j=(0,Z.useRef)(),S=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,"__original"))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch(e){}return n},O=(0,Z.useMemo)(()=>{let e=w?.language,t=w;w&&(k.current&&k.current.__original===w?j.current!==e?(k.current=t=S(w),j.current=e):t=k.current:(k.current=t=S(w),j.current=e));let n=x||s?b:(...e)=>(eo(i,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),b(...e)),r=[n,t,x];return r.t=n,r.i18n=t,r.ready=x,r},[b,w,x,w.resolvedLanguage,w.language,w.languages]);if(i&&s&&!x){let e=!1;try{e=!1}catch(e){}throw e&&eo(i,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(e=>{let n=()=>e();t.lng?el(i,t.lng,f,n):ei(i,f,n)})}return O};function em({i18n:e,defaultNS:t,children:n}){let r=(0,Z.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,Z.createElement)(ee.Provider,{value:r},n)}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ev="hs-language",ey={"zh-CN":"zh-CN",en:"en-US"},eb=G.createInstance();function ex(e){"u">typeof document&&(document.documentElement.lang=e)}function ew(e){return eb.on("languageChanged",e),function(){return eb.off("languageChanged",e)}}function ek(){return(0,i.lX)(eb.language)?eb.language:i.gI}function ej(){var e=(0,Z.useSyncExternalStore)(ew,ek,ek),t=(0,Z.useCallback)(function(e){try{localStorage.setItem(ev,e)}catch(e){}eb.changeLanguage(e)},[]);return(0,Z.useMemo)(function(){return{language:e,locale:ey[e],setLanguage:t}},[e,t])}function eS(e){var t=e.children;return(0,a.jsx)(em,{i18n:eb,children:t})}eb.use({type:"3rdParty",init(e){((e={})=>{Q={...Q,...e}})(e.options.react),r=e}}).init({lng:function(){try{var e=localStorage.getItem(ev);return(0,i.lX)(e)?e:i.gI}catch(e){return i.gI}}(),fallbackLng:i.gI,supportedLngs:function(e){if(Array.isArray(e))return eg(e)}(o=i.Yj)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e){if(e){if("string"==typeof e)return eg(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eg(e,void 0)}}(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),resources:{"zh-CN":{translation:i.jF["zh-CN"]},en:{translation:i.jF.en}},initAsync:!1,interpolation:{escapeValue:!1},returnNull:!1}),ex(eb.language),eb.on("languageChanged",ex)},2935(e,t,n){n.d(t,{AZ:()=>l,OD:()=>s,PY:()=>i,ec:()=>c});var r=n(4041);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var a="hs-theme";function i(){var e=function(){try{var e=localStorage.getItem(a);return"light"===e||"dark"===e?e:null}catch(e){return null}}();return e||("u">typeof window&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}function l(e){document.documentElement.classList.toggle("dark","dark"===e),document.documentElement.style.colorScheme=e;try{localStorage.setItem(a,e)}catch(e){}}function s(e){var t="dark"===e?"light":"dark";return l(t),t}function c(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,r.useState)(function(){return"u">typeof document&&document.documentElement.classList.contains("dark")?"dark":"light"}))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return o(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],a=t[1];return(0,r.useEffect)(function(){var e=document.documentElement,t=new MutationObserver(function(){a(e.classList.contains("dark")?"dark":"light")});return t.observe(e,{attributes:!0,attributeFilter:["class"]}),function(){return t.disconnect()}},[]),n}},4530(e,t,n){let r;n.d(t,{AF:()=>s,Hr:()=>r_,wl:()=>rk,OQ:()=>l,RP:()=>f,lX:()=>v,jF:()=>y,b1:()=>rM,gI:()=>g,oo:()=>d,Yj:()=>m,Vz:()=>c});var o,a,i,l={favoriteNotFound:"favoriteNotFound",favoriteRevisionRequired:"favoriteRevisionRequired",favoriteRevisionConflict:"favoriteRevisionConflict",favoriteInUse:"favoriteInUse",favoriteConnectionInUse:"favoriteConnectionInUse",favoriteEndpointMissing:"favoriteEndpointMissing",favoriteProtocolUnsupported:"favoriteProtocolUnsupported",favoriteProjectionUnsupported:"favoriteProjectionUnsupported",favoriteProfileDiverged:"favoriteProfileDiverged",favoriteRawOverrideConflict:"favoriteRawOverrideConflict",favoriteActiveUpdateRequiresApply:"favoriteActiveUpdateRequiresApply",favoritePlanStale:"favoritePlanStale",favoritePlanExpired:"favoritePlanExpired",favoriteIdempotencyConflict:"favoriteIdempotencyConflict",favoriteUndoConflict:"favoriteUndoConflict",favoritePreferenceNotRepresented:"favoritePreferenceNotRepresented",favoriteEffortUnverified:"favoriteEffortUnverified",favoriteStoreInvalid:"favoriteStoreInvalid",favoriteBackupInvalid:"favoriteBackupInvalid",favoriteBackupStale:"favoriteBackupStale",favoriteBackupRecoveryFailed:"favoriteBackupRecoveryFailed",favoriteLimitReached:"favoriteLimitReached",favoriteCredentialConsentRequired:"favoriteCredentialConsentRequired",requestFailed:"http.requestFailed",invalidRequest:"http.invalidRequest",internalServerError:"http.internalServerError",authenticationRequired:"http.authenticationRequired",crossOriginDenied:"http.crossOriginDenied",invalidPassword:"auth.invalidPassword",missingArgument:"cli.missingArgument",invalidConflictPolicy:"sync.invalidConflictPolicy",harnessNotFound:"harness.notFound",fileNotRegular:"file.notRegular",fileOutsideManagedDirectory:"file.outsideManagedDirectory",fileOwnershipRequiresRoot:"file.ownershipRequiresRoot",nativeConfigInvalid:"adapter.nativeConfigInvalid",adapterUnknownTarget:"adapter.unknownTarget",profileActiveDeleteForbidden:"profile.activeDeleteForbidden",profileAlreadyExists:"profile.alreadyExists",profileNotFound:"profile.notFound",profileEndpointNotFound:"profile.endpointNotFound",profileApiKeyRequired:"profile.apiKeyRequired",profileNameRequired:"profile.nameRequired",profileNameInvalid:"profile.nameInvalid",profileNameTooLong:"profile.nameTooLong",adapterModelRequired:"adapter.modelRequired",adapterApiKeyRequired:"adapter.apiKeyRequired",officialLoginUnsupported:"activation.officialLoginUnsupported",officialLoginMissing:"activation.officialLoginMissing",officialApiKeyMissing:"activation.officialApiKeyMissing",noActiveProfile:"activation.noActiveProfile",officialProfileCannotAdopt:"activation.officialProfileCannotAdopt",adoptUnsupported:"activation.adoptUnsupported",manualOverridesPreventAdopt:"activation.manualOverridesPreventAdopt",officialProfileAlreadyExists:"activation.officialProfileAlreadyExists",providerInUse:"provider.inUse",providerCredentialUnreadable:"provider.credentialUnreadable",providerNotFound:"provider.notFound",providerNameRequired:"provider.nameRequired",providerApiKeyRequired:"provider.apiKeyRequired",providerEndpointsInvalid:"provider.endpointsInvalid",providerEndpointKeyRequired:"provider.endpointKeyRequired",providerEndpointKeyInvalid:"provider.endpointKeyInvalid",providerEndpointKeyDuplicate:"provider.endpointKeyDuplicate",providerEndpointUrlRequired:"provider.endpointUrlRequired",codexCacheTooLarge:"codex.loginCacheTooLarge",codexCacheInvalidJson:"codex.loginCacheInvalidJson",codexConfigDirNotRegular:"codex.configDirectoryNotRegular",codexCacheNotRegular:"codex.loginCacheNotRegular",transferEnvelopeInvalid:"transfer.envelopeInvalid",transferPassphraseTooShort:"transfer.passphraseTooShort",transferDecryptFailed:"transfer.decryptFailed",transferTooManyProfiles:"transfer.tooManyProfiles",transferProfilesInvalid:"transfer.profilesInvalid",transferProfileNameInvalid:"transfer.profileNameInvalid",transferDuplicateProfile:"transfer.duplicateProfile",transferProvidersInvalid:"transfer.providersInvalid",transferDuplicateProvider:"transfer.duplicateProvider",transferProviderMissing:"transfer.providerMissing",transferActiveInvalid:"transfer.activeInvalid",transferDuplicateActive:"transfer.duplicateActive",transferActiveProfileMissing:"transfer.activeProfileMissing",transferOfficialActiveInvalid:"transfer.officialActiveInvalid",transferCodexCacheInvalid:"transfer.codexCacheInvalid",syncSourceCacheMissing:"sync.sourceCodexLoginCacheMissing",syncSourceEqualsTarget:"sync.sourceEqualsTarget",scanApiKeyRequired:"scan.apiKeyRequired",backupTargetInvalid:"backup.targetInvalid",backupInvalidId:"backup.invalidId",backupNotFound:"backup.notFound",backupFileNotOwned:"backup.fileNotOwned",backupPayloadMissing:"backup.payloadMissing",backupPayloadNameInvalid:"backup.payloadNameInvalid",operationAlreadyUndone:"operation.alreadyUndone",operationIncomplete:"operation.incomplete",operationBackupMissing:"operation.backupMissing",operationStorageUnknown:"operation.storageUnknown",operationSnapshotMissing:"operation.snapshotMissing",operationInvalidId:"operation.invalidId",operationNotFound:"operation.notFound",githubNotConnected:"github.notConnected",githubAuthFailed:"github.authFailed",githubGistNotFound:"github.gistNotFound",githubDeviceCodeExpired:"github.deviceCodeExpired",githubRateLimitExceeded:"github.rateLimitExceeded",userNotManageable:"user.notManageable",userNotSwitchable:"user.notSwitchable",storageUnreadable:"storage.unreadable",storageQuarantineFailed:"storage.quarantineFailed",storageCorruptQuarantined:"storage.corruptQuarantined"},s={badUrl:"probe.badUrl",missingBaseUrl:"probe.missingBaseUrl",missingApiKey:"probe.missingApiKey",timeout:"probe.timeout",networkError:"probe.networkError",unauthorized:"probe.unauthorized",httpError:"probe.httpError",invalidResponse:"probe.invalidResponse",missingModel:"probe.missingModel",completionUnsupported:"probe.completionUnsupported",completionHttpError:"probe.completionHttpError",completionInvalid:"probe.completionInvalid"};function c(e){return u.some(function(t){return e.startsWith(t)})?e:"error.".concat(e)}var u=["warning.","doctor.check.","scan.note.","favorite."];[l,{result:"favorite.result"},{envRebuildFailed:"warning.activation.envRebuildFailed",officialEnvRebuildFailed:"warning.activation.officialEnvRebuildFailed",backfillFailed:"warning.activation.backfillFailed",endpointFallback:"warning.provider.endpointFallback",reapplyFailed:"warning.provider.reapplyFailed",syncReapplyFailed:"warning.sync.activeReapplyFailed",transferActiveRestoreFailed:"warning.transfer.activeRestoreFailed",scanProfileGone:"warning.scan.profileGone",scanProfileExists:"warning.scan.profileExists",scanImportFailed:"warning.scan.importFailed"},{installFound:"doctor.check.installFound",installMissing:"doctor.check.installMissing",installNotRequired:"doctor.check.installNotRequired",fileMissing:"doctor.check.fileMissing",fileUnreadable:"doctor.check.fileUnreadable",fileUnwritable:"doctor.check.fileUnwritable",filePermissive:"doctor.check.filePermissive",fileOk:"doctor.check.fileOk",parseOk:"doctor.check.parseOk",parseFailed:"doctor.check.parseFailed",parseUnreadable:"doctor.check.parseUnreadable",driftNoProfile:"doctor.check.driftNoProfile",driftInvalid:"doctor.check.driftInvalid",driftMismatch:"doctor.check.driftMismatch",driftInSync:"doctor.check.driftInSync",probeNoProfile:"doctor.check.probeNoProfile",probeOfficialLogin:"doctor.check.probeOfficialLogin",probeMissingCredential:"doctor.check.probeMissingCredential",probeOk:"doctor.check.probeOk",probeFailed:"doctor.check.probeFailed",completionOk:"doctor.check.completionOk",completionFailed:"doctor.check.completionFailed",completionOkCached:"doctor.check.completionOkCached",completionFailedCached:"doctor.check.completionFailedCached"},{unsupported:"scan.note.unsupported",noConfigFiles:"scan.note.noConfigFiles",unparsable:"scan.note.unparsable",noCandidates:"scan.note.noCandidates"},s,{homeUnsearchable:"user.block.homeUnsearchable",homeUnwritable:"user.block.homeUnwritable",storeInaccessible:"user.block.storeInaccessible",ownershipRequiresRoot:"user.block.ownershipRequiresRoot",homeMissing:"user.block.homeMissing"}].flatMap(function(e){return Object.values(e)});var d=["claude","codex","kimi","pi","dsh"],f={claude:"Claude Code",codex:"Codex",kimi:"Kimi Code",pi:"Pi",dsh:"DeepSeek Harness"},p=JSON.parse('{"app":{"name":"harness-switch","tagline":"Native configuration management","checkingSession":"Checking session…","brandMark":"HS / harness-switch","devMode":"Local development mode: this page is served by a local dev server"},"language":{"toEnglish":"Switch to English","toChinese":"Switch to Chinese","short":"中文"},"theme":{"toLight":"Switch to the light theme","toDark":"Switch to the dark theme"},"login":{"title":"Server configuration control plane","intro":"Activating a profile writes directly to each CLI\'s own configuration files, with no shell setup required.","hint":"Enter the web password printed in the terminal on first launch.","password":"Web password","submitting":"Signing in…","submit":"Sign in"},"nav":{"currentLocalUser":"Current local user","localUser":"Local user","transfer":"Move configuration","vault":"Provider vault","signOut":"Sign out","switchHarness":"Switch harness"},"harness":{"field":{"toggle":{"on":"On","off":"Off"},"providerId":{"label":"Provider ID (optional)","placeholder":"Defaults to the profile name"},"contextLength":{"label":"Context length"},"maxTokens":{"label":"Max output tokens"},"claude":{"authVar":{"label":"Credential variable","help":"Third-party relays usually require ANTHROPIC_AUTH_TOKEN; use ANTHROPIC_API_KEY for an official API key.","option":{"authToken":"ANTHROPIC_AUTH_TOKEN (third-party relay)","official":"ANTHROPIC_API_KEY (official)"}},"haikuModel":{"label":"Haiku model mapping"},"sonnetModel":{"label":"Sonnet model mapping"},"opusModel":{"label":"Opus model mapping"},"fableModel":{"label":"Fable model mapping (optional)","help":"Written to ANTHROPIC_DEFAULT_FABLE_MODEL, for newer Claude Code builds that support the Fable tier."},"subagentModel":{"label":"Subagent model (optional)","help":"Written to CLAUDE_CODE_SUBAGENT_MODEL, so subagents can use a faster or cheaper model."},"haikuModelName":{"label":"Haiku display name (optional)"},"sonnetModelName":{"label":"Sonnet display name (optional)"},"opusModelName":{"label":"Opus display name (optional)"},"fableModelName":{"label":"Fable display name (optional)"},"modelMapping":{"help":"Written to {{envVar}}."},"modelName":{"help":"Written to {{envVar}}; left empty, Claude Code shows the model ID itself.","placeholder":"Leave empty to use the {{role}} model ID"},"example":{"placeholder":"e.g. {{value}}"},"extraEnv":{"label":"Extra environment variables (optional)","help":"One KEY=VALUE per line, merged into the env block of settings.json."},"oneM":{"subagentLabel":"Declare 1M support for subagents","label":"Declare 1M support for {{role}}","help":"Appends [1m] to the model ID to declare a 1M context window to Claude Code, which strips the suffix before calling the provider. Enable it only when the model really supports 1M."}},"codex":{"envNote":"Only the environment-variable auth mode needs env.sh; the other modes keep their credential inside config.toml.","authMode":{"label":"Authentication mode","help":"auth.json is Codex\'s own login cache. Overwriting it loses the ChatGPT session, so it is left alone by default.","option":{"bearerToken":"Write to config.toml (recommended, keeps official login)","envKey":"Environment variable (requires sourcing env.sh)","openaiAuth":"Write to auth.json (overwrites the ChatGPT login cache)"}},"providerId":{"help":"openai, ollama, lmstudio, amazon-bedrock and similar are reserved by Codex and get renamed automatically."},"envKeyName":{"label":"Environment variable name","help":"Only used by the environment-variable mode."},"reasoningEffort":{"label":"Reasoning effort (optional)","option":{"unset":"Not set"}},"target":{"auth":"auth.json (auth.json mode only)"}},"kimi":{"envNote":"Kimi Code does not read credentials from the shell, so env.sh has no effect on it.","providerType":{"label":"Provider type","help":"Decides which protocol implementation Kimi Code uses.","option":{"kimi":"kimi (Moonshot / Kimi Code)"}},"maxContextSize":{"help":"Kimi Code requires every models entry to declare max_context_size."}},"pi":{"envNote":"The API key is written straight into models.json, so no environment variable is needed; --model still overrides at run time.","providerId":{"help":"Models are referenced as provider/model."},"api":{"label":"Protocol"},"authHeader":{"label":"Authorization header","help":"Sent as Authorization: Bearer <key>."},"reasoning":{"label":"Reasoning support","help":"Maps to reasoning in models.json. Enable it for thinking models such as GPT or Claude."}},"dsh":{"envNote":"The API key is written securely to DSH\'s .credentials.yaml and referenced from settings.yaml.","providerType":{"label":"Provider type","option":{"custom":"Custom provider","official":"DeepSeek official API"}},"providerId":{"help":"DSH\'s model routing identifier; it must start with a lowercase letter."},"models":{"label":"Model catalog (optional)","placeholder":"One model ID per line; left empty, only the default model above is registered","help":"One provider can register several models; the Model field above is the default for new sessions."},"api":{"label":"API protocol"},"reasoningEfforts":{"label":"Supported reasoning levels","help":"DSH only shows the levels declared here that the upstream model actually supports.","option":{"unset":"Not declared (provider default)","none":"Model does not support reasoning levels","lowToMax":"Low / Medium / High / XHigh / Max","lowToXhigh":"Low / Medium / High / XHigh","minimalToHigh":"Minimal / Low / Medium / High"}}}},"subtitle":"Manage profiles and safely write this tool\'s native configuration files.","newProfile":"New profile","addCustomProvider":"Add custom provider","current":"Current: {{name}}","currentInactive":"Current: inactive","activeConfig":"Active configuration","defaultModel":"Default model","activeNamed":"Active \xb7 {{name}}","inactive":"Inactive","active":"Active","activate":"Activate","setDefault":"Set as default","default":"Default","deepseekOfficial":"DeepSeek official","writeTargets":"Write targets","noTargetFile":"No target file configured","moreFiles_one":"and {{count}} more file","moreFiles_other":"and {{count}} more files","overwriteWarning":"The profile overwrites the target files directly. A backup is taken first; verify connectivity and model availability after switching.","profiles":"Profiles","providers":"Providers","profileCount_one":"{{count}} custom profile","profileCount_other":"{{count}} custom profiles","copy":"Copy {{name}}","noProfiles":"No profiles yet","manualOverride":"Manual override","edit":"Edit {{name}}","delete":"Delete {{name}}","deleteBlocked":"Activate another profile before deleting this one","deleteTitle":"Delete profile?","deleteBody":"This deletes {{harness}} / {{profile}}. {{extra}}This cannot be undone.","deleteAdditiveExtra":"Its provider entry in the configuration file is removed as well. ","deleteDshOfficialExtra":"Its native DeepSeek route and credential reference are removed as well. ","official":"Official login","officialActive":"In use","officialSwitch":"Back to official","officialHintClaude":"Use Claude Code\'s own Anthropic account login","officialHintCodex":"Use Codex\'s own ChatGPT / OpenAI account login","officialHintKimi":"Use Kimi Code\'s own Kimi account login (the OAuth credential written by /login)","officialHintDsh":"Detect and switch to DeepSeek Harness\'s existing official DeepSeek API key configuration","application":"Application","writeMode":"Write mode","modeReplace":"Replace current configuration","modeAdditive":"Keep entries and switch pointer"},"profile":{"editTitle":"Edit {{harness}} / {{profile}}","createTitle":"New {{harness}} profile","copyTitle":"Copy {{harness}} / {{profile}}","intro":"Saving writes to {{targets}}.","additiveNote":"This tool\'s config file keeps providers side by side, so switching only moves the current pointer — the other providers you wrote by hand are left alone.","useSharedProvider":"Use a shared provider (vault)","useSharedProviderLabel":"Use a shared provider","keyFromVault":"Key comes from the vault","providerNone":"None (this profile carries its own key)","vaultEmpty":"The vault is empty. Add a provider entry under “Vault” at the top first.","namedEndpoint":"Named endpoint (optional)","namedEndpointLabel":"Named endpoint","endpointNone":"Unset (use the base URL below)","endpointOption":"{{label}} ({{key}})","noEndpoints":"This provider has no named endpoint, so the base URL below is used.","quickFill":"Quick fill:","name":"Profile name","namePlaceholder":"e.g. openrouter-main","renameHint":"Renaming also updates the recorded active profile and the provider id in the native config.","baseUrl":"API base URL","baseUrlPlaceholder":"https://api.example.com/v1","baseUrlFromVault":"The base URL comes from vault endpoint “{{endpoint}}”.","apiKey":"API key","apiKeyKeep":"Leave empty to keep the current key","apiKeyRequiredPlaceholder":"Required","apiKeySharedHint":"This profile references a shared provider; rotate the key in the vault instead.","dshOfficialApiKeyHint":"Enter a DeepSeek Platform API key. It is securely written to DSH\'s .credentials.yaml and referenced as DEEPSEEK_API_KEY from settings.yaml.","fallbackModel":"Fallback model (ANTHROPIC_MODEL)","model":"Model","fallbackModelPlaceholder":"Optional; used when no tier matches, e.g. glm-5","modelPlaceholder":"e.g. claude-sonnet-4-5","claudeModelHint":"Leave empty to keep Claude Code\'s default model; map the individual tiers below.","notes":"Notes (optional)","advanced":"Advanced: raw configuration","overridden":"Overridden by hand","saveFirst":"Save this profile first, then reopen it to take over the raw file contents.","save":"Save profile","saving":"Saving…","rawLoading":"Reading what will be written…","rawIntro":"Below is what is currently written to disk, generated from the fields as last saved. Editing any of them counts as taking it over by hand, and the form fields stop affecting that file.","resetToGenerated":"Back to generated","selectPlaceholder":"Select one","mapping":{"title":"Model mapping","intro":"Display names only affect Claude Code\'s /model menu; an empty one shows the actual model ID. Turning on “1M context” appends [1m] to the model ID — only enable it for a model that really supports 1M.","role":"Model role","displayName":"Display name","actualModel":"Model actually requested","oneM":"1M context","defaultTo":"Default: {{model}}","notInMenu":"Not shown in the /model menu","oneMUnsupported":"{{role}} has no 1M variant","enable":"Enable"},"error":{"nameRequired":"Enter a profile name","nameSlash":"A profile name cannot contain / or \\\\","nameTooLong":"A profile name is at most {{max}} characters","nameDuplicate":"A profile with this name already exists","baseUrlRequired":"Enter an API base URL","apiKeyRequired":"Enter an API key","modelRequired":"Enter a model name","providerGone":"The referenced provider no longer exists — pick another","endpointGone":"The referenced endpoint no longer exists — pick another","fieldRequired":"Fill in {{label}}","checkFields":"Check the fields marked in red."}},"vault":{"title":"Vault","intro":"A provider entry keeps the API key in one place (AES-256-GCM encrypted, hidden by default) along with reusable endpoints. Profiles can reference an entry here instead of each holding its own copy of the key.","createTitle":"New provider","editTitle":"Edit {{name}}","formIntro":"Set the credential and any reusable named endpoints; saving returns to the list.","loading":"Reading the vault…","entryCount_one":"{{count}} provider entry","entryCount_other":"{{count}} provider entries","add":"New credential","empty":"The vault is empty — add a provider first.","keyConfigured":"Key set","keyMissing":"No key","noEndpoints":"No named endpoint","reveal":"Show {{name}}\'s key","hide":"Hide {{name}}\'s key","edit":"Edit {{name}}","delete":"Delete {{name}}","close":"Close","deleteTitle":"Delete this provider?","deleteBody":"This deletes “{{name}}”. An entry referenced by a profile cannot be deleted — remove the reference first.","deleted":"Deleted.","deleteFailed":"Delete failed","revealFailed":"Could not read the key","name":"Name","namePlaceholder":"e.g. openrouter","apiKey":"API key","apiKeyKeep":"Leave empty to keep the current key","apiKeyRequiredPlaceholder":"Required","notes":"Notes (optional)","endpoints":"Named endpoints (optional)","endpointsHint":"A profile referencing this provider can pick one of these endpoints, whose base URL then wins over the profile\'s own address.","noEndpointDrafts":"No endpoint yet","endpointKeyLabel":"Endpoint {{index}} name","endpointKeyPlaceholder":"id, e.g. default","endpointUrlLabel":"Endpoint {{index}} base URL","endpointUrlPlaceholder":"https://api.example.com/v1","endpointLabelLabel":"Endpoint {{index}} label","endpointLabelPlaceholder":"Display label (optional)","removeEndpoint":"Remove endpoint {{index}}","addEndpoint":"Add endpoint","saving":"Saving…","saveChanges":"Save changes","updated":"Updated.","created":"Provider entry added.","saveFailed":"Save failed","error":{"nameRequired":"Enter a provider name","apiKeyRequired":"Enter an API key","endpointKeyRequired":"Enter an endpoint id","endpointKeyInvalid":"Cannot contain / or \\\\, and is at most {{max}} characters","endpointKeyDuplicate":"Endpoint ids must be unique","endpointUrlRequired":"Enter a base URL","checkFields":"Check the fields marked in red."},"probeEndpointLabel":"Endpoint to test","probeFailed":"Probe request failed"},"activate":{"title":"Activate profile?","officialTitle":"Return to official login?","body":"This switches {{harness}} to \\"{{profile}}\\" and writes its native configuration files{{changed}}. Target local user: {{user}}. A backup is taken first.","officialBody":"This returns {{harness}} to its official login and writes its native configuration files{{changed}}. Target local user: {{user}}. A backup is taken first.","changedFiles_one":", of which {{count}} file will change","changedFiles_other":", of which {{count}} files will change","loadFailed":"Could not read the content to be written: {{reason}}","loading":"Loading the content to be written…","confirm":"Confirm activation","executing":"Writing…","failed":"Writing failed: {{reason}}. The configuration was not switched; fix the issue and retry.","retry":"Retry activation","retryPreview":"Reload preview"},"env":{"title":"Environment file compatibility","intro":"Switching does not require it. Run this in the relevant shell only when Codex uses environment-variable authentication:","note":"The file contains only variables recognized by each tool. Kimi Code and Pi do not read credentials from the shell, so their sections contain only a comment."},"backup":{"latest":"Latest backup","profile":"Profile","fileCount_one":"{{count}} file","fileCount_other":"{{count}} files","empty":"No snapshots yet","history":"Configuration history","restore":"Restore","restoreTitle":"Restore this snapshot?","restoreBody":"This writes the {{harness}} / {{profile}} configuration files from {{time}} back to disk, overwriting the current content.","confirmRestore":"Confirm restore","current":"Matches disk","loadFailed":"Could not read the snapshot: {{reason}}","loading":"Loading the snapshot…","written":"Restored the files from that snapshot to disk.","historyTitle":"{{harness}} configuration history","historyIntro":"Every write snapshots the original files into the data directory, keeping the last 10. Only this tool’s history is listed; entries that match what is on disk are marked current.","currentBadge":"Current","withDeletions":"includes deletions","restoreHistoryTitle":"Restore this snapshot?","restoreHistoryBody":"Red is what you lose, green is what the restore writes. Confirming overwrites the files on disk from this snapshot; the active profile harness-switch has on record does not roll back with it.","comparing":"Computing the diff…","diffFailed":"Could not load the diff"},"diff":{"delete":"Will delete","create":"Will create","replace":"Will overwrite","same":"No change","rendering":"Rendering the diff…","absent":"(absent)","afterRestore":"↓ after restore","deletedAfterRestore":"(deleted after restore)","bothAbsent":"Absent on both sides"},"drift":{"title":"Configuration drift","recheck":"Re-check drift","checking":"Checking for drift…","noData":"No drift data yet.","none":"No drift","mismatch_one":"{{count}} file differs","mismatch_other":"{{count}} files differ","moreFiles":"and {{count}} more…","viewDiff":"View diff","dialogTitle":"{{harness}} configuration drift","legend":"Red is what is on disk; green is what the active profile would write.","noActiveProfile":"This tool has no active profile.","nothingToCompare":"No active profile, so there is nothing to compare.","allInSync":"Every file matches the active profile.","adopt":"Adopt live configuration","reapply":"Re-apply","reapplyTitle":"Re-apply the active profile?","reapplyBody":"This rewrites {{harness}}\'s native configuration files from the active profile, overwriting local edits on disk. A backup is taken first.","confirmReapply":"Confirm re-apply","reapplyFailed":"Re-apply failed","adoptTitle":"Adopt the live configuration?","adoptBody":"This writes the current on-disk content back into the profile, and later writes will use it as the source. This cannot be undone.","confirmAdopt":"Confirm adopt","adoptFailed":"Adopt failed","reapplied":"Rewrote {{harness}}\'s native configuration files from the active profile.","adopted":"Adopted {{harness}}\'s live configuration into the profile.","status":{"in-sync":"In sync","drifted":"Modified","missing":"Missing","invalid":"Unparseable","unknown":"Unknown"}},"doctor":{"title":"Diagnostics","titleFor":"{{harness}} diagnostics","intro":"Checks tool installation, whether configuration files are readable, writable and parseable, storage permissions, and drift.","checking":"Checking…","notRun":"Diagnostics have not run yet","viewDetails":"View details","rerun":"Run again","close":"Close","updateAvailable":"A new version is available","noChecks":"Nothing to check","countOk":"{{count}} ok","countWarn":"{{count}} warning","countError":"{{count}} error","countUnknown":"{{count}} unknown","status":{"ok":"OK","warn":"Warning","error":"Error","unknown":"Unknown"},"check":{"installFound":"Found the {{bin}} executable","installMissing":"No {{bin}} executable on PATH — the tool may not be installed","installNotRequired":"{{harness}} is typically a web service — no PATH CLI is required","fileMissing":"{{target}} does not exist ({{path}})","fileUnreadable":"{{target}} is not readable ({{path}})","fileUnwritable":"{{target}} is not writable ({{path}})","filePermissive":"{{target}} is readable and writable, but its mode is {{mode}} — group/other can read it; 0600 is recommended","fileOk":"{{target}} exists and is readable and writable ({{path}})","parseOk":"{{target}} parses cleanly","parseFailed":"{{target}} could not be parsed: {{reason}}","parseUnreadable":"{{target}} could not be read: {{reason}}","driftNoProfile":"No active profile, so there is no drift to check","driftInvalid":"The live files contain content that cannot be parsed","driftMismatch_one":"{{count}} file does not match the active profile ({{status}})","driftMismatch_other":"{{count}} files do not match the active profile ({{status}})","driftInSync":"The live files match the active profile","probeNoProfile":"No active profile; connectivity probe skipped","probeOfficialLogin":"{{harness}} is on its built-in account login; no custom endpoint to probe","probeMissingCredential":"Profile {{profile}} has no base URL or API key; cannot probe","probeOk":"Endpoint of profile {{profile}} is reachable","probeFailed":"Connectivity probe failed for profile {{profile}}","completionOk":"Model {{model}} completed a request ({{latencyMs}}ms)","completionFailed":"Model {{model}} failed to complete: the endpoint is reachable, but this model cannot answer","completionOkCached":"Model {{model}} completed a request ({{latencyMs}}ms, cached)","completionFailedCached":"Model {{model}} failed to complete: the endpoint is reachable, but this model cannot answer (cached)"}},"notice":{"switchDone":"Switch complete","warningPrefix":"Note: {{message}}","currentUser":"the current user","transferImported":"Import finished.","userSynced":"Sync finished."},"operations":{"undone":"Undid that operation on {{harness}}; both the native configuration files and the recorded active profile are back to where they were.","title":"Operation history","titleFor":"{{harness}} operation history","intro":"Every write to a native configuration file is recorded first, so after a power loss or a killed process the service rolls back whatever was left unfinished on its next start. Undo returns both the configuration files and the recorded active profile to their state before the operation.","loading":"Loading…","empty":"No operations recorded yet","viewDetails":"View details","refresh":"Refresh","close":"Close","count_one":"{{count}} entry","count_other":"{{count}} entries","fileCount_one":"{{count}} file","fileCount_other":"{{count}} files","user":"user {{user}}","undo":"Undo","undoTitle":"Undo this operation?","undoBody":"This restores {{harness}}\'s {{count}} native configuration files to their content before the operation and returns the recorded active profile with them. A snapshot is taken first.","undoFailed":"Undo failed","confirmUndo":"Confirm undo","kind":{"activate":"Switch profile","activate-official":"Back to official login","revoke":"Remove provider","reapply":"Re-write","import":"Import","sync":"Cross-user sync"},"state":{"prepared":"Prepared","applying":"Writing","metadata-committed":"Finishing","committed":"Done","rolled-back":"Rolled back","degraded":"Needs attention"}},"error":{"unknown":"Unknown error","http":{"requestFailed":"Request failed","invalidRequest":"The request data is invalid","internalServerError":"Internal server error","authenticationRequired":"Sign-in required","crossOriginDenied":"Cross-origin request denied"},"auth":{"invalidPassword":"Incorrect password"},"github":{"notConnected":"Connect GitHub before continuing","authFailed":"GitHub authorization failed; sign in again","gistNotFound":"No harness-switch backup Gist was found in GitHub","deviceCodeExpired":"The device code expired; get a new one","rateLimitExceeded":"GitHub API rate limit exceeded; try again later"},"cli":{"missingArgument":"A required argument is missing"},"profile":{"activeDeleteForbidden":"This profile is in use; activate another one before deleting it","alreadyExists":"A profile with this name already exists","notFound":"Profile not found","endpointNotFound":"Endpoint {{endpoint}} was not found","apiKeyRequired":"Enter an API key","nameRequired":"Enter a profile name","nameInvalid":"A profile name cannot contain slashes","nameTooLong":"A profile name is too long"},"adapter":{"modelRequired":"{{harness}} requires a model name","apiKeyRequired":"{{harness}} requires an API key","nativeConfigInvalid":"{{path}} is not valid {{format}} configuration","unknownTarget":"The adapter produced an unknown target {{key}}"},"activation":{"officialLoginUnsupported":"{{harness}} does not support official account login","officialLoginMissing":"No official login entry was found for {{harness}}; complete its official login in a terminal once first","officialApiKeyMissing":"No official DeepSeek API key configuration was found for {{harness}}","noActiveProfile":"This tool has no active profile, so there is nothing to render","officialProfileCannotAdopt":"The official login is active, so there is no profile to adopt into","adoptUnsupported":"This tool cannot adopt a live configuration","manualOverridesPreventAdopt":"Manual overrides would be lost by adoption; restore generated files first","officialProfileAlreadyExists":"A DeepSeek official profile already exists; edit it instead"},"provider":{"inUse_one":"This credential is referenced by {{count}} profile; remove the reference first","inUse_other":"This credential is referenced by {{count}} profiles; remove the references first","credentialUnreadable":"Could not read the key for credential {{id}}","notFound":"Provider not found","nameRequired":"Enter a provider name","apiKeyRequired":"Enter an API key","endpointsInvalid":"Endpoints must be an array","endpointKeyRequired":"Enter an endpoint id","endpointKeyInvalid":"An endpoint id contains invalid characters","endpointKeyDuplicate":"Endpoint {{key}} is duplicated","endpointUrlRequired":"Enter a base URL for endpoint {{key}}"},"codex":{"loginCacheTooLarge":"The Codex login cache file is too large and was skipped","loginCacheInvalidJson":"The Codex login cache is not valid JSON","configDirectoryNotRegular":"The Codex configuration directory is not a regular directory","loginCacheNotRegular":"The Codex login cache is not a regular file"},"transfer":{"envelopeInvalid":"Unsupported export file format","passphraseTooShort":"The migration passphrase must be at least 8 characters","decryptFailed":"Wrong migration passphrase, or the export file is damaged","tooManyProfiles":"The export file contains too many profiles","profilesInvalid":"The profile data in the export file is invalid","profileNameInvalid":"The export file contains an invalid profile name","duplicateProfile":"The export file contains a duplicate profile","providersInvalid":"The vault data in the export file is invalid","duplicateProvider":"The export file contains a duplicate vault entry","providerMissing":"A profile in the export file references a vault entry that does not exist","activeInvalid":"The active-profile data in the export file is invalid","duplicateActive":"The export file contains a duplicate active profile","activeProfileMissing":"An active profile in the export file references a profile that does not exist","officialActiveInvalid":"The official-login state in the export file is invalid","codexCacheInvalid":"The Codex login cache in the export file is invalid"},"sync":{"sourceCodexLoginCacheMissing":"The source user has no usable Codex official login cache","sourceEqualsTarget":"The source and target users are the same","invalidConflictPolicy":"The conflict policy is invalid"},"harness":{"notFound":"Harness not found"},"file":{"notRegular":"{{file}} is not a regular file","outsideManagedDirectory":"{{file}} is outside the managed directories","ownershipRequiresRoot":"Changing ownership of {{path}} requires running as root"},"scan":{"apiKeyRequired":"No credential could be extracted; enter an API key first"},"backup":{"targetInvalid":"{{path}} is not a valid {{harness}} backup target","invalidId":"The backup id is invalid","notFound":"Backup not found","fileNotOwned":"The backup references a file that {{harness}} does not own","payloadMissing":"Backup data for {{file}} is missing","payloadNameInvalid":"The backup payload name is invalid"},"operation":{"alreadyUndone":"This operation has already been undone","incomplete":"This operation has not finished; wait or restart the server to recover it","backupMissing":"Backup {{backupId}} for operation {{id}} has been rotated away","storageUnknown":"The operation refers to unknown storage {{key}}","snapshotMissing":"Operation {{id}} is missing the {{key}} snapshot","invalidId":"The operation id is invalid","notFound":"Operation not found"},"user":{"notManageable":"User {{username}} is not manageable","notSwitchable":"Cannot switch to user {{username}}","block":{"homeUnsearchable":"No permission to access","homeUnwritable":"No permission to write","storeInaccessible":"Config dir not writable","ownershipRequiresRoot":"Requires running as root","homeMissing":"Home directory missing"}},"storage":{"unreadable":"Could not read {{file}}","quarantineFailed":"Could not quarantine the corrupt {{file}}","corruptQuarantined":"The data store is corrupt. The original was quarantined as {{quarantine}}; restore from a backup before continuing"},"probe":{"badUrl":"Base URL does not parse, or is not http/https","missingBaseUrl":"No base URL supplied; nothing to test","missingApiKey":"No API key supplied; nothing to test","timeout":"Request timed out (10 seconds)","networkError":"Could not reach the endpoint (DNS, refused connection or TLS failure)","unauthorized":"Endpoint reachable but rejected the credential (HTTP {{status}}); check the API key","httpError":"Endpoint returned HTTP {{status}}","invalidResponse":"The response is not a recognized model-catalog format","missingModel":"No model to complete against: fill in a model name, or fetch the catalog first","completionUnsupported":"The endpoint accepts none of the known completion protocols","completionHttpError":"Model {{model}} returned HTTP {{status}} for a completion: the catalog lists it, but it cannot answer","completionInvalid":"The completion response is not a recognized format, so the model cannot be confirmed to have answered"},"favoriteNotFound":"Favorite not found.","favoriteRevisionRequired":"Favorite revision required.","favoriteRevisionConflict":"Favorite revision conflict.","favoriteInUse":"Favorite in use.","favoriteConnectionInUse":"Favorite connection in use.","favoriteEndpointMissing":"Favorite endpoint missing.","favoriteProtocolUnsupported":"Favorite protocol unsupported.","favoriteProjectionUnsupported":"Favorite projection unsupported.","favoriteProfileDiverged":"Favorite profile diverged.","favoriteRawOverrideConflict":"Favorite raw override conflict.","favoriteActiveUpdateRequiresApply":"Favorite active update requires apply.","favoritePlanStale":"Favorite plan stale.","favoritePlanExpired":"Favorite plan expired.","favoriteIdempotencyConflict":"Favorite idempotency conflict.","favoriteUndoConflict":"Favorite undo conflict.","favoritePreferenceNotRepresented":"Confirm ignoring the reasoning preference this harness cannot express.","favoriteEffortUnverified":"The connection reasoning effort levels are unverified.","favoriteStoreInvalid":"Favorite store invalid.","favoriteLimitReached":"Favorite limit reached.","favoriteCredentialConsentRequired":"Favorite credential consent required.","favoriteBackupInvalid":"The backup is invalid, damaged or belongs to different configuration paths. Nothing was restored.","favoriteBackupRecoveryFailed":"Restore rollback is incomplete. Configuration operations are paused to protect data. Check file permissions and retry.","favoriteBackupStale":"Configuration changed after preview. Check the restore impact again."},"warning":{"activation":{"envRebuildFailed":"The native configuration was written, but rebuilding env.sh failed","officialEnvRebuildFailed":"The official login was restored, but rebuilding env.sh failed","backfillFailed":"Could not save {{profile}}\'s existing configuration back into the profile"},"provider":{"endpointFallback":"Endpoint {{endpoint}} no longer exists; falling back to the provider\'s first endpoint","reapplyFailed":"Re-apply failed: {{reason}}"},"sync":{"activeReapplyFailed":"The profile store was updated, but automatic re-activation failed: {{reason}}"},"transfer":{"activeRestoreFailed":"Could not restore the active state: {{reason}}"},"scan":{"profileGone":"The configuration is no longer on disk; skipped","profileExists":"A profile with the same name already exists; skipped","importFailed":"Import failed: {{reason}}"}},"update":{"updating":"Updating…","failed":"Update failed","failedHint":"Run bunx @seaveyon/harness-switch@latest manually","short":"Update","toVersion":"Update to v{{version}}"},"sync":{"title":"Sync from another user","intro":"Copies the source user\'s profiles and the credentials they reference to {{user}}. Active state, backups and native configuration files are not copied by default; migrating the Codex login cache is a separate opt-in.","sourceUser":"Source user","selectUser":"Select a local user","profileCount":"Profiles {{count}}","providerCount":"Credentials {{count}}","conflictCount":"Name conflicts {{count}}","overwriteByHarness":"Overwrite same-named profiles per harness","overwriteHint":"Only checked harnesses are overwritten; unchecked ones keep the current user\'s version.","overwriteHarness":"Overwrite {{harness}}","conflictsInHarness_one":"{{count}} same-named profile","conflictsInHarness_other":"{{count}} same-named profiles","migrateCache":"Migrate the Codex official login cache (auth.json)","migrateCacheHint":"This copies a reusable Codex login session, not ordinary configuration. Choose it only when the target user is entitled to that login.","migrateCacheOverwrite":"The target user already has a login cache; continuing overwrites it and takes a backup first.","storeOnlyHint":"Syncing only writes to the profile store. Activate the profile you want after syncing to make it take effect.","noOtherUsers":"There are no other manageable local login users.","inspecting":"Checking…","inspect":"Check what can be synced","syncing":"Syncing…","syncTo":"Sync to {{user}}","confirmCacheTitle":"Migrate the Codex login cache?","confirmCacheBody":"This copies {{source}}\'s Codex official login cache (auth.json) to {{target}}. {{extra}}Continue only if the target user is entitled to use that login session.","confirmCacheOverwrite":"The target user already has a cache; it will be overwritten and backed up. ","confirmCacheFresh":"The target user will get a new local login cache. ","confirmCacheAction":"Migrate the login cache and sync","done":"Sync complete: {{imported}} added, {{overwritten}} overwritten, {{skipped}} skipped, {{providersCopied}} credentials copied.","cacheMigrated":"The Codex login cache was migrated.","cacheNotMigrated":"The Codex login cache was not migrated."},"transfer":{"title":"Move configuration","intro":"Bring profiles and credentials onto this machine, or pack them up to take along. Every source writes to this manager’s own store.","exportTitle":"Export everything","exportIntro":"The file is AES-256-GCM encrypted with the transfer passphrase, independent of this machine\'s local key.","passphrase":"Transfer passphrase","passphrasePlaceholder":"At least {{min}} characters","passphraseConfirm":"Confirm the passphrase","passphraseConfirmPlaceholder":"Type it again","passphraseMismatch":"The two passphrases do not match.","encrypting":"Encrypting…","download":"Download the encrypted export","exported":"The encrypted export is ready. The passphrase is not written to the file — keep it separately.","importTitle":"Import onto this machine","importIntro":"The file is decrypted and checked for conflicts first; nothing is written until you confirm. Profiles of the same name on this machine are kept by default.","pickFile":"Choose a .hsw-backup file","pickFileHint":"The file is decrypted by the server on this machine; nothing is sent to an external service.","notAnExport":"Not a valid harness-switch export file","importPassphrasePlaceholder":"The passphrase set at export time","inspecting":"Checking…","inspect":"Check what would be imported","profileCount_one":"{{count}} profile","profileCount_other":"{{count}} profiles","providerCount_one":"{{count}} credential","providerCount_other":"{{count}} credentials","conflictCount_one":"{{count}} name conflict","conflictCount_other":"{{count}} name conflicts","activeCount_one":"{{count}} activation state","activeCount_other":"{{count}} activation states","harnessProfiles":"{{harness}}: {{count}}","conflictList":"Same name: {{items}}","previewStale":"The import options changed — check the contents again before confirming.","conflictPolicy":"Profiles with the same name","policySkip":"Keep this machine’s profile, skip the import","policyOverwrite":"Overwrite this machine’s profile from the export","restoreActive":"Restore the activation state from the export","recheckNeeded":"Check the contents again","confirmImport":"Confirm the import","confirmAuthTitle":"Confirm a change to Codex auth.json?","confirmTitle":"Import every profile?","confirmBody":"This imports {{count}} profiles.","confirmOverwrite_one":"{{count}} of them has the same name and will be overwritten.","confirmOverwrite_other":"{{count}} of them have the same name and will be overwritten.","confirmKeep":"Profiles with the same name are kept, not overwritten.","proceedAware":"Understood, import anyway","proceedOverwrite":"Overwrite and import","proceedSafe":"Import safely","importedCount_one":"{{count}} added","importedCount_other":"{{count}} added","overwrittenCount_one":"{{count}} overwritten","overwrittenCount_other":"{{count}} overwritten","providersCopiedCount_one":"{{count}} credential restored","providersCopiedCount_other":"{{count}} credentials restored","skippedCount_one":"{{count}} skipped","skippedCount_other":"{{count}} skipped","activeRestoredCount_one":"{{count}} activation state restored","activeRestoredCount_other":"{{count}} activation states restored","cacheMigrated":"the export\'s Codex login cache was migrated","cacheNotMigrated":"the export\'s Codex login cache was not migrated","importedSummary":"Import complete: {{parts}}.","authEffect":{"openai-api-key":"Restoring the selected Codex profile updates OPENAI_API_KEY in this machine\'s auth.json; that is not the same as migrating the export\'s full official login session.","auth-override":"Restoring the selected Codex profile writes that profile\'s raw auth override into this machine\'s auth.json.","official-cleanup":"Restoring Codex\'s official-login state may clear a leftover OPENAI_API_KEY from this machine\'s auth.json."},"sourceLabel":"Pick a source","sources":{"scan":"Config already here","user":"Another local user","file":"Encrypted file","gist":"GitHub Gist"},"currentPolicy":"Current policy: {{policy}}","importing":"Importing…"},"githubSync":{"title":"GitHub Cloud Sync","loading":"Checking GitHub connection…","intro":"Seamless multi-machine configuration synchronization using your GitHub account. Backups are end-to-end AES-256-GCM encrypted with a master passphrase before storing into a private Gist.","tabDevice":"GitHub OAuth Login","tabToken":"Personal Access Token","deviceIntro":"Enter the user code on GitHub to complete binding.","openAuthPage":"Authorize on GitHub","getCode":"Get Device Code","userCode":"User Code","copyCode":"Copy Code","copied":"Copied","waitingAuth":"Waiting for GitHub authorization…","waitingAuthInterval":"Waiting for GitHub authorization (polling in {{seconds}}s)…","checkingAuth":"Checking authorization…","checkNow":"Check now","regenerateCode":"Get a new device code","tokenPlaceholder":"Enter GitHub Token with gist permission (ghp_...)","connectToken":"Connect & Sign in","connecting":"Connecting…","disconnect":"Disconnect","lastSynced":"Last synced:","neverSynced":"Never synced","cloudGist":"Cloud Gist:","pushTitle":"Upload to Cloud","pushIntro":"Encrypts all profiles and provider credentials on this machine and uploads to your private Gist.","passphrase":"Sync Passphrase","passphrasePlaceholder":"Passphrase for end-to-end encryption","pushing":"Encrypting and uploading…","pushSuccess":"Successfully synced to GitHub Gist ({{profiles}} profiles, {{vault}} credentials).","pullTitle":"Pull from Cloud","pullIntro":"Downloads the encrypted backup from your private Gist and decrypts it locally.","pullPassphrasePlaceholder":"Sync passphrase set during upload","inspect":"Inspect Cloud Backup","pulling":"Pulling…","confirmPull":"Confirm Sync to Local","pullSuccess":"Cloud sync complete: {{summary}}","authorized":"GitHub authorized — welcome, {{user}}.","connected":"GitHub connected — welcome, {{user}}.","disconnected":"Disconnected from GitHub.","codeExpired":"The authorization code expired — request a new one.","authFailed":"Authorization failed — try again.","connectedBadge":"Connected","refreshStatus":"Refresh status","previewTitle":"What the cloud backup holds","backedUpAt":"Backed up {{time}}","tokenLabel":"Personal access token","tokenScopeHint":"The token needs the gist scope to read and write the encrypted config file."},"import":{"title":"Import existing configuration","intro":"Reads what these five tools currently have on disk and picks out the providers that can be adopted. Neither the scan nor the import touches their configuration files; you have to activate a profile yourself before anything is written.","scanning":"Reading the existing configuration…","failed":"Import failed","summary":"Imported {{imported}}, skipped {{skipped}}, created {{providersCreated}} credentials","providerCount_one":"{{count}} provider","providerCount_other":"{{count}} providers","sourceMissing":"missing","sourceRead":"read","sourceUnparsable":"unparseable","select":"Select {{name}}","inUse":"In use","nameTaken":"A profile with this name exists","matchesProvider":"Already in the vault: {{name}}","noBaseUrl":"(no base url)","keyOutsideConfig":"credential is not in the config file","profileName":"Profile name","credentialTarget":"Where to keep the credential","targetProfile":"In this profile itself","targetNewVault":"As a new vault entry","targetExisting":"Link to existing credential: {{name}}","apiKeyFromEnv":"This provider reads its credential from the environment, so it is not in the config file","overwriteExisting":"Overwrite the existing profile with this name","selected":"{{count}} selected","selectPrompt":"Check the providers to adopt","rescan":"Scan again","importSelected":"Import selected"},"scan":{"note":{"unsupported":"This tool does not support scan-and-import yet","noConfigFiles":"No config file for this tool was found on disk","unparsable":"The config file exists but cannot be parsed — fix it before importing","noCandidates":"No importable provider was found in the config file"}},"common":{"cancel":"Cancel","delete":"Delete","close":"Close","closeDialog":"Close dialog","apiKey":"API key","listSeparator":", "},"preset":{"zaiAnthropic":"Z.AI (Anthropic compatible)","moonshotAnthropic":"Moonshot (Anthropic compatible)","deepseekAnthropic":"DeepSeek (Anthropic compatible)","openrouter":"OpenRouter","zai":"Z.AI","moonshot":"Moonshot","deepseek":"DeepSeek","cliproxyResponses":"CLIProxy (Responses)"},"probe":{"action":"Test connection","fetchModels":"Fetch models","fetchingModels":"Fetching…","completionAction":"Test completion","testingCompletion":"Testing completion…","completionHint":"Sends one real minimal request to prove the model actually answers (costs a token or two).","probing":"Testing…","ok":"Reachable \xb7 {{latencyMs}}ms \xb7 {{count}} models","okNoCatalog":"Reachable \xb7 {{latencyMs}}ms \xb7 no model catalog returned","completionOk":"Model {{model}} answers \xb7 {{latencyMs}}ms","completionCached":"Model {{model}} answers \xb7 cached {{at}}","completionFailedCached":"cached {{at}}","catalogHint":"Fetched {{count}} models; model fields can now use the dropdown.","missingBaseUrl":"Add an endpoint URL before testing."},"favorites":{"linked":"Linked template","sourceMissing":"Template source is missing","connectionMissing":"Source connection is missing","importCount":"{{count}} templates","retryFailed":"Preview failed items again","saveFavorite":"Save template","authentication":"Authentication mode","liveState":"Native file state","preserved":"These existing fields keep their values; fixed model slots continue using their existing models","exportVersion":"Default exports use payload v2; the receiving version must support model favorites.","legacyExport":"Legacy export (omits favorites and source links)","catalog":"Fetch model catalog (no completion request)","catalogModel":"Choose a model ID from the catalog","noCatalog":"Catalog unavailable or empty; you can still enter a model ID.","title":"Templates","subtitle":"Save templates, choose connections, configure your tools.","add":"New template","edit":"Edit template","name":"Template name","notes":"Notes","save":"Save configuration only","delete":"Delete template","connections":"Connections","connection":"Select connection","label":"Connection label","endpoint":"Vault endpoint","protocol":"Protocol","model":"Exact request model ID","addConnection":"+ Add channel","removeConnection":"Remove connection","contextWindow":"Context window","maxOutputTokens":"Maximum output tokens","reasoningSupported":"Reasoning capability","reasoningEffort":"Preferred reasoning effort","supportedReasoningEfforts":"Supported reasoning efforts","effortsHint":"Comma-separated: none,minimal,low,medium,high,xhigh,max,ultra","unknown":"Unknown / unset","true":"Yes","false":"No","declared":"User-declared values; capabilities are not verified.","inherited":"Inherited from template","overridden":"Connection override; blank clears inheritance","inherit":"Inherit","invalid":"Check the name, connections and capability declarations.","configure":"Configure tools","saveOnlyHint":"Saving alone does not change native files. Choose activation to apply to a tool.","target":"Target profile","newProfile":"New profile","profileName":"Profile name (blank for automatic naming)","mode":"Operation","activate":"Save and activate","ignorePreference":"Ignore unsupported reasoning preference","overwriteDiverged":"Overwrite diverged controlled fields from template","preview":"Preview","appliedToast":"Applied the template to {{count}} tools.","confirm":"Apply reviewed plan","rendererDefault":"Renderer default","notRepresented":"Fields not represented","nativeFiles":"Native write targets","none":"None","applied":"Applied","unchanged":"Unchanged","failed":"Failed; preview again","skipped":"Skipped; preview again","capture":"Capture existing profile","extractCredential":"Store inline credential in the vault for reuse","linkSource":"Link the source profile","search":"Search names, models or connections","loading":"Loading favorites…","empty":"No favorites yet. Capture a profile or add one manually.","pending":"Not connected","generated":"Generated profiles","needsUpdate":"Update available","diverged":"Local divergence","detach":"Detach, keep profile","harnesses":"Harness profiles","autoName":"Use the model name when empty","modelAdvanced":"Advanced: capabilities, reasoning and notes","channelName":"Customize channel name","channelAdvanced":"Advanced: channel overrides","targetAdvanced":"Change target profile or name","changeDetails":"View parameter changes","fileDetails":"View native file changes","activateSelected":"Activate in selected tools after saving","noCompatibleChannel":"No compatible channel","updateProfile":"Update existing profile","backups":"Backup and restore","backupHint":"Back up this user’s favorites, profiles, credentials and native tool files. The last 20 automatic checkpoints before favorite changes and one manual checkpoint are kept, encrypted locally.","backupNow":"Back up current state","backupCreated":"Checkpoint created","backupRestored":"Restored. The previous state was also backed up, so you can revert this restore.","backupEmpty":"No checkpoints yet. One will be created before the first change.","restoreScope":"Restore all favorites, profiles, provider credentials, active records and native configuration for the five tools to this time, replacing later changes. The current state will be backed up first. Manager sign-in and password stay unchanged.","restore":"Review restore impact","restoreConfirm":"Confirm restore","cancel":"Cancel","backupReason":{"manual":"Manual checkpoint","change":"Before favorite change","apply":"Before applying to tools","restore":"Before restore"},"workflow":"Configuration steps","chooseTools":"Choose tools","reviewChanges":"Review changes","chooseHint":"Choose tools to configure. Existing linked profiles are selected automatically.","reviewHint":"Review the changes below. Nothing is written until you confirm.","targetTools":"Target tools","activateCount":"Activate now","changedFiles":"Native file changes","autoBackupNotice":"A checkpoint is created before applying. Restore it from the global Recovery timeline.","resolveBeforeApply":"Go back to resolve the conflicts, then generate a new preview.","selectedCount":"{{count}} tools selected","compatibleCount":"{{count}} compatible channels","selected":"Selected","backToSelection":"Back to selection","done":"Done","confirmSave":"Save profiles","confirmActivate":"Save and activate","parameter":"Parameter","before":"Before","after":"After","noParameterChanges":"No parameter changes","mappingDetails":"Mapping and preserved settings","redactedDiffHint":"Only credentials such as API keys and tokens are hidden; models and ordinary settings remain visible. Files are shown in a normalized structure.","modeLabel":{"save":"Save only","activate":"Save and activate"},"toolNames":{"claude":"Claude Code","codex":"Codex","kimi":"Kimi Code","pi":"Pi","dsh":"DeepSeek Harness"},"liveComparison":"Current tool configuration → after applying","liveComparisonHint":"Compare the current native files on disk with what will be written. Only credentials such as API keys and tokens are hidden.","previewBlocked":"Native file preview is unavailable. Resolve the blocking issues first.","savedComparison":"View saved profile changes","savedComparisonHint":"This compares the saved target profile with the profile to be saved, not the configuration currently used by the tool.","savedUnchanged":"Saved profile unchanged \xb7 View details","savedUnchangedHint":"The target profile already contains these settings. Switching to it may still change the tool\'s native files.","savedBefore":"Saved profile","savedAfter":"After saving","batchSummary":"{{count}} tools \xb7 Switch {{activate}} \xb7 Change {{files}} native files","confirmBatchSave":"Confirm save to {{count}} tools","confirmBatchActivate":"Confirm save and switch {{count}} tools","tabBlocked":"Needs attention","tabChanges":"{{count}} changed files","restoreReview":"Confirm global restore","restoreReviewHint":"Review the impact on the current state before restoring.","restoreChecking":"Working, please wait…","restoreRecheck":"Check impact again","restoreImpact":"{{count}} items will change","restoreNoChanges":"Current contents match this restore point. No restore is needed.","restoreUnchanged":"{{count}} unchanged items","restoreArea":{"favorites":"All model favorites","profiles":"Profiles for all tools","vault":"Providers and credential vault","active":"Active configuration records","env":"Environment file"},"restoreAction":{"create":"Restore missing file","replace":"Replace with backup contents","delete":"Delete file absent from backup"},"backupAction":{"create":"Before adding favorite “{{name}}”","update":"Before editing favorite “{{name}}”","delete":"Before deleting favorite “{{name}}”","capture":"Before capturing “{{name}}” from {{tools}}","detach":"Before detaching “{{name}}” from {{tools}}","apply":"Before configuring “{{name}}” for {{tools}}","restore":"Before global restore to {{name}}"},"channelNumber":"Channel {{count}}","channelHint":"Choose a provider and the model to use","channelProvider":"Provider / endpoint","chooseProvider":"Choose a provider endpoint","removeChannelNamed":"Remove channel: {{name}}","modelPicker":"Model","modelPickerHint":"Choose from the catalog or enter a custom model ID.","modelPlaceholder":"Choose or enter a model ID","modelSearch":"Search or enter a model ID","modelEmpty":"Enter a model ID to add it, or load the provider catalog first.","modelCustom":"Use “{{value}}”","catalogLoad":"Load catalog","catalogRefresh":"Refresh catalog","catalogLoading":"Loading","catalogCount":"{{count}} catalog models available to search above.","noCatalogManual":"No catalog available. You can still enter a model ID."},"favorite":{"result":"Operation completed"},"templates":{"tag":"Template"},"workspace":{"fileDiffTab":"File changes","navigation":"Main navigation","breadcrumb":"Breadcrumb","nav":{"workspace":"Workspace","favorites":"Templates","history":"Recovery timeline"},"eyebrow":"CONFIGURATION WORKSPACE","title":"What are your tools using?","subtitle":"Choose a tool and inspect the configuration currently in use.","homeSubtitle":"Home shows only live configuration; switching and management stay in each tool\'s configuration workspace.","manageFavorites":"Manage templates","switchTool":"Switch {{name}}","configureTool":"Configure and switch","configureSwitch":"Configure and switch","switcherEyebrow":"CONFIGURE AND SWITCH","switcherTitle":"Configure and switch {{name}}","switcherHint":"Create a candidate from a configuration or template, compare its route and file changes, then confirm the write.","configurations":"Configurations","useConfiguration":"Use this configuration","newConfiguration":"New configuration","noProfiles":"No local configuration is available to switch to yet.","noTemplates":"No template yet.","manageConfigurations":"Manage configuration entries","mappedModels":"Role-based mapping","toolDefaultModel":"Default model selected by the tool","currentConfigurationManagement":"Current configuration and advanced management","chooseTemplate":"Choose a template","pickTemplate":"Search and select a template","pickTemplateHint":"Choose a template to see its connections and preview the switch.","newFromTemplate":"Create configuration from template","manageTemplates":"Manage templates","noMatches":"No matching models.","startTitle":"Save a model once. Use it across your tools.","startHint":"Start from an existing tool profile to reuse its provider and model ID. Then choose a tool to preview a switch without entering credentials again.","noTools":"No tool information available.","lastBackup":"Latest recovery point: {{time}}","historyHint":"Save a checkpoint or explore automatic backups before favorite operations.","openHistory":"View timeline","relationship":"Configuration connections","provider":"Provider","tool":"Tool","missingProvider":"Provider missing","relationshipHint":"Connections show configuration sources and writes. Tools send model requests directly.","currentChain":"Current route","configuration":"Configuration","currentChainHint":"This route is active in the current tool.","currentForTool":"{{name}} is currently using","currentForToolHint":"Home only shows active configuration, never an unconfirmed candidate.","activeNow":"Active","switchMap":"Current and new routes","candidateChain":"New route","appliesAfterConfirm":"Active after apply","notWritten":"Not written","switchTarget":"Switching {{name}} in this preview","switchTargetHint":"This is a preview target for {{name}} and has not been written. Other tools keep their own current configuration.","checking":"Checking available channels…","chooseChannel":"Choose a channel for this switch","current":"Current","currentToolModel":"Current {{name}} model","targetToolModel":"{{name}} will switch to","preview":"Preview switch","previewHint":"Takes effect after confirmation. An automatic backup is available in the recovery timeline.","captureHint":"Reuse the model and provider from an existing profile.","favoriteEyebrow":"MODELS CONNECTED TO TOOLS","favoriteHint":"Choose a model to see its channels and linked tools. Click a tool to configure it.","favoriteDetail":"Connections reflect actual channels and tool profiles.","graphHint":"Choose a channel on the left, then a tool on the right.","manageLinks":"Manage generated profiles and favorite","inUse":"In use","saved":"Saved","available":"Available","linkMissing":"Linked source missing","back":"Back to workspace","captureCurrent":"Favorite the current profile"},"timeline":{"title":"Recovery timeline","eyebrow":"YOUR CONFIGURATION THROUGH TIME","subtitle":"Return to a working configuration. Select a checkpoint to review its impact.","points":"Recovery points","current":"Current state","currentHint":"Models currently used by your tools","snapshot":"Historical snapshot","snapshotHint":"Automatic checkpoints preserve the state before the named operation. Review the file changes needed to restore it from the current state.","older":"Older","newer":"Newer","restore":"Restore all to this point","protection":"Your current state is backed up before restoring.","currentDescription":"These are your tools\' active configurations. Save a manual checkpoint or choose a historical recovery point.","selectHint":"Select a recovery point to review files that will be replaced, deleted, or created."}}'),h=JSON.parse('{"app":{"name":"harness-switch","tagline":"写入原生配置","checkingSession":"正在检查会话…","brandMark":"HS / harness-switch","devMode":"本地开发模式:当前页面由本地 dev server 提供"},"language":{"toEnglish":"Switch to English","toChinese":"Switch to Chinese","short":"EN"},"theme":{"toLight":"切换到浅色主题","toDark":"切换到深色主题"},"login":{"title":"服务器端配置中枢","intro":"激活档案时直接写入各 CLI 自己的配置文件,不依赖你在某个 shell 里 source 过什么。","hint":"输入首次启动时终端打印的 Web 密码。","password":"Web 密码","submitting":"登录中…","submit":"登录"},"nav":{"currentLocalUser":"当前本地用户","localUser":"本地用户","transfer":"配置迁移","vault":"凭据库","signOut":"退出","switchHarness":"切换 Harness"},"harness":{"field":{"toggle":{"on":"开启","off":"关闭"},"providerId":{"label":"Provider ID(可选)","placeholder":"默认取配置名称"},"contextLength":{"label":"上下文长度"},"maxTokens":{"label":"最大输出 tokens"},"claude":{"authVar":{"label":"凭据变量","help":"第三方中转通常要求 ANTHROPIC_AUTH_TOKEN;官方 API key 用 ANTHROPIC_API_KEY。","option":{"authToken":"ANTHROPIC_AUTH_TOKEN(第三方中转)","official":"ANTHROPIC_API_KEY(官方)"}},"haikuModel":{"label":"Haiku 模型映射"},"sonnetModel":{"label":"Sonnet 模型映射"},"opusModel":{"label":"Opus 模型映射"},"fableModel":{"label":"Fable 模型映射(可选)","help":"写入 ANTHROPIC_DEFAULT_FABLE_MODEL;用于支持 Fable 档位的新版 Claude Code。"},"subagentModel":{"label":"子代理模型(可选)","help":"写入 CLAUDE_CODE_SUBAGENT_MODEL,可让子代理使用更快或成本更低的模型。"},"haikuModelName":{"label":"Haiku 显示名称(选填)"},"sonnetModelName":{"label":"Sonnet 显示名称(选填)"},"opusModelName":{"label":"Opus 显示名称(选填)"},"fableModelName":{"label":"Fable 显示名称(选填)"},"modelMapping":{"help":"写入 {{envVar}}。"},"modelName":{"help":"写入 {{envVar}};留空时 Claude Code 默认显示对应模型 ID。","placeholder":"留空则使用 {{role}} 模型 ID"},"example":{"placeholder":"例如:{{value}}"},"extraEnv":{"label":"追加环境变量(可选)","help":"每行一个 KEY=VALUE,会合并进 settings.json 的 env。"},"oneM":{"subagentLabel":"子代理 声明支持 1M","label":"{{role}} 声明支持 1M","help":"在模型 ID 末尾追加 [1m],向 Claude Code 声明 1M 上下文;Claude Code 请求上游前会去掉该后缀。仅在该模型确实支持 1M 时开启。"}},"codex":{"envNote":"仅「环境变量」认证模式需要 env.sh,其余模式的凭据自包含在 config.toml 里。","authMode":{"label":"认证方式","help":"auth.json 就是 Codex 的登录缓存,覆盖它会丢失 ChatGPT 登录态,所以默认不碰它。","option":{"bearerToken":"写入 config.toml(推荐,保留官方登录)","envKey":"环境变量(需要 source env.sh)","openaiAuth":"写入 auth.json(会覆盖 ChatGPT 登录缓存)"}},"providerId":{"help":"openai / ollama / lmstudio / amazon-bedrock 等是 Codex 保留字,会自动改名。"},"envKeyName":{"label":"环境变量名","help":"仅「环境变量」模式生效。"},"reasoningEffort":{"label":"推理强度(可选)","option":{"unset":"不设置"}},"target":{"auth":"auth.json(仅 auth.json 模式)"}},"kimi":{"envNote":"Kimi Code 不从 shell 读取凭据,env.sh 对它无效。","providerType":{"label":"Provider 类型","help":"决定 Kimi Code 使用哪套协议实现。","option":{"kimi":"kimi(Moonshot / Kimi Code)"}},"maxContextSize":{"help":"Kimi Code 要求 models 条目必须声明 max_context_size。"}},"pi":{"envNote":"API key 直接写入 models.json,无需环境变量;运行时仍可用 --model 覆盖。","providerId":{"help":"模型引用格式为 provider/model。"},"api":{"label":"协议"},"authHeader":{"label":"Authorization 头","help":"以 Authorization: Bearer <key> 发送。"},"reasoning":{"label":"推理能力","help":"对应 models.json 的 reasoning。GPT / Claude 思考模型需要开启。"}},"dsh":{"envNote":"API key 安全写入 DSH 的 .credentials.yaml,并由 settings.yaml 引用。","providerType":{"label":"提供方类型","option":{"custom":"自定义提供方","official":"DeepSeek 官方 API"}},"providerId":{"help":"DSH 的模型路由标识;必须以小写字母开头。"},"models":{"label":"模型目录(可选)","placeholder":"每行一个模型 ID;留空时只注册上方的默认模型","help":"一个提供方可注册多个模型;上方“模型”作为新会话的默认模型。"},"api":{"label":"API 协议"},"reasoningEfforts":{"label":"支持的思考程度","help":"DSH 只会显示这里声明且上游模型实际支持的档位。","option":{"unset":"不声明(提供方默认)","none":"模型不支持思考程度","lowToMax":"Low / Medium / High / XHigh / Max","lowToXhigh":"Low / Medium / High / XHigh","minimalToHigh":"Minimal / Low / Medium / High"}}}},"subtitle":"管理配置档案并安全写入该工具的原生配置文件。","newProfile":"新增配置","addCustomProvider":"添加自定义提供方","current":"当前:{{name}}","currentInactive":"当前:未激活","activeConfig":"当前生效配置","defaultModel":"默认模型","activeNamed":"当前激活 \xb7 {{name}}","inactive":"未激活","active":"已激活","activate":"激活","setDefault":"设为默认","default":"默认","deepseekOfficial":"DeepSeek 官方","writeTargets":"写入目标","noTargetFile":"未配置目标文件","moreFiles_one":"以及另外 {{count}} 个文件","moreFiles_other":"以及另外 {{count}} 个文件","overwriteWarning":"配置将直接覆盖目标文件。写入前会自动备份,切换后请验证服务连通性与模型可用性。","profiles":"配置档案","providers":"提供方","profileCount_one":"{{count}} 个自定义配置","profileCount_other":"{{count}} 个自定义配置","copy":"复制 {{name}}","noProfiles":"还没有配置档案","manualOverride":"手动接管","edit":"编辑 {{name}}","delete":"删除 {{name}}","deleteBlocked":"先激活另一个配置,才能删除当前配置","deleteTitle":"删除配置?","deleteBody":"将删除 {{harness}} / {{profile}}。{{extra}}此操作不可撤销。","deleteAdditiveExtra":"它在配置文件里的 provider 条目也会被一并摘掉。","deleteDshOfficialExtra":"它的 DeepSeek 原生路由和凭据引用也会被一并移除。","official":"官方登录","officialActive":"已使用","officialSwitch":"切回官方","officialHintClaude":"使用 Claude Code 自身的 Anthropic 账号登录","officialHintCodex":"使用 Codex 自身的 ChatGPT / OpenAI 账号登录","officialHintKimi":"使用 Kimi Code 自身的 Kimi 账号登录(/login 写入的 OAuth 凭据)","officialHintDsh":"检测并切换到 DeepSeek Harness 已有的 DeepSeek 官方 API Key 配置。","application":"应用","writeMode":"写入模式","modeReplace":"替换当前配置","modeAdditive":"保留并切换指针"},"profile":{"editTitle":"编辑 {{harness}} / {{profile}}","createTitle":"新增 {{harness}} 配置","copyTitle":"复制 {{harness}} / {{profile}}","intro":"保存后会写入 {{targets}}。","additiveNote":"该工具的配置文件按 provider 共存,切换只会移动当前指针,不会删除你手写的其他 provider。","useSharedProvider":"使用共享 Provider(凭据库)","useSharedProviderLabel":"使用共享 Provider","keyFromVault":"密钥由凭据库提供","providerNone":"不使用(本配置自带密钥)","vaultEmpty":"凭据库为空,可先在顶部「凭据库」中新增 Provider 条目。","namedEndpoint":"命名 Endpoint(可选)","namedEndpointLabel":"命名 Endpoint","endpointNone":"不指定(使用下方 Base URL)","endpointOption":"{{label}}({{key}})","noEndpoints":"该 Provider 没有命名 endpoint,将使用下方 Base URL。","quickFill":"快速填充:","name":"配置名称","namePlaceholder":"例如:openrouter-main","renameHint":"修改后会同步更新当前激活状态和原生配置中的 Provider 标识。","baseUrl":"API Base URL","baseUrlPlaceholder":"https://api.example.com/v1","baseUrlFromVault":"Base URL 来自凭据库 endpoint「{{endpoint}}」。","apiKey":"API Key","apiKeyKeep":"留空表示保持不变","apiKeyRequiredPlaceholder":"必填","apiKeySharedHint":"已引用共享 Provider,密钥在「凭据库」中统一轮换。","dshOfficialApiKeyHint":"填写 DeepSeek 开放平台 API Key;它会安全写入 DSH 的 .credentials.yaml,并以 DEEPSEEK_API_KEY 被 settings.yaml 引用。","fallbackModel":"回退模型(ANTHROPIC_MODEL)","model":"模型","fallbackModelPlaceholder":"可选;各档未匹配时使用,例如 glm-5","modelPlaceholder":"例如:claude-sonnet-4-5","claudeModelHint":"留空则沿用 Claude Code 默认模型;可在下面分别映射各模型档位。","notes":"备注(可选)","advanced":"高级:原始配置","overridden":"已手动接管","saveFirst":"先保存这份配置,之后回到编辑界面即可接管原始文件内容。","save":"保存配置","saving":"保存中…","rawLoading":"正在读取将写入的内容…","rawIntro":"下面是当前会写入磁盘的内容,基于最近一次保存的字段生成。改动任意一份即视为手动接管,之后表单字段不再影响这份文件。","resetToGenerated":"恢复为自动生成","selectPlaceholder":"请选择","mapping":{"title":"模型映射","intro":"显示名称仅影响 Claude Code 的 /model 菜单;留空时显示对应的实际模型 ID。开启「1M 上下文」会在模型 ID 末尾追加 [1m],仅在该模型确实支持 1M 时开启。","role":"模型角色","displayName":"显示名称","actualModel":"实际请求模型","oneM":"1M 上下文","defaultTo":"默认:{{model}}","notInMenu":"不显示在 /model 菜单","oneMUnsupported":"{{role}} 不支持 1M","enable":"启用"},"error":{"nameRequired":"请输入配置名称","nameSlash":"配置名称不能包含 / 或 \\\\","nameTooLong":"配置名称最多 {{max}} 个字符","nameDuplicate":"同名配置已经存在","baseUrlRequired":"请输入 API Base URL","apiKeyRequired":"请输入 API Key","modelRequired":"请输入模型名称","providerGone":"引用的 Provider 已不存在,请重新选择","endpointGone":"引用的 Endpoint 已不存在,请重新选择","fieldRequired":"请填写{{label}}","checkFields":"请检查标红的必填项或输入内容。"}},"vault":{"title":"凭据库","intro":"Provider 条目集中保存 API Key(AES-256-GCM 加密,默认不显示明文),并附带可复用的 endpoint。配置档案可以引用这里的条目,而不是各自保存一份密钥。","createTitle":"新增 Provider","editTitle":"编辑 {{name}}","formIntro":"配置凭据和可复用的命名 Endpoint;保存后返回凭据库列表。","loading":"正在读取凭据库…","entryCount_one":"{{count}} 个 Provider 条目","entryCount_other":"{{count}} 个 Provider 条目","add":"新增凭据","empty":"凭据库为空,先新增一个 Provider。","keyConfigured":"密钥已配置","keyMissing":"未配置密钥","noEndpoints":"没有命名 endpoint","reveal":"显示 {{name}} 的密钥","hide":"隐藏 {{name}} 的密钥","edit":"编辑 {{name}}","delete":"删除 {{name}}","close":"关闭","deleteTitle":"删除这个 Provider?","deleteBody":"将删除「{{name}}」。被配置档案引用的条目无法删除,请先移除引用。","deleted":"已删除。","deleteFailed":"删除失败","revealFailed":"无法读取密钥","name":"名称","namePlaceholder":"例如:openrouter","apiKey":"API Key","apiKeyKeep":"留空表示保持不变","apiKeyRequiredPlaceholder":"必填","notes":"备注(可选)","endpoints":"命名 Endpoint(可选)","endpointsHint":"配置档案引用此 Provider 时可以选择某个 endpoint,其 Base URL 优先于配置自身的地址。","noEndpointDrafts":"还没有 endpoint","endpointKeyLabel":"Endpoint {{index}} 名称","endpointKeyPlaceholder":"标识,如 default","endpointUrlLabel":"Endpoint {{index}} Base URL","endpointUrlPlaceholder":"https://api.example.com/v1","endpointLabelLabel":"Endpoint {{index}} 标签","endpointLabelPlaceholder":"显示标签(可选)","removeEndpoint":"移除 Endpoint {{index}}","addEndpoint":"添加 endpoint","saving":"保存中…","saveChanges":"保存修改","updated":"已更新。","created":"已新增 Provider 条目。","saveFailed":"保存失败","error":{"nameRequired":"请输入 Provider 名称","apiKeyRequired":"请输入 API Key","endpointKeyRequired":"请输入 Endpoint 标识","endpointKeyInvalid":"不能包含 / 或 \\\\,且最多 {{max}} 个字符","endpointKeyDuplicate":"Endpoint 标识不能重复","endpointUrlRequired":"请输入 Base URL","checkFields":"请检查标红的必填项。"},"probeEndpointLabel":"选择要测试的 endpoint","probeFailed":"测试请求失败"},"activate":{"title":"激活配置?","officialTitle":"切回官方登录?","body":"将把 {{harness}} 切换到「{{profile}}」并写入原生配置文件{{changed}}。目标本地用户:{{user}}。写入前会自动备份。","officialBody":"将把 {{harness}} 切回官方登录并写入原生配置文件{{changed}}。目标本地用户:{{user}}。写入前会自动备份。","changedFiles_one":",其中 {{count}} 个文件将变更","changedFiles_other":",其中 {{count}} 个文件将变更","loadFailed":"无法读取将要写入的内容:{{reason}}","loading":"正在读取将要写入的内容…","confirm":"确认激活","executing":"正在写入…","failed":"写入失败:{{reason}}。配置未切换,请修正后重试。","retry":"重试激活","retryPreview":"重新读取预览"},"env":{"title":"环境变量文件兼容性","intro":"切换本身不需要它。只有 Codex 选择「环境变量」认证方式时才需要在对应 shell 执行:","note":"文件里只会写入对应工具确实认识的变量。Kimi Code 与 Pi 不从 shell 读取凭据,所以它们只有一行注释。"},"backup":{"latest":"最近备份","profile":"配置档案","fileCount_one":"{{count}} 个文件","fileCount_other":"{{count}} 个文件","empty":"还没有历史快照","history":"历史快照","restore":"恢复","restoreTitle":"恢复这份快照?","restoreBody":"将把 {{harness}} / {{profile}} 在 {{time}} 的配置文件写回磁盘,覆盖当前内容。","confirmRestore":"确认恢复","current":"与磁盘一致","loadFailed":"无法读取快照内容:{{reason}}","loading":"正在读取快照…","written":"已把该历史快照的文件写回磁盘。","historyTitle":"{{harness}} 配置历史","historyIntro":"每次写入前都会把原文件快照到数据目录,保留最近 10 份。这里只显示当前工具的历史;与磁盘一致的条目会标成「当前」。","currentBadge":"当前","withDeletions":"含删除","restoreHistoryTitle":"恢复这份历史?","restoreHistoryBody":"红是当前将丢失的内容,绿是恢复后的内容。确认后会按历史快照覆盖磁盘文件,harness-switch 记录的「当前激活」不会随之回退。","comparing":"正在对比差异…","diffFailed":"加载差异失败"},"diff":{"delete":"将删除","create":"将新建","replace":"将覆盖","same":"无变更","rendering":"正在渲染差异…","absent":"(当前不存在)","afterRestore":"↓ 恢复后","deletedAfterRestore":"(恢复后删除)","bothAbsent":"两侧都不存在"},"drift":{"title":"配置漂移","recheck":"重新检查漂移","checking":"正在检查漂移…","noData":"暂无漂移数据。","none":"无漂移","mismatch_one":"{{count}} 个文件不一致","mismatch_other":"{{count}} 个文件不一致","moreFiles":"还有 {{count}} 个文件…","viewDiff":"查看差异","dialogTitle":"{{harness}} 配置漂移","legend":"红色是磁盘现状,绿色是按激活配置应写入的内容。","noActiveProfile":"该工具未激活任何配置。","nothingToCompare":"未激活任何配置,没有可对比的内容。","allInSync":"所有文件与激活配置一致。","adopt":"采纳现场配置","reapply":"重新应用","reapplyTitle":"重新应用激活配置?","reapplyBody":"将按激活配置重新写入 {{harness}} 的原生配置文件,覆盖磁盘上的现场修改。写入前会自动备份。","confirmReapply":"确认重新应用","reapplyFailed":"重新应用失败","adoptTitle":"采纳现场配置?","adoptBody":"将把磁盘上的当前内容回填进配置档案,之后的写入会以现场为准。此操作不可撤销。","confirmAdopt":"确认采纳","adoptFailed":"采纳失败","reapplied":"已按激活配置重新写入 {{harness}} 的原生配置文件。","adopted":"已把 {{harness}} 现场配置回填进配置档案。","status":{"in-sync":"一致","drifted":"已修改","missing":"缺失","invalid":"无法解析","unknown":"未知"}},"doctor":{"title":"诊断","titleFor":"{{harness}} 诊断","intro":"检查工具安装、配置文件可读可写可解析、存储权限与漂移状态。","checking":"正在检查…","notRun":"尚未运行诊断","viewDetails":"查看详情","rerun":"重新诊断","close":"关闭","updateAvailable":"有新版本可用","noChecks":"没有可检查的项目","countOk":"{{count}} 项正常","countWarn":"{{count}} 项警告","countError":"{{count}} 项错误","countUnknown":"{{count}} 项未知","status":{"ok":"正常","warn":"警告","error":"错误","unknown":"未知"},"check":{"installFound":"已找到可执行文件 {{bin}}","installMissing":"未找到可执行文件 {{bin}}(PATH 中不存在),工具可能未安装","installNotRequired":"{{harness}} 以 Web 服务部署,不要求 PATH 上有 CLI","fileMissing":"{{target}} 不存在({{path}})","fileUnreadable":"{{target}} 不可读({{path}})","fileUnwritable":"{{target}} 不可写({{path}})","filePermissive":"{{target}} 存在可读写,但权限为 {{mode}},group/other 可读,建议 0600","fileOk":"{{target}} 存在且可读可写({{path}})","parseOk":"{{target}} 解析正常","parseFailed":"{{target}} 无法解析:{{reason}}","parseUnreadable":"{{target}} 无法读取:{{reason}}","driftNoProfile":"未激活任何配置,无漂移可检查","driftInvalid":"live 文件存在无法解析的内容","driftMismatch_one":"{{count}} 个文件与激活配置不一致({{status}})","driftMismatch_other":"{{count}} 个文件与激活配置不一致({{status}})","driftInSync":"live 文件与激活配置一致","probeNoProfile":"未激活任何配置,跳过连通性探测","probeOfficialLogin":"{{harness}} 处于官方账号登录状态,无自定义端点可探测","probeMissingCredential":"配置 {{profile}} 缺少 Base URL 或 API Key,无法探测","probeOk":"配置 {{profile}} 的端点可达","probeFailed":"配置 {{profile}} 的连通性探测失败","completionOk":"模型 {{model}} 补全成功({{latencyMs}}ms)","completionFailed":"模型 {{model}} 补全失败:端点可达,但这个模型无法作答","completionOkCached":"模型 {{model}} 补全成功({{latencyMs}}ms,缓存结果)","completionFailedCached":"模型 {{model}} 补全失败:端点可达,但这个模型无法作答(缓存结果)"}},"notice":{"switchDone":"切换完成","warningPrefix":"注意:{{message}}","currentUser":"当前用户","transferImported":"导入完成。","userSynced":"同步完成。"},"operations":{"undone":"已撤销 {{harness}} 的这次操作,原生配置文件与「当前激活」记录都回到了操作前。","title":"操作记录","titleFor":"{{harness}} 操作记录","intro":"每次写入原生配置都会先落一条记录,断电或进程被杀掉后,服务下次启动会按它把没做完的操作回滚。撤销会把配置文件和「当前激活」一起退回操作前的状态。","loading":"正在加载…","empty":"还没有操作记录","viewDetails":"查看详情","refresh":"刷新","close":"关闭","count_one":"{{count}} 条记录","count_other":"{{count}} 条记录","fileCount_one":"{{count}} 个文件","fileCount_other":"{{count}} 个文件","user":"用户 {{user}}","undo":"撤销","undoTitle":"撤销这次操作?","undoBody":"会把 {{harness}} 的 {{count}} 个原生配置文件恢复成这次操作之前的内容,并把「当前激活」一并退回。这一步本身也会先做一次快照。","undoFailed":"撤销失败","confirmUndo":"确认撤销","kind":{"activate":"切换配置","activate-official":"切回官方登录","revoke":"移除 provider","reapply":"重新写入","import":"导入","sync":"跨用户同步"},"state":{"prepared":"准备中","applying":"写入中","metadata-committed":"收尾中","committed":"已完成","rolled-back":"已回滚","degraded":"需人工处理"}},"error":{"unknown":"未知错误","http":{"requestFailed":"请求失败","invalidRequest":"请求数据无效","internalServerError":"服务器内部错误","authenticationRequired":"需要登录","crossOriginDenied":"跨域请求被拒绝"},"auth":{"invalidPassword":"密码错误"},"github":{"notConnected":"请先连接 GitHub","authFailed":"GitHub 授权失败,请重新登录","gistNotFound":"GitHub 中未找到 harness-switch 备份 Gist","deviceCodeExpired":"设备授权码已过期,请重新获取","rateLimitExceeded":"GitHub API 请求速率超限,请稍后再试"},"cli":{"missingArgument":"缺少必要参数"},"profile":{"activeDeleteForbidden":"该配置正在使用中,请先激活另一个配置再删除","alreadyExists":"同名配置已经存在","notFound":"未找到配置","endpointNotFound":"未找到 endpoint {{endpoint}}","apiKeyRequired":"请填写 API key","nameRequired":"请填写配置名称","nameInvalid":"配置名称不能包含斜杠","nameTooLong":"配置名称过长"},"adapter":{"modelRequired":"{{harness}} 需要填写模型名称","apiKeyRequired":"{{harness}} 需要填写 API key","nativeConfigInvalid":"{{path}} 不是合法的 {{format}} 配置","unknownTarget":"适配器产生了未知写入目标 {{key}}"},"activation":{"officialLoginUnsupported":"{{harness}} 不支持官方账号登录模式","officialLoginMissing":"未检测到 {{harness}} 的官方登录条目,请先在终端完成一次官方登录","officialApiKeyMissing":"未检测到 {{harness}} 的 DeepSeek 官方 API Key 配置","noActiveProfile":"该工具未激活任何配置,无可渲染的内容","officialProfileCannotAdopt":"当前处于官方登录状态,没有可回填的配置档案","adoptUnsupported":"该工具不支持采纳现场配置","manualOverridesPreventAdopt":"采纳会丢弃手动覆盖的内容;请先恢复为自动生成","officialProfileAlreadyExists":"DeepSeek 官方配置已存在,请直接编辑它"},"provider":{"inUse_one":"该凭据正被 {{count}} 个配置引用,请先解除引用","inUse_other":"该凭据正被 {{count}} 个配置引用,请先解除引用","credentialUnreadable":"无法读取凭据 {{id}} 的密钥","notFound":"未找到 provider","nameRequired":"请填写 provider 名称","apiKeyRequired":"请填写 API key","endpointsInvalid":"endpoints 必须是数组","endpointKeyRequired":"请填写 endpoint 标识","endpointKeyInvalid":"endpoint 标识包含无效字符","endpointKeyDuplicate":"endpoint {{key}} 重复","endpointUrlRequired":"请填写 endpoint {{key}} 的 Base URL"},"codex":{"loginCacheTooLarge":"Codex 登录缓存文件过大,已跳过","loginCacheInvalidJson":"Codex 登录缓存不是合法 JSON","configDirectoryNotRegular":"Codex 配置目录不是普通目录","loginCacheNotRegular":"Codex 登录缓存不是普通文件"},"transfer":{"envelopeInvalid":"不支持的导出文件格式","passphraseTooShort":"迁移密码至少需要 8 个字符","decryptFailed":"迁移密码错误或导出文件已损坏","tooManyProfiles":"导出文件包含过多配置","profilesInvalid":"导出文件中的配置数据无效","profileNameInvalid":"导出文件包含无效的配置名称","duplicateProfile":"导出文件包含重复的配置","providersInvalid":"导出文件中的凭据库数据无效","duplicateProvider":"导出文件包含重复的凭据库条目","providerMissing":"导出文件中的配置引用了不存在的凭据库条目","activeInvalid":"导出文件中的激活状态无效","duplicateActive":"导出文件包含重复的激活状态","activeProfileMissing":"导出文件中的激活状态引用了不存在的配置","officialActiveInvalid":"导出文件中的官方登录状态无效","codexCacheInvalid":"导出文件中的 Codex 登录缓存无效"},"sync":{"sourceCodexLoginCacheMissing":"源用户没有可用的 Codex 官方登录缓存","sourceEqualsTarget":"源用户与目标用户相同","invalidConflictPolicy":"冲突处理策略无效"},"harness":{"notFound":"未找到工具"},"file":{"notRegular":"{{file}} 不是普通文件","outsideManagedDirectory":"{{file}} 位于可管理目录之外","ownershipRequiresRoot":"修改 {{path}} 的所有权需要以 root 运行"},"scan":{"apiKeyRequired":"这条配置里没有可提取的凭据,请先填写 API key"},"backup":{"targetInvalid":"{{path}} 不是 {{harness}} 的有效备份目标","invalidId":"备份 ID 无效","notFound":"未找到备份","fileNotOwned":"备份引用了 {{harness}} 不拥有的文件","payloadMissing":"备份中缺少 {{file}} 的内容","payloadNameInvalid":"备份内容文件名无效"},"operation":{"alreadyUndone":"该操作已经撤销过了","incomplete":"该操作尚未完成,请等待或重启服务以自动恢复","backupMissing":"操作 {{id}} 的备份 {{backupId}} 已被轮换删除","storageUnknown":"操作引用了未知的存储文件 {{key}}","snapshotMissing":"操作 {{id}} 缺少 {{key}} 的快照","invalidId":"操作 ID 无效","notFound":"未找到操作"},"user":{"notManageable":"用户 {{username}} 不可管理","notSwitchable":"无法切换到用户 {{username}}","block":{"homeUnsearchable":"没有权限访问","homeUnwritable":"没有权限写入","storeInaccessible":"配置目录不可写","ownershipRequiresRoot":"需要以 root 运行","homeMissing":"主目录不存在"}},"storage":{"unreadable":"无法读取 {{file}}","quarantineFailed":"无法隔离损坏的 {{file}}","corruptQuarantined":"数据存储已损坏,原文件已隔离为 {{quarantine}},请从备份恢复后再继续"},"probe":{"badUrl":"Base URL 无法解析,或不是 http/https","missingBaseUrl":"未提供 Base URL,无法测试","missingApiKey":"未提供 API Key,无法测试","timeout":"请求超时(10 秒)","networkError":"无法连接到端点(DNS、拒绝连接或 TLS 失败)","unauthorized":"端点可达但拒绝了凭据(HTTP {{status}}),请检查 API Key","httpError":"端点返回 HTTP {{status}}","invalidResponse":"响应不是已知的模型目录格式","missingModel":"没有可用于补全测试的模型:请填写模型名称,或先获取模型目录","completionUnsupported":"端点不接受任何已知的补全协议","completionHttpError":"模型 {{model}} 的补全请求返回 HTTP {{status}}:目录里有这个模型,但它无法作答","completionInvalid":"补全响应不是已知的格式,无法确认模型真的作答"},"favoriteNotFound":"收藏不存在","favoriteRevisionRequired":"请提供当前收藏版本","favoriteRevisionConflict":"收藏版本已变化,请重新加载","favoriteInUse":"收藏仍被引用,请先解除关联","favoriteConnectionInUse":"渠道仍被引用,请先解除关联","favoriteEndpointMissing":"渠道引用的供应商端点不存在","favoriteProtocolUnsupported":"此工具不支持所选渠道协议","favoriteProjectionUnsupported":"无法无损表达模型设置","favoriteProfileDiverged":"配置已发生分歧,请明确选择覆盖或解除关联","favoriteRawOverrideConflict":"请先移除原始文件覆盖","favoriteActiveUpdateRequiresApply":"激活配置的变更必须同时应用","favoritePlanStale":"计划已过期或输入已变化,请重新预览","favoritePlanExpired":"计划已过期,请重新预览","favoriteIdempotencyConflict":"请求标识已用于其他批准内容","favoriteUndoConflict":"后续修改阻止撤销,请重新规划","favoritePreferenceNotRepresented":"此工具无法设置默认思考偏好,需要确认忽略","favoriteEffortUnverified":"渠道的可选思考档位未经验证","favoriteStoreInvalid":"收藏文件损坏或版本不受支持","favoriteLimitReached":"收藏数量已达上限","favoriteCredentialConsentRequired":"需要明确同意将内联密钥存入凭据库","favoriteBackupInvalid":"备份无效、已损坏或配置目录已改变,未恢复。","favoriteBackupRecoveryFailed":"恢复回滚未完成,已暂停配置操作以保护数据。请检查文件权限后重试。","favoriteBackupStale":"配置在预览后发生变化,请重新检查恢复影响。"},"warning":{"activation":{"envRebuildFailed":"原生配置已写入,但重建 env.sh 失败","officialEnvRebuildFailed":"已恢复官方登录,但重建 env.sh 失败","backfillFailed":"未能把 {{profile}} 的现有配置回填保存"},"provider":{"endpointFallback":"endpoint {{endpoint}} 已不存在,将回退到 provider 首个 endpoint","reapplyFailed":"重新应用失败:{{reason}}"},"sync":{"activeReapplyFailed":"已更新配置库,但自动重新激活失败:{{reason}}"},"transfer":{"activeRestoreFailed":"未能恢复激活状态:{{reason}}"},"scan":{"profileGone":"配置已不在磁盘上,已跳过","profileExists":"同名配置已存在,已跳过","importFailed":"导入失败:{{reason}}"}},"update":{"updating":"更新中…","failed":"更新失败","failedHint":"手动运行 bunx @seaveyon/harness-switch@latest","short":"更新","toVersion":"更新到 v{{version}}"},"sync":{"title":"从其他用户同步","intro":"将来源用户的配置和所引用的凭据复制到 {{user}}。激活状态、备份和原生配置文件默认不会复制;可单独选择迁移 Codex 登录缓存。","sourceUser":"来源用户","selectUser":"选择本地用户","profileCount":"配置 {{count}}","providerCount":"凭据 {{count}}","conflictCount":"同名冲突 {{count}}","overwriteByHarness":"按 Harness 覆盖同名配置","overwriteHint":"只覆盖勾选的 Harness;未勾选的同名配置会保留当前用户版本。","overwriteHarness":"覆盖 {{harness}}","conflictsInHarness_one":"{{count}} 个同名配置","conflictsInHarness_other":"{{count}} 个同名配置","migrateCache":"迁移 Codex 官方登录缓存(auth.json)","migrateCacheHint":"这会复制可复用的 Codex 登录会话,不是普通配置。仅在目标用户可以使用该登录时选择。","migrateCacheOverwrite":"目标用户已有登录缓存;继续后将覆盖它,并自动创建备份。","storeOnlyHint":"同步仅写入配置库。需要生效时,请在同步后手动激活对应配置。","noOtherUsers":"没有其他可管理的本地登录用户。","inspecting":"正在检查…","inspect":"检查可同步内容","syncing":"正在同步…","syncTo":"同步到 {{user}}","confirmCacheTitle":"确认迁移 Codex 登录缓存?","confirmCacheBody":"将把 {{source}} 的 Codex 官方登录缓存(auth.json)复制到 {{target}}。{{extra}}仅当目标用户可以使用这个登录会话时才继续。","confirmCacheOverwrite":"目标用户已有缓存,会被覆盖并创建备份。","confirmCacheFresh":"目标用户将获得新的本地登录缓存。","confirmCacheAction":"迁移登录缓存并同步","done":"同步完成:新增 {{imported}},覆盖 {{overwritten}},跳过 {{skipped}},复制凭据 {{providersCopied}}。","cacheMigrated":"Codex 登录缓存已迁移。","cacheNotMigrated":"Codex 登录缓存未迁移。"},"transfer":{"title":"配置迁移","intro":"把配置档案和凭据搬进这台机器,或打包带走。所有来源写入的都是本管理器自己的配置库。","exportTitle":"导出所有配置","exportIntro":"文件使用迁移密码进行 AES-256-GCM 加密,不依赖当前机器的本地密钥。","passphrase":"迁移密码","passphrasePlaceholder":"至少 {{min}} 个字符","passphraseConfirm":"确认迁移密码","passphraseConfirmPlaceholder":"再次输入","passphraseMismatch":"两次输入的迁移密码不一致。","encrypting":"正在加密…","download":"下载加密导出包","exported":"加密导出包已生成。迁移密码不会写入文件,请单独保管。","importTitle":"导入到当前机器","importIntro":"先解密并检查冲突,确认后才会写入。默认保留当前机器上的同名配置。","pickFile":"选择 .hsw-backup 文件","pickFileHint":"文件内容在本机服务端解密,不会发送到外部服务。","notAnExport":"不是有效的 harness-switch 导出文件","importPassphrasePlaceholder":"导出时设置的密码","inspecting":"正在检查…","inspect":"检查导入内容","profileCount_one":"{{count}} 个配置","profileCount_other":"{{count}} 个配置","providerCount_one":"{{count}} 条凭据","providerCount_other":"{{count}} 条凭据","conflictCount_one":"{{count}} 个同名冲突","conflictCount_other":"{{count}} 个同名冲突","activeCount_one":"{{count}} 个激活状态","activeCount_other":"{{count}} 个激活状态","harnessProfiles":"{{harness}}:{{count}}","conflictList":"同名项:{{items}}","previewStale":"已修改导入选项,请重新检查内容后再确认导入。","conflictPolicy":"同名配置处理","policySkip":"保留本机配置,跳过导入","policyOverwrite":"使用导出包覆盖本机配置","restoreActive":"恢复导出时的激活状态","recheckNeeded":"请重新检查导入内容","confirmImport":"确认导入","confirmAuthTitle":"确认可能改动 Codex auth.json?","confirmTitle":"确认导入全部配置?","confirmBody":"将导入 {{count}} 个配置。","confirmOverwrite_one":"其中 {{count}} 个同名配置会被覆盖。","confirmOverwrite_other":"其中 {{count}} 个同名配置会被覆盖。","confirmKeep":"同名配置会保留,不会被覆盖。","proceedAware":"了解并继续导入","proceedOverwrite":"覆盖并导入","proceedSafe":"安全导入","importedCount_one":"新增 {{count}} 项","importedCount_other":"新增 {{count}} 项","overwrittenCount_one":"覆盖 {{count}} 项","overwrittenCount_other":"覆盖 {{count}} 项","providersCopiedCount_one":"恢复 {{count}} 条凭据","providersCopiedCount_other":"恢复 {{count}} 条凭据","skippedCount_one":"跳过 {{count}} 项","skippedCount_other":"跳过 {{count}} 项","activeRestoredCount_one":"恢复 {{count}} 个激活状态","activeRestoredCount_other":"恢复 {{count}} 个激活状态","cacheMigrated":"已迁移导出包内的 Codex 登录缓存","cacheNotMigrated":"未迁移导出包内的 Codex 登录缓存","importedSummary":"导入完成:{{parts}}。","authEffect":{"openai-api-key":"恢复选定的 Codex 激活配置会更新本机 auth.json 中的 OPENAI_API_KEY;这不是迁移导出包内的完整官方登录会话。","auth-override":"恢复选定的 Codex 激活配置会按该配置的原始 auth 覆盖内容写入本机 auth.json。","official-cleanup":"恢复 Codex 官方登录状态可能清理本机 auth.json 中遗留的 OPENAI_API_KEY。"},"sourceLabel":"选择来源","sources":{"scan":"本机现有配置","user":"其他本地用户","file":"加密文件","gist":"GitHub Gist"},"currentPolicy":"当前策略:{{policy}}","importing":"正在导入…"},"githubSync":{"title":"GitHub 云端同步","loading":"正在读取 GitHub 连接状态…","intro":"通过 GitHub 账号实现多机器无缝同步。配置包使用主密码进行端到端 AES-256-GCM 加密后存入私有 Gist,保护凭据安全。","tabDevice":"GitHub 授权登录","tabToken":"Token 登录","deviceIntro":"在 GitHub 输入下方授权码即可完成绑定。","openAuthPage":"前往 GitHub 授权","getCode":"获取设备授权码","userCode":"用户授权码","copyCode":"复制授权码","copied":"已复制","waitingAuth":"等待 GitHub 授权中…","waitingAuthInterval":"等待 GitHub 授权中({{seconds}} 秒后轮询)…","checkingAuth":"正在检查授权…","checkNow":"立即检查","regenerateCode":"重新获取授权码","tokenPlaceholder":"输入具有 gist 权限的 GitHub Token (ghp_...)","connectToken":"连接并登录","connecting":"连接中…","disconnect":"断开连接","lastSynced":"上次同步:","neverSynced":"尚未同步","cloudGist":"云端 Gist:","pushTitle":"上传到云端","pushIntro":"将当前机器的全部 Profiles 和凭据库加密备份到 GitHub 私有 Gist。","passphrase":"同步主密码","passphrasePlaceholder":"用于端到端加密与解密的密码","pushing":"正在加密并上传…","pushSuccess":"成功上传并同步到云端 Gist({{profiles}} 个配置,{{vault}} 条凭据)。","pullTitle":"从云端拉取","pullIntro":"从 GitHub 私有 Gist 下载加密备份并在本地解密还原。","pullPassphrasePlaceholder":"上传时设置的同步主密码","inspect":"检查云端备份","pulling":"正在拉取…","confirmPull":"确认同步到本地","pullSuccess":"云端同步完成:{{summary}}","authorized":"GitHub 授权成功,欢迎 {{user}}。","connected":"GitHub 连接成功,欢迎 {{user}}。","disconnected":"已断开与 GitHub 的连接。","codeExpired":"授权码已过期,请重新获取。","authFailed":"授权失败,请重试。","connectedBadge":"已连接","refreshStatus":"刷新状态","previewTitle":"云端备份检查结果","backedUpAt":"备份时间:{{time}}","tokenLabel":"Personal Access Token","tokenScopeHint":"Token 需具备 gist 权限,才能读写加密配置文件。"},"import":{"title":"导入已有配置","intro":"读取这五个工具当前在磁盘上的配置,挑出可以接管的 provider。扫描和导入都不会改动它们的配置文件;导入后需要你手动激活才会真正写盘。","scanning":"正在读取现有配置…","failed":"导入失败","summary":"导入 {{imported}} 条,跳过 {{skipped}} 条,新建凭据 {{providersCreated}} 条","providerCount_one":"{{count}} 个 provider","providerCount_other":"{{count}} 个 provider","sourceMissing":"缺失","sourceRead":"已读取","sourceUnparsable":"无法解析","select":"选择 {{name}}","inUse":"使用中","nameTaken":"同名配置已存在","matchesProvider":"凭据已在库中:{{name}}","noBaseUrl":"(没有 base url)","keyOutsideConfig":"凭据不在配置文件里","profileName":"配置名称","credentialTarget":"凭据保存方式","targetProfile":"存进这条配置自己","targetNewVault":"抽成新的凭据库条目","targetExisting":"关联已有凭据:{{name}}","apiKeyFromEnv":"这个 provider 从环境变量读取凭据,配置文件里没有","overwriteExisting":"覆盖同名的现有配置","selected":"已选择 {{count}} 条","selectPrompt":"勾选要接管的 provider","rescan":"重新扫描","importSelected":"导入所选"},"scan":{"note":{"unsupported":"该工具暂不支持扫描导入","noConfigFiles":"磁盘上没有找到该工具的配置文件","unparsable":"配置文件存在但无法解析,导入前请先修复它","noCandidates":"配置文件里没有找到可导入的 provider"}},"common":{"cancel":"取消","delete":"删除","close":"关闭","closeDialog":"关闭对话框","apiKey":"API 密钥","listSeparator":"、"},"preset":{"zaiAnthropic":"Z.AI(Anthropic 兼容)","moonshotAnthropic":"Moonshot(Anthropic 兼容)","deepseekAnthropic":"DeepSeek(Anthropic 兼容)","openrouter":"OpenRouter","zai":"Z.AI","moonshot":"Moonshot","deepseek":"DeepSeek","cliproxyResponses":"CLIProxy(Responses)"},"probe":{"action":"测试连接","fetchModels":"拉取模型","fetchingModels":"正在拉取…","completionAction":"测试补全","testingCompletion":"正在测试补全…","completionHint":"真实发送一条最小请求,验证模型确实能作答(会消耗一两个 token)。","probing":"正在测试…","ok":"连接正常 \xb7 {{latencyMs}}ms \xb7 {{count}} 个模型","okNoCatalog":"连接正常 \xb7 {{latencyMs}}ms \xb7 端点未提供模型目录","completionOk":"模型 {{model}} 可作答 \xb7 {{latencyMs}}ms","completionCached":"模型 {{model}} 可作答 \xb7 缓存于 {{at}}","completionFailedCached":"缓存于 {{at}}","catalogHint":"已获取 {{count}} 个模型,模型字段现可从下拉列表选择。","missingBaseUrl":"请先填写至少一个 endpoint URL 再测试。"},"favorites":{"linked":"关联模板","sourceMissing":"模板来源不存在","connectionMissing":"来源渠道不存在","importCount":"{{count}} 个模板","retryFailed":"仅重新预览失败项","saveFavorite":"保存模板","authentication":"认证方式","liveState":"原生文件状态","preserved":"这些现有字段保留原值;固定模型档位继续使用原模型","exportVersion":"默认使用 payload v2,目标版本必须支持模型收藏夹。","legacyExport":"兼容旧版导出(不迁移收藏和来源关联)","catalog":"获取模型目录(不发送补全请求)","catalogModel":"从目录选择模型 ID","noCatalog":"目录不可用或为空,仍可手工输入模型 ID。","title":"模板库","subtitle":"保存模板,选择渠道,配置到工具。","add":"新建模板","edit":"编辑模板","name":"模板名称","notes":"备注","save":"仅保存配置","delete":"删除模板","connections":"渠道","connection":"选择渠道","label":"渠道标签","endpoint":"凭据库端点","protocol":"协议","model":"精确请求模型 ID","addConnection":"+ 添加渠道","removeConnection":"移除此渠道","contextWindow":"上下文窗口","maxOutputTokens":"最大输出 token","reasoningSupported":"支持推理","reasoningEffort":"默认思考偏好","supportedReasoningEfforts":"支持的思考档位","effortsHint":"逗号分隔:none,minimal,low,medium,high,xhigh,max,ultra","unknown":"未知 / 未设置","true":"是","false":"否","declared":"填写值:由你声明,不代表实测能力。","inherited":"继承模板","overridden":"此渠道覆写;留空表示清除继承","inherit":"恢复继承","invalid":"请检查名称、渠道和能力声明是否完整且一致。","configure":"配置到工具","saveOnlyHint":"仅保存不会修改原生文件。选择同时激活后才会应用到工具。","target":"目标配置","newProfile":"新建配置","profileName":"配置名称(留空自动生成)","mode":"操作方式","activate":"保存并激活","ignorePreference":"确认忽略无法表达的思考偏好","overwriteDiverged":"以模板覆盖已分歧的受控字段","preview":"生成预览","appliedToast":"已将模板应用到 {{count}} 个工具。","confirm":"确认执行计划","rendererDefault":"工具渲染默认值","notRepresented":"无法表达的字段","nativeFiles":"原生写入目标","none":"无","applied":"已完成","unchanged":"无变化","failed":"失败,请重新预览","skipped":"未执行,请重新预览","capture":"从已有配置收藏","extractCredential":"同意将内联密钥存入凭据库并复用","linkSource":"关联来源配置","search":"搜索名称、模型或渠道","loading":"正在加载收藏…","empty":"还没有收藏。可从已有配置收藏,或手动添加。","pending":"待连接","generated":"已生成配置","needsUpdate":"有更新","diverged":"有本地分歧","detach":"解除关联,保留配置","harnesses":"工具配置","autoName":"留空使用模型名称","modelAdvanced":"高级设置:能力、思考与备注","channelName":"自定义渠道名称","channelAdvanced":"高级设置:渠道参数覆盖","targetAdvanced":"更改目标配置或名称","changeDetails":"查看参数差异","fileDetails":"查看原生文件差异","activateSelected":"保存后立即激活到所选工具","noCompatibleChannel":"暂无兼容渠道","updateProfile":"更新已有配置","backups":"备份与恢复","backupHint":"备份当前用户的收藏、配置、凭据和工具原生文件。收藏变更前自动保留最近 20 次备份,另可保留一个手动恢复点。备份加密保存在本机。","backupNow":"备份当前状态","backupCreated":"已创建恢复点","backupRestored":"已恢复;恢复前的状态也已备份,可随时撤回","backupEmpty":"还没有恢复点,首次变更前会自动创建。","restoreScope":"将当前用户的全部收藏、配置档案、凭据库、激活记录和五种工具的原生配置恢复到此时刻,覆盖此后修改。恢复前会再次备份当前状态;管理后台的登录会话和密码不变。","restore":"查看恢复影响","restoreConfirm":"确认恢复","cancel":"取消","backupReason":{"manual":"手动恢复点","change":"收藏变更前","apply":"应用到工具前","restore":"恢复前的状态"},"workflow":"配置步骤","chooseTools":"选择工具","reviewChanges":"预览并确认","chooseHint":"选择要配置的工具,已有配置会自动沿用。","reviewHint":"核对本次变更,确认后才会写入。","targetTools":"目标工具","activateCount":"立即激活","changedFiles":"原生文件变更","autoBackupNotice":"应用前自动备份,可从全局「恢复时间线」回退。","resolveBeforeApply":"请返回上一步处理冲突,再重新生成预览。","selectedCount":"已选择 {{count}} 个工具","compatibleCount":"{{count}} 个可用渠道","selected":"已选","backToSelection":"返回选择","done":"完成","confirmSave":"确认保存配置","confirmActivate":"确认保存并激活","parameter":"参数","before":"变更前","after":"变更后","noParameterChanges":"参数保持不变","mappingDetails":"映射依据与保留设置","redactedDiffHint":"仅隐藏 API key、token 等凭据,保留模型与普通配置;以下以统一结构展示文件差异。","modeLabel":{"save":"仅保存","activate":"保存并激活"},"toolNames":{"claude":"Claude Code","codex":"Codex","kimi":"Kimi Code","pi":"Pi","dsh":"DeepSeek Harness"},"liveComparison":"工具当前配置 → 应用后","liveComparisonHint":"以下比较磁盘上的当前原生文件与本次将写入的内容;仅隐藏密钥、token 等凭据。","previewBlocked":"尚未生成原生文件预览,请先处理阻止应用的问题。","savedComparison":"查看保存档案的变更","savedComparisonHint":"这里比较已保存的目标档案与本次保存结果,不代表工具当前使用的配置。","savedUnchanged":"保存档案无变化 \xb7 查看详情","savedUnchangedHint":"目标档案已经包含这些参数;切换到该档案时,工具的原生文件仍可能变化。","savedBefore":"已保存的档案","savedAfter":"本次保存后","batchSummary":"本次处理 {{count}} 个工具 \xb7 切换 {{activate}} 个 \xb7 改动 {{files}} 个原生文件","confirmBatchSave":"确认保存到 {{count}} 个工具","confirmBatchActivate":"确认保存并切换 {{count}} 个工具","tabBlocked":"需处理","tabChanges":"{{count}} 个文件变化","restoreReview":"确认全局恢复","restoreReviewHint":"先核对当前状态将受到的影响,再决定是否恢复。","restoreChecking":"正在处理,请稍候…","restoreRecheck":"重新检查影响","restoreImpact":"将更改 {{count}} 项","restoreNoChanges":"当前内容与此恢复点相同,无需恢复。","restoreUnchanged":"{{count}} 项内容相同","restoreArea":{"favorites":"全部模型收藏","profiles":"全部工具的配置档案","vault":"供应商与凭据库","active":"当前激活记录","env":"环境变量文件"},"restoreAction":{"create":"还原缺失文件","replace":"还原为备份内容","delete":"删除备份时不存在的文件"},"backupAction":{"create":"添加收藏「{{name}}」前","update":"修改收藏「{{name}}」前","delete":"删除收藏「{{name}}」前","capture":"从 {{tools}} 收藏「{{name}}」前","detach":"解除 {{tools}} 配置「{{name}}」的关联前","apply":"将「{{name}}」配置到 {{tools}} 前","restore":"全局恢复到 {{name}} 前"},"channelNumber":"渠道 {{count}}","channelHint":"选择供应商,再设置要使用的模型","channelProvider":"供应商 / 入口","chooseProvider":"选择供应商入口","removeChannelNamed":"移除渠道:{{name}}","modelPicker":"模型","modelPickerHint":"从目录选择,或输入自定义模型 ID。","modelPlaceholder":"选择或输入模型 ID","modelSearch":"搜索或输入模型 ID","modelEmpty":"输入模型 ID 即可添加,也可以先加载供应商目录。","modelCustom":"使用「{{value}}」","catalogLoad":"加载目录","catalogRefresh":"刷新目录","catalogLoading":"加载中","catalogCount":"目录中有 {{count}} 个模型,可在上方搜索选择。","noCatalogManual":"暂无可用目录,仍可手动输入模型 ID。"},"favorite":{"result":"操作完成"},"templates":{"tag":"模板"},"workspace":{"fileDiffTab":"文件差异","navigation":"主导航","breadcrumb":"路径导航","nav":{"workspace":"工作台","favorites":"模板","history":"恢复时间线"},"eyebrow":"配置工作台","title":"你的工具,现在用什么","subtitle":"选择工具,查看当前正在使用的配置。","homeSubtitle":"首页只展示真实生效的配置;切换和管理集中到工具的配置工作区。","manageFavorites":"管理模板","switchTool":"切换 {{name}}","configureTool":"配置与切换","configureSwitch":"配置与切换","switcherEyebrow":"配置与切换","switcherTitle":"{{name}} 配置与切换","switcherHint":"从配置或模板创建候选,先比较链路与文件差异,再确认写入。","configurations":"配置","useConfiguration":"使用此配置","newConfiguration":"新建配置","noProfiles":"还没有可用于切换的本地配置。","noTemplates":"还没有模板。","manageConfigurations":"管理配置条目","mappedModels":"按角色映射","toolDefaultModel":"由工具选择默认模型","currentConfigurationManagement":"当前配置与高级管理","chooseTemplate":"选择模板","pickTemplate":"搜索并选择模板","pickTemplateHint":"选一个模板,即可查看配置关系和切换影响。","newFromTemplate":"从模板创建配置","manageTemplates":"管理模板","noMatches":"没有找到匹配的模型。","startTitle":"把常用模型收藏起来,一次配置,多处使用","startHint":"从已有工具配置收藏模型,供应商和模型 ID 会自动带入。之后选一个工具就能预览切换,无需重复填写凭据。","noTools":"暂无工具信息。","lastBackup":"最近恢复点:{{time}}","historyHint":"手动保存恢复点,或查看收藏操作前的自动备份。","openHistory":"查看时间线","relationship":"配置关系","provider":"供应商","tool":"工具","missingProvider":"供应商已缺失","relationshipHint":"连线表示配置来源与写入关系;模型请求由工具直接发出。","currentChain":"当前链路","configuration":"配置","currentChainHint":"这条链路已经在当前工具中生效。","currentForTool":"{{name}} 当前正在使用","currentForToolHint":"首页只展示已经生效的配置,不包含未确认的候选。","activeNow":"生效中","switchMap":"当前与新链路","candidateChain":"新链路","appliesAfterConfirm":"应用后生效","notWritten":"未写入","switchTarget":"本次将切换到 {{name}}","switchTargetHint":"这是 {{name}} 的预览目标,尚未写入;其他工具保持各自当前配置。","checking":"正在检查可用渠道…","chooseChannel":"请选择本次使用的渠道","current":"当前","currentToolModel":"{{name}} 当前","targetToolModel":"{{name}} 将切换为","preview":"预览切换","previewHint":"确认后生效;应用前自动备份,可在恢复时间线回退。","captureHint":"复用已有配置中的模型和供应商,无需重新填写。","favoriteEyebrow":"模型与工具的连接","favoriteHint":"选中模型,查看它的渠道和已关联工具;点击工具即可配置。","favoriteDetail":"渠道与工具之间的关系由实际配置生成。","graphHint":"选择左侧渠道,再点击右侧工具。","manageLinks":"管理已生成配置与收藏","inUse":"正在使用","saved":"已保存","available":"可配置","linkMissing":"关联来源缺失","back":"返回工作台","captureCurrent":"收藏当前配置"},"timeline":{"title":"恢复时间线","eyebrow":"配置的时间回廊","subtitle":"回到配置正常的那一刻。选中恢复点,先查看实际影响。","points":"恢复时间点","current":"当前状态","currentHint":"查看工具当前使用的模型","snapshot":"查看历史快照","snapshotHint":"自动恢复点保存的是所列操作发生前的状态。下面列出从当前状态恢复到这里的文件影响。","older":"更早","newer":"较新","restore":"全局恢复到此时","protection":"恢复前会自动保存当前状态。","currentDescription":"这里展示当前生效的工具配置。可以先手动备份,也可以从时间线选择一个历史恢复点。","selectHint":"选择左侧恢复点,即可查看覆盖、删除和新增的文件。"}}'),m=["zh-CN","en"],g="zh-CN";function v(e){return m.includes(e)}var y={en:p,"zh-CN":h};function b(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:i,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let o=i.prototype,a=Object.keys(o);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=o[t].bind(n))}}let o=n?.Parent??Object;class a extends o{}function i(e){var t;let o=n?.Parent?new a:this;for(let n of(r(o,e),(t=o._zod).deferred??(t.deferred=[]),o._zod.deferred))n();return o}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}Symbol("zod_brand");class x extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class w extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(a=globalThis).__zod_globalConfig??(a.__zod_globalConfig={});let k=globalThis.__zod_globalConfig;function j(e){return e&&Object.assign(k,e),k}let S=/^[cC][0-9a-z]{6,}$/,O=/^[0-9a-z]+$/,C=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,N=/^[0-9a-vA-V]{20}$/,P=/^[A-Za-z0-9]{27}$/,E=/^[a-zA-Z0-9_-]{21}$/,_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,A=/^([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})$/,I=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)$/,T=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,R=/^(?:(?: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])$/,M=/^(([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}|:))$/,z=/^((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])$/,D=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,L=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,F=/^[A-Za-z0-9_-]*$/,$=/^https?$/,U=/^\+[1-9]\d{6,14}$/,H="(?:(?:\\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])))",B=RegExp(`^${H}$`);function V(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let K=/^-?\d+$/,q=/^-?\d+(?:\.\d+)?$/,W=/^(?:true|false)$/i,G=/^[^A-Z]*$/,Z=/^[^a-z]*$/;function Y(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function X(e,t){return"bigint"==typeof t?t.toString():t}function J(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Q(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}let ee=Symbol("evaluating");function et(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ee)return void 0===r&&(r=ee,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function en(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function er(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function eo(e){return JSON.stringify(e)}let ea="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ei(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let el=J(()=>{if(k.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function es(e){if(!1===ei(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==ei(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ec(e){return es(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let eu=new Set(["string","number","symbol"]);function ed(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ef(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ep(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}let eh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function em(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function eg(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function ev(e){return"string"==typeof e?e:e?.message}function ey(e,t,n){let r=e.message?e.message:ev(e.inst?._zod.def?.error?.(e))??ev(t?.error?.(e))??ev(n.customError?.(e))??ev(n.localeError?.(e))??"Invalid input",{inst:o,continue:a,input:i,...l}=e;return l.path??(l.path=[]),l.message=r,t?.reportInput&&(l.input=i),l}function eb(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ex(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}let ew=b("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ek={number:"number",bigint:"bigint",object:"date"},ej=b("$ZodCheckLessThan",(e,t)=>{ew.init(e,t);let n=ek[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eS=b("$ZodCheckGreaterThan",(e,t)=>{ew.init(e,t);let n=ek[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eO=b("$ZodCheckMultipleOf",(e,t)=>{ew.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{let r,o,a;if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0==(o=Math.round(r=n.value/t.value),a=Number.EPSILON*Math.max(Math.abs(r),1),Math.abs(r-o)<a?0:r-o))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),eC=b("$ZodCheckNumberFormat",(e,t)=>{ew.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,a]=eh[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=a,n&&(r.pattern=K)}),e._zod.check=i=>{let l=i.value;if(n){if(!Number.isInteger(l))return void i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});if(!Number.isSafeInteger(l))return void(l>0?i.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}l<o&&i.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>a&&i.issues.push({origin:"number",input:l,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),eN=b("$ZodCheckMaxLength",(e,t)=>{var n;ew.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let o=eb(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eP=b("$ZodCheckMinLength",(e,t)=>{var n;ew.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let o=eb(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eE=b("$ZodCheckLengthEquals",(e,t)=>{var n;ew.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,o=r.length;if(o===t.length)return;let a=eb(r),i=o>t.length;n.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),e_=b("$ZodCheckStringFormat",(e,t)=>{var n,r;ew.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),eA=b("$ZodCheckRegex",(e,t)=>{e_.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})}}),eI=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=G),e_.init(e,t)}),eT=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Z),e_.init(e,t)}),eR=b("$ZodCheckIncludes",(e,t)=>{ew.init(e,t);let n=ed(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),eM=b("$ZodCheckStartsWith",(e,t)=>{ew.init(e,t);let n=RegExp(`^${ed(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ez=b("$ZodCheckEndsWith",(e,t)=>{ew.init(e,t);let n=RegExp(`.*${ed(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),eD=b("$ZodCheckOverwrite",(e,t)=>{ew.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class eL{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let eF=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,X,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},e$=b("$ZodError",eF),eU=b("$ZodError",eF,{Parent:Error}),eH=e=>(t,n,r,o)=>{let a=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new x;if(i.issues.length){let t=new(o?.Err??e)(i.issues.map(e=>ey(e,a,j())));throw ea(t,o?.callee),t}return i.value},eB=e=>async(t,n,r,o)=>{let a=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){let t=new(o?.Err??e)(i.issues.map(e=>ey(e,a,j())));throw ea(t,o?.callee),t}return i.value},eV=e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new x;return a.issues.length?{success:!1,error:new(e??e$)(a.issues.map(e=>ey(e,o,j())))}:{success:!0,data:a.value}},eK=eV(eU),eq=e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ey(e,o,j())))}:{success:!0,data:a.value}},eW=eq(eU),eG={major:4,minor:4,patch:3},eZ=b("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eG;let r=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&r.unshift(e),r))for(let n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r,o=em(e);for(let a of t){if(a._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}(e)||!a._zod.def.when(e))continue}else if(o)continue;let t=e.issues.length,i=a._zod.check(e);if(i instanceof Promise&&n?.async===!1)throw new x;if(r||i instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await i,e.issues.length!==t&&(o||(o=em(e,t)))});else{if(e.issues.length===t)continue;o||(o=em(e,t))}}return r?r.then(()=>e):e},n=(n,o,a)=>{if(em(n))return n.aborted=!0,n;let i=t(o,r,a);if(i instanceof Promise){if(!1===a.async)throw new x;return i.then(t=>e._zod.parse(t,a))}return e._zod.parse(i,a)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if("backward"===a.direction){let t=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,a)):n(t,o,a)}let i=e._zod.parse(o,a);if(i instanceof Promise){if(!1===a.async)throw new x;return i.then(e=>t(e,r,a))}return t(i,r,a)}}et(e,"~standard",()=>({validate:t=>{try{let n=eK(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return eW(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),eY=b("$ZodString",(e,t)=>{var n;let r;eZ.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=(n=e._zod.bag)?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${r}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),eX=b("$ZodStringFormat",(e,t)=>{e_.init(e,t),eY.init(e,t)}),eJ=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=A),eX.init(e,t)}),eQ=b("$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(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=I(e))}else t.pattern??(t.pattern=I());eX.init(e,t)}),e0=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=T),eX.init(e,t)}),e1=b("$ZodURL",(e,t)=>{eX.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===$.source&&!/^https?:\/\//i.test(r))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});let o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),e2=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),eX.init(e,t)}),e4=b("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=E),eX.init(e,t)}),e3=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=S),eX.init(e,t)}),e5=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=O),eX.init(e,t)}),e6=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=C),eX.init(e,t)}),e8=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=N),eX.init(e,t)}),e9=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=P),eX.init(e,t)}),e7=b("$ZodISODateTime",(e,t)=>{let n,r,o;t.pattern??(n=V({precision:t.precision}),r=["Z"],t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),o=`${n}(?:${r.join("|")})`,t.pattern=RegExp(`^${H}T(?:${o})$`)),eX.init(e,t)}),te=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=B),eX.init(e,t)}),tt=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${V(t)}$`)),eX.init(e,t)}),tn=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_),eX.init(e,t)}),tr=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=R),eX.init(e,t),e._zod.bag.format="ipv4"}),to=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=M),eX.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ta=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=z),eX.init(e,t)}),ti=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=D),eX.init(e,t),e._zod.check=n=>{let r=n.value.split("/");try{if(2!==r.length)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function tl(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ts=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=L),eX.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{tl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),tc=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=F),eX.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{!function(e){if(!F.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tl(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),tu=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=U),eX.init(e,t)}),td=b("$ZodJWT",(e,t)=>{eX.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let o=JSON.parse(atob(r));if("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),tf=b("$ZodNumber",(e,t)=>{eZ.init(e,t),e._zod.pattern=e._zod.bag.pattern??q,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;let a="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...a?{received:a}:{}}),n}}),tp=b("$ZodNumberFormat",(e,t)=>{eC.init(e,t),tf.init(e,t)}),th=b("$ZodBoolean",(e,t)=>{eZ.init(e,t),e._zod.pattern=W,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),tm=b("$ZodUnknown",(e,t)=>{eZ.init(e,t),e._zod.parse=e=>e}),tg=b("$ZodNever",(e,t)=>{eZ.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function tv(e,t,n){e.issues.length&&t.issues.push(...eg(n,e.issues)),t.value[n]=e.value}let ty=b("$ZodArray",(e,t)=>{eZ.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);let a=[];for(let e=0;e<o.length;e++){let i=o[e],l=t.element._zod.run({value:i,issues:[]},r);l instanceof Promise?a.push(l.then(t=>tv(t,n,e))):tv(l,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function tb(e,t,n,r,o,a){let i=n in r;if(e.issues.length){if(o&&a&&!i)return;t.issues.push(...eg(n,e.issues))}if(!i&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===e.value?i&&(t.value[n]=void 0):t.value[n]=e.value}function tx(e){var t;let n=Object.keys(e.shape);for(let t of n)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let r=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function tw(e,t,n,r,o,a){let i=[],l=o.keySet,s=o.catchall._zod,c=s.def.type,u="optional"===s.optin,d="optional"===s.optout;for(let o in t){if("__proto__"===o||l.has(o))continue;if("never"===c){i.push(o);continue}let a=s.run({value:t[o],issues:[]},r);a instanceof Promise?e.push(a.then(e=>tb(e,n,o,t,u,d))):tb(a,n,o,t,u,d)}return(i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length)?Promise.all(e).then(()=>n):n}let tk=b("$ZodObject",(e,t)=>{let n;eZ.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let o=J(()=>tx(t));et(e._zod,"propValues",()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values)for(let e of(n[t]??(n[t]=new Set),r.values))n[t].add(e)}return n});let a=t.catchall;e._zod.parse=(t,r)=>{n??(n=o.value);let i=t.value;if(!ei(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value={};let l=[],s=n.shape;for(let e of n.keys){let n=s[e],o="optional"===n._zod.optin,a="optional"===n._zod.optout,c=n._zod.run({value:i[e],issues:[]},r);c instanceof Promise?l.push(c.then(n=>tb(n,t,e,i,o,a))):tb(c,t,e,i,o,a)}return a?tw(l,i,t,r,o.value,e):l.length?Promise.all(l).then(()=>t):t}}),tj=b("$ZodObjectJIT",(e,t)=>{let n,r;tk.init(e,t);let o=e._zod.parse,a=J(()=>tx(t)),i=!k.jitless,l=i&&el.value,s=t.catchall;e._zod.parse=(c,u)=>{r??(r=a.value);let d=c.value;return ei(d)?i&&l&&u?.async===!1&&!0!==u.jitless?(n||(n=(e=>{let t=new eL(["shape","payload","ctx"]),n=a.value,r=e=>{let t=eo(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let o=Object.create(null),i=0;for(let e of n.keys)o[e]=`key_${i++}`;for(let a of(t.write("const newResult = {};"),n.keys)){let n=o[a],i=eo(a),l=e[a],s=l?._zod?.optin==="optional",c=l?._zod?.optout==="optional";t.write(`const ${n} = ${r(a)};`),s&&c?t.write(`
|
|
2
|
+
if (${n}.issues.length) {
|
|
3
|
+
if (${i} in input) {
|
|
4
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
5
|
+
...iss,
|
|
6
|
+
path: iss.path ? [${i}, ...iss.path] : [${i}]
|
|
7
|
+
})));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (${n}.value === undefined) {
|
|
12
|
+
if (${i} in input) {
|
|
13
|
+
newResult[${i}] = undefined;
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
newResult[${i}] = ${n}.value;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
`):s?t.write(`
|
|
20
|
+
if (${n}.issues.length) {
|
|
21
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
22
|
+
...iss,
|
|
23
|
+
path: iss.path ? [${i}, ...iss.path] : [${i}]
|
|
24
|
+
})));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (${n}.value === undefined) {
|
|
28
|
+
if (${i} in input) {
|
|
29
|
+
newResult[${i}] = undefined;
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
newResult[${i}] = ${n}.value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
`):t.write(`
|
|
36
|
+
const ${n}_present = ${i} in input;
|
|
37
|
+
if (${n}.issues.length) {
|
|
38
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
39
|
+
...iss,
|
|
40
|
+
path: iss.path ? [${i}, ...iss.path] : [${i}]
|
|
41
|
+
})));
|
|
42
|
+
}
|
|
43
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
44
|
+
payload.issues.push({
|
|
45
|
+
code: "invalid_type",
|
|
46
|
+
expected: "nonoptional",
|
|
47
|
+
input: undefined,
|
|
48
|
+
path: [${i}]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (${n}_present) {
|
|
53
|
+
if (${n}.value === undefined) {
|
|
54
|
+
newResult[${i}] = undefined;
|
|
55
|
+
} else {
|
|
56
|
+
newResult[${i}] = ${n}.value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
`)}t.write("payload.value = newResult;"),t.write("return payload;");let l=t.compile();return(t,n)=>l(e,t,n)})(t.shape)),c=n(c,u),s)?tw([],d,c,u,r,e):c:o(c,u):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function tS(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let o=e.filter(e=>!em(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ey(e,r,j())))}),t)}let tO=b("$ZodUnion",(e,t)=>{eZ.init(e,t),et(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),et(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),et(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),et(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Q(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let a=!1,i=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},o);if(t instanceof Promise)i.push(t),a=!0;else{if(0===t.issues.length)return t;i.push(t)}}return a?Promise.all(i).then(t=>tS(t,r,e,o)):tS(i,r,e,o)}}),tC=b("$ZodIntersection",(e,t)=>{eZ.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,o=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([t,n])=>tN(e,t,n)):tN(e,o,a)}});function tN(e,t,n){let r,o=new Map;for(let n of t.issues)if("unrecognized_keys"===n.code)for(let e of(r??(r=n),n.keys))o.has(e)||o.set(e,{}),o.get(e).l=!0;else e.issues.push(n);for(let t of n.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)o.has(e)||o.set(e,{}),o.get(e).r=!0;else e.issues.push(t);let a=[...o].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&r&&e.issues.push({...r,keys:a}),em(e))return e;let i=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(es(t)&&es(n)){let r=Object.keys(n),o=Object.keys(t).filter(e=>-1!==r.indexOf(e)),a={...t,...n};for(let r of o){let o=e(t[r],n[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};a[r]=o.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<t.length;o++){let a=e(t[o],n[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}let tP=b("$ZodRecord",(e,t)=>{eZ.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!es(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;let a=[],i=t.keyType._zod.values;if(i){let l;n.value={};let s=new Set;for(let l of i)if("string"==typeof l||"number"==typeof l||"symbol"==typeof l){s.add("number"==typeof l?l.toString():l);let i=t.keyType._zod.run({value:l,issues:[]},r);if(i instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(i.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:i.issues.map(e=>ey(e,r,j())),input:l,path:[l],inst:e});continue}let c=i.value,u=t.valueType._zod.run({value:o[l],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...eg(l,e.issues)),n.value[c]=e.value})):(u.issues.length&&n.issues.push(...eg(l,u.issues)),n.value[c]=u.value)}for(let e in o)s.has(e)||(l=l??[]).push(e);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else for(let i of(n.value={},Reflect.ownKeys(o))){if("__proto__"===i||!Object.prototype.propertyIsEnumerable.call(o,i))continue;let l=t.keyType._zod.run({value:i,issues:[]},r);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof i&&q.test(i)&&l.issues.length){let e=t.keyType._zod.run({value:Number(i),issues:[]},r);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(l=e)}if(l.issues.length){"loose"===t.mode?n.value[i]=o[i]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(e=>ey(e,r,j())),input:i,path:[i],inst:e});continue}let s=t.valueType._zod.run({value:o[i],issues:[]},r);s instanceof Promise?a.push(s.then(e=>{e.issues.length&&n.issues.push(...eg(i,e.issues)),n.value[l.value]=e.value})):(s.issues.length&&n.issues.push(...eg(i,s.issues)),n.value[l.value]=s.value)}return a.length?Promise.all(a).then(()=>n):n}}),tE=b("$ZodEnum",(e,t)=>{eZ.init(e,t);let n=Y(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>eu.has(typeof e)).map(e=>"string"==typeof e?ed(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{let a=t.value;return r.has(a)||t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),t_=b("$ZodLiteral",(e,t)=>{if(eZ.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?ed(e):e?ed(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,o)=>{let a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),tA=b("$ZodTransform",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new w(e.constructor.name);let o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n.fallback=!0,n));if(o instanceof Promise)throw new x;return n.value=o,n.fallback=!0,n}});function tI(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let tT=b("$ZodOptional",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",e._zod.optout="optional",et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),et(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Q(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){let r=e.value,o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then(e=>tI(e,r)):tI(o,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),tR=b("$ZodExactOptional",(e,t)=>{tT.init(e,t),et(e._zod,"values",()=>t.innerType._zod.values),et(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),tM=b("$ZodNullable",(e,t)=>{eZ.init(e,t),et(e._zod,"optin",()=>t.innerType._zod.optin),et(e._zod,"optout",()=>t.innerType._zod.optout),et(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Q(e.source)}|null)$`):void 0}),et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),tz=b("$ZodDefault",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>tD(e,t)):tD(r,t)}});function tD(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let tL=b("$ZodPrefault",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),tF=b("$ZodNonOptional",(e,t)=>{eZ.init(e,t),et(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>t$(t,e)):t$(o,e)}});function t$(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let tU=b("$ZodCatch",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",et(e._zod,"optout",()=>t.innerType._zod.optout),et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ey(e,n,j()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ey(e,n,j()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),tH=b("$ZodPipe",(e,t)=>{eZ.init(e,t),et(e._zod,"values",()=>t.in._zod.values),et(e._zod,"optin",()=>t.in._zod.optin),et(e._zod,"optout",()=>t.out._zod.optout),et(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>tB(e,t.in,n)):tB(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>tB(e,t.out,n)):tB(r,t.out,n)}});function tB(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}let tV=b("$ZodReadonly",(e,t)=>{eZ.init(e,t),et(e._zod,"propValues",()=>t.innerType._zod.propValues),et(e._zod,"values",()=>t.innerType._zod.values),et(e._zod,"optin",()=>t.innerType?._zod?.optin),et(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(tK):tK(r)}});function tK(e){return e.value=Object.freeze(e.value),e}let tq=b("$ZodCustom",(e,t)=>{ew.init(e,t),eZ.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>tW(t,n,r,e));tW(o,n,r,e)}});function tW(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ex(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(i=globalThis).__zod_globalRegistry??(i.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let tG=globalThis.__zod_globalRegistry;function tZ(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ep(t)})}function tY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ep(t)})}function tX(e,t){return new ej({check:"less_than",...ep(t),value:e,inclusive:!1})}function tJ(e,t){return new ej({check:"less_than",...ep(t),value:e,inclusive:!0})}function tQ(e,t){return new eS({check:"greater_than",...ep(t),value:e,inclusive:!1})}function t0(e,t){return new eS({check:"greater_than",...ep(t),value:e,inclusive:!0})}function t1(e,t){return new eO({check:"multiple_of",...ep(t),value:e})}function t2(e,t){return new eN({check:"max_length",...ep(t),maximum:e})}function t4(e,t){return new eP({check:"min_length",...ep(t),minimum:e})}function t3(e,t){return new eE({check:"length_equals",...ep(t),length:e})}function t5(e){return new eD({check:"overwrite",tx:e})}function t6(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??tG,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function t8(e,t,n={path:[],schemaPath:[]}){var r;let o=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);let l=e._zod.toJSONSchema?.();if(l)i.schema=l;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,r);else{let n=i.schema,a=t.processors[o.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(i.ref||(i.ref=a),t8(a,t,r),t.seen.get(a).isParent=!0)}let s=t.metadataRegistry.get(e);return s&&Object.assign(i.schema,s),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;if("transform"===o.type)return!0;if("array"===o.type)return e(o.element,r);if("set"===o.type)return e(o.valueType,r);if("lazy"===o.type)return e(o.getter(),r);if("promise"===o.type||"optional"===o.type||"nonoptional"===o.type||"nullable"===o.type||"readonly"===o.type||"default"===o.type||"prefault"===o.type)return e(o.innerType,r);if("intersection"===o.type)return e(o.left,r)||e(o.right,r);if("record"===o.type||"map"===o.type)return e(o.keyType,r)||e(o.valueType,r);if("pipe"===o.type)return!!t._zod.traits.has("$ZodCodec")||e(o.in,r)||e(o.out,r);if("object"===o.type){for(let t in o.shape)if(e(o.shape[t],r))return!0;return!1}if("union"===o.type){for(let t of o.options)if(e(t,r))return!0;return!1}if("tuple"===o.type){for(let t of o.items)if(e(t,r))return!0;if(o.rest&&e(o.rest,r))return!0}return!1}(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function t9(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let o=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:o,defId:a}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${o("__shared")}#/${r}/${a}`}}if(t[1]===n)return{ref:"#"};let o=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:o+a}})(t);r.def={...r.schema},a&&(r.defId=a);let i=r.schema;for(let e in i)delete i[e];i.$ref=o};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
61
|
+
|
|
62
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){o(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&"ref"===e.reused){o(n);continue}}}function t7(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let o=n.def??n.schema,a={...o},i=n.ref;if(n.ref=null,i){r(i);let n=e.seen.get(i),l=n.schema;if(l.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(o.allOf=o.allOf??[],o.allOf.push(l)):Object.assign(o,l),Object.assign(o,a),t._zod.parent===i)for(let e in o)"$ref"!==e&&"allOf"!==e&&(e in a||delete o[e]);if(l.$ref&&n.def)for(let e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}let l=t._zod.parent;if(l&&l!==i){r(l);let t=e.seen.get(l);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(let e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;void 0!==a&&o.id===a&&delete o.id;let i=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?o.$defs=i:o.definitions=i);try{let n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:ne(t,"input",e.processors),output:ne(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let ne=(e,t,n={})=>r=>{let{libraryOptions:o,target:a}=r??{},i=t6({...o??{},target:a,io:t,processors:n});return t8(e,i),t9(i,e),t7(i,e)},nt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nn=(e,t,n,r)=>{let o=e._zod.def;t8(o.innerType,t,r),t.seen.get(e).ref=o.innerType},nr=b("ZodISODateTime",(e,t)=>{e7.init(e,t),nN.init(e,t)});function no(e){return new nr({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ep(e)})}let na=b("ZodISODate",(e,t)=>{te.init(e,t),nN.init(e,t)}),ni=b("ZodISOTime",(e,t)=>{tt.init(e,t),nN.init(e,t)}),nl=b("ZodISODuration",(e,t)=>{tn.init(e,t),nN.init(e,t)}),ns=b("ZodError",(e,t)=>{e$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,o=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>r({issues:e},[...o,...a.path]));else if("invalid_key"===a.code)r({issues:a.issues},[...o,...a.path]);else if("invalid_element"===a.code)r({issues:a.issues},[...o,...a.path]);else{let e=[...o,...a.path];if(0===e.length)n._errors.push(t(a));else{let r=n,o=0;for(;o<e.length;){let n=e[o];o===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],o++}}}};return r(e),n})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let n={},r=[];for(let o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,X,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,X,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),nc=eH(ns),nu=eB(ns),nd=eV(ns),nf=eq(ns),np=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eH(ns)(e,t,r)},nh=(e,t,n)=>eH(ns)(e,t,n),nm=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eB(ns)(e,t,r)},ng=async(e,t,n)=>eB(ns)(e,t,n),nv=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eV(ns)(e,t,r)},ny=(e,t,n)=>eV(ns)(e,t,n),nb=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eq(ns)(e,t,r)},nx=async(e,t,n)=>eq(ns)(e,t,n),nw=new WeakMap;function nk(e,t,n){let r=Object.getPrototypeOf(e),o=nw.get(r);if(o||(o=new Set,nw.set(r,o)),!o.has(t))for(let e in o.add(t),n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let nj=b("ZodType",(e,t)=>(eZ.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ne(e,"input"),output:ne(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{let r=t6({...n,processors:t});return t8(e,r),t9(r,e),t7(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>nc(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>nd(e,t,n),e.parseAsync=async(t,n)=>nu(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>nf(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>np(e,t,n),e.decode=(t,n)=>nh(e,t,n),e.encodeAsync=async(t,n)=>nm(e,t,n),e.decodeAsync=async(t,n)=>ng(e,t,n),e.safeEncode=(t,n)=>nv(e,t,n),e.safeDecode=(t,n)=>ny(e,t,n),e.safeEncodeAsync=async(t,n)=>nb(e,t,n),e.safeDecodeAsync=async(t,n)=>nx(e,t,n),nk(e,"ZodType",{check(...e){let t=this.def;return this.clone(er(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ef(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new ry({type:"custom",check:"custom",fn:e,...ep(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,o;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(ex(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(ex(e)))},e(t.value,t)),(o=new ew({check:"custom",...ep(t)}))._zod.check=n,r=o}(e,t))},overwrite(e){return this.check(t5(e))},optional(){return rl(this)},exactOptional(){var e;return e=this,new rs({type:"optional",innerType:e})},nullable(){return ru(this)},nullish(){return rl(ru(this))},nonoptional(e){var t;return t=this,new rp({type:"nonoptional",innerType:t,...ep(e)})},array(){return n4(this)},or(e){return n8([this,e])},and(e){var t;return t=this,new n9({type:"intersection",left:t,right:e})},transform(e){return rg(this,new ra({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new rd({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():ec(n)}})},prefault(e){var t,n;return t=this,n=e,new rf({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():ec(n)}})},catch(e){var t,n;return t=this,new rh({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:()=>n})},pipe(e){return rg(this,e)},readonly(){var e;return e=this,new rv({type:"readonly",innerType:e})},describe(e){let t=this.clone();return tG.add(t,{description:e}),t},meta(...e){if(0===e.length)return tG.get(this);let t=this.clone();return tG.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>tG.get(e)?.description,configurable:!0}),e)),nS=b("_ZodString",(e,t)=>{eY.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{n.type="string";let{minimum:o,maximum:a,format:i,patterns:l,contentEncoding:s}=e._zod.bag;if("number"==typeof o&&(n.minLength=o),"number"==typeof a&&(n.maxLength=a),i&&(n.format=nt[i]??i,""===n.format&&delete n.format,"time"===i&&delete n.format),s&&(n.contentEncoding=s),l&&l.size>0){let e=[...l];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n,0);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,nk(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new eA({check:"string_format",format:"regex",...ep(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new eR({check:"string_format",format:"includes",...ep(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new eM({check:"string_format",format:"starts_with",...ep(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new ez({check:"string_format",format:"ends_with",...ep(t),suffix:e})}(...e))},min(...e){return this.check(t4(...e))},max(...e){return this.check(t2(...e))},length(...e){return this.check(t3(...e))},nonempty(...e){return this.check(t4(1,...e))},lowercase(e){return this.check(new eI({check:"string_format",format:"lowercase",...ep(e)}))},uppercase(e){return this.check(new eT({check:"string_format",format:"uppercase",...ep(e)}))},trim(){return this.check(t5(e=>e.trim()))},normalize(...e){return this.check(function(e){return t5(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(t5(e=>e.toLowerCase()))},toUpperCase(){return this.check(t5(e=>e.toUpperCase()))},slugify(){return this.check(t5(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})}),nO=b("ZodString",(e,t)=>{eY.init(e,t),nS.init(e,t),e.email=t=>e.check(new nP({type:"string",format:"email",check:"string_format",abort:!1,...ep(t)})),e.url=t=>e.check(new nA({type:"string",format:"url",check:"string_format",abort:!1,...ep(t)})),e.jwt=t=>e.check(new nq({type:"string",format:"jwt",check:"string_format",abort:!1,...ep(t)})),e.emoji=t=>e.check(new nI({type:"string",format:"emoji",check:"string_format",abort:!1,...ep(t)})),e.guid=t=>e.check(tZ(nE,t)),e.uuid=t=>e.check(tY(n_,t)),e.uuidv4=t=>e.check(new n_({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ep(t)})),e.uuidv6=t=>e.check(new n_({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ep(t)})),e.uuidv7=t=>e.check(new n_({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ep(t)})),e.nanoid=t=>e.check(new nT({type:"string",format:"nanoid",check:"string_format",abort:!1,...ep(t)})),e.guid=t=>e.check(tZ(nE,t)),e.cuid=t=>e.check(new nR({type:"string",format:"cuid",check:"string_format",abort:!1,...ep(t)})),e.cuid2=t=>e.check(new nM({type:"string",format:"cuid2",check:"string_format",abort:!1,...ep(t)})),e.ulid=t=>e.check(new nz({type:"string",format:"ulid",check:"string_format",abort:!1,...ep(t)})),e.base64=t=>e.check(new nB({type:"string",format:"base64",check:"string_format",abort:!1,...ep(t)})),e.base64url=t=>e.check(new nV({type:"string",format:"base64url",check:"string_format",abort:!1,...ep(t)})),e.xid=t=>e.check(new nD({type:"string",format:"xid",check:"string_format",abort:!1,...ep(t)})),e.ksuid=t=>e.check(new nL({type:"string",format:"ksuid",check:"string_format",abort:!1,...ep(t)})),e.ipv4=t=>e.check(new nF({type:"string",format:"ipv4",check:"string_format",abort:!1,...ep(t)})),e.ipv6=t=>e.check(new n$({type:"string",format:"ipv6",check:"string_format",abort:!1,...ep(t)})),e.cidrv4=t=>e.check(new nU({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ep(t)})),e.cidrv6=t=>e.check(new nH({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ep(t)})),e.e164=t=>e.check(new nK({type:"string",format:"e164",check:"string_format",abort:!1,...ep(t)})),e.datetime=t=>e.check(no(t)),e.date=t=>e.check(new na({type:"string",format:"date",check:"string_format",...ep(t)})),e.time=t=>e.check(new ni({type:"string",format:"time",check:"string_format",precision:null,...ep(t)})),e.duration=t=>e.check(new nl({type:"string",format:"duration",check:"string_format",...ep(t)}))});function nC(e){return new nO({type:"string",...ep(e)})}let nN=b("ZodStringFormat",(e,t)=>{eX.init(e,t),nS.init(e,t)}),nP=b("ZodEmail",(e,t)=>{e0.init(e,t),nN.init(e,t)}),nE=b("ZodGUID",(e,t)=>{eJ.init(e,t),nN.init(e,t)}),n_=b("ZodUUID",(e,t)=>{eQ.init(e,t),nN.init(e,t)}),nA=b("ZodURL",(e,t)=>{e1.init(e,t),nN.init(e,t)}),nI=b("ZodEmoji",(e,t)=>{e2.init(e,t),nN.init(e,t)}),nT=b("ZodNanoID",(e,t)=>{e4.init(e,t),nN.init(e,t)}),nR=b("ZodCUID",(e,t)=>{e3.init(e,t),nN.init(e,t)}),nM=b("ZodCUID2",(e,t)=>{e5.init(e,t),nN.init(e,t)}),nz=b("ZodULID",(e,t)=>{e6.init(e,t),nN.init(e,t)}),nD=b("ZodXID",(e,t)=>{e8.init(e,t),nN.init(e,t)}),nL=b("ZodKSUID",(e,t)=>{e9.init(e,t),nN.init(e,t)}),nF=b("ZodIPv4",(e,t)=>{tr.init(e,t),nN.init(e,t)}),n$=b("ZodIPv6",(e,t)=>{to.init(e,t),nN.init(e,t)}),nU=b("ZodCIDRv4",(e,t)=>{ta.init(e,t),nN.init(e,t)}),nH=b("ZodCIDRv6",(e,t)=>{ti.init(e,t),nN.init(e,t)}),nB=b("ZodBase64",(e,t)=>{ts.init(e,t),nN.init(e,t)}),nV=b("ZodBase64URL",(e,t)=>{tc.init(e,t),nN.init(e,t)}),nK=b("ZodE164",(e,t)=>{tu.init(e,t),nN.init(e,t)}),nq=b("ZodJWT",(e,t)=>{td.init(e,t),nN.init(e,t)}),nW=b("ZodNumber",(e,t)=>{tf.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:o,maximum:a,format:i,multipleOf:l,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;"string"==typeof i&&i.includes("int")?n.type="integer":n.type="number";let u="number"==typeof c&&c>=(o??-1/0),d="number"==typeof s&&s<=(a??1/0),f="draft-04"===t.target||"openapi-3.0"===t.target;u?f?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c:"number"==typeof o&&(n.minimum=o),d?f?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s:"number"==typeof a&&(n.maximum=a),"number"==typeof l&&(n.multipleOf=l)})(e,t,n,0),nk(e,"ZodNumber",{gt(e,t){return this.check(tQ(e,t))},gte(e,t){return this.check(t0(e,t))},min(e,t){return this.check(t0(e,t))},lt(e,t){return this.check(tX(e,t))},lte(e,t){return this.check(tJ(e,t))},max(e,t){return this.check(tJ(e,t))},int(e){return this.check(nY(e))},safe(e){return this.check(nY(e))},positive(e){return this.check(tQ(0,e))},nonnegative(e){return this.check(t0(0,e))},negative(e){return this.check(tX(0,e))},nonpositive(e){return this.check(tJ(0,e))},multipleOf(e,t){return this.check(t1(e,t))},step(e,t){return this.check(t1(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function nG(e){return new nW({type:"number",checks:[],...ep(e)})}let nZ=b("ZodNumberFormat",(e,t)=>{tp.init(e,t),nW.init(e,t)});function nY(e){return new nZ({type:"number",check:"number_format",abort:!1,format:"safeint",...ep(e)})}let nX=b("ZodBoolean",(e,t)=>{th.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function nJ(e){return new nX({type:"boolean",...ep(e)})}let nQ=b("ZodUnknown",(e,t)=>{tm.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function n0(){return new nQ({type:"unknown"})}let n1=b("ZodNever",(e,t)=>{tg.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),n2=b("ZodArray",(e,t)=>{ty.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o=e._zod.def,{minimum:a,maximum:i}=e._zod.bag;"number"==typeof a&&(n.minItems=a),"number"==typeof i&&(n.maxItems=i),n.type="array",n.items=t8(o.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,nk(e,"ZodArray",{min(e,t){return this.check(t4(e,t))},nonempty(e){return this.check(t4(1,e))},max(e,t){return this.check(t2(e,t))},length(e,t){return this.check(t3(e,t))},unwrap(){return this.element}})});function n4(e,t){return new n2({type:"array",element:e,...ep(t)})}let n3=b("ZodObject",(e,t)=>{tj.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o=e._zod.def;n.type="object",n.properties={};let a=o.shape;for(let e in a)n.properties[e]=t8(a[e],t,{...r,path:[...r.path,"properties",e]});let i=new Set([...new Set(Object.keys(a))].filter(e=>{let n=o.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));i.size>0&&(n.required=Array.from(i)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=t8(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),et(e,"shape",()=>t.shape),nk(e,"ZodObject",{keyof(){return rn(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:n0()})},loose(){return this.clone({...this._zod.def,catchall:n0()})},strict(){return this.clone({...this._zod.def,catchall:new n1({type:"never",...ep(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!es(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=er(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return en(this,"shape",n),n}});return ef(e,r)}(this,e)},safeExtend(e){var t=this;if(!es(e))throw Error("Invalid input to safeExtend: expected a plain object");let n=er(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return en(this,"shape",n),n}});return ef(t,n)},merge(e){var t=this;if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=er(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return en(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return ef(t,n)},pick(e){return function(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 o=er(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return en(this,"shape",e),e},checks:[]});return ef(e,o)}(this,e)},omit(e){return function(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 o=er(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return en(this,"shape",r),r},checks:[]});return ef(e,o)}(this,e)},partial(...e){return function(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let o=er(t._zod.def,{get shape(){let r=t._zod.def.shape,o={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return en(this,"shape",o),o},checks:[]});return ef(t,o)}(ri,this,e[0])},required(...e){var t,n;let r;return t=this,n=e[0],r=er(t._zod.def,{get shape(){let e=t._zod.def.shape,r={...e};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new rp({type:"nonoptional",innerType:e[t]}))}else for(let t in e)r[t]=new rp({type:"nonoptional",innerType:e[t]});return en(this,"shape",r),r}}),ef(t,r)}})});function n5(e,t){return new n3({type:"object",shape:e??{},...ep(t)})}let n6=b("ZodUnion",(e,t)=>{tO.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o,a,i;return a=!1===(o=e._zod.def).inclusive,i=o.options.map((e,n)=>t8(e,t,{...r,path:[...r.path,a?"oneOf":"anyOf",n]})),void(a?n.oneOf=i:n.anyOf=i)},e.options=t.options});function n8(e,t){return new n6({type:"union",options:e,...ep(t)})}let n9=b("ZodIntersection",(e,t)=>{tC.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o,a,i,l;return a=t8((o=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),i=t8(o.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=[...(l=e=>"allOf"in e&&1===Object.keys(e).length)(a)?a.allOf:[a],...l(i)?i.allOf:[i]])}}),n7=b("ZodRecord",(e,t)=>{tP.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o=e._zod.def;n.type="object";let a=o.keyType,i=a._zod.bag,l=i?.patterns;if("loose"===o.mode&&l&&l.size>0){let e=t8(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},l))n.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(n.propertyNames=t8(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=t8(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let s=a._zod.values;if(s){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function re(e,t,n){return new n7(t&&t._zod?{type:"record",keyType:e,valueType:t,...ep(n)}:{type:"record",keyType:nC(),valueType:e,...ep(t)})}let rt=b("ZodEnum",(e,t)=>{tE.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;(o=Y(e._zod.def.entries)).every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=o},e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let o={};for(let r of e)if(n.has(r))o[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new rt({...t,checks:[],...ep(r),entries:o})},e.exclude=(e,r)=>{let o={...t.entries};for(let t of e)if(n.has(t))delete o[t];else throw Error(`Key ${t} not found in enum`);return new rt({...t,checks:[],...ep(r),entries:o})}});function rn(e,t){return new rt({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ep(t)})}let rr=b("ZodLiteral",(e,t)=>{t_.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o=e._zod.def,a=[];for(let e of o.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else a.push(Number(e));else a.push(e);if(0===a.length);else if(1===a.length){let e=a[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else a.every(e=>"number"==typeof e)&&(n.type="number"),a.every(e=>"string"==typeof e)&&(n.type="string"),a.every(e=>"boolean"==typeof e)&&(n.type="boolean"),a.every(e=>null===e)&&(n.type="null"),n.enum=a})(e,t,n,0),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ro(e,t){return new rr({type:"literal",values:Array.isArray(e)?e:[e],...ep(t)})}let ra=b("ZodTransform",(e,t)=>{tA.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new w(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(ex(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(ex(r)))};let o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}}),ri=b("ZodOptional",(e,t)=>{tT.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nn(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rl(e){return new ri({type:"optional",innerType:e})}let rs=b("ZodExactOptional",(e,t)=>{tR.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nn(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),rc=b("ZodNullable",(e,t)=>{tM.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o,a,i;return a=t8((o=e._zod.def).innerType,t,r),i=t.seen.get(e),void("openapi-3.0"===t.target?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function ru(e){return new rc({type:"nullable",innerType:e})}let rd=b("ZodDefault",(e,t)=>{tz.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;t8((o=e._zod.def).innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),rf=b("ZodPrefault",(e,t)=>{tL.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;t8((o=e._zod.def).innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),rp=b("ZodNonOptional",(e,t)=>{tF.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;t8((o=e._zod.def).innerType,t,r),t.seen.get(e).ref=o.innerType},e.unwrap=()=>e._zod.def.innerType}),rh=b("ZodCatch",(e,t)=>{tU.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o,a=e._zod.def;t8(a.innerType,t,r),t.seen.get(e).ref=a.innerType;try{o=a.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=o})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),rm=b("ZodPipe",(e,t)=>{tH.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o,a,i;return a=(o=e._zod.def).in._zod.traits.has("$ZodTransform"),void(t8(i="input"===t.io?a?o.out:o.in:o.out,t,r),t.seen.get(e).ref=i)},e.in=t.in,e.out=t.out});function rg(e,t){return new rm({type:"pipe",in:e,out:t})}let rv=b("ZodReadonly",(e,t)=>{tV.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;t8((o=e._zod.def).innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),ry=b("ZodCustom",(e,t)=>{tq.init(e,t),nj.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)});function rb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){rb(e,t,n[t])})}return e}var rw=rn(["openai-chat","openai-responses","anthropic-messages"]),rk=rn(["none","minimal","low","medium","high","xhigh","max","ultra"]),rj=nG().int().positive().max(1e8),rS=n4(rk).max(8).refine(function(e){return new Set(e).size===e.length}),rO=n5({contextWindow:rj.optional(),maxOutputTokens:rj.optional(),reasoningSupported:nJ().optional(),supportedReasoningEfforts:rS.optional()}),rC=n5({reasoningEffort:rk.optional()}),rN=n5({id:tY(n_,void 0),label:nC().trim().min(1).max(120),providerId:nC().min(1).max(120),endpointKey:nC().min(1).max(60),protocol:rw,requestModelId:nC().trim().min(1).max(120),factOverrides:n5({contextWindow:rj.nullable().optional(),maxOutputTokens:rj.nullable().optional(),reasoningSupported:nJ().nullable().optional(),supportedReasoningEfforts:rS.nullable().optional()}).default({}),preferenceOverrides:n5({reasoningEffort:rk.nullable().optional()}).default({})}),rP=n5({name:nC().trim().min(1).max(120),notes:nC().max(4096).default(""),defaults:rO.default({}),preferences:rC.default({}),connections:n4(rN).max(50).default([])});function rE(e,t){var n=new Set,r=new Set,o=function(e,n,r){var o,a,i=n.reasoningEffort;(!1===e.reasoningSupported&&((null!=(o=null==(a=e.supportedReasoningEfforts)?void 0:a.length)?o:0)>0||i&&"none"!==i)||i&&e.supportedReasoningEfforts&&!e.supportedReasoningEfforts.includes(i))&&t.addIssue({code:"custom",path:r,message:"favoriteInvalidFacts"})};o(e.defaults,e.preferences,["defaults"]),e.connections.forEach(function(a,i){var l=JSON.stringify([a.providerId,a.endpointKey,a.protocol,a.requestModelId]);(n.has(l)||r.has(a.id))&&t.addIssue({code:"custom",path:["connections",i],message:"favoriteDuplicateConnection"}),n.add(l),r.add(a.id);var s=function(e,t){var n=rx({},e.defaults),r={},o=!0,a=!1,i=void 0;try{for(var l,s=Object.keys(rO.shape)[Symbol.iterator]();!(o=(l=s.next()).done);o=!0){var c=l.value,u=t.factOverrides[c];null===u?delete n[c]:void 0!==u&&Object.assign(n,rb({},c,u)),r[c]=null===u?"unknown":void 0!==u?"connection":void 0!==n[c]?"favorite":"unknown"}}catch(e){a=!0,i=e}finally{try{o||null==s.return||s.return()}finally{if(a)throw i}}var d=t.preferenceOverrides.reasoningEffort,f=null===d?{}:void 0===d?rx({},e.preferences):{reasoningEffort:d};return r.reasoningEffort=null===d?"unknown":void 0!==d?"connection":f.reasoningEffort?"favorite":"unknown",{facts:n,preferences:f,sources:r}}(e,a);o(s.facts,s.preferences,["connections",i])})}var r_=rP.superRefine(rE),rA=rP.extend({id:tY(n_,void 0),revision:nG().int().positive(),createdAt:no(),updatedAt:no()}).superRefine(rE);n5({schemaVersion:ro(1),favorites:n4(rA).max(1e3)}).refine(function(e){return new Set(e.favorites.map(function(e){return e.id})).size===e.favorites.length}),n5({name:rP.shape.name.optional(),notes:nC().max(4096).optional(),defaults:rO.optional(),preferences:rC.optional(),connections:n4(rN).max(50).optional(),expectedRevision:nG().int().positive().optional()}),n5({expectedRevision:nG().int().positive().optional()});var rI=rn(["api","providerType","contextWindow","maxContextSize","maxTokens","reasoning","reasoningEfforts","reasoningEffort"]),rT=n5({harness:rn(d),model:nC().max(120),providerId:nC().max(120),providerEndpoint:nC().max(60),extras:(o=nC().max(4096).nullable(),(r=ef(rI))._zod.values=void 0,new n7({type:"record",keyType:r,valueType:o,...ep(void 0)}))}),rR=n5({favoriteId:tY(n_,void 0),connectionId:tY(n_,void 0),appliedRevision:nG().int().positive(),projectionVersion:nG().int().positive(),baseline:rT});n5({harness:rn(d),name:nC().min(1).max(120),sourceFingerprint:nC().length(64),favoriteName:nC().trim().min(1).max(120),extractCredential:nJ().optional(),linkSource:nJ().optional()}),n5({sourceFingerprint:nC().length(64)}),n5({favoriteId:tY(n_,void 0),expectedRevision:nG().int().positive(),items:n4(n5({harness:rn(d),connectionId:tY(n_,void 0),profile:nC().trim().min(1).max(120).refine(function(e){return!/[\\/]/.test(e)}).optional(),existing:nJ().default(!1),mode:rn(["save","activate"]).default("save"),overwriteDiverged:nJ().default(!1),allowAuthOverwrite:nJ().optional(),ignorePreference:nJ().default(!1)})).min(1).max(5).refine(function(e){return new Set(e.map(function(e){return e.harness})).size===e.length})}),n5({requestId:tY(n_,void 0)}),n5({action:rn(["create","update","delete","capture","detach","apply","restore"]),name:nC().optional(),tools:n4(rn(d)).optional()}),n5({fingerprint:nC().optional()});var rM={name:120,endpointKey:60,url:2048,notes:4096,apiKey:4096},rz=nC().trim().min(1,"名称不能为空").max(120,"名称不能超过 ".concat(120," 个字符")).refine(function(e){return!e.includes("/")&&!e.includes("\\")},"名称不能包含斜杠"),rD=function(e){return nC().max(e)},rL=nC().min(1).max(120),rF=rn(d),r$=re(rL,rD(4096)),rU=re(rL,rD(1048576)),rH=rn(["skip","overwrite"]),rB=rn(["openai-chat","openai-responses","anthropic-messages"]);n5({password:nC().trim().min(1,"password 不能为空").max(4096)}),n5({name:rz,copySourceName:rz.optional(),baseUrl:rD(2048).optional(),apiKey:rD(4096).optional(),model:rD(120).optional(),notes:rD(4096).optional(),extras:r$.optional(),overrides:rU.optional(),providerId:rD(120).optional(),providerEndpoint:rD(120).optional()}).partial();var rV=n4(n5({key:nC().trim().min(1,"endpoint key 不能为空").max(60,"endpoint key 过长").refine(function(e){return!e.includes("/")&&!e.includes("\\")},"endpoint key 不能包含斜杠"),label:rD(120).optional(),baseUrl:nC().trim().min(1,"endpoint 需要 baseUrl").max(2048)})).max(50).refine(function(e){return new Set(e.map(function(e){return e.key})).size===e.length},"endpoint key 不能重复");n5({name:rz,apiKey:nC().min(1,"apiKey 不能为空").max(4096),endpoints:rV.optional(),notes:rD(4096).optional()}),n5({name:rz.optional(),apiKey:rD(4096).optional(),endpoints:rV.optional(),notes:rD(4096).optional()}),n5({sourceUser:nC().trim().min(1,"来源用户不能为空").max(120),conflictPolicy:rH.optional(),overwriteHarnesses:n4(rF).optional(),migrateCodexLoginCache:nJ().optional()});var rK=n5({format:ro("harness-switch-encrypted-export"),version:ro(1),kdf:n5({name:ro("scrypt"),salt:nC().min(1)}),cipher:n5({name:ro("aes-256-gcm"),iv:nC().min(1),tag:nC().min(1),data:nC().min(1)})}),rq=n5({modelFavorite:rR.optional(),harness:rF,name:rz,baseUrl:rD(2048),apiKey:rD(4096),model:rD(120),notes:rD(4096),extras:r$,overrides:rU,providerId:rD(120).optional(),providerEndpoint:rD(120).optional()}),rW=n5({id:nC().min(1).max(64).refine(function(e){return!e.includes("/")&&!e.includes("\\")},"provider id 不能包含斜杠").refine(function(e){return"__proto__"!==e&&"constructor"!==e},"provider id 不合法"),name:nC().min(1).max(120),apiKey:nC().min(1).max(4096),notes:rD(4096).optional(),endpoints:n4(n5({key:rL,label:rD(120),baseUrl:rD(2048)}))}),rG=n5({harness:rF,name:rz,official:nJ()});n5({format:ro("harness-switch-portable-config"),version:n8([ro(1),ro(2)]),favorites:n4(rA).max(1e3).optional(),exportedAt:nC(),profiles:n4(rq).max(1e4),providers:n4(rW).max(1e4).optional(),active:n4(rG),codexLoginCache:nC().optional()}),n5({legacy:nJ().optional(),passphrase:rD(4096),includeCodexLoginCache:nJ().optional()}),n5({envelope:rK,passphrase:rD(4096),conflictPolicy:rH.optional(),restoreActive:nJ().optional(),migrateCodexLoginCache:nJ().optional()});var rZ=n5({id:nC().min(1).max(240),name:rz,target:rn(["profile","vault"]),apiKey:rD(4096).optional(),providerId:rD(120).optional(),providerName:rz.optional(),overwrite:nJ().optional()});n5({selections:n4(rZ).min(1,"请至少选择一条配置").max(200)}),n5({baseUrl:nC().trim().min(1,"baseUrl 不能为空").max(2048),apiKey:rD(4096).optional(),providerId:rD(120).optional(),completion:nJ().optional(),model:rD(120).optional(),protocol:rB.optional()}),n5({endpoint:rD(120).optional(),completion:nJ().optional(),model:rD(120).optional(),protocol:rB.optional(),refresh:nJ().optional()}),n5({clientId:rD(100).optional()}),n5({deviceCode:nC().min(1).max(200),clientId:rD(100).optional()}),n5({token:nC().trim().min(1,"Token 不能为空").max(500)}),n5({passphrase:rD(4096),includeCodexLoginCache:nJ().optional()}),n5({passphrase:rD(4096),conflictPolicy:rH.optional(),restoreActive:nJ().optional()}),n5({passphrase:rD(4096),conflictPolicy:rH.optional(),restoreActive:nJ().optional(),migrateCodexLoginCache:nJ().optional()})}},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return c[e](n,n.exports,d),n.exports}d.m=c,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(n,r){if(1&r&&(n=this(n)),8&r||"object"==typeof n&&n&&(4&r&&n.__esModule||16&r&&"function"==typeof n.then))return n;var o=Object.create(null);d.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var i=2&r&&n;("object"==typeof i||"function"==typeof i)&&!~e.indexOf(i);i=t(i))Object.getOwnPropertyNames(i).forEach(e=>{a[e]=()=>n[e]});return a.default=()=>n,d.d(o,a),o},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((t,n)=>(d.f[n](e,t),t),[])),d.k=e=>""+e+".css",d.u=e=>"assets/"+e+"."+({38:"12ddaa3e",403:"83e8a5aa",703:"74dabcc4",780:"6c88bbeb",886:"215586f6",911:"fae0dbda",952:"906cea7c",997:"79084a9d"})[e]+".js",d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},d.l=function(e,t,r,o){if(n[e])return void n[e].push(t);if(void 0!==r)for(var a,i,l=document.getElementsByTagName("script"),s=0;s<l.length;s++){var c=l[s];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@seaveyon/harness-switch-web:"+r){a=c;break}}a||(i=!0,(a=document.createElement("script")).timeout=120,d.nc&&a.setAttribute("nonce",d.nc),a.setAttribute("data-rspack","@seaveyon/harness-switch-web:"+r),a.src=e),n[e]=[t];var u=function(t,r){a.onerror=a.onload=null,clearTimeout(f);var o=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(function(e){return e(r)}),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),i&&document.head.appendChild(a)},d.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.nc=void 0,d.p="/",d.rv=()=>"1.7.12",r={889:0},a="data-rspack-loading",(o=(e,t)=>{r[t]=0})(d.m,0,"889"),d.f.css=(e,t,n)=>{var i=d.o(r,e)?r[e]:void 0;if(0!==i)if(i)t.push(i[2]);else if(889==e){var l=new Promise(function(t,n){i=r[e]=[t,n]});t.push(i[2]=l);var s=d.p+d.k(e),c=Error(),u=function(t){if(d.o(r,e)&&(0!==(i=r[e])&&(r[e]=void 0),i))if("load"!==t.type){var n=t&&t.type,a=t&&t.target&&t.target.src;c.message="Loading css chunk "+e+" failed.\n("+n+": "+a+")",c.name="ChunkLoadError",c.type=n,c.request=a,i[1](c)}else o(d.m,e),i[0]()};"u">typeof document?((e,t,n,r,o)=>{var i,l,s="chunk-"+e;if(!r){for(var c=document.getElementsByTagName("link"),u=0;u<c.length;u++){var f=c[u],p=f.getAttribute("href")||f.href;if(p&&!p.startsWith(d.p)&&(p=d.p+(p.startsWith("/")?p.slice(1):p)),"stylesheet"==f.rel&&(p&&p.startsWith(t)||f.getAttribute("data-rspack")=="@seaveyon/harness-switch-web:"+s)){i=f;break}}if(!n)return}i||(l=!0,i=document.createElement("link"),d.nc&&i.setAttribute("nonce",d.nc),i.setAttribute("data-rspack","@seaveyon/harness-switch-web:"+s),i.setAttribute(a,1),i.rel="stylesheet",i.href=t);var h=(e,t)=>{if(i.onerror=i.onload=null,i.removeAttribute(a),clearTimeout(m),t&&"load"!=t.type&&i.parentNode.removeChild(i),n(t),e)return e(t)};if(i.getAttribute(a)){var m=setTimeout(h.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=h.bind(null,i.onerror),i.onload=h.bind(null,i.onload)}else h(void 0,{type:"load",target:i});return r&&r.getAttribute("fetchpriority")&&i.setAttribute("fetchpriority",r.getAttribute("fetchpriority")),r?document.head.insertBefore(i,r):l&&document.head.appendChild(i)})(e,s,u,void 0,0):u({type:"load"})}else r[e]=0},i={889:0},d.f.j=function(e,t){var n=d.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise((t,r)=>n=i[e]=[t,r]);t.push(n[2]=r);var o=d.p+d.u(e),a=Error();d.l(o,function(t){if(d.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}},l=(e,t)=>{var n,r,[o,a,l]=t,s=0;if(o.some(e=>0!==i[e])){for(n in a)d.o(a,n)&&(d.m[n]=a[n]);l&&l(d)}for(e&&e(t);s<o.length;s++)r=o[s],d.o(i,r)&&i[r]&&i[r][0](),i[r]=0},(s=self.webpackChunk_seaveyon_harness_switch_web=self.webpackChunk_seaveyon_harness_switch_web||[]).forEach(l.bind(null,0)),s.push=l.bind(null,s.push.bind(s)),d.ruid="bundler=rspack@1.7.12",(()=>{let e,t;var n,r,o,a,i,l,s,c,u,f,p,h,m,g,v,y,b,x=d(1085),w=d(4041),k=d.t(w,2),j=d(5873),S=d(1434),O=d(4530);let C=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},N=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();var P={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let E=(0,w.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...l},s)=>(0,w.createElement)("svg",{ref:s,...P,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:N("lucide",o),...!a&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(l)&&{"aria-hidden":"true"},...l},[...i.map(([e,t])=>(0,w.createElement)(e,t)),...Array.isArray(a)?a:[a]])),_=(e,t)=>{let n=(0,w.forwardRef)(({className:n,...r},o)=>(0,w.createElement)(E,{ref:o,iconNode:t,className:N(`lucide-${C(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r}));return n.displayName=C(e),n},A=_("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),I=_("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),T=_("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),R=_("arrow-right-left",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]),M=_("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),z=_("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),D=_("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),L=_("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),F=_("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]),$=_("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),U=_("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),H=_("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function B(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}(e))&&(r&&(r+=" "),r+=t);return r}let V=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,K=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return B(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{let t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;let i=V(t)||V(r);return o[e][i]}),l=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return B(e,i,null==t||null==(r=t.compoundVariants)?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...l}[t]):({...a,...l})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)},q=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),W=[],G=(e,t,n)=>{if(0==e.length-t)return n.classGroupId;let r=e[t],o=n.nextPart.get(r);if(o){let n=G(e,t+1,o);if(n)return n}let a=n.validators;if(null===a)return;let i=0===t?e.join("-"):e.slice(t).join("-"),l=a.length;for(let e=0;e<l;e++){let t=a[e];if(t.validator(i))return t.classGroupId}},Z=(e,t)=>{let n=q();for(let r in e)Y(e[r],n,r,t);return n},Y=(e,t,n,r)=>{let o=e.length;for(let a=0;a<o;a++)X(e[a],t,n,r)},X=(e,t,n,r)=>{"string"==typeof e?J(e,t,n):"function"==typeof e?Q(e,t,n,r):ee(e,t,n,r)},J=(e,t,n)=>{(""===e?t:et(t,e)).classGroupId=n},Q=(e,t,n,r)=>{en(e)?Y(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:n,validator:e}))},ee=(e,t,n,r)=>{let o=Object.entries(e),a=o.length;for(let e=0;e<a;e++){let[a,i]=o[e];Y(i,et(t,a),n,r)}},et=(e,t)=>{let n=e,r=t.split("-"),o=r.length;for(let e=0;e<o;e++){let t=r[e],o=n.nextPart.get(t);o||(o=q(),n.nextPart.set(t,o)),n=o}return n},en=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,er=[],eo=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),ea=/\s+/,ei=e=>{let t;if("string"==typeof e)return e;let n="";for(let r=0;r<e.length;r++)e[r]&&(t=ei(e[r]))&&(n&&(n+=" "),n+=t);return n},el=[],es=e=>{let t=t=>t[e]||el;return t.isThemeGetter=!0,t},ec=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ed=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ef=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ep=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,em=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ev=e=>ed.test(e),ey=e=>!!e&&!Number.isNaN(Number(e)),eb=e=>!!e&&Number.isInteger(Number(e)),ex=e=>e.endsWith("%")&&ey(e.slice(0,-1)),ew=e=>ef.test(e),ek=()=>!0,ej=e=>ep.test(e)&&!eh.test(e),eS=()=>!1,eO=e=>em.test(e),eC=e=>eg.test(e),eN=e=>!e_(e)&&!eL(e),eP=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),eE=e=>eq(e,eY,eS),e_=e=>ec.test(e),eA=e=>eq(e,eX,ej),eI=e=>eq(e,eJ,ey),eT=e=>eq(e,e0,ek),eR=e=>eq(e,eQ,eS),eM=e=>eq(e,eG,eS),ez=e=>eq(e,eZ,eC),eD=e=>eq(e,e1,eO),eL=e=>eu.test(e),eF=e=>eW(e,eX),e$=e=>eW(e,eQ),eU=e=>eW(e,eG),eH=e=>eW(e,eY),eB=e=>eW(e,eZ),eV=e=>eW(e,e1,!0),eK=e=>eW(e,e0,!0),eq=(e,t,n)=>{let r=ec.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},eW=(e,t,n=!1)=>{let r=eu.exec(e);return!!r&&(r[1]?t(r[1]):n)},eG=e=>"position"===e||"percentage"===e,eZ=e=>"image"===e||"url"===e,eY=e=>"length"===e||"size"===e||"bg-size"===e,eX=e=>"length"===e,eJ=e=>"number"===e,eQ=e=>"family-name"===e,e0=e=>"number"===e||"weight"===e,e1=e=>"shadow"===e,e2=((e,...t)=>{let n,r,o,a,i=e=>{let t=r(e);if(t)return t;let a=((e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a,postfixLookupClassGroupIds:i}=t,l=[],s=e.trim().split(ea),c="";for(let e=s.length-1;e>=0;e-=1){let t,u=s[e],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let g=!!m;if(g){let e=(t=r(h.substring(0,m)))&&i[t]?r(h):void 0;e&&e!==t&&(t=e,g=!1)}else t=r(h);if(!t){if(!g||!(t=r(h))){c=u+(c.length>0?" "+c:c);continue}g=!1}let v=0===f.length?"":1===f.length?f[0]:a(f).join(":"),y=p?v+"!":v,b=y+t;if(l.indexOf(b)>-1)continue;l.push(b);let x=o(t,g);for(let e=0;e<x.length;++e){let t=x[e];l.push(y+t)}c=u+(c.length>0?" "+c:c)}return c})(e,n);return o(e,a),a};return a=l=>{var s;let c;return r=(n={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),o=(o,a)=>{n[o]=a,++t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(o(e,t),t):void 0},set(e,t){e in n?n[e]=t:o(e,t)}}})((s=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t,n=[],r=0,o=0,a=0,i=e.length;for(let l=0;l<i;l++){let i=e[l];if(0===r&&0===o){if(":"===i){n.push(e.slice(a,l)),a=l+1;continue}if("/"===i){t=l;continue}}"["===i?r++:"]"===i?r--:"("===i?o++:")"===i&&o--}let l=0===n.length?e:e.slice(a),s=l,c=!1;return l.endsWith("!")?(s=l.slice(0,-1),c=!0):l.startsWith("!")&&(s=l.slice(1),c=!0),eo(n,c,s,t&&t>a?t-a:void 0)};if(t){let e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):eo(er,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r})(s),sortModifiers:(c=new Map,s.orderSensitiveModifiers.forEach((e,t)=>{c.set(e,1e6+t)}),e=>{let t=[],n=[];for(let r=0;r<e.length;r++){let o=e[r],a="["===o[0],i=c.has(o);a||i?(n.length>0&&(n.sort(),t.push(...n),n=[]),t.push(o)):n.push(o)}return n.length>0&&(n.sort(),t.push(...n)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t})(s),...(e=>{let t=(e=>{let{theme:t,classGroups:n}=e;return Z(n,t)})(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var n;let t,r,o;return -1===(n=e).slice(1,-1).indexOf(":")?void 0:(r=(t=n.slice(1,-1)).indexOf(":"),(o=t.slice(0,r))?"arbitrary.."+o:void 0)}let r=e.split("-"),o=+(""===r[0]&&r.length>1);return G(r,o,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],o=n[e];if(t){if(o){let e=Array(o.length+t.length);for(let t=0;t<o.length;t++)e[t]=o[t];for(let n=0;n<t.length;n++)e[o.length+n]=t[n];return e}return t}return o||W}return n[e]||W}}})(s)}).cache.get,o=n.cache.set,a=i,i(l)},(...e)=>a(((...e)=>{let t,n,r=0,o="";for(;r<e.length;)(t=e[r++])&&(n=ei(t))&&(o&&(o+=" "),o+=n);return o})(...e))})(()=>{let e=es("color"),t=es("font"),n=es("text"),r=es("font-weight"),o=es("tracking"),a=es("leading"),i=es("breakpoint"),l=es("container"),s=es("spacing"),c=es("radius"),u=es("shadow"),d=es("inset-shadow"),f=es("text-shadow"),p=es("drop-shadow"),h=es("blur"),m=es("perspective"),g=es("aspect"),v=es("ease"),y=es("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),eL,e_],k=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],S=()=>[eL,e_,s],O=()=>[ev,"full","auto",...S()],C=()=>[eb,"none","subgrid",eL,e_],N=()=>["auto",{span:["full",eb,eL,e_]},eb,eL,e_],P=()=>[eb,"auto",eL,e_],E=()=>["auto","min","max","fr",eL,e_],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...S()],T=()=>[ev,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],R=()=>[ev,"screen","full","dvw","lvw","svw","min","max","fit",...S()],M=()=>[ev,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],z=()=>[e,eL,e_],D=()=>[...x(),eU,eM,{position:[eL,e_]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",eH,eE,{size:[eL,e_]}],$=()=>[ex,eF,eA],U=()=>["","none","full",c,eL,e_],H=()=>["",ey,eF,eA],B=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[ey,ex,eU,eM],q=()=>["","none",h,eL,e_],W=()=>["none",ey,eL,e_],G=()=>["none",ey,eL,e_],Z=()=>[ey,eL,e_],Y=()=>[ev,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ew],breakpoint:[ew],color:[ek],container:[ew],"drop-shadow":[ew],ease:["in","out","in-out"],font:[eN],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ew],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ew],shadow:[ew],spacing:["px",ey],text:[ew],"text-shadow":[ew],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ev,e_,eL,g]}],container:["container"],"container-type":[{"@container":["","normal","size",eL,e_]}],"container-named":[eP],columns:[{columns:[ey,e_,eL,l]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[eb,"auto",eL,e_]}],basis:[{basis:[ev,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ey,ev,"auto","initial","none",e_]}],grow:[{grow:["",ey,eL,e_]}],shrink:[{shrink:["",ey,eL,e_]}],order:[{order:[eb,"first","last","none",eL,e_]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...A(),"normal"]}],"justify-self":[{"justify-self":["auto",...A()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...A(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...A(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...A(),"baseline"]}],"place-self":[{"place-self":["auto",...A()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mbs:[{mbs:I()}],mbe:[{mbe:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...M()]}],"min-block-size":[{"min-block":["auto",...M()]}],"max-block-size":[{"max-block":["none",...M()]}],w:[{w:[l,"screen",...T()]}],"min-w":[{"min-w":[l,"screen","none",...T()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",n,eF,eA]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,eK,eT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ex,e_]}],"font-family":[{font:[e$,eR,t]}],"font-features":[{"font-features":[e_]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,eL,e_]}],"line-clamp":[{"line-clamp":[ey,"none",eL,eI]}],leading:[{leading:[a,...S()]}],"list-image":[{"list-image":["none",eL,e_]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",eL,e_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[ey,"from-font","auto",eL,eA]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[ey,"auto",eL,e_]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"tab-size":[{tab:[eb,eL,e_]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",eL,e_]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",eL,e_]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eb,eL,e_],radial:["",eL,e_],conic:[eb,eL,e_]},eB,ez]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ey,eL,e_]}],"outline-w":[{outline:["",ey,eF,eA]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,eV,eD]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,eV,eD]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[ey,eA]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,eV,eD]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[ey,eL,e_]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ey]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[eL,e_]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[ey]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",eL,e_]}],filter:[{filter:["","none",eL,e_]}],blur:[{blur:q()}],brightness:[{brightness:[ey,eL,e_]}],contrast:[{contrast:[ey,eL,e_]}],"drop-shadow":[{"drop-shadow":["","none",p,eV,eD]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",ey,eL,e_]}],"hue-rotate":[{"hue-rotate":[ey,eL,e_]}],invert:[{invert:["",ey,eL,e_]}],saturate:[{saturate:[ey,eL,e_]}],sepia:[{sepia:["",ey,eL,e_]}],"backdrop-filter":[{"backdrop-filter":["","none",eL,e_]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[ey,eL,e_]}],"backdrop-contrast":[{"backdrop-contrast":[ey,eL,e_]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ey,eL,e_]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ey,eL,e_]}],"backdrop-invert":[{"backdrop-invert":["",ey,eL,e_]}],"backdrop-opacity":[{"backdrop-opacity":[ey,eL,e_]}],"backdrop-saturate":[{"backdrop-saturate":[ey,eL,e_]}],"backdrop-sepia":[{"backdrop-sepia":["",ey,eL,e_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",eL,e_]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ey,"initial",eL,e_]}],ease:[{ease:["linear","initial",v,eL,e_]}],delay:[{delay:[ey,eL,e_]}],animate:[{animate:["none",y,eL,e_]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,eL,e_]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:W()}],"rotate-x":[{"rotate-x":W()}],"rotate-y":[{"rotate-y":W()}],"rotate-z":[{"rotate-z":W()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:Z()}],"skew-x":[{"skew-x":Z()}],"skew-y":[{"skew-y":Z()}],transform:[{transform:[eL,e_,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],zoom:[{zoom:[eb,eL,e_]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",eL,e_]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",eL,e_]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[ey,eF,eA,eI]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function e4(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return e2(B(t))}var e3=K("inline-flex items-center rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function e5(e){var t=e.className,n=e.variant,r=function(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}(e,["className","variant"]);return(0,x.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"badge",className:e4(e3({variant:n}),t)},r))}function e6(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function e8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function e9(e){return(e9=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e7(e,t){return(e7=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(te=function(){return!!e})()}var tt=(0,w.lazy)(function(){var e;return(e=function(){return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,Promise.all([d.e("780"),d.e("38")]).then(d.bind(d,1419))];case 1:return[2,{default:e.sent().PierreFileDiff}]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){e6(a,r,o,i,l,"next",e)}function l(e){e6(a,r,o,i,l,"throw",e)}i(void 0)})})()});function tn(e){return null===e.content&&null===e.currentContent?"same":null===e.content?"delete":null===e.currentContent?"create":e.content===e.currentContent?"same":"replace"}function tr(e){var t=e.files,n=e.intent,r=void 0===n?"restore":n,o=e.collapseUnchanged,a=void 0!==o&&o;return(0,x.jsx)("div",{className:"space-y-3",children:t.map(function(e){return(0,x.jsx)(to,{file:e,intent:r,collapseUnchanged:a},e.path)})})}function to(e){var t=e.file,n=e.intent,r=e.collapseUnchanged,o=(0,S.Bd)().t,a=tn(t);return(0,x.jsxs)("div",{className:"overflow-hidden rounded-xl border",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b bg-muted/40 px-3 py-2",children:[(0,x.jsx)("p",{className:"min-w-0 truncate font-mono text-xs",title:t.path,children:t.path}),(0,x.jsx)(e5,{variant:"secondary",children:o("diff.".concat(a))})]}),(0,x.jsx)(ti,{fallback:(0,x.jsx)(ta,{file:t,intent:n}),children:(0,x.jsx)(w.Suspense,{fallback:(0,x.jsx)("p",{className:"px-3 py-4 text-sm text-muted-foreground",children:o("diff.rendering")}),children:(0,x.jsx)(tt,{file:t,collapseUnchanged:r})})})]})}function ta(e){var t,n,r=e.file,o=e.intent,a=(0,S.Bd)().t;return(0,x.jsxs)("div",{className:"grid gap-2 p-3 font-mono text-xs",children:[(0,x.jsx)("pre",{className:"whitespace-pre-wrap text-red-400/90",children:null!=(t=r.currentContent)?t:a("diff.absent")}),(0,x.jsx)("p",{className:"font-sans text-muted-foreground",children:a("apply"===o?"favorites.after":"diff.afterRestore")}),(0,x.jsx)("pre",{className:"whitespace-pre-wrap text-emerald-400/90",children:null!=(n=r.content)?n:a("apply"===o?"diff.absent":"diff.deletedAfterRestore")})]})}var ti=function(e){var t,n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n,o,a;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=e9(t),e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,te()?Reflect.construct(t,n||[],e9(this).constructor):t.apply(this,n)),a={failed:!1},(o="state")in e?Object.defineProperty(e,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[o]=a,e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&e7(r,e),n=[{key:"getDerivedStateFromError",value:function(){return{failed:!0}}}],t=[{key:"render",value:function(){return this.state.failed?this.props.fallback:this.props.children}}],e8(r.prototype,t),n&&e8(r,n),r}(w.Component),tl=Object.defineProperty,ts=(e,t)=>tl(e,"name",{value:t,configurable:!0});function tc(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function tu(...e){return t=>{let n=!1,r=e.map(e=>{let r=tc(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():tc(e[t],null)}}}}function td(...e){return w.useCallback(tu(...e),e)}ts(tc,"setRef"),ts(tu,"composeRefs"),ts(td,"useComposedRefs");var tf=Object.defineProperty,tp=(e,t)=>tf(e,"name",{value:t,configurable:!0});function th(e){let t=w.forwardRef((t,n)=>{let{children:r,...o}=t,a=null,i=!1,l=[];tj(r)&&"function"==typeof tN&&(r=tN(r._payload)),w.Children.forEach(r,e=>{if(tw(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;tj(t)&&"function"==typeof tN&&(t=tN(t._payload)),a=ty(e,t),l.push(a?.props?.children)}else l.push(e)}),a?a=w.cloneElement(a,void 0,l):!i&&1===w.Children.count(r)&&w.isValidElement(r)&&(a=r);let s=a?tx(a):void 0,c=td(n,s);if(!a){if(r||0===r)throw Error(i?tC(e):tO(e));return r}let u=tb(o,a.props??{});return a.type!==w.Fragment&&(u.ref=n?c:s),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}tp(th,"createSlot");var tm=th("Slot"),tg=Symbol.for("radix.slottable");function tv(e){let t=tp(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=tg,t}tp(tv,"createSlottable");var ty=tp((e,t)=>{if("child"in e.props){let t=e.props.child;return w.isValidElement(t)?w.cloneElement(t,void 0,e.props.children(t.props.children)):null}return w.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function tb(e,t){let n={...t};for(let r in t){let o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{let t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function tx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function tw(e){return w.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tg}tp(tb,"mergeProps"),tp(tx,"getElementRef"),tp(tw,"isSlottable");var tk=Symbol.for("react.lazy");function tj(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===tk&&"_payload"in e&&tS(e._payload)}function tS(e){return"object"==typeof e&&null!==e&&"then"in e}tp(tj,"isLazyComponent"),tp(tS,"isPromiseLike");var tO=tp(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),tC=tp(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),tN=k[" use ".trim().toString()],tP=K("inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-[10px] text-sm font-medium transition-[color,background-color,border-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-background active:translate-y-px disabled:pointer-events-none disabled:opacity-50 disabled:active:translate-y-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-[0_8px_20px_-10px_color-mix(in_srgb,var(--primary)_65%,transparent)] hover:bg-primary/90 hover:shadow-[0_10px_24px_-10px_color-mix(in_srgb,var(--primary)_80%,transparent)]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/88",outline:"border border-input bg-card shadow-[0_1px_2px_rgb(20_24_40/0.04)] hover:border-ring/35 hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent/75 hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3 text-xs",lg:"h-11 px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function tE(e){var t=e.className,n=e.variant,r=e.size,o=e.asChild,a=function(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}(e,["className","variant","size","asChild"]);return(0,x.jsx)(void 0!==o&&o?tm:"button",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"button",className:e4(tP({variant:n,size:r,className:t}))},a))}var t_=Object.defineProperty,tA=(e,t)=>t_(e,"name",{value:t,configurable:!0}),tI=!!("u">typeof window&&window.document&&window.document.createElement);function tT(e,t,{checkForDefaultPrevented:n=!0}={}){return tA(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function tR(e){if(!tI)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function tM(e){return"IFRAME"===e.tagName}tA(tT,"composeEventHandlers"),tA(function(e){if(!tI)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),tA(tR,"getOwnerDocument"),tA(function e(t,n=!1){let{activeElement:r}=tR(t);if(!r?.nodeName)return null;if(tM(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=tR(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),tA(tM,"isFrame");var tz=Object.defineProperty,tD=(e,t)=>tz(e,"name",{value:t,configurable:!0});function tL(e,t=[]){let n=[];function r(t,r){let o=w.createContext(r);o.displayName=t+"Context";let a=n.length;n=[...n,r];let i=tD(t=>{let{scope:n,children:r,...i}=t,l=n?.[e]?.[a]||o,s=w.useMemo(()=>i,Object.values(i));return(0,x.jsx)(l.Provider,{value:s,children:r})},"Provider");function l(n,i,s={}){let{optional:c=!1}=s,u=i?.[e]?.[a]||o,d=w.useContext(u);if(d)return d;if(void 0!==r)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return i.displayName=t+"Provider",tD(l,"useContext"),[i,l]}tD(r,"createContext");let o=tD(()=>{let t=n.map(e=>w.createContext(e));return tD(function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},"useScope")},"createScope");return o.scopeName=e,[r,tF(o,...t)]}function tF(...e){let t=e[0];if(1===e.length)return t;let n=tD(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return tD(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let o=n(e)[`__scope${r}`];return{...t,...o}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}tD(function(e,t){let n=w.createContext(t);n.displayName=e+"Context";let r=tD(e=>{let{children:t,...r}=e,o=w.useMemo(()=>r,Object.values(r));return(0,x.jsx)(n.Provider,{value:o,children:t})},"Provider");function o(r,a={}){let{optional:i=!1}=a,l=w.useContext(n);if(l)return l;if(void 0!==t)return t;if(!i)throw Error(`\`${r}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",tD(o,"useContext"),[r,o]},"createContext"),tD(tL,"createContextScope"),tD(tF,"composeContextScopes");var t$=globalThis?.document?w.useLayoutEffect:()=>{},tU=Object.defineProperty,tH=k[" useId ".trim().toString()]||(()=>void 0),tB=0;function tV(e){let[t,n]=w.useState(tH());return t$(()=>{e||n(e=>e??String(tB++))},[e]),e||(t?`radix-${t}`:"")}tU(tV,"name",{value:"useId",configurable:!0});var tK=Object.defineProperty,tq=k[" useEffectEvent ".trim().toString()],tW=k[" useInsertionEffect ".trim().toString()];function tG(e){if("function"==typeof tq)return tq(e);let t=w.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof tW?tW(()=>{t.current=e}):t$(()=>{t.current=e}),w.useMemo(()=>(...e)=>t.current?.(...e),[])}tK(tG,"name",{value:"useEffectEvent",configurable:!0});var tZ=Object.defineProperty,tY=(e,t)=>tZ(e,"name",{value:t,configurable:!0}),tX=k[" useInsertionEffect ".trim().toString()]||t$;function tJ({prop:e,defaultProp:t,onChange:n=tY(()=>{},"onChange"),caller:r}){let[o,a,i]=tQ({defaultProp:t,onChange:n}),l=void 0!==e,s=l?e:o;return[s,w.useCallback(t=>{if(l){let n=t0(t)?t(e):t;n!==e&&i.current?.(n)}else a(t)},[l,e,a,i])]}function tQ({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),o=w.useRef(n),a=w.useRef(t);return tX(()=>{a.current=t},[t]),w.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}function t0(e){return"function"==typeof e}tY(tJ,"useControllableState"),tY(tQ,"useUncontrolledState"),tY(t0,"isFunction");var t1=Symbol("RADIX:SYNC_STATE");tY(function(e,t,n,r){let{prop:o,defaultProp:a,onChange:i,caller:l}=t,s=void 0!==o,c=tG(i),u=[{...n,state:a}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===t1)return{...t,state:n.state};let r=e(t,n);return s&&!Object.is(r.state,t.state)&&c(r.state),r},...u),p=d.state,h=w.useRef(p);w.useEffect(()=>{h.current!==p&&(h.current=p,s||c(p))},[p,h,s]);let m=w.useMemo(()=>void 0!==o?{...d,state:o}:d,[d,o]);return w.useEffect(()=>{s&&!Object.is(o,d.state)&&f({type:t1,state:o})},[o,d.state,s]),[m,f]},"useControllableStateReducer");var t2=d(3144),t4=Object.defineProperty,t3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=th(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:o,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,x.jsx)(o?n:t,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function t5(e,t){e&&t2.flushSync(()=>e.dispatchEvent(t))}function t6(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...e)=>t.current?.(...e),[])}t4(t5,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),(0,Object.defineProperty)(t6,"name",{value:"useCallbackRef",configurable:!0});var t8=Object.defineProperty,t9=(e,t)=>t8(e,"name",{value:t,configurable:!0}),t7="dismissableLayer.update",ne=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nt=w.forwardRef(t9(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=e,u=w.useContext(ne),[d,f]=w.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=w.useState({}),m=td(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,j=b>=y,S=w.useRef(!1),O=no(e=>{a?.(e),l?.(e),e.defaultPrevented||s?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return j&&!t},[u.branches,j])}),C=na(e=>{if(r&&S.current)return;let t=e.target;![...u.branches].some(e=>e.contains(t))&&(i?.(e),l?.(e),e.defaultPrevented||s?.())},p),N=!!d&&b===g.length-1,P=t6(e=>{"Escape"===e.key&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))});return w.useEffect(()=>{if(N)return p.addEventListener("keydown",P,{capture:!0}),()=>p.removeEventListener("keydown",P,{capture:!0})},[p,N,P]),w.useEffect(()=>{if(d)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(p$=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ni(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),0===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=p$))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ni())},[d,u]),w.useEffect(()=>{let e=t9(()=>h({}),"handleUpdate");return document.addEventListener(t7,e),()=>document.removeEventListener(t7,e)},[]),(0,x.jsx)(t3.div,{...c,ref:m,style:{pointerEvents:k?j?"auto":"none":void 0,...e.style},onFocusCapture:tT(e.onFocusCapture,C.onFocusCapture),onBlurCapture:tT(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:tT(e.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));function nn(){let e=w.useContext(ne),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}t9(nn,"useDismissableLayerSurface");var nr=t9(()=>!0,"IS_TRUE");function no(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:a,shouldHandlePointerDownOutside:i=nr}=t,l=t6(e),s=w.useRef(!1),c=w.useRef(!1),u=w.useRef(new Map),d=w.useRef(()=>{});return w.useEffect(()=>{function e(){c.current=!1,o.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&d.current()},0)}function p(e){c.current&&u.current.set(e.type,!1)}t9(e,"resetOutsideInteraction"),t9(t,"isOutsideInteractionIntercepted"),t9(f,"handleInteractionCapture"),t9(p,"handleInteractionBubble");let h=t9(a=>{if(a.target&&!s.current){let f=function(){n.removeEventListener("click",d.current);let r=t();e(),r||nl("dismissableLayer.pointerDownOutside",l,p,{discrete:!0})};if(t9(f,"handleAndDispatchPointerDownOutsideEvent"),!i(a.target)){n.removeEventListener("click",d.current),e(),s.current=!1;return}let p={originalEvent:a};c.current=!0,o.current=r&&0===a.button,u.current.clear(),r&&0===a.button?(n.removeEventListener("click",d.current),d.current=f,n.addEventListener("click",d.current,{once:!0})):f()}else n.removeEventListener("click",d.current),e();s.current=!1},"handlePointerDown"),m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{for(let e of(window.clearTimeout(g),n.removeEventListener("pointerdown",h),n.removeEventListener("click",d.current),m))n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,l,r,o,a,i]),{onPointerDownCapture:t9(()=>s.current=!0,"onPointerDownCapture")}}function na(e,t=globalThis?.document){let n=t6(e),r=w.useRef(!1);return w.useEffect(()=>{let e=t9(e=>{e.target&&!r.current&&nl("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:t9(()=>r.current=!0,"onFocusCapture"),onBlurCapture:t9(()=>r.current=!1,"onBlurCapture")}}function ni(){let e=new CustomEvent(t7);document.dispatchEvent(e)}function nl(e,t,n,{discrete:r}){let o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?t5(o,a):o.dispatchEvent(a)}t9(no,"usePointerDownOutside"),t9(na,"useFocusOutside"),t9(ni,"dispatchUpdate"),t9(nl,"handleAndDispatchCustomEvent");var ns=Object.defineProperty,nc=(e,t)=>ns(e,"name",{value:t,configurable:!0}),nu="focusScope.autoFocusOnMount",nd="focusScope.autoFocusOnUnmount",nf={bubbles:!1,cancelable:!0},np=w.forwardRef(nc(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[l,s]=w.useState(null),c=t6(o),u=t6(a),d=w.useRef(null),f=td(t,s),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let e=function(e){if(p.paused||!l)return;let t=e.target;l.contains(t)?d.current=t:nx(d.current,{select:!0})},t=function(e){if(p.paused||!l)return;let t=e.relatedTarget;null!==t&&(l.contains(t)||nx(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&nx(l)};nc(e,"handleFocusIn"),nc(t,"handleFocusOut"),nc(n,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,l,p.paused]),w.useEffect(()=>{if(l){nw.add(p);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(nu,nf);l.addEventListener(nu,c),l.dispatchEvent(t),t.defaultPrevented||(nh(nS(ng(l)),{select:!0}),document.activeElement===e&&nx(l))}return()=>{l.removeEventListener(nu,c),setTimeout(()=>{let t=new CustomEvent(nd,nf);l.addEventListener(nd,u),l.dispatchEvent(t),t.defaultPrevented||nx(e??document.body,{select:!0}),l.removeEventListener(nd,u),nw.remove(p)},0)}}},[l,c,u,p]);let h=w.useCallback(e=>{if(!n&&!r||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[r,a]=nm(t);r&&a?e.shiftKey||o!==a?e.shiftKey&&o===r&&(e.preventDefault(),n&&nx(a,{select:!0})):(e.preventDefault(),n&&nx(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,p.paused]);return(0,x.jsx)(t3.div,{tabIndex:-1,...i,ref:f,onKeyDown:h})},"FocusScope"));function nh(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(nx(r,{select:t}),document.activeElement!==n)return}function nm(e){let t=ng(e);return[nv(t,e),nv(t.reverse(),e)]}function ng(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:nc(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}function nv(e,t){let n="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ny(r,{upTo:t})))return r}function ny(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function nb(e){return e instanceof HTMLInputElement&&"select"in e}function nx(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nb(e)&&t&&e.select()}}nc(nh,"focusFirst"),nc(nm,"getTabbableEdges"),nc(ng,"getTabbableCandidates"),nc(nv,"findVisible"),nc(ny,"isHidden"),nc(nb,"isSelectableInput"),nc(nx,"focus");var nw=nk();function nk(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),(e=nj(e,t)).unshift(t)},remove(t){e=nj(e,t),e[0]?.resume()}}}function nj(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}function nS(e){return e.filter(e=>"A"!==e.tagName)}nc(nk,"createFocusScopesStack"),nc(nj,"arrayRemove"),nc(nS,"removeLinks");var nO=Object.defineProperty,nC=w.forwardRef(nO(function(e,t){let{container:n,...r}=e,[o,a]=w.useState(!1);t$(()=>a(!0),[]);let i=n||o&&globalThis?.document?.body;return i?t2.createPortal((0,x.jsx)(t3.div,{...r,ref:t}),i):null},"name",{value:"Portal",configurable:!0})),nN=Object.defineProperty,nP=(e,t)=>nN(e,"name",{value:t,configurable:!0});function nE(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}nP(nE,"useStateMachine");var n_=nP(e=>{let{present:t,children:n}=e,r=nA(t),o="function"==typeof n?n({present:r.isPresent}):w.Children.only(n),a=nT(r.ref,nM(o));return"function"==typeof n||r.isPresent?w.cloneElement(o,{ref:a}):null},"Presence");function nA(e){let[t,n]=w.useState(),r=w.useRef(null),o=w.useRef(e),a=w.useRef("none"),i=w.useRef(void 0),[l,s]=nE(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{"mounted"===l?(a.current=i.current??nR(r.current),i.current=void 0):a.current="none"},[l]),t$(()=>{let t=r.current,n=o.current;if(n!==e){let r=a.current,l=nR(t);e?(i.current=l,s("MOUNT")):"none"===l||t?.display==="none"?s("UNMOUNT"):n&&r!==l?s("ANIMATION_OUT"):s("UNMOUNT"),o.current=e}},[e,s]),t$(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,i=nP(a=>{let i=nR(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&i&&(s("ANIMATION_END"),!o.current)){let r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},"handleAnimationEnd"),l=nP(e=>{e.target===t&&(a.current=nR(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,i.current=nR(t)}else r.current=null;n(e)},[])}}function nI(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function nT(...e){let t=w.useRef(e);return t.current=e,w.useCallback(e=>{let n=t.current,r=!1,o=n.map(t=>{let n=nI(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<o.length;e++){let t=o[e];"function"==typeof t?t():nI(n[e],null)}}},[])}function nR(e){return e?.animationName||"none"}function nM(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}nP(nA,"usePresence"),nP(nI,"setRef"),nP(nT,"useStableComposedRefs"),nP(nR,"getAnimationName"),nP(nM,"getElementRef");var nz=Object.defineProperty,nD=(e,t)=>nz(e,"name",{value:t,configurable:!0}),nL=0,nF=null;function n$(){w.useEffect(()=>{nF||(nF={start:nU(),end:nU()});let{start:e,end:t}=nF;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),nL++,()=>{1===nL&&(nF?.start.remove(),nF?.end.remove(),nF=null),nL=Math.max(0,nL-1)}},[])}function nU(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}nD(function(e){return n$(),e.children},"FocusGuards"),nD(n$,"useFocusGuards"),nD(nU,"createFocusGuard");var nH=function(){return(nH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function nB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}var nV="right-scroll-bar-position",nK="width-before-scroll-bar";function nq(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var nW="u">typeof window?w.useLayoutEffect:w.useEffect,nG=new WeakMap,nZ=(void 0===pR&&(pR={}),(void 0===pM&&(pM=function(e){return e}),pz=[],pD=!1,pL={read:function(){if(pD)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return pz.length?pz[pz.length-1]:null},useMedium:function(e){var t=pM(e,pD);return pz.push(t),function(){pz=pz.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(pD=!0;pz.length;){var t=pz;pz=[],t.forEach(e)}pz={push:function(t){return e(t)},filter:function(){return pz}}},assignMedium:function(e){pD=!0;var t=[];if(pz.length){var n=pz;pz=[],n.forEach(e),t=pz}var r=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(r)};o(),pz={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),pz}}}}).options=nH({async:!0,ssr:!1},pR),pL),nY=function(){},nX=w.forwardRef(function(e,t){var n,r,o,a,i=w.useRef(null),l=w.useState({onScrollCapture:nY,onWheelCapture:nY,onTouchMoveCapture:nY}),s=l[0],c=l[1],u=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,g=e.sideCar,v=e.noRelative,y=e.noIsolation,b=e.inert,x=e.allowPinchZoom,k=e.as,j=e.gapMode,S=nB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=(n=[i,t],r=function(e){return n.forEach(function(t){return nq(t,e)})},(o=(0,w.useState)(function(){return{value:null,callback:r,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=r,a=o.facade,nW(function(){var e=nG.get(a);if(e){var t=new Set(e),r=new Set(n),o=a.current;t.forEach(function(e){r.has(e)||nq(e,null)}),r.forEach(function(e){t.has(e)||nq(e,o)})}nG.set(a,n)},[n]),a),C=nH(nH({},S),s);return w.createElement(w.Fragment,null,h&&w.createElement(g,{sideCar:nZ,removeScrollBar:p,shards:m,noRelative:v,noIsolation:y,inert:b,setCallbacks:c,allowPinchZoom:!!x,lockRef:i,gapMode:j}),u?w.cloneElement(w.Children.only(d),nH(nH({},C),{ref:O})):w.createElement(void 0===k?"div":k,nH({},C,{className:f,ref:O}),d))});nX.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},nX.classNames={fullWidth:nK,zeroRight:nV};var nJ=function(e){var t=e.sideCar,n=nB(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return w.createElement(r,nH({},n))};nJ.isSideCarExport=!0;var nQ=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pU||d.nc;return t&&e.setAttribute("nonce",t),e}())){var r,o;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),o=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(o)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},n0=function(){var e=nQ();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},n1=function(){var e=n0();return function(t){return e(t.styles,t.dynamic),null}},n2={left:0,top:0,right:0,gap:0},n4=function(e){return parseInt(e||"",10)||0},n3=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[n4(n),n4(r),n4(o)]},n5=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return n2;var t=n3(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},n6=n1(),n8="data-scroll-locked",n9=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(n8,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(nV," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(nK," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(nV," .").concat(nV," {\n right: 0 ").concat(r,";\n }\n \n .").concat(nK," .").concat(nK," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(n8,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},n7=function(){var e=parseInt(document.body.getAttribute(n8)||"0",10);return isFinite(e)?e:0},re=function(){w.useEffect(function(){return document.body.setAttribute(n8,(n7()+1).toString()),function(){var e=n7()-1;e<=0?document.body.removeAttribute(n8):document.body.setAttribute(n8,e.toString())}},[])},rt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;re();var a=w.useMemo(function(){return n5(o)},[o]);return w.createElement(n6,{styles:n9(a,!t,o,n?"":"!important")})},rn=!1;if("u">typeof window)try{var rr=Object.defineProperty({},"passive",{get:function(){return rn=!0,!0}});window.addEventListener("test",rr,rr),window.removeEventListener("test",rr,rr)}catch(e){rn=!1}var ro=!!rn&&{passive:!1},ra=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},ri=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),rl(e,r)){var o=rs(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rl=function(e,t){return"v"===e?ra(t,"overflowY"):ra(t,"overflowX")},rs=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},rc=function(e,t,n,r,o){var a,i=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),l=i*r,s=n.target,c=t.contains(s),u=!1,d=l>0,f=0,p=0;do{if(!s)break;var h=rs(e,s),m=h[0],g=h[1]-h[2]-i*m;(m||g)&&rl(e,s)&&(f+=g,p+=m);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return d&&(o&&1>Math.abs(f)||!o&&l>f)?u=!0:!d&&(o&&1>Math.abs(p)||!o&&-l>p)&&(u=!0),u},ru=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rd=function(e){return[e.deltaX,e.deltaY]},rf=function(e){return e&&"current"in e?e.current:e},rp=0,rh=[];let rm=(pF=function(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(rp++)[0],a=w.useState(n1)[0],i=w.useRef(e);w.useEffect(function(){i.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(rf),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=w.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=ru(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-a[0],c="deltaY"in e?e.deltaY:l[1]-a[1],u=e.target,d=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var h=ri(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=ri(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(s||c)&&(r.current=o),!o)return!0;var m=r.current||o;return rc(m,t,e,"h"===m?s:c,!0)},[]),s=w.useCallback(function(e){if(rh.length&&rh[rh.length-1]===a){var n="deltaY"in e?rd(e):ru(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var o=(i.current.shards||[]).map(rf).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?l(e,o[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=w.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=w.useCallback(function(e){n.current=ru(e),r.current=void 0},[]),d=w.useCallback(function(t){c(t.type,rd(t),t.target,l(t,e.lockRef.current))},[]),f=w.useCallback(function(t){c(t.type,ru(t),t.target,l(t,e.lockRef.current))},[]);w.useEffect(function(){return rh.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",s,ro),document.addEventListener("touchmove",s,ro),document.addEventListener("touchstart",u,ro),function(){rh=rh.filter(function(e){return e!==a}),document.removeEventListener("wheel",s,ro),document.removeEventListener("touchmove",s,ro),document.removeEventListener("touchstart",u,ro)}},[]);var p=e.removeScrollBar,h=e.inert;return w.createElement(w.Fragment,null,h?w.createElement(a,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,p?w.createElement(rt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},nZ.useMedium(pF),nJ);var rg=w.forwardRef(function(e,t){return w.createElement(nX,nH({},e,{ref:t,sideCar:rm}))});rg.classNames=nX.classNames;var rv=new WeakMap,ry=new WeakMap,rb={},rx=0,rw=function(e){return e&&(e.host||rw(e.parentNode))},rk=function(e,t,n,r){var o=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=rw(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});rb[n]||(rb[n]=new WeakMap);var a=rb[n],i=[],l=new Set,s=new Set(o),c=function(e){!e||l.has(e)||(l.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(rv.get(e)||0)+1,c=(a.get(e)||0)+1;rv.set(e,s),a.set(e,c),i.push(e),1===s&&o&&ry.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),l.clear(),rx++,function(){i.forEach(function(e){var t=rv.get(e)-1,o=a.get(e)-1;rv.set(e,t),a.set(e,o),t||(ry.has(e)||e.removeAttribute(r),ry.delete(e)),o||e.removeAttribute(n)}),--rx||(rv=new WeakMap,rv=new WeakMap,ry=new WeakMap,rb={})}},rj=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),rk(r,o,n,"aria-hidden")):function(){return null}},rS=Object.defineProperty,rO=(e,t)=>rS(e,"name",{value:t,configurable:!0}),rC="Dialog",[rN,rP]=tL(rC),[rE,r_]=rN(rC),rA=rO(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,l=w.useRef(null),s=w.useRef(null),[c,u]=tJ({prop:r,defaultProp:o??!1,onChange:a,caller:rC}),[d,f]=w.useState(0),[p,h]=w.useState(0);return(0,x.jsx)(rE,{scope:t,triggerRef:l,contentRef:s,contentId:tV(),titleId:tV(),descriptionId:tV(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:c,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(e=>!e),[u]),modal:i,children:n})},"Dialog"),rI=w.forwardRef(rO(function(e,t){let{__scopeDialog:n,...r}=e,o=r_("DialogTrigger",n),a=td(t,o.triggerRef);return(0,x.jsx)(t3.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":rZ(o.open),...r,ref:a,onClick:tT(e.onClick,o.onOpenToggle)})},"DialogTrigger")),rT="DialogPortal",[rR,rM]=rN(rT,{forceMount:void 0}),rz=rO(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=r_(rT,t);return(0,x.jsx)(rR,{scope:t,forceMount:n,children:w.Children.map(r,e=>(0,x.jsx)(n_,{present:n||a.open,children:(0,x.jsx)(nC,{asChild:!0,container:o,children:e})}))})},"DialogPortal"),rD="DialogOverlay",rL=w.forwardRef(rO(function(e,t){let n=rM(rD,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=r_(rD,e.__scopeDialog);return a.modal?(0,x.jsx)(n_,{present:r||a.open,children:(0,x.jsx)(r$,{...o,ref:t})}):null},"DialogOverlay")),rF=th("DialogOverlay.RemoveScroll"),r$=w.forwardRef(rO(function(e,t){let{__scopeDialog:n,...r}=e,o=r_(rD,n),a=td(t,nn());return(0,x.jsx)(rg,{as:rF,allowPinchZoom:!0,shards:[o.contentRef],children:(0,x.jsx)(t3.div,{"data-state":rZ(o.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),rU="DialogContent",rH=w.forwardRef(rO(function(e,t){let n=rM(rU,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=r_(rU,e.__scopeDialog);return(0,x.jsx)(n_,{present:r||a.open,children:a.modal?(0,x.jsx)(rB,{...o,ref:t}):(0,x.jsx)(rV,{...o,ref:t})})},"DialogContent")),rB=w.forwardRef(rO(function(e,t){let n=r_(rU,e.__scopeDialog),r=w.useRef(null),o=td(t,n.contentRef,r);return w.useEffect(()=>{let e=r.current;if(e)return rj(e)},[]),(0,x.jsx)(rK,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:tT(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:tT(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:tT(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),rV=w.forwardRef(rO(function(e,t){let n=r_(rU,e.__scopeDialog),r=w.useRef(!1),o=w.useRef(!1);return(0,x.jsx)(rK,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})},"DialogContentNonModal")),rK=w.forwardRef(rO(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,l=r_(rU,n);return n$(),(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(np,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:(0,x.jsx)(nt,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":rZ(l.open),...i,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),rq=w.forwardRef(rO(function(e,t){let{__scopeDialog:n,...r}=e,o=r_("DialogTitle",n),{setTitleCount:a}=o;return t$(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,x.jsx)(t3.h2,{id:o.titleId,...r,ref:t})},"DialogTitle")),rW=w.forwardRef(rO(function(e,t){let{__scopeDialog:n,...r}=e,o=r_("DialogDescription",n),{setDescriptionCount:a}=o;return t$(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,x.jsx)(t3.p,{id:o.descriptionId,...r,ref:t})},"DialogDescription")),rG=w.forwardRef(rO(function(e,t){let{__scopeDialog:n,...r}=e,o=r_("DialogClose",n);return(0,x.jsx)(t3.button,{type:"button",...r,ref:t,onClick:tT(e.onClick,()=>o.onOpenChange(!1))})},"DialogClose"));function rZ(e){return e?"open":"closed"}rO(rZ,"getState");let rY=_("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function rX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function rJ(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}function rQ(e){var t=e.className,n=rJ(e,["className"]);return(0,x.jsx)(rL,rX({"data-slot":"dialog-overlay",className:e4("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},n))}function r0(e){var t,n,r=e.className,o=e.children,a=rJ(e,["className","children"]),i=(0,S.Bd)().t;return(0,x.jsxs)(rz,{children:[(0,x.jsx)(rQ,{}),(0,x.jsxs)(rH,(t=rX({"data-slot":"dialog-content",className:e4("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-2xl",r)},a),n=n={children:[o,(0,x.jsxs)(rG,{className:"absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 ring-offset-background transition-[opacity,background-color] hover:bg-accent hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 active:bg-accent/80 disabled:pointer-events-none",children:[(0,x.jsx)(rY,{className:"size-4"}),(0,x.jsx)("span",{className:"sr-only",children:i("common.closeDialog")})]})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))]})}function r1(e){var t=e.className,n=rJ(e,["className"]);return(0,x.jsx)("div",rX({"data-slot":"dialog-header",className:e4("flex flex-col space-y-1.5 text-center sm:text-left",t)},n))}function r2(e){var t=e.className,n=rJ(e,["className"]);return(0,x.jsx)("div",rX({"data-slot":"dialog-footer",className:e4("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},n))}function r4(e){var t=e.className,n=rJ(e,["className"]);return(0,x.jsx)(rq,rX({"data-slot":"dialog-title",className:e4("text-lg font-semibold leading-none tracking-tight",t)},n))}function r3(e){var t=e.className,n=rJ(e,["className"]);return(0,x.jsx)(rW,rX({"data-slot":"dialog-description",className:e4("text-sm text-muted-foreground",t)},n))}function r5(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function r6(e,t,n){return(r6=ot()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&r7(o,n.prototype),o}).apply(null,arguments)}function r8(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r9(e){return(r9=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r7(e,t){return(r7=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oe(e){var t="function"==typeof Map?new Map:void 0;return(oe=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return r6(e,arguments,r9(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r7(n,e)})(e)}function ot(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ot=function(){return!!e})()}var on=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(e,n){var r,o,a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return r=t,o=[n],r=r9(r),r8(a=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,ot()?Reflect.construct(r,o||[],r9(this).constructor):r.apply(this,o)),"status",void 0),r8(a,"code",void 0),r8(a,"data",void 0),a.status=e,a.name="ApiError",a.code=i.code,a.data=i.data,a}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r7(t,e),t}(oe(Error));function or(){return"/api/harnesses"}function oo(e){return"".concat(or(),"/").concat(e,"/profiles")}function oa(e,t){return"".concat(oo(e),"/").concat(encodeURIComponent(t))}function oi(e){return e?"/api/backups/".concat(encodeURIComponent(e)):"/api/backups"}function ol(){return"/api/providers"}function os(e){return"".concat(ol(),"/").concat(encodeURIComponent(e))}function oc(e){return"".concat(os(e),"/probe")}function ou(e){return e?"/api/drift/".concat(encodeURIComponent(e)):"/api/drift"}function od(){return"/api/scan"}function of(e){return e?"/api/operations?harness=".concat(encodeURIComponent(e)):"/api/operations"}function op(){return"/api/users"}var oh="/api/version";function om(e){var t;return(t=function(e){var t,n,r,o,a,i=arguments;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(l){switch(l.label){case 0:var s,c;return(n=new Headers((t=i.length>1&&void 0!==i[1]?i[1]:{}).headers)).set("Accept-Language",S.Ru.language),t.body&&!n.has("Content-Type")&&n.set("Content-Type","application/json"),[4,fetch(e,(s=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){r8(e,t,n[t])})}return e}({credentials:"include"},t),c=c={headers:n},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(c)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(c)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(c,e))}),s))];case 1:return[4,(r=l.sent()).json().catch(function(){return{}})];case 2:if(o=l.sent(),!r.ok)throw new on(r.status,null!=(a=o.msg)?a:"",{code:o.code,data:o.data});return[2,o]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function i(e){r5(a,r,o,i,l,"next",e)}function l(e){r5(a,r,o,i,l,"throw",e)}i(void 0)})}).apply(this,arguments)}var og=function(e){return"/api/model-favorites".concat(e?"/".concat(e):"")},ov=function(e){return"".concat(og(),"/").concat(encodeURIComponent(e))},oy=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return"".concat(og(),"/source/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t)).concat(n?"/detach":"")},ob=function(){return"/api/model-favorite-plans"},ox=function(e){return"".concat(og("backups")).concat(e?"/".concat(encodeURIComponent(e),"/restore"):"")};function ow(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ok(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function oj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function oS(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function oO(e){return{key:(0,O.Vz)(e.code),params:e.data,scope:e.scope}}function oC(e){return ok(e,on)&&e.code?oO({code:e.code,data:e.data}):{key:"error.unknown",fallback:ok(e,Error)?e.message:String(e)}}function oN(e,t){var n=oC(e);return"error.unknown"===n.key?oS(oj({},n),{key:t}):n}var oP=new Set(["drift.adoptFailed","drift.reapplyFailed","vault.deleteFailed","vault.saveFailed","vault.revealFailed","operations.undoFailed","import.failed","activate.loadFailed","backup.loadFailed","backup.diffFailed"]);function oE(e,t){if(t.fallback&&("error.unknown"===t.key||oP.has(t.key))){var n,r,o,a=null!=(o=t.fallback)?o:t.key;return t.scope?"".concat(t.scope,": ").concat(a):a}var i=Object.fromEntries(Object.entries(null!=(n=t.paramKeys)?n:{}).map(function(t){var n=function(e){if(Array.isArray(e))return e}(t)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return ow(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ow(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return[n[0],e(n[1])]})),l=e([t.key,"error.unknown"],oS(oj({},t.params,i),{defaultValue:null!=(r=t.fallback)?r:t.key}));return t.scope?"".concat(t.scope,": ").concat(l):l}function o_(e,t,n,r){return t?oE(e,{key:t,params:r,fallback:n}):n}function oA(e,t,n){return e(t,oj({},n))}function oI(e,t){return t.placeholderCode?oA(e,t.placeholderCode,t.params):t.placeholder}let oT=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))},i=t=e(r,o,a);return a},oR=e=>{let t=e?oT(e):oT,n=e=>(function(e,t=e=>e){let n=w.useSyncExternalStore(e.subscribe,w.useCallback(()=>t(e.getState()),[e,t]),w.useCallback(()=>t(e.getInitialState()),[e,t]));return w.useDebugValue(n),n})(t,e);return Object.assign(n,t),n};function oM(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function oz(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){oM(a,r,o,i,l,"next",e)}function l(e){oM(a,r,o,i,l,"throw",e)}i(void 0)})}}function oD(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var oL=function(e,t){return{backups:[],loadBackups:function(){return oz(function(){var t;return oD(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,om(oi())];case 1:return e({backups:n.sent().items}),[3,3];case 2:var r;return r=t=n.sent(),(null!=on&&"u">typeof Symbol&&on[Symbol.hasInstance]?on[Symbol.hasInstance](r):r instanceof on)&&401===t.status||e({error:oC(t)}),[3,3];case 3:return[2]}})})()},loadBackupDetail:function(e){return oz(function(){return oD(this,function(t){return[2,om(oi(e))]})})()},restoreBackup:function(n){return oz(function(){return oD(this,function(r){switch(r.label){case 0:return[4,om("".concat(oi(n),"/restore"),{method:"POST"})];case 1:return r.sent(),e({notice:[{key:"backup.written"}]}),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 2:return r.sent(),[2]}})})()}}};function oF(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function o$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){o$(e,t,n[t])})}return e}function oH(e,t,n){var r;return(r=function(){var r;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:e(oB(t,!0,null)),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n()];case 2:return e(oU({},o$({},t,o.sent()),oB(t,!1,null))),[3,4];case 3:var a;if(a=r=o.sent(),(null!=on&&"u">typeof Symbol&&on[Symbol.hasInstance]?!!on[Symbol.hasInstance](a):a instanceof on)&&401===r.status)return e(oU({authenticated:!1},o$({},t,"githubStatus"===t?null:[]),oB(t,!1,null))),[2];return e(oB(t,!1,oC(r))),[3,4];case 4:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var a=r.apply(e,t);function i(e){oF(a,n,o,i,l,"next",e)}function l(e){oF(a,n,o,i,l,"throw",e)}i(void 0)})})()}function oB(e,t,n){var r;return o$(r={},"".concat(e,"Loading"),t),o$(r,"".concat(e,"Error"),n),r}function oV(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function oK(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){oV(a,r,o,i,l,"next",e)}function l(e){oV(a,r,o,i,l,"throw",e)}i(void 0)})}}function oq(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var oW=function(e){return{githubStatus:null,githubStatusLoading:!1,githubStatusError:null,loadGithubStatus:function(){return oK(function(){return oq(this,function(t){switch(t.label){case 0:return[4,oH(e,"githubStatus",function(){return om("/api/github/status")})];case 1:return t.sent(),[2]}})})()},setGithubStatus:function(t){e({githubStatus:t,githubStatusError:null})},disconnectGithub:function(){return oK(function(){return oq(this,function(t){switch(t.label){case 0:return[4,om("/api/github/disconnect",{method:"POST"})];case 1:return t.sent(),e({githubStatus:{connected:!1},githubStatusError:null}),[2]}})})()}}};function oG(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oZ(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function oY(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){oZ(a,r,o,i,l,"next",e)}function l(e){oZ(a,r,o,i,l,"throw",e)}i(void 0)})}}function oX(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var oJ=function(e,t){var n=function(n){return oY(function(){return oX(this,function(r){switch(r.label){case 0:return[4,om(n,{method:"POST"})];case 1:var o;return e({notice:[{key:"notice.switchDone"}].concat(function(e){if(Array.isArray(e))return oG(e)}(o=r.sent().warnings.map(oO))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e){if(e){if("string"==typeof e)return oG(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oG(e,void 0)}}(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()};return{envFile:"",harnesses:[],loadHarnesses:function(){return oY(function(){var n,r;return oX(this,function(o){switch(o.label){case 0:e({loading:!0,error:null}),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,om(or())];case 2:return e({harnesses:(n=o.sent()).items,envFile:n.envFile,loading:!1}),[4,t().loadDrift()];case 3:return o.sent(),[3,5];case 4:var a;if(a=r=o.sent(),(null!=on&&"u">typeof Symbol&&on[Symbol.hasInstance]?!!on[Symbol.hasInstance](a):a instanceof on)&&401===r.status)return e({authenticated:!1,loading:!1,harnesses:[]}),[2];return e({loading:!1,error:oC(r)}),[3,5];case 5:return[2]}})})()},createProfile:function(e,n){return oY(function(){return oX(this,function(r){switch(r.label){case 0:return[4,om(oo(e),{method:"POST",body:JSON.stringify(n)})];case 1:return r.sent(),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()},updateProfile:function(e,n,r){return oY(function(){return oX(this,function(o){switch(o.label){case 0:return[4,om(oa(e,n),{method:"PATCH",body:JSON.stringify(r)})];case 1:return o.sent(),[4,t().loadHarnesses()];case 2:return o.sent(),[2]}})})()},deleteProfile:function(e,n){return oY(function(){return oX(this,function(r){switch(r.label){case 0:return[4,om(oa(e,n),{method:"DELETE"})];case 1:return r.sent(),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()},activateProfile:function(e,t){return oY(function(){return oX(this,function(r){switch(r.label){case 0:return[4,n("".concat(oa(e,t),"/activate"))];case 1:return r.sent(),[2]}})})()},activateOfficial:function(e){return oY(function(){return oX(this,function(t){switch(t.label){case 0:return[4,n("".concat(or(),"/").concat(e,"/official/activate"))];case 1:return t.sent(),[2]}})})()},previewProfile:function(e,t){return oY(function(){return oX(this,function(n){switch(n.label){case 0:return[4,om("".concat(oa(e,t),"/preview"))];case 1:return[2,n.sent().targets]}})})()},previewOfficial:function(e){return oY(function(){return oX(this,function(t){switch(t.label){case 0:return[4,om("".concat(or(),"/").concat(e,"/official/preview"))];case 1:return[2,t.sent().targets]}})})()}}};function oQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o0(e){return function(e){if(Array.isArray(e))return oQ(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return oQ(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oQ(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o1(e,t,n){return o0((null!=e?e:[]).filter(function(e){return e.harness!==n})).concat(o0(t.filter(function(e){return e.harness===n})))}function o2(e,t){var n,r;return null!=(n=null==(r=e.harnesses.find(function(e){return e.id===t}))?void 0:r.label)?n:t}function o4(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function o3(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){o4(a,r,o,i,l,"next",e)}function l(e){o4(a,r,o,i,l,"throw",e)}i(void 0)})}}function o5(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var o6=function(e,t){return{doctor:null,doctorUpdatedAvailable:!1,doctorLoading:!1,doctorError:null,drift:null,driftLoading:!1,driftError:null,loadDoctor:function(n){return o3(function(){return o5(this,function(r){switch(r.label){case 0:return[4,oH(e,"doctor",function(){return o3(function(){var r;return o5(this,function(o){switch(o.label){case 0:return[4,om(n?"/api/doctor?harness=".concat(encodeURIComponent(n)):"/api/doctor")];case 1:return e({doctorUpdatedAvailable:(r=o.sent()).updatedAvailable}),[2,o1(t().doctor,r.items,n)]}})})()})];case 1:return r.sent(),[2]}})})()},loadDrift:function(){return o3(function(){return o5(this,function(t){switch(t.label){case 0:return[4,oH(e,"drift",function(){return o3(function(){var e;return o5(this,function(t){switch(t.label){case 0:return[4,om(ou())];case 1:return[2,null!=(e=t.sent().items)?e:[]]}})})()})];case 1:return t.sent(),[2]}})})()},reapplyDrift:function(n){return o3(function(){var r;return o5(this,function(o){switch(o.label){case 0:return[4,om("".concat(ou(n),"/reapply"),{method:"POST"})];case 1:return r=o.sent(),e({notice:[{key:"drift.reapplied",params:{harness:o2(t(),n)}}]}),[4,t().loadDrift()];case 2:return o.sent(),[2,r.files]}})})()},adoptDrift:function(n){return o3(function(){var r;return o5(this,function(o){switch(o.label){case 0:return[4,om("".concat(ou(n),"/adopt"),{method:"POST"})];case 1:return r=o.sent(),e({notice:[{key:"drift.adopted",params:{harness:o2(t(),n)}}]}),[4,t().loadHarnesses()];case 2:return o.sent(),[2,r]}})})()}}};function o8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o9(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function o7(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){o9(a,r,o,i,l,"next",e)}function l(e){o9(a,r,o,i,l,"throw",e)}i(void 0)})}}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ae(e,t,n[t])})}return e}function an(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ar(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var ao=function(e,t){var n=0,r=0;return{favoriteBackups:[],favoriteBackupPreview:null,previewFavoriteBackup:function(r){return o7(function(){var o,a,i;return ar(this,function(l){switch(l.label){case 0:return o=++n,a=t().currentUser,e({favoriteBackupPreview:null}),[4,om("".concat(og("backups"),"/").concat(encodeURIComponent(r),"/preview"))];case 1:return i=l.sent(),a===t().currentUser&&o===n&&e({favoriteBackupPreview:i.data}),[2]}})})()},loadFavoriteBackups:function(){return o7(function(){var n,r;return ar(this,function(o){switch(o.label){case 0:return n=t().currentUser,[4,om(ox())];case 1:return r=o.sent(),n===t().currentUser&&e({favoriteBackups:r.data}),[2]}})})()},createFavoriteBackup:function(){return o7(function(){return ar(this,function(e){switch(e.label){case 0:return[4,om(ox(),{method:"POST"})];case 1:return e.sent(),[4,t().loadFavoriteBackups()];case 2:return e.sent(),[2]}})})()},restoreFavoriteBackup:function(o,a){return o7(function(){var i;return ar(this,function(l){switch(l.label){case 0:return n++,r++,i=t().currentUser,[4,om(ox(o),{method:"POST",body:JSON.stringify({fingerprint:a})})];case 1:if(l.sent(),i!==t().currentUser)return[2];return e({favoritePlan:null,favoriteBackupPreview:null,favoriteOperation:null,favoriteOperationHistory:[],favoriteTargets:{},favoriteCatalogs:{}}),[4,Promise.all([t().loadFavoriteBackups(),t().loadFavorites(),t().loadHarnesses(),t().loadProviders(),t().loadBackups()])];case 2:return l.sent(),[2]}})})()},favoriteTargets:{},loadFavoriteTargets:function(n){return o7(function(){var r,o;return ar(this,function(a){switch(a.label){case 0:return r=t().currentUser,[4,om("".concat(ov(n),"/targets"))];case 1:return o=a.sent(),r===t().currentUser&&e({favoriteTargets:an(at({},t().favoriteTargets),ae({},n,o.data))}),[2]}})})()},favoriteCatalogs:{},loadFavoriteCatalog:function(n,r){return o7(function(){var o,a;return ar(this,function(i){switch(i.label){case 0:return o=t().currentUser,[4,om(oc(n),{method:"POST",body:JSON.stringify({endpoint:r,completion:!1})})];case 1:return a=i.sent(),t().currentUser===o&&e({favoriteCatalogs:an(at({},t().favoriteCatalogs),ae({},"".concat(n,"/").concat(r),a.result))}),[2]}})})()},favorites:null,favoritesLoading:!1,favoritesError:null,favoritePlan:null,favoriteOperation:null,favoriteOperationHistory:[],loadFavorites:function(){return o7(function(){var n;return ar(this,function(r){switch(r.label){case 0:if(t().favoritesLoading)return[2];return n=t().currentUser,[4,oH(e,"favorites",function(){return o7(function(){var e;return ar(this,function(r){switch(r.label){case 0:return[4,om(og())];case 1:return e=r.sent(),[2,n===t().currentUser?e.data:t().favorites]}})})()})];case 1:return r.sent(),[2]}})})()},saveFavorite:function(e,n){return o7(function(){var r;return ar(this,function(o){switch(o.label){case 0:return r=n?an(at({},e),{expectedRevision:n.revision}):e,[4,om(n?ov(n.id):og(),{method:n?"PATCH":"POST",body:JSON.stringify(r)})];case 1:return o.sent(),[4,t().loadFavorites()];case 2:return o.sent(),[2]}})})()},deleteFavorite:function(e){return o7(function(){return ar(this,function(n){switch(n.label){case 0:return[4,om(ov(e.id),{method:"DELETE",body:JSON.stringify({expectedRevision:e.revision})})];case 1:return n.sent(),[4,t().loadFavorites()];case 2:return n.sent(),[2]}})})()},captureFavorite:function(e,n,r,o,a){return o7(function(){var i;return ar(this,function(l){switch(l.label){case 0:return[4,om(oy(e,n))];case 1:return i=l.sent(),[4,om(og("from-profile"),{method:"POST",body:JSON.stringify(at({harness:e,name:n,favoriteName:r,extractCredential:o,linkSource:a},i.data))})];case 2:return l.sent(),[4,Promise.all([t().loadFavorites(),t().loadHarnesses(),t().loadProviders()])];case 3:return l.sent(),[2]}})})()},planFavorite:function(n){return o7(function(){var o,a,i;return ar(this,function(l){switch(l.label){case 0:return o=++r,a=t().currentUser,e({favoritePlan:null,favoriteOperation:null}),[4,om(ob(),{method:"POST",body:JSON.stringify(n)})];case 1:return i=l.sent(),a===t().currentUser&&o===r&&e({favoritePlan:i.data}),[2]}})})()},applyFavorite:function(n){return o7(function(){var r,o,a;return ar(this,function(i){var l,s;switch(i.label){case 0:if(r=t().favoritePlan,o=t().currentUser,!r)return[2];return[4,om((l=r.id,"".concat(ob(),"/").concat(encodeURIComponent(l),"/apply")),{method:"POST",body:JSON.stringify({requestId:n})})];case 1:if(a=i.sent(),o!==t().currentUser)return[2];return e({favoriteOperation:a.data,favoriteOperationHistory:((function(e){if(Array.isArray(e))return o8(e)})(s=t().favoriteOperationHistory)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e){if(e){if("string"==typeof e)return o8(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o8(e,void 0)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([a.data]).slice(-10),notice:[{key:"favorites.appliedToast",params:{count:a.data.items.length}}]}),[4,Promise.all([t().loadFavorites(),t().loadHarnesses()])];case 2:return i.sent(),[2]}})})()},detachFavorite:function(e,n){return o7(function(){var r;return ar(this,function(o){switch(o.label){case 0:return[4,om(oy(e,n))];case 1:return r=o.sent(),[4,om(oy(e,n,!0),{method:"POST",body:JSON.stringify(r.data)})];case 2:return o.sent(),[4,Promise.all([t().loadFavorites(),t().loadHarnesses()])];case 3:return o.sent(),[2]}})})()},clearFavoritePlan:function(){r++,e({favoritePlan:null,favoriteOperation:null})}}},aa=function(e){return{notice:null,setNotice:function(t){return e({notice:t})},clearNotice:function(){return e({notice:null})}}};function ai(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function al(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){ai(a,r,o,i,l,"next",e)}function l(e){ai(a,r,o,i,l,"throw",e)}i(void 0)})}}function as(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var ac=function(e,t){return{operations:null,operationsLoading:!1,operationsError:null,loadOperations:function(n){return al(function(){return as(this,function(r){switch(r.label){case 0:return[4,oH(e,"operations",function(){return al(function(){var e;return as(this,function(r){switch(r.label){case 0:return[4,om(of(n))];case 1:return e=r.sent(),[2,o1(t().operations,e.items,n)]}})})()})];case 1:return r.sent(),[2]}})})()},undoOperation:function(n){return al(function(){var r;return as(this,function(o){switch(o.label){case 0:return[4,om("".concat(of(),"/").concat(encodeURIComponent(n),"/undo"),{method:"POST"})];case 1:return r=o.sent().receipt,e({notice:[{key:"operations.undone",params:{harness:o2(t(),r.harness)}}]}),[4,Promise.all([t().loadHarnesses(),t().loadBackups(),t().loadOperations(r.harness)])];case 2:return o.sent(),[2]}})})()}}};function au(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ad(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){au(a,r,o,i,l,"next",e)}function l(e){au(a,r,o,i,l,"throw",e)}i(void 0)})}}function af(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var ap=function(){return{probeDraft:function(e){return ad(function(){return af(this,function(t){return[2,ah("/api/probe",e)]})})()},probeProfile:function(e,t,n){return ad(function(){return af(this,function(r){return[2,ah("".concat(oa(e,t),"/probe"),null!=n?n:{})]})})()},probeVaultEntry:function(e,t){return ad(function(){return af(this,function(n){return[2,ah(oc(e),null!=t?t:{})]})})()}}};function ah(e,t){return ad(function(){return af(this,function(n){switch(n.label){case 0:return[4,om(e,{method:"POST",body:JSON.stringify(t)})];case 1:return[2,n.sent().result]}})})()}function am(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ag(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){am(a,r,o,i,l,"next",e)}function l(e){am(a,r,o,i,l,"throw",e)}i(void 0)})}}function av(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var ay=function(e,t){return{providers:null,providersLoading:!1,providersError:null,loadProviders:function(){return ag(function(){return av(this,function(t){switch(t.label){case 0:return[4,oH(e,"providers",function(){return ag(function(){return av(this,function(e){switch(e.label){case 0:return[4,om(ol())];case 1:return[2,e.sent().items]}})})()})];case 1:return t.sent(),[2]}})})()},createProvider:function(e){return ag(function(){return av(this,function(n){switch(n.label){case 0:return[4,om(ol(),{method:"POST",body:JSON.stringify(e)})];case 1:return n.sent(),[4,t().loadProviders()];case 2:return n.sent(),[2]}})})()},updateProvider:function(e,n){return ag(function(){var r;return av(this,function(o){switch(o.label){case 0:return[4,om(os(e),{method:"PATCH",body:JSON.stringify(n)})];case 1:return r=o.sent(),[4,t().loadProviders()];case 2:return o.sent(),[4,t().loadHarnesses()];case 3:return o.sent(),[4,t().loadDrift()];case 4:return o.sent(),[2,r]}})})()},deleteProvider:function(e){return ag(function(){return av(this,function(n){switch(n.label){case 0:return[4,om(os(e),{method:"DELETE"})];case 1:return n.sent(),[4,t().loadProviders()];case 2:return n.sent(),[2]}})})()},revealProvider:function(e){return ag(function(){return av(this,function(t){return[2,om("".concat(os(e),"/reveal"))]})})()}}};function ab(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ax(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){ab(a,r,o,i,l,"next",e)}function l(e){ab(a,r,o,i,l,"throw",e)}i(void 0)})}}function aw(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var ak=function(e,t){return{scan:null,scanLoading:!1,scanError:null,loadScan:function(){return ax(function(){return aw(this,function(t){switch(t.label){case 0:return[4,oH(e,"scan",function(){return ax(function(){return aw(this,function(e){switch(e.label){case 0:return[4,om(od())];case 1:return[2,e.sent().items]}})})()})];case 1:return t.sent(),[2]}})})()},importScan:function(e){return ax(function(){var n;return aw(this,function(r){switch(r.label){case 0:return[4,om("".concat(od(),"/import"),{method:"POST",body:JSON.stringify({selections:e})})];case 1:return n=r.sent(),[4,Promise.all([t().loadHarnesses(),t().loadProviders(),t().loadScan()])];case 2:return r.sent(),[2,n]}})})()}}};function aj(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function aS(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){aj(a,r,o,i,l,"next",e)}function l(e){aj(a,r,o,i,l,"throw",e)}i(void 0)})}}function aO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function aC(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var aN={favoriteCatalogs:{},favoriteBackups:[],favoriteBackupPreview:null,favoriteTargets:{},favoriteOperationHistory:[],favorites:null,favoritePlan:null,favoriteOperation:null,favoritesError:null,favoritesLoading:!1,harnesses:[],backups:[],envFile:"",providers:null,doctor:null,doctorUpdatedAvailable:!1,drift:null},aP=function(e,t){return{sessionChecked:!1,authenticated:!1,currentUser:"",users:[],usersLoading:!1,loading:!1,error:null,loadSession:function(){return aS(function(){var n;return aC(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,om("/api/auth/session")];case 1:return e({authenticated:!0,sessionChecked:!0,currentUser:r.sent().currentUser,error:null}),[4,t().loadUsers()];case 2:return r.sent(),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 3:return r.sent(),[4,t().loadDrift()];case 4:return r.sent(),[3,6];case 5:var o;return e({authenticated:!1,sessionChecked:!0,error:(o=n=r.sent(),(null!=on&&"u">typeof Symbol&&on[Symbol.hasInstance]?!!on[Symbol.hasInstance](o):o instanceof on)&&401===n.status)?null:oC(n)}),[3,6];case 6:return[2]}})})()},login:function(n){return aS(function(){var r;return aC(this,function(o){switch(o.label){case 0:e({loading:!0,error:null}),o.label=1;case 1:return o.trys.push([1,5,,6]),[4,om("/api/auth/login",{method:"POST",body:JSON.stringify({password:n})})];case 2:return e({authenticated:!0,loading:!1,currentUser:o.sent().currentUser}),[4,t().loadUsers()];case 3:return o.sent(),[4,t().loadHarnesses()];case 4:return o.sent(),[3,6];case 5:throw e({loading:!1,error:oC(r=o.sent())}),r;case 6:return[2]}})})()},logout:function(){return aS(function(){return aC(this,function(t){switch(t.label){case 0:return[4,om("/api/auth/logout",{method:"POST"})];case 1:return t.sent(),e(aO({authenticated:!1,currentUser:"",users:[]},aN)),[2]}})})()},loadUsers:function(){return aS(function(){var t;return aC(this,function(n){switch(n.label){case 0:e({usersLoading:!0}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,om(op())];case 2:return e({users:(t=n.sent()).items,currentUser:t.currentUser,usersLoading:!1}),[3,4];case 3:return e({usersLoading:!1,error:oC(n.sent())}),[3,4];case 4:return[2]}})})()},switchUser:function(n){return aS(function(){var r;return aC(this,function(o){switch(o.label){case 0:if(!n||n===t().currentUser)return[2];e({usersLoading:!0,loading:!0,error:null}),o.label=1;case 1:return o.trys.push([1,5,,6]),[4,om("".concat(op(),"/").concat(encodeURIComponent(n),"/select"),{method:"POST"})];case 2:return o.sent(),e(aO({currentUser:n},aN)),[4,t().loadUsers()];case 3:return o.sent(),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 4:return o.sent(),e({usersLoading:!1,loading:!1}),[3,6];case 5:throw e({usersLoading:!1,loading:!1,error:oC(r=o.sent())}),r;case 6:return[2]}})})()}}};function aE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a_(e){return function(e){if(Array.isArray(e))return aE(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return aE(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return aE(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var aA=(t?oR(t):oR)(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},aP.apply(void 0,a_(t)),ao.apply(void 0,a_(t)),oJ.apply(void 0,a_(t)),oL.apply(void 0,a_(t)),ay.apply(void 0,a_(t)),ap.apply(void 0,a_(t)),o6.apply(void 0,a_(t)),ak.apply(void 0,a_(t)),ac.apply(void 0,a_(t)),oW.apply(void 0,a_(t)),aa.apply(void 0,a_(t)))});function aI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function aT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return aI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aI(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aR(e){var t,n=e.harnessId,r=(0,S.s9)().locale,o=(0,S.Bd)().t,a=aA(function(e){return e.backups}),i=aA(function(e){return e.loadBackups}),l=aA(function(e){return e.loadBackupDetail}),s=aA(function(e){return e.restoreBackup}),c=aT((0,w.useState)(!1),2),u=c[0],d=c[1],f=aT((0,w.useState)(null),2),p=f[0],h=f[1],m=aT((0,w.useState)(null),2),g=m[0],v=m[1],y=aT((0,w.useState)(null),2),b=y[0],k=y[1],j=aT((0,w.useState)(!1),2),C=j[0],N=j[1],P=a.filter(function(e){return e.harness===n}),E=null!=(t=a.find(function(e){return e.id===p}))?t:null,_=O.RP[n];return(0,w.useEffect)(function(){i()},[i]),(0,w.useEffect)(function(){d(!1),h(null)},[n]),(0,w.useEffect)(function(){if(!p){v(null),k(null),N(!1);return}var e=!1;return v(null),k(null),N(!0),l(p).then(function(t){e||v(t)}).catch(function(t){e||k(oN(t,"backup.diffFailed"))}).finally(function(){e||N(!1)}),function(){e=!0}},[p,l]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(tE,{className:"w-full justify-between",size:"sm",variant:"outline",onClick:function(){return d(!0)},children:[(0,x.jsx)(T,{}),o("backup.history"),P.length>0?(0,x.jsx)(e5,{variant:"secondary",children:P.length}):null]}),(0,x.jsx)(rA,{open:u,onOpenChange:d,children:(0,x.jsxs)(r0,{className:"max-w-xl",children:[(0,x.jsxs)(r1,{children:[(0,x.jsx)(r4,{children:o("backup.historyTitle",{harness:_})}),(0,x.jsx)(r3,{children:o("backup.historyIntro")})]}),0===P.length?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("backup.empty")}):(0,x.jsx)("ul",{className:"max-h-80 divide-y overflow-y-auto rounded-xl border",children:P.map(function(e){var t,n,a;return(0,x.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2.5 hover:bg-muted/30",children:[(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,x.jsx)("p",{className:"truncate text-sm font-medium",children:e.profile}),e.current?(0,x.jsx)(e5,{children:o("backup.currentBadge")}):null]}),(0,x.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(t=e.createdAt,n=r,Number.isNaN((a=new Date(t)).getTime())?t:a.toLocaleString(n))," \xb7"," ",o("backup.fileCount",{count:e.files.length}),e.files.some(function(e){return!e.existed})?" \xb7 ".concat(o("backup.withDeletions")):""]})]}),e.current?null:(0,x.jsx)(tE,{size:"sm",variant:"outline",className:"shrink-0",onClick:function(){return h(e.id)},children:o("backup.restore")})]},e.id)})})]})}),(0,x.jsx)(rA,{open:null!==E,onOpenChange:function(e){return!e&&h(null)},children:(0,x.jsxs)(r0,{className:"flex max-h-[85vh] w-[min(64rem,calc(100vw-2rem))] max-w-5xl flex-col overflow-hidden",children:[(0,x.jsxs)(r1,{children:[(0,x.jsx)(r4,{children:o("backup.restoreHistoryTitle")}),(0,x.jsx)(r3,{children:o("backup.restoreHistoryBody")})]}),(0,x.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[C?(0,x.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("backup.comparing")}):null,b?(0,x.jsx)("p",{className:"py-8 text-center text-sm text-destructive",children:oE(o,b)}):null,g?(0,x.jsx)(tr,{files:g.files}):null]}),(0,x.jsxs)(r2,{children:[(0,x.jsx)(tE,{variant:"outline",onClick:function(){return h(null)},children:o("common.cancel")}),(0,x.jsx)(tE,{disabled:C||null!==b||null===g,onClick:function(){p&&s(p).then(function(){h(null),d(!1)})},children:o("backup.confirmRestore")})]})]})})]})}function aM(e){var t=e.className;return(0,x.jsxs)("span",{"aria-hidden":"true",className:e4("relative inline-block size-6 overflow-hidden rounded-[26%]",t),children:[(0,x.jsx)("img",{alt:"",className:"size-full object-cover dark:hidden",draggable:!1,src:"/brand-mark-light.png"}),(0,x.jsx)("img",{alt:"",className:"hidden size-full object-cover dark:block",draggable:!1,src:"/brand-mark-dark.png"})]})}let az=_("file-search",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]),aD=_("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),aL=_("file-lock-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v1",key:"jmtmu2"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"5",x:"2",y:"13",rx:"1",key:"10y5wo"}],["path",{d:"M8 13v-2a2 2 0 1 0-4 0v2",key:"1pdxzg"}]]),aF=_("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),a$=_("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),aU=_("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var aH=Object.defineProperty,aB=(e,t)=>aH(e,"name",{value:t,configurable:!0}),[aV,aK]=tL("AlertDialog",[rP]),aq=rP(),aW=aB(e=>{let{__scopeAlertDialog:t,...n}=e,r=aq(t);return(0,x.jsx)(rA,{...r,...n,modal:!0})},"AlertDialog");w.forwardRef(aB(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=aq(n);return(0,x.jsx)(rI,{...o,...r,ref:t})},"AlertDialogTrigger"));var aG=aB(e=>{let{__scopeAlertDialog:t,...n}=e,r=aq(t);return(0,x.jsx)(rz,{...r,...n})},"AlertDialogPortal"),aZ=w.forwardRef(aB(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=aq(n);return(0,x.jsx)(rL,{...o,...r,ref:t})},"AlertDialogOverlay")),[aY,aX]=aV("AlertDialogContent"),aJ=w.forwardRef(aB(function(e,t){let{__scopeAlertDialog:n,children:r,...o}=e,a=aq(n),i=td(t,w.useRef(null)),l=w.useRef(null);return(0,x.jsx)(aY,{scope:n,cancelRef:l,children:(0,x.jsx)(rH,{role:"alertdialog",...a,...o,ref:i,onOpenAutoFocus:tT(o.onOpenAutoFocus,e=>{e.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},"AlertDialogContent")),aQ=w.forwardRef(aB(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=aq(n);return(0,x.jsx)(rq,{...o,...r,ref:t})},"AlertDialogTitle")),a0=w.forwardRef(aB(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=aq(n);return(0,x.jsx)(rW,{...o,...r,ref:t})},"AlertDialogDescription")),a1=w.forwardRef(aB(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=aq(n);return(0,x.jsx)(rG,{...o,...r,ref:t})},"AlertDialogAction")),a2=w.forwardRef(aB(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=aX("AlertDialogCancel",n),a=aq(n),i=td(t,o);return(0,x.jsx)(rG,{...a,...r,ref:i})},"AlertDialogCancel"));function a4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function a3(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}function a5(e){var t=e.className,n=a3(e,["className"]);return(0,x.jsx)(aZ,a4({"data-slot":"alert-dialog-overlay",className:e4("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},n))}function a6(e){var t=e.className,n=a3(e,["className"]);return(0,x.jsxs)(aG,{children:[(0,x.jsx)(a5,{}),(0,x.jsx)(aJ,a4({"data-slot":"alert-dialog-content",className:e4("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-2xl",t)},n))]})}function a8(e){var t=e.className,n=a3(e,["className"]);return(0,x.jsx)("div",a4({className:e4("flex flex-col space-y-2 text-center sm:text-left",t)},n))}function a9(e){var t=e.className,n=a3(e,["className"]);return(0,x.jsx)("div",a4({className:e4("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},n))}function a7(e){var t=e.className,n=a3(e,["className"]);return(0,x.jsx)(aQ,a4({className:e4("text-lg font-semibold",t)},n))}function ie(e){var t=e.className,n=a3(e,["className"]);return(0,x.jsx)(a0,a4({className:e4("text-sm text-muted-foreground",t)},n))}function it(e){var t=e.className,n=a3(e,["className"]);return(0,x.jsx)(a1,a4({className:e4(tP(),t)},n))}function ir(e){var t=e.className,n=a3(e,["className"]);return(0,x.jsx)(a2,a4({className:e4(tP({variant:"outline"}),"mt-2 sm:mt-0",t)},n))}function io(e){let[t,n]=w.useState(void 0);return t$(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,o;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,o=t.blockSize}else r=e.offsetWidth,o=e.offsetHeight;n({width:r,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(io,"name",{value:"useSize",configurable:!0});var ia=Object.defineProperty,ii=(e,t)=>ia(e,"name",{value:t,configurable:!0}),il="Checkbox",[is,ic]=tL(il),[iu,id]=is(il);function ip(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:a,form:i,name:l,onCheckedChange:s,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,p]=tJ({prop:n,defaultProp:o??!1,onChange:s,caller:il}),[h,m]=w.useState(null),[g,v]=w.useState(null),y=w.useRef(!1),[b,k]=w.useReducer(e=>e+1,0),j=!h||!!i||!!h.closest("form"),S={checked:f,disabled:a,setChecked:p,control:h,setControl:m,name:l,form:i,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:k,required:c,defaultChecked:!ib(o)&&o,isFormControl:j,bubbleInput:g,setBubbleInput:v};return(0,x.jsx)(iu,{scope:t,...S,children:iy(d)?d(S):r})}ii(ip,"CheckboxProvider");var ih=w.forwardRef(ii(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o){let{control:a,value:i,disabled:l,checked:s,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:m}=id("CheckboxTrigger",e),g=td(o,u),v=w.useRef(s);return w.useEffect(()=>{let e=a?.form;if(e){let t=ii(()=>d(v.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[a,d]),(0,x.jsx)(t3.button,{type:"button",role:"checkbox","aria-checked":ib(s)?"mixed":s,"aria-required":c,"data-state":ix(s),"data-disabled":l?"":void 0,disabled:l,value:i,...r,ref:g,onKeyDown:tT(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:tT(n,e=>{p(),d(e=>!!ib(e)||!e),m&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},"CheckboxTrigger")),im=w.forwardRef(ii(function(e,t){let{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:i,disabled:l,value:s,onCheckedChange:c,form:u,...d}=e;return(0,x.jsx)(ip,{__scopeCheckbox:n,checked:o,defaultChecked:a,disabled:l,required:i,onCheckedChange:c,name:r,form:u,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ih,{...d,ref:t,__scopeCheckbox:n}),e&&(0,x.jsx)(iv,{__scopeCheckbox:n})]})})},"Checkbox")),ig=w.forwardRef(ii(function(e,t){let{__scopeCheckbox:n,forceMount:r,...o}=e,a=id("CheckboxIndicator",n);return(0,x.jsx)(n_,{present:r||ib(a.checked)||!0===a.checked,children:(0,x.jsx)(t3.span,{"data-state":ix(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),iv=w.forwardRef(ii(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:o,hasConsumerStoppedPropagationRef:a,userInteractionCount:i,checked:l,defaultChecked:s,required:c,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:m}=id("CheckboxBubbleInput",e),g=td(r,m),v=io(o),y=w.useRef(!1),b=w.useRef(l),k=w.useRef(i);w.useEffect(()=>{if(!h)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=i!==k.current;k.current=i;let n=b.current!==l;b.current=l;let r=!(t&&a.current);if(n&&e){y.current=!t;let n=new Event("click",{bubbles:r});h.indeterminate=ib(l),e.call(h,!ib(l)&&l),h.dispatchEvent(n),y.current=!1}},[h,l,a,i]);let j=w.useRef(!ib(l)&&l);return(0,x.jsx)(t3.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??j.current,required:c,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:tT(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function iy(e){return"function"==typeof e}function ib(e){return"indeterminate"===e}function ix(e){return ib(e)?"indeterminate":e?"checked":"unchecked"}ii(iy,"isFunction"),ii(ib,"isIndeterminate"),ii(ix,"getState");let iw=_("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function ik(e){var t,n,r=e.className,o=function(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}(e,["className"]);return(0,x.jsx)(im,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"checkbox",className:e4("peer size-4 shrink-0 cursor-pointer rounded-[5px] border border-input bg-card shadow-[0_1px_2px_rgb(20_24_40/0.04)] outline-none transition-[border-color,box-shadow,background-color] hover:border-ring/35 focus-visible:border-ring/50 focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r)},o),n=n={children:(0,x.jsx)(ig,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:(0,x.jsx)(iw,{className:"size-3",strokeWidth:3.5})})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}var ij=Object.defineProperty,iS=w.forwardRef(ij(function(e,t){return(0,x.jsx)(t3.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}));function iO(e){var t=e.className,n=function(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}(e,["className"]);return(0,x.jsx)(iS,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"label",className:e4("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t)},n))}function iC(e,[t,n]){return Math.min(n,Math.max(t,e))}(0,Object.defineProperty)(iC,"name",{value:"clamp",configurable:!0});var iN=Object.defineProperty,iP=(e,t)=>iN(e,"name",{value:t,configurable:!0});function iE(e){let t=e+"CollectionProvider",[n,r]=tL(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=iP(e=>{let{scope:t,children:n}=e,r=w.useRef(null),a=w.useRef(new Map).current;return(0,x.jsx)(o,{scope:t,itemMap:a,collectionRef:r,children:n})},"CollectionProvider");i.displayName=t;let l=e+"CollectionSlot",s=th(l),c=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=td(t,a(l,n).collectionRef);return(0,x.jsx)(s,{ref:o,children:r})});c.displayName=l;let u=e+"CollectionItemSlot",d="data-radix-collection-item",f=th(u),p=w.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,i=w.useRef(null),l=td(t,i),s=a(u,n);return w.useEffect(()=>(s.itemMap.set(i,{ref:i,...o}),()=>void s.itemMap.delete(i))),(0,x.jsx)(f,{...{[d]:""},ref:l,children:r})});function h(t){let n=a(e+"CollectionConsumer",t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return p.displayName=u,iP(h,"useCollection"),[{Provider:i,Slot:c,ItemSlot:p},h,r]}iP(iE,"createCollection");var i_=new WeakMap,iA=class e extends Map{static{iP(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],i_.set(this,!0)}set(e,t){return i_.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r,o=this.has(t),a=this.#e.length,i=iR(e),l=i>=0?i:a+i,s=l<0||l>=a?-1:l;if(s===this.size||o&&s===this.size-1||-1===s)return this.set(t,n),this;let c=this.size+ +!o;i<0&&l++;let u=[...this.#e],d=!1;for(let e=l;e<c;e++)if(l===e){let a=u[e];u[e]===t&&(a=u[e+1]),o&&this.delete(t),r=this.get(a),this.set(t,n)}else{d||u[e-1]!==t||(d=!0);let n=u[d?e:e-1],o=r;r=this.get(n),this.delete(n),this.set(n,o)}return this}with(t,n,r){let o=new e(this);return o.insert(t,n,r),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=iI(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=iI(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return iI(this.#e,e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],o=0;for(let e of this)Reflect.apply(t,n,[e,o,this])&&r.push(e),o++;return new e(r)}map(t,n){let r=[],o=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,o,this])]),o++;return new e(r)}reduce(...e){let[t,n]=e,r=0,o=n??this.at(0);for(let n of this)o=0===r&&1===e.length?n:Reflect.apply(t,this,[o,n,r,this]),r++;return o}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let o=this.at(n);r=n===this.size-1&&1===e.length?o:Reflect.apply(t,this,[r,o,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,o=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(o=n-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function iI(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=iT(e,t);return -1===n?void 0:e[n]}function iT(e,t){let n=e.length,r=iR(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}function iR(e){return e!=e||0===e?0:Math.trunc(e)}function iM(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function iz(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function iD(e,t){return e[1].element&&t[1].element?iz(e[1].element,t[1].element)?-1:1:0}function iL(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type)return void e()})}iP(iI,"at"),iP(iT,"toSafeIndex"),iP(iR,"toSafeInteger"),iP(function(e){let t=e+"CollectionProvider",[n,r]=tL(t),[o,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new iA,setItemMap:iP(()=>void 0,"setItemMap")}),i=iP(({state:e,...t})=>e?(0,x.jsx)(s,{...t,state:e}):(0,x.jsx)(l,{...t}),"CollectionProvider");i.displayName=t;let l=iP(e=>{let t=m();return(0,x.jsx)(s,{...e,state:t})},"CollectionInit");l.displayName=t+"Init";let s=iP(e=>{let{scope:t,children:n,state:r}=e,a=w.useRef(null),[i,l]=w.useState(null),s=td(a,l),[c,u]=r;return w.useEffect(()=>{if(!i)return;let e=iL(()=>{});return e.observe(i,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[i]),(0,x.jsx)(o,{scope:t,itemMap:c,setItemMap:u,collectionRef:s,collectionRefObject:a,collectionElement:i,children:n})},"CollectionProviderImpl");s.displayName=t+"Impl";let c=e+"CollectionSlot",u=th(c),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=td(t,a(c,n).collectionRef);return(0,x.jsx)(u,{ref:o,children:r})});d.displayName=c;let f=e+"CollectionItemSlot",p=th(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,i=w.useRef(null),[l,s]=w.useState(null),c=td(t,i,s),{setItemMap:u}=a(f,n),d=w.useRef(o);iM(d.current,o)||(d.current=o);let h=d.current;return w.useEffect(()=>(u(e=>l?e.has(l)?e.set(l,{...h,element:l}).toSorted(iD):(e.set(l,{...h,element:l}),e.toSorted(iD)):e),()=>{u(e=>l&&e.has(l)?(e.delete(l),new iA(e)):e)}),[l,h,u]),(0,x.jsx)(p,{"data-radix-collection-item":"",ref:c,children:r})});function m(){return w.useState(new iA)}function g(t){let{itemMap:n}=a(e+"CollectionConsumer",t);return n}return h.displayName=f,iP(m,"useInitCollection"),iP(g,"useCollection"),[{Provider:i,Slot:d,ItemSlot:h},{createCollectionScope:r,useCollection:g,useInitCollection:m}]},"createCollection"),iP(iM,"shallowEqual"),iP(iz,"isElementPreceding"),iP(iD,"sortByDocumentPosition"),iP(iL,"getChildListObserver");var iF=Object.defineProperty,i$=w.createContext(void 0);function iU(e){let t=w.useContext(i$);return e||t||"ltr"}iF(iU,"name",{value:"useDirection",configurable:!0});let iH=["top","right","bottom","left"],iB=Math.min,iV=Math.max,iK=Math.round,iq=Math.floor,iW=e=>({x:e,y:e}),iG={left:"right",right:"left",bottom:"top",top:"bottom"};function iZ(e,t){return"function"==typeof e?e(t):e}function iY(e){return e.split("-")[0]}function iX(e){return e.split("-")[1]}function iJ(e){return"x"===e?"y":"x"}function iQ(e){return"y"===e?"height":"width"}function i0(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function i1(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let i2=["left","right"],i4=["right","left"],i3=["top","bottom"],i5=["bottom","top"];function i6(e){let t=iY(e);return iG[t]+e.slice(t.length)}function i8(e){var t,n,r,o;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(o=e.left)?o:0}:{top:e,right:e,bottom:e,left:e}}function i9(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function i7(e,t,n){let r,{reference:o,floating:a}=e,i=i0(t),l=iJ(i0(t)),s=iQ(l),c=iY(t),u=o.x+o.width/2-a.width/2,d=o.y+o.height/2-a.height/2,f=o[s]/2-a[s]/2;switch(c){case"top":r={x:u,y:o.y-a.height};break;case"bottom":r={x:u,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:d};break;case"left":r={x:o.x-a.width,y:d};break;default:r={x:o.x,y:o.y}}let p=iX(t);return p&&(r[l]+=f*("end"===p?1:-1)*(n&&"y"===i?-1:1)),r}async function le(e,t){var n;void 0===t&&(t={});let{x:r,y:o,platform:a,rects:i,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=iZ(t,e),h=i8(p),m=l[f?"floating"===d?"reference":"floating":d],g=i9(await a.getClippingRect({element:null==(n=await (null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await (null==a.getDocumentElement?void 0:a.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),v="floating"===d?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await (null==a.getOffsetParent?void 0:a.getOffsetParent(l.floating)),b=await (null==a.isElement?void 0:a.isElement(y))&&await (null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},x=i9(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:y,strategy:s}):v);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}let lt=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:le},s=await (null==i.isRTL?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=i7(c,r,s),f=r,p=0,h={};for(let n=0;n<a.length;n++){let m=a[n];if(!m)continue;let{name:g,fn:v}=m,{x:y,y:b,data:x,reset:w}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:l,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=b?b:d,h[g]={...h[g],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:d}=i7(c,f,s)),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};function ln(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lr(e){return iH.some(t=>e[t]>=0)}let lo=new Set(["left","top"]);async function la(e,t){let{placement:n,platform:r,elements:o}=e,a=await (null==r.isRTL?void 0:r.isRTL(o.floating)),i=iY(n),l=iX(n),s="y"===i0(n),c=lo.has(i)?-1:1,u=a&&s?-1:1,d=iZ(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof h&&(p="end"===l?-1*h:h),s?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function li(){return"u">typeof window}function ll(e){return lu(e)?(e.nodeName||"").toLowerCase():"#document"}function ls(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function lc(e){var t;return null==(t=(lu(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function lu(e){return!!li()&&(e instanceof Node||e instanceof ls(e).Node)}function ld(e){return!!li()&&(e instanceof Element||e instanceof ls(e).Element)}function lf(e){return!!li()&&(e instanceof HTMLElement||e instanceof ls(e).HTMLElement)}function lp(e){return!(!li()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ls(e).ShadowRoot)}function lh(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=lk(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function lm(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let lg=/transform|translate|scale|rotate|perspective|filter/,lv=/paint|layout|strict|content/,ly=e=>!!e&&"none"!==e;function lb(e){let t=ld(e)?lk(e):e;return ly(t.transform)||ly(t.translate)||ly(t.scale)||ly(t.rotate)||ly(t.perspective)||!lx()&&(ly(t.backdropFilter)||ly(t.filter))||lg.test(t.willChange||"")||lv.test(t.contain||"")}function lx(){return null==e&&(e="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),e}function lw(e){return/^(html|body|#document)$/.test(ll(e))}function lk(e){return ls(e).getComputedStyle(e)}function lj(e){return ld(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lS(e){if("html"===ll(e))return e;let t=e.assignedSlot||e.parentNode||lp(e)&&e.host||lc(e);return lp(t)?t.host:t}function lO(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let o=function e(t){let n=lS(t);return lw(n)?(t.ownerDocument||t).body:lf(n)&&lh(n)?n:e(n)}(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=ls(o);if(!a)return t.concat(o,lO(o,[],n));{let e=lC(i);return t.concat(i,i.visualViewport||[],lh(o)?o:[],e&&n?lO(e):[])}}function lC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lN(e){let t=lk(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=lf(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=iK(n)!==a||iK(r)!==i;return l&&(n=a,r=i),{width:n,height:r,$:l}}function lP(e){return ld(e)?e:e.contextElement}function lE(e){let t=lP(e);if(!lf(t))return iW(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:a}=lN(t),i=(a?iK(n.width):n.width)/r,l=(a?iK(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}let l_=iW(0);function lA(e){let t=ls(e);return lx()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:l_}function lI(e,t,n,r){var o;void 0===t&&(t=!1),void 0===n&&(n=!1);let a=e.getBoundingClientRect(),i=lP(e),l=iW(1);t&&(r?ld(r)&&(l=lE(r)):l=lE(e));let s=(void 0===(o=n)&&(o=!1),r&&o&&r===ls(i))?lA(i):iW(0),c=(a.left+s.x)/l.x,u=(a.top+s.y)/l.y,d=a.width/l.x,f=a.height/l.y;if(i&&r){let e=ls(i),t=ld(r)?ls(r):r,n=e,o=lC(n);for(;o&&t!==n;){let e=lE(o),t=o.getBoundingClientRect(),r=lk(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=a,u+=i,o=lC(n=ls(o))}}return i9({width:d,height:f,x:c,y:u})}function lT(e,t){let n=lj(e).scrollLeft;return t?t.left+n:lI(lc(e)).left+n}function lR(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-lT(e,n),y:n.top+t.scrollTop}}function lM(e,t,n){var r;let o;if("viewport"===t||"layoutViewport"===t)o=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,o=ls(e),a=lc(e),i=o.visualViewport,l=a.clientWidth,s=a.clientHeight,c=0,u=0;if(i){let e=!lx()||"fixed"===t;r?e||(c=-i.offsetLeft,u=-i.offsetTop):(l=i.width,s=i.height,e&&(c=i.offsetLeft,u=i.offsetTop))}if(0>=lT(a)){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(a.clientWidth-t.clientWidth-r),i="stable both-edges"===getComputedStyle(a).scrollbarGutter?o/2:o;i<=25&&(l-=i)}return{width:l,height:s,x:c,y:u}}(e,n,t);else if("document"===t){let t,n,a,i,l,s;t=lj(r=lc(e)),n=r.ownerDocument.body,a=iV(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),i=iV(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight),l=-t.scrollLeft+lT(r),s=-t.scrollTop,"rtl"===lk(n).direction&&(l+=iV(r.clientWidth,n.clientWidth)-a),o={width:a,height:i,x:l,y:s}}else if(ld(t)){let e,r,a,i,l,s;r=(e=lI(t,!0,"fixed"===n)).top+t.clientTop,a=e.left+t.clientLeft,i=lE(t),l=t.clientWidth*i.x,s=t.clientHeight*i.y,o={width:l,height:s,x:a*i.x,y:r*i.y}}else{let n=lA(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return i9(o)}function lz(e){return"static"===lk(e).position}function lD(e,t){if(!lf(e)||"fixed"===lk(e).position)return null;if(t)return t(e);let n=e.offsetParent;return lc(e)===n&&(n=n.ownerDocument.body),n}function lL(e,t){var n;let r=ls(e);if(lm(e))return r;if(!lf(e)){let t=lS(e);for(;t&&!lw(t);){if(ld(t)&&!lz(t))return t;t=lS(t)}return r}let o=lD(e,t);for(;o&&(n=o,/^(table|td|th)$/.test(ll(n)))&&lz(o);)o=lD(o,t);return o&&lw(o)&&lz(o)&&!lb(o)?r:o||function(e){let t=lS(e);for(;lf(t)&&!lw(t);){if(lb(t))return t;if(lm(t))break;t=lS(t)}return null}(e)||r}let lF=async function(e){let t=this.getOffsetParent||lL,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=lf(t),o=lc(t),a="fixed"===n,i=lI(e,!0,a,t),l={scrollLeft:0,scrollTop:0},s=iW(0);if((r||!a)&&(("body"!==ll(t)||lh(o))&&(l=lj(t)),r)){let e=lI(t,!0,a,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!r&&o&&(s.x=lT(o));let c=!o||r||a?iW(0):lR(o,l);return{x:i.left+l.scrollLeft-s.x-c.x,y:i.top+l.scrollTop-s.y-c.y,width:i.width,height:i.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},l$={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,a="fixed"===o,i=lc(r),l=!!t&&lm(t.floating);if(r===i||l&&a)return n;let s={scrollLeft:0,scrollTop:0},c=iW(1),u=iW(0),d=lf(r);if((d||!a)&&(("body"!==ll(r)||lh(i))&&(s=lj(r)),d)){let e=lI(r);c=lE(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=!i||d||a?iW(0):lR(i,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-s.scrollTop*c.y+u.y+f.y}},getDocumentElement:lc,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,a=[..."clippingAncestors"===n?lm(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=lO(e,[],!1).filter(e=>ld(e)&&"body"!==ll(e)),o=null,a="fixed"===lk(e).position,i=a?lS(e):e;for(;ld(i)&&!lw(i);){let e=lk(i),t=lb(i),n=o?o.position:a?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?o=e:r=r.filter(e=>e!==i),i=lS(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=lM(t,a[0],o),l=i.top,s=i.right,c=i.bottom,u=i.left;for(let e=1;e<a.length;e++){let n=lM(t,a[e],o);l=iV(n.top,l),s=iB(n.right,s),c=iB(n.bottom,c),u=iV(n.left,u)}return{width:s-u,height:c-l,x:u,y:l}},getOffsetParent:lL,getElementRects:lF,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=lN(e);return{width:t,height:n}},getScale:lE,isElement:ld,isRTL:function(e){return"rtl"===lk(e).direction}};function lU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let lH=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:a,platform:i,elements:l,middlewareData:s}=t,{element:c,padding:u=0}=iZ(e,t)||{};if(null==c)return{};let d=i8(u),f={x:n,y:r},p=iJ(i0(o)),h=iQ(p),m=await i.getDimensions(c),g="y"===p,v=g?"clientHeight":"clientWidth",y=a.reference[h]+a.reference[p]-f[p]-a.floating[h],b=f[p]-a.reference[p],x=await (null==i.getOffsetParent?void 0:i.getOffsetParent(c)),w=x?x[v]:0;w&&await (null==i.isElement?void 0:i.isElement(x))||(w=l.floating[v]||a.floating[h]);let k=w/2-m[h]/2-1,j=iB(d[g?"top":"left"],k),S=iB(d[g?"bottom":"right"],k),O=w-m[h]-S,C=w/2-m[h]/2+(y/2-b/2),N=iV(j,iB(C,O)),P=!s.arrow&&null!=iX(o)&&C!==N&&a.reference[h]/2-(C<j?j:S)-m[h]/2<0,E=P?C<j?C-j:C-O:0;return{[p]:f[p]+E,data:{[p]:N,centerOffset:C-N-E,...P&&{alignmentOffset:E}},reset:P}}});var lB="u">typeof document?w.useLayoutEffect:function(){};function lV(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!lV(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!lV(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function lK(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lq(e,t){let n=lK(e);return Math.round(t*n)/n}function lW(e){let t=w.useRef(e);return lB(()=>{t.current=e}),t}var lG=Object.defineProperty,lZ=(e,t)=>lG(e,"name",{value:t,configurable:!0}),lY="Popper",[lX,lJ]=tL(lY),[lQ,l0]=lX(lY),l1=lZ(e=>{let{__scopePopper:t,children:n}=e,[r,o]=w.useState(null),[a,i]=w.useState(void 0);return(0,x.jsx)(lQ,{scope:t,anchor:r,onAnchorChange:o,placementState:a,setPlacementState:i,children:n})},"Popper"),l2=w.forwardRef(lZ(function(e,t){let{__scopePopper:n,virtualRef:r,...o}=e,a=l0("PopperAnchor",n),i=w.useRef(null),l=a.onAnchorChange,s=td(t,w.useCallback(e=>{i.current=e,e&&l(e)},[l])),c=w.useRef(null);w.useEffect(()=>{if(!r)return;let e=c.current;c.current=r.current,e!==c.current&&l(c.current)});let u=a.placementState&&l7(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,x.jsx)(t3.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...o,ref:s})},"PopperAnchor")),l4="PopperContent",[l3,l5]=lX(l4),l6=w.forwardRef(lZ(function(e,t){var n,r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,k,j,S;let O,C,N,P,E,_,{__scopePopper:A,side:I="bottom",sideOffset:T=0,align:R="center",alignOffset:M=0,arrowPadding:z=0,avoidCollisions:D=!0,collisionBoundary:L=[],collisionPadding:F=0,sticky:$="partial",hideWhenDetached:U=!1,updatePositionStrategy:H="optimized",onPlaced:B,...V}=e,K=l0(l4,A),[q,W]=w.useState(null),G=td(t,W),[Z,Y]=w.useState(null),X=io(Z),J=X?.width??0,Q=X?.height??0,ee="number"==typeof F?F:{top:0,right:0,bottom:0,left:0,...F},et=Array.isArray(L)?L:[L],en=et.length>0,er={padding:ee,boundary:et.filter(l8),altBoundary:en},{refs:eo,floatingStyles:ea,placement:ei,isPositioned:el,middlewareData:es}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:s,open:c}=e,[u,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(r);lV(f,r)||p(r);let[h,m]=w.useState(null),[g,v]=w.useState(null),y=w.useCallback(e=>{e!==j.current&&(j.current=e,m(e))},[]),b=w.useCallback(e=>{e!==S.current&&(S.current=e,v(e))},[]),x=a||h,k=i||g,j=w.useRef(null),S=w.useRef(null),O=w.useRef(u),C=null!=s,N=lW(s),P=lW(o),E=lW(c),_=w.useCallback(()=>{var e,r;let o,a,i;if(!j.current||!S.current)return;let l={placement:t,strategy:n,middleware:f};P.current&&(l.platform=P.current),(e=j.current,r=S.current,o=new Map,a=null!=l?l:{},i={...l$,...a.platform,_c:o},lt(e,r,{...a,platform:i})).then(e=>{let t={...e,isPositioned:!1!==E.current};A.current&&!lV(O.current,t)&&(O.current=t,t2.flushSync(()=>{d(t)}))})},[f,t,n,P,E]);lB(()=>{!1===c&&O.current.isPositioned&&(O.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let A=w.useRef(!1);lB(()=>(A.current=!0,()=>{A.current=!1}),[]),lB(()=>{if(x&&(j.current=x),k&&(S.current=k),x&&k){if(N.current)return N.current(x,k,_);_()}},[x,k,_,N,C]);let I=w.useMemo(()=>({reference:j,floating:S,setReference:y,setFloating:b}),[y,b]),T=w.useMemo(()=>({reference:x,floating:k}),[x,k]),R=w.useMemo(()=>{let e={position:n,left:0,top:0};if(!T.floating)return e;let t=lq(T.floating,u.x),r=lq(T.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...lK(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,T.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:_,refs:I,elements:T,floatingStyles:R}),[u,_,I,T,R])}({strategy:"fixed",placement:I+("center"!==R?"-"+R:""),whileElementsMounted:lZ((...e)=>(function(e,t,n,r){let o;void 0===r&&(r={});let{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,u=lP(e),d=a||i?[...u?lO(u):[],...t?lO(t):[]]:[];d.forEach(e=>{a&&e.addEventListener("scroll",n),i&&e.addEventListener("resize",n)});let f=u&&s?function(e,t,n){let r,o=null,a=lc(e);function i(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function l(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),i();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(n||t(),!f||!p)return;let h={rootMargin:-iq(d)+"px "+-iq(a.clientWidth-(u+f))+"px "+-iq(a.clientHeight-(d+p))+"px "+-iq(u)+"px",threshold:iV(0,iB(1,s))||1},m=!0;function g(t){let n=t[0].intersectionRatio;if(!lU(c,e.getBoundingClientRect()))return l();if(n!==s){if(!m)return l();n?l(!1,n):r=setTimeout(()=>{l(!1,1e-7)},1e3)}m=!1}try{o=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){o=new IntersectionObserver(g,h)}o.observe(e)}let s=ls(e),c=()=>l(n);return s.addEventListener("resize",c),l(!0),()=>{s.removeEventListener("resize",c),i()}}(u,n,i):null,p=-1,h=null;l&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),u&&!c&&h.observe(u),t&&h.observe(t));let m=c?lI(e):null;return c&&function t(){let r=lI(e);m&&!lU(m,r)&&n(),m=r,o=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(o)}})(...e,{animationFrame:"always"===H}),"whileElementsMounted"),elements:{reference:K.anchor},middleware:[{name:(O={name:"offset",options:o=n={mainAxis:T+Q,alignmentAxis:M},async fn(e){var t,n;let{x:r,y:a,placement:i,middlewareData:l}=e,s=await la(e,o);return i===(null==(t=l.offset)?void 0:t.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:r+s.x,y:a+s.y,data:{...s,placement:i}}}}).name,fn:O.fn,options:[n,r]},D&&{name:(C={name:"shift",options:u=s={mainAxis:!0,crossAxis:!1,limiter:"partial"===$?{fn:(void 0===(l=a)&&(l={}),{options:l,fn(e){var t,n,r,o;let{x:a,y:i,placement:s,rects:c,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=iZ(l,e),h={x:a,y:i},m=i0(s),g=iJ(m),v=h[g],y=h[m],b=iZ(d,e),x="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:null!=(t=b.mainAxis)?t:0,crossAxis:null!=(n=b.crossAxis)?n:0};if(f){let e="y"===g?"height":"width",t=c.reference[g]-c.floating[e]+x.mainAxis,n=c.reference[g]+c.reference[e]-x.mainAxis;v<t?v=t:v>n&&(v=n)}if(p){let e="y"===g?"width":"height",t=lo.has(iY(s)),n=c.reference[m]-c.floating[e]+(t&&(null==(r=u.offset)?void 0:r[m])||0)+(t?0:x.crossAxis),a=c.reference[m]+c.reference[e]+(t?0:(null==(o=u.offset)?void 0:o[m])||0)-(t?x.crossAxis:0);y<n?y=n:y>a&&(y=a)}return{[g]:v,[m]:y}}}).fn,options:[a,i]}:void 0,...er},async fn(e){let{x:t,y:n,placement:r,platform:o}=e,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=iZ(u,e),c={x:t,y:n},d=await o.detectOverflow(e,s),f=i0(r),p=iJ(f),h=c[p],m=c[f],g=(e,t)=>iV(t+d["y"===e?"top":"left"],iB(t,t-d["y"===e?"bottom":"right"]));a&&(h=g(p,h)),i&&(m=g(f,m));let v=l.fn({...e,[p]:h,[f]:m});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[f]:i}}}}}).name,fn:C.fn,options:[s,c]},D&&{name:(N={name:"flip",options:p=d={...er},async fn(e){var t,n,r,o,a,i,l,s;let c,u,d,{placement:f,middlewareData:h,rects:m,initialPlacement:g,platform:v,elements:y}=e,{mainAxis:b=!0,crossAxis:x=!0,fallbackPlacements:w,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:S=!0,...O}=iZ(p,e);if(null!=(t=h.arrow)&&t.alignmentOffset)return{};let C=iY(f),N=i0(g),P=iY(g)===g,E=await (null==v.isRTL?void 0:v.isRTL(y.floating)),_=w||(P||!S?[i6(g)]:(c=i6(g),[i1(g),c,i1(c)])),A="none"!==j;!w&&A&&_.push(...(u=iX(g),d=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?i4:i2;return t?i2:i4;case"left":case"right":return t?i3:i5;default:return[]}}(iY(g),"start"===j,E),u&&(d=d.map(e=>e+"-"+u),S&&(d=d.concat(d.map(i1)))),d));let I=[g,..._],T=await v.detectOverflow(e,O),R=[],M=(null==(n=h.flip)?void 0:n.overflows)||[];if(b&&R.push(T[C]),x){let e,t,n,r,o=(i=f,l=m,void 0===(s=E)&&(s=!1),e=iX(i),n=iQ(t=iJ(i0(i))),r="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",l.reference[n]>l.floating[n]&&(r=i6(r)),[r,i6(r)]);R.push(T[o[0]],T[o[1]])}if(M=[...M,{placement:f,overflows:R}],!R.every(e=>e<=0)){let e=((null==(r=h.flip)?void 0:r.index)||0)+1,t=I[e];if(t&&("alignment"!==x||N===i0(t)||M.every(e=>i0(e.placement)!==N||e.overflows[0]>0)))return{data:{index:e,overflows:M},reset:{placement:t}};let n=null==(o=M.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!n)switch(k){case"bestFit":{let e=null==(a=M.filter(e=>{if(A){let t=i0(e.placement);return t===N||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(n=e);break}case"initialPlacement":n=g}if(f!==n)return{reset:{placement:n}}}return{}}}).name,fn:N.fn,options:[d,f]},{name:(P={name:"size",options:g=h={...er,apply:lZ(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)},"apply")},async fn(e){let t,n,{placement:r,rects:o,platform:a,elements:i}=e,{apply:l=()=>{},...s}=iZ(g,e),c=await a.detectOverflow(e,s),u=iY(r),d=iX(r),f="y"===i0(r),{width:p,height:h}=o.floating;"top"===u||"bottom"===u?(t=u,n=d===(await (null==a.isRTL?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(n=u,t="end"===d?"top":"bottom");let m=h-c.top-c.bottom,v=p-c.left-c.right,y=iB(h-c[t],m),b=iB(p-c[n],v),x=e.middlewareData.shift,w=!x,k=y,j=b;null!=x&&x.enabled.x&&(j=v),null!=x&&x.enabled.y&&(k=m),w&&!d&&(f?j=p-2*iV(c.left,c.right):k=h-2*iV(c.top,c.bottom)),await l({...e,availableWidth:j,availableHeight:k});let S=await a.getDimensions(i.floating);return p!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}).name,fn:P.fn,options:[h,m]},Z&&{name:(E={name:"arrow",options:b=v={element:Z,padding:z},fn(e){let{element:t,padding:n}="function"==typeof b?b(e):b;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?lH({element:t.current,padding:n}).fn(e):{}:t?lH({element:t,padding:n}).fn(e):{}}}).name,fn:E.fn,options:[v,y]},l9({arrowWidth:J,arrowHeight:Q}),U&&{name:(_={name:"hide",options:S=k={strategy:"referenceHidden",...er,boundary:en?er.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...o}=iZ(S,e);switch(r){case"referenceHidden":{let r=ln(await n.detectOverflow(e,{...o,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:lr(r)}}}case"escaped":{let r=ln(await n.detectOverflow(e,{...o,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:lr(r)}}}default:return{}}}}).name,fn:_.fn,options:[k,j]}]}),ec=K.setPlacementState;t$(()=>(ec(ei),()=>{ec(void 0)}),[ei,ec]);let[eu,ed]=l7(ei),ef=t6(B);t$(()=>{el&&ef?.()},[el,ef]);let ep=es.arrow?.x,eh=es.arrow?.y,em=es.arrow?.centerOffset!==0,[eg,ev]=w.useState();return t$(()=>{q&&ev(window.getComputedStyle(q).zIndex)},[q]),(0,x.jsx)("div",{ref:eo.setFloating,"data-radix-popper-content-wrapper":"",style:{...ea,transform:el?ea.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eg,"--radix-popper-transform-origin":[es.transformOrigin?.x,es.transformOrigin?.y].join(" "),...es.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,x.jsx)(l3,{scope:A,placedSide:eu,placedAlign:ed,onArrowChange:Y,arrowX:ep,arrowY:eh,shouldHideArrow:em,children:(0,x.jsx)(t3.div,{"data-side":eu,"data-align":ed,...V,ref:G,style:{...V.style,animation:el?V.style?.animation:"none"}})})})},"PopperContent"));function l8(e){return null!==e}lZ(l8,"isNotNull");var l9=lZ(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=l7(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+l/2,p="",h="";return"bottom"===s?(p=a?u:`${d}px`,h=`${-l}px`):"top"===s?(p=a?u:`${d}px`,h=`${r.floating.height+l}px`):"right"===s?(p=`${-l}px`,h=a?u:`${f}px`):"left"===s&&(p=`${r.floating.width+l}px`,h=a?u:`${f}px`),{data:{x:p,y:h}}}}),"transformOrigin");function l7(e){let[t,n="center"]=e.split("-");return[t,n]}function se(e){let t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}lZ(l7,"getSideAndAlignFromPlacement"),(0,Object.defineProperty)(se,"name",{value:"usePrevious",configurable:!0});var st=Object.defineProperty,sn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sr=w.forwardRef(st(function(e,t){return(0,x.jsx)(t3.span,{...e,ref:t,style:{...sn,...e.style}})},"name",{value:"VisuallyHidden",configurable:!0})),so=Object.defineProperty,sa=(e,t)=>so(e,"name",{value:t,configurable:!0}),si=[" ","Enter","ArrowUp","ArrowDown"],sl=[" ","Enter"],ss="Select",[sc,su,sd]=iE(ss),[sf,sp]=tL(ss,[sd,lJ]),sh=lJ(),[sm,sg]=sf(ss),[sv,sy]=sf(ss);function sb(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:i,defaultValue:l,onValueChange:s,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:h,internal_do_not_use_render:m}=e,g=sh(t),[v,y]=w.useState(null),[b,k]=w.useState(null),[j,S]=w.useState(!1),O=iU(c),[C,N]=tJ({prop:r,defaultProp:o??!1,onChange:a,caller:ss}),[P,E]=tJ({prop:i,defaultProp:l,onChange:s,caller:ss}),_=w.useRef(null),A=w.useRef(P);w.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=sa(()=>E(A.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[h,v,E]);let I=!v||!!h||!!v.closest("form"),[T,R]=w.useState(new Set),M=tV(),z=Array.from(T).map(e=>e.props.value).join(";"),D=w.useCallback(e=>{R(t=>new Set(t).add(e))},[]),L=w.useCallback(e=>{R(t=>{let n=new Set(t);return n.delete(e),n})},[]),F={required:p,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:M,value:P,onValueChange:E,open:C,onOpenChange:N,dir:O,triggerPointerDownPosRef:_,disabled:f,name:u,autoComplete:d,form:h,nativeOptions:T,nativeSelectKey:z,isFormControl:I};return(0,x.jsx)(l1,{...g,children:(0,x.jsx)(sm,{scope:t,...F,children:(0,x.jsx)(sc.Provider,{scope:t,children:(0,x.jsx)(sv,{scope:t,onNativeOptionAdd:D,onNativeOptionRemove:L,children:s4(m)?m(F):n})})})})}sa(sb,"SelectProvider");var sx=sa(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,x.jsx)(sb,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[n,e?(0,x.jsx)(s2,{__scopeSelect:t}):null]})})},"Select"),sw=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,disabled:r=!1,...o}=e,a=sh(n),i=sg("SelectTrigger",n),l=i.disabled||r,s=td(t,i.onTriggerChange),c=su(n),u=w.useRef("touch"),[d,f,p]=s5(e=>{let t=c().filter(e=>!e.disabled),n=t.find(e=>e.value===i.value),r=s6(t,e,n);void 0!==r&&i.onValueChange(r.value)}),h=sa(e=>{l||(i.onOpenChange(!0),p()),e&&(i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,x.jsx)(l2,{asChild:!0,...a,children:(0,x.jsx)(t3.button,{type:"button",role:"combobox","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":s3(i.value)?"":void 0,...o,ref:s,onClick:tT(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==u.current&&h(e)}),onPointerDown:tT(o.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(h(e),e.preventDefault())}),onKeyDown:tT(o.onKeyDown,e=>{let t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),(!t||" "!==e.key)&&si.includes(e.key)&&(h(),e.preventDefault())})})})},"SelectTrigger")),sk=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...l}=e,s=sg("SelectValue",n),{onValueNodeHasChildrenChange:c}=s,u=void 0!==a,d=td(t,s.onValueNodeChange);t$(()=>{c(u)},[c,u]);let f=s3(s.value);return(0,x.jsx)(t3.span,{...l,asChild:!f&&l.asChild,ref:d,style:{pointerEvents:"none"},children:(0,x.jsx)(w.Fragment,{children:f?i:a},f?"placeholder":"value")})},"SelectValue")),sj=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,children:r,...o}=e;return(0,x.jsx)(t3.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})},"SelectIcon")),[sS,sO]=sf("SelectPortal",{forceMount:void 0}),sC=sa(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,x.jsx)(sS,{scope:e.__scopeSelect,forceMount:n,children:(0,x.jsx)(nC,{asChild:!0,...r})})},"SelectPortal"),sN="SelectContent",sP=w.forwardRef(sa(function(e,t){let n=sO(sN,e.__scopeSelect),{forceMount:r=n.forceMount,...o}=e,a=sg(sN,e.__scopeSelect),[i,l]=w.useState();return t$(()=>{l(new DocumentFragment)},[]),(0,x.jsx)(n_,{present:r||a.open,children:({present:e})=>e?(0,x.jsx)(sT,{...o,ref:t}):(0,x.jsx)(sE,{...o,fragment:i})})},"SelectContent")),sE=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,children:r,fragment:o}=e;return o?t2.createPortal((0,x.jsx)(s_,{scope:n,children:(0,x.jsx)(sc.Slot,{scope:n,children:(0,x.jsx)("div",{ref:t,children:r})})}),o):null},"SelectContentFragment")),[s_,sA]=sf(sN),sI=th("SelectContent.RemoveScroll"),sT=w.forwardRef(sa(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:l,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:g,...v}=e,y=sg(sN,n),[b,k]=w.useState(null),[j,S]=w.useState(null),O=td(t,k),[C,N]=w.useState(null),[P,E]=w.useState(null),_=su(n),[A,I]=w.useState(!1),T=w.useRef(!1);w.useEffect(()=>{if(b)return rj(b)},[b]),n$();let R=w.useCallback(e=>{let[t,...n]=_().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(n?.scrollIntoView({block:"nearest"}),n===t&&j&&(j.scrollTop=0),n===r&&j&&(j.scrollTop=j.scrollHeight),n?.focus(),document.activeElement!==o))return},[_,j]),M=w.useCallback(()=>R([C,b]),[R,C,b]);w.useEffect(()=>{A&&M()},[A,M]);let{onOpenChange:z,triggerPointerDownPosRef:D}=y;w.useEffect(()=>{if(b){let e={x:0,y:0},t=sa(t=>{e={x:Math.abs(Math.round(t.pageX)-(D.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(D.current?.y??0))}},"handlePointerMove"),n=sa(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||z(!1),document.removeEventListener("pointermove",t),D.current=null},"handlePointerUp");return null!==D.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[b,z,D]),w.useEffect(()=>{let e=sa(()=>z(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);let[L,F]=s5(e=>{let t=_().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=s6(t,e,n);r&&setTimeout(()=>r.ref.current?.focus())}),$=w.useCallback((e,t,n)=>{let r=!T.current&&!n;(void 0!==y.value&&y.value===t||r)&&(N(e),r&&(T.current=!0))},[y.value]),U=w.useCallback(()=>b?.focus(),[b]),H=w.useCallback((e,t,n)=>{let r=!T.current&&!n;(void 0!==y.value&&y.value===t||r)&&E(e)},[y.value]),B="popper"===r?sM:sR;return(0,x.jsx)(s_,{scope:n,content:b,viewport:j,onViewportChange:S,itemRefCallback:$,selectedItem:C,onItemLeave:U,itemTextRefCallback:H,focusSelectedItem:M,selectedItemText:P,position:r,isPositioned:A,searchRef:L,children:(0,x.jsx)(rg,{as:sI,allowPinchZoom:!0,children:(0,x.jsx)(np,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:tT(o,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,x.jsx)(nt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,x.jsx)(B,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...B===sM?{side:l,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:g}:{},onPlaced:()=>I(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:tT(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=_().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>R(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),sR=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,onPlaced:r,...o}=e,a=sg(sN,n),i=sA(sN,n),[l,s]=w.useState(null),[c,u]=w.useState(null),d=td(t,u),f=su(n),p=w.useRef(!1),h=w.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=i,b=w.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&c&&m&&g&&v){let e=a.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),o=v.getBoundingClientRect();if("rtl"!==a.dir){let r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),u=iC(a,[10,Math.max(10,window.innerWidth-10-c)]);l.style.minWidth=s+"px",l.style.left=u+"px"}else{let r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,s=e.width+i,c=Math.max(s,t.width),u=iC(a,[10,Math.max(10,window.innerWidth-10-c)]);l.style.minWidth=s+"px",l.style.right=u+"px"}let i=f(),s=window.innerHeight-20,u=m.scrollHeight,d=window.getComputedStyle(c),h=parseInt(d.borderTopWidth,10),y=parseInt(d.paddingTop,10),b=parseInt(d.borderBottomWidth,10),x=h+y+u+parseInt(d.paddingBottom,10)+b,w=Math.min(5*g.offsetHeight,x),k=window.getComputedStyle(m),j=parseInt(k.paddingTop,10),S=parseInt(k.paddingBottom,10),O=e.top+e.height/2-10,C=g.offsetHeight/2,N=h+y+(g.offsetTop+C);if(N<=O){let e=i.length>0&&g===i[i.length-1].ref.current;l.style.bottom="0px";let t=Math.max(s-O,C+(e?S:0)+(c.clientHeight-m.offsetTop-m.offsetHeight)+b);l.style.height=N+t+"px"}else{let e=i.length>0&&g===i[0].ref.current;l.style.top="0px";let t=Math.max(O,h+m.offsetTop+(e?j:0)+C);l.style.height=t+(x-N)+"px",m.scrollTop=N-O+m.offsetTop}l.style.margin="10px 0",l.style.minHeight=w+"px",l.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,l,c,m,g,v,a.dir,r]);t$(()=>b(),[b]);let[k,j]=w.useState();t$(()=>{c&&j(window.getComputedStyle(c).zIndex)},[c]);let S=w.useCallback(e=>{e&&!0===h.current&&(b(),y?.(),h.current=!1)},[b,y]);return(0,x.jsx)(sz,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,x.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,x.jsx)(t3.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})},"SelectItemAlignedPosition")),sM=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:o=10,...a}=e,i=sh(n);return(0,x.jsx)(l6,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[sz,sD]=sf(sN,{}),sL="SelectViewport",sF=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,nonce:r,...o}=e,a=sA(sL,n),i=sD(sL,n),l=td(t,a.onViewportChange),s=w.useRef(0);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),(0,x.jsx)(sc.Slot,{scope:n,children:(0,x.jsx)(t3.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:tT(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=i;if(r?.current&&n){let e=Math.abs(s.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<r){let a=o+e,i=Math.min(r,a),l=a-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}s.current=t.scrollTop})})})]})},"SelectViewport")),[s$,sU]=sf("SelectGroup"),sH=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,...r}=e,o=sU("SelectLabel",n);return(0,x.jsx)(t3.div,{id:o.id,...r,ref:t})},"SelectLabel")),sB="SelectItem",[sV,sK]=sf(sB),sq=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...i}=e,l=sg(sB,n),s=sA(sB,n),c=l.value===r,[u,d]=w.useState(a??""),[f,p]=w.useState(!1),h=td(t,t6(e=>s.itemRefCallback?.(e,r,o))),m=tV(),g=w.useRef("touch"),v=sa(()=>{o||(l.onValueChange(r),l.onOpenChange(!1))},"handleSelect");return(0,x.jsx)(sV,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:w.useCallback(e=>{d(t=>t||(e?.textContent??"").trim())},[]),children:(0,x.jsx)(sc.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:(0,x.jsx)(t3.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:h,onFocus:tT(i.onFocus,()=>p(!0)),onBlur:tT(i.onBlur,()=>p(!1)),onClick:tT(i.onClick,()=>{"mouse"!==g.current&&v()}),onPointerUp:tT(i.onPointerUp,()=>{"mouse"===g.current&&v()}),onPointerDown:tT(i.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:tT(i.onPointerMove,e=>{g.current=e.pointerType,o?s.onItemLeave?.():"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:tT(i.onPointerLeave,e=>{e.currentTarget===document.activeElement&&s.onItemLeave?.()}),onKeyDown:tT(i.onKeyDown,e=>{o||e.target!==e.currentTarget||(s.searchRef?.current===""||" "!==e.key)&&(sl.includes(e.key)&&v()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),sW="SelectItemText",sG=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,className:r,style:o,...a}=e,i=sg(sW,n),l=sA(sW,n),s=sK(sW,n),c=sy(sW,n),[u,d]=w.useState(null),f=t6(e=>l.itemTextRefCallback?.(e,s.value,s.disabled)),p=td(t,d,s.onItemTextChange,f),h=u?.textContent,m=w.useMemo(()=>(0,x.jsx)("option",{value:s.value,disabled:s.disabled,children:h},s.value),[s.disabled,s.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=c;return t$(()=>(g(m),()=>v(m)),[g,v,m]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(t3.span,{id:s.textId,...a,ref:p}),s.isSelected&&i.valueNode&&!i.valueNodeHasChildren&&!s3(i.value)?t2.createPortal(a.children,i.valueNode):null]})},"SelectItemText")),sZ=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,...r}=e;return sK("SelectItemIndicator",n).isSelected?(0,x.jsx)(t3.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),sY="SelectScrollUpButton",sX=w.forwardRef(sa(function(e,t){let n=sA(sY,e.__scopeSelect),r=sD(sY,e.__scopeSelect),[o,a]=w.useState(!1),i=td(t,r.onScrollButtonChange);return t$(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)};sa(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?(0,x.jsx)(s0,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null},"SelectScrollUpButton")),sJ="SelectScrollDownButton",sQ=w.forwardRef(sa(function(e,t){let n=sA(sJ,e.__scopeSelect),r=sD(sJ,e.__scopeSelect),[o,a]=w.useState(!1),i=td(t,r.onScrollButtonChange);return t$(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)};sa(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?(0,x.jsx)(s0,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null},"SelectScrollDownButton")),s0=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...o}=e,a=sA("SelectScrollButton",n),i=w.useRef(null),l=su(n),s=w.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return w.useEffect(()=>()=>s(),[s]),t$(()=>{let e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),(0,x.jsx)(t3.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:tT(o.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(r,50))}),onPointerMove:tT(o.onPointerMove,()=>{a.onItemLeave?.(),null===i.current&&(i.current=window.setInterval(r,50))}),onPointerLeave:tT(o.onPointerLeave,()=>{s()})})},"SelectScrollButtonImpl")),s1=w.forwardRef(sa(function(e,t){let{__scopeSelect:n,...r}=e;return(0,x.jsx)(t3.div,{"aria-hidden":!0,...r,ref:t})},"SelectSeparator")),s2=w.forwardRef(sa(function({__scopeSelect:e,...t},n){let r=sg("SelectBubbleInput",e),{value:o,onValueChange:a,required:i,disabled:l,name:s,autoComplete:c,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=w.useRef(null),h=td(n,p),m=o??"",g=se(m),v=Array.from(d).some(e=>(e.props.value??"")==="");return w.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(g!==m&&t){let n=new Event("change",{bubbles:!0});t.call(e,m),e.dispatchEvent(n)}},[g,m]),(0,x.jsxs)(t3.select,{"aria-hidden":!0,required:i,tabIndex:-1,name:s,autoComplete:c,disabled:l,form:u,onChange:e=>a(e.target.value),...t,style:{...sn,...t.style},ref:h,defaultValue:m,children:[s3(o)&&!v?(0,x.jsx)("option",{value:""}):null,Array.from(d)]},f)},"SelectBubbleInput"));function s4(e){return"function"==typeof e}function s3(e){return""===e||void 0===e}function s5(e){let t=t6(e),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(e=>{t(n.current+e)},[t]),a=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function s6(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,a=s8(e,Math.max(o,0));1===r.length&&(a=a.filter(e=>e!==n));let i=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return i!==n?i:void 0}function s8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}sa(s4,"isFunction"),sa(s3,"shouldShowPlaceholder"),sa(s5,"useTypeaheadSearch"),sa(s6,"findNextItem"),sa(s8,"wrapArray");let s9=_("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function s7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ce(e){if(Array.isArray(e))return e}function ct(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function cr(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function co(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}function ca(e,t){return ce(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||cl(e,t)||ct()}function ci(e){return ce(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||cl(e)||ct()}function cl(e,t){if(e){if("string"==typeof e)return s7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s7(e,t)}}var cs=w.forwardRef(function(e,t){var n=ci([e,t]),r=n[0],o=n.slice(1),a=r.className,i=r.children,l=co(r,["className","children"]),s=ca(o,1)[0];return(0,x.jsxs)(sw,cr(cn({ref:s,"data-slot":"select-trigger",className:e4("flex h-10 w-full cursor-pointer items-center justify-between gap-2 rounded-[10px] border border-input bg-card px-3 py-2 text-sm text-foreground shadow-[0_1px_2px_rgb(20_24_40/0.04)] outline-none transition-[border-color,box-shadow,background-color] hover:border-ring/35 focus-visible:border-ring/50 focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:pointer-events-none disabled:opacity-50 data-[placeholder]:text-muted-foreground [&>span]:truncate",a)},l),{children:[i,(0,x.jsx)(sj,{asChild:!0,children:(0,x.jsx)(L,{className:"size-4 shrink-0 text-muted-foreground"})})]}))});cs.displayName=sw.displayName;var cc=w.forwardRef(function(e,t){var n=ci([e,t]),r=n[0],o=n.slice(1),a=r.className,i=co(r,["className"]),l=ca(o,1)[0];return(0,x.jsx)(sX,cr(cn({ref:l,className:e4("flex cursor-default items-center justify-center py-1",a)},i),{children:(0,x.jsx)(s9,{className:"size-4"})}))});cc.displayName=sX.displayName;var cu=w.forwardRef(function(e,t){var n=ci([e,t]),r=n[0],o=n.slice(1),a=r.className,i=co(r,["className"]),l=ca(o,1)[0];return(0,x.jsx)(sQ,cr(cn({ref:l,className:e4("flex cursor-default items-center justify-center py-1",a)},i),{children:(0,x.jsx)(L,{className:"size-4"})}))});cu.displayName=sQ.displayName;var cd=w.forwardRef(function(e,t){var n=ci([e,t]),r=n[0],o=n.slice(1),a=r.className,i=r.children,l=r.position,s=void 0===l?"popper":l,c=r.sideOffset,u=co(r,["className","children","position","sideOffset"]),d=ca(o,1)[0];return(0,x.jsx)(sC,{children:(0,x.jsxs)(sP,cr(cn({ref:d,"data-slot":"select-content",position:s,sideOffset:void 0===c?6:c,className:e4("relative z-50 max-h-[min(20rem,var(--radix-select-content-available-height))] min-w-[8rem] overflow-hidden rounded-xl border border-border/80 bg-popover text-popover-foreground shadow-[0_18px_50px_rgb(22_27_45/0.14)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","popper"===s&&"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a)},u),{children:[(0,x.jsx)(cc,{}),(0,x.jsx)(sF,{className:e4("p-1.5","popper"===s&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),(0,x.jsx)(cu,{})]}))})});cd.displayName=sP.displayName,w.forwardRef(function(e,t){var n=ci([e,t]),r=n[0],o=n.slice(1),a=r.className,i=co(r,["className"]),l=ca(o,1)[0];return(0,x.jsx)(sH,cn({ref:l,className:e4("px-2 py-1.5 text-xs font-semibold text-muted-foreground",a)},i))}).displayName=sH.displayName;var cf=w.forwardRef(function(e,t){var n=ci([e,t]),r=n[0],o=n.slice(1),a=r.className,i=r.children,l=co(r,["className","children"]),s=ca(o,1)[0];return(0,x.jsxs)(sq,cr(cn({ref:s,"data-slot":"select-item",className:e4("relative flex w-full cursor-pointer select-none items-center rounded-lg py-2 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a)},l),{children:[(0,x.jsx)(sG,{children:i}),(0,x.jsx)("span",{className:"absolute right-2 flex size-4 items-center justify-center text-primary",children:(0,x.jsx)(sZ,{children:(0,x.jsx)(iw,{className:"size-4",strokeWidth:2.5})})})]}))});function cp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ch(e,t){if(e){if("string"==typeof e)return cp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cp(e,t)}}function cm(e){var t,n=e.preview,r=e.conflictPolicy,o=e.restoreActive,a=e.stale,i=e.pending,l=e.canImport,s=e.onPolicyChange,c=e.onRestoreActiveChange,u=e.onConfirm,d=e.meta,f=e.idPrefix,p=(0,S.Bd)().t,h=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||ch(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),m=h[0],g=h[1],v=a?null:function(e,t){switch(t){case"openai-api-key":return e("transfer.authEffect.openai-api-key");case"auth-override":return e("transfer.authEffect.auth-override");case"official-cleanup":return e("transfer.authEffect.official-cleanup");case"none":return null}}(p,n.codexActivationAuthEffect);return(0,x.jsxs)("div",{className:"space-y-4 rounded-xl border bg-card p-4",children:[d?(0,x.jsx)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b pb-3 text-xs text-muted-foreground",children:d}):null,(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)(e5,{children:p("transfer.profileCount",{count:n.profileCount})}),n.favoriteCount?(0,x.jsx)(e5,{children:p("favorites.importCount",{count:n.favoriteCount})}):null,(0,x.jsx)(e5,{variant:"secondary",children:p("transfer.providerCount",{count:n.providerCount})}),(0,x.jsx)(e5,{variant:n.conflicts.length>0?"outline":"secondary",children:p("transfer.conflictCount",{count:n.conflicts.length})}),(0,x.jsx)(e5,{variant:"secondary",children:p("transfer.activeCount",{count:n.activeCount})})]}),(0,x.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:n.harnesses.map(function(e){return(0,x.jsx)("span",{children:p("transfer.harnessProfiles",{harness:O.RP[e.harness],count:e.profiles})},e.harness)})}),n.conflicts.length>0?(0,x.jsxs)("div",{className:"space-y-1 rounded-xl bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:[(0,x.jsx)("p",{children:p("transfer.conflictList",{items:n.conflicts.map(function(e){return"".concat(O.RP[e.harness]," / ").concat(e.name)}).join(p("common.listSeparator"))})}),(0,x.jsx)("p",{children:p("transfer.currentPolicy",{policy:"skip"===r?p("transfer.policySkip"):p("transfer.policyOverwrite")})})]}):null,v?(0,x.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:v}):null,a?(0,x.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:p("transfer.previewStale")}):null,(0,x.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iO,{htmlFor:"".concat(f,"-conflict-policy"),children:p("transfer.conflictPolicy")}),(0,x.jsxs)(sx,{value:r,onValueChange:function(e){return s(e)},children:[(0,x.jsx)(cs,{id:"".concat(f,"-conflict-policy"),children:(0,x.jsx)(sk,{})}),(0,x.jsxs)(cd,{children:[(0,x.jsx)(cf,{value:"skip",children:p("transfer.policySkip")}),(0,x.jsx)(cf,{value:"overwrite",children:p("transfer.policyOverwrite")})]})]})]}),(0,x.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl border px-3 py-2 text-sm",children:[(0,x.jsx)(ik,{checked:o,onCheckedChange:function(e){return c(!0===e)}}),p("transfer.restoreActive")]})]}),(0,x.jsxs)(tE,{type:"button",disabled:!l,onClick:function(){return g(!0)},children:[(0,x.jsx)(a$,{}),a?p("transfer.recheckNeeded"):i?p("transfer.importing"):p("transfer.confirmImport")]}),(0,x.jsx)(aW,{open:m,onOpenChange:g,children:(0,x.jsxs)(a6,{children:[(0,x.jsxs)(a8,{children:[(0,x.jsx)(a7,{children:v?p("transfer.confirmAuthTitle"):p("transfer.confirmTitle")}),(0,x.jsxs)(ie,{children:[p("transfer.confirmBody",{count:n.profileCount}),"overwrite"===r&&n.conflicts.length>0?p("transfer.confirmOverwrite",{count:n.conflicts.length}):p("transfer.confirmKeep"),v?" ".concat(v):null]})]}),(0,x.jsxs)(a9,{children:[(0,x.jsx)(ir,{children:p("common.cancel")}),(0,x.jsx)(it,{onClick:function(){g(!1),u()},children:v?p("transfer.proceedAware"):"overwrite"===r?p("transfer.proceedOverwrite"):p("transfer.proceedSafe")})]})]})})]})}function cg(e,t){var n,r=[e("transfer.importedCount",{count:t.imported})];return t.overwritten>0&&r.push(e("transfer.overwrittenCount",{count:t.overwritten})),t.providersCopied>0&&r.push(e("transfer.providersCopiedCount",{count:t.providersCopied})),t.skipped>0&&r.push(e("transfer.skippedCount",{count:t.skipped})),t.activeRestored>0&&r.push(e("transfer.activeRestoredCount",{count:t.activeRestored})),r.push(e(t.codexLoginCacheMigrated?"transfer.cacheMigrated":"transfer.cacheNotMigrated")),[{key:"transfer.importedSummary",params:{parts:r.join(e("common.listSeparator"))}}].concat(function(e){if(Array.isArray(e))return cp(e)}(n=t.warnings.map(function(e){return oO(e)}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||ch(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}function cv(e){var t=e.className,n=e.type,r=function(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}(e,["className","type"]);return(0,x.jsx)("input",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({type:n,"data-slot":"input",className:e4("flex h-10 w-full rounded-[10px] border border-input bg-card px-3 py-1 text-base shadow-[0_1px_2px_rgb(20_24_40/0.04)] transition-[border-color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t)},r))}function cy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cb(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function cx(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){cb(a,r,o,i,l,"next",e)}function l(e){cb(a,r,o,i,l,"throw",e)}i(void 0)})}}function cw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cy(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ck(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function cj(e){var t=e.fetchPreview,n=e.runImport,r=e.onImported,o=cw((0,w.useState)(null),2),a=o[0],i=o[1],l=cw((0,w.useState)(!1),2),s=l[0],c=l[1],u=cw((0,w.useState)("skip"),2),d=u[0],f=u[1],p=cw((0,w.useState)(!0),2),h=p[0],m=p[1],g=cw((0,w.useState)(null),2),v=g[0],y=g[1],b=cw((0,w.useState)(null),2),x=b[0],k=b[1],j=(0,w.useCallback)(function(){i(null),c(!1)},[]),S=(0,w.useCallback)(function(){j(),k(null),y(null)},[j]),O=(0,w.useCallback)(function(){return cx(function(){var e;return ck(this,function(n){switch(n.label){case 0:y("preview"),k(null),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,t({conflictPolicy:d,restoreActive:h})];case 2:return i(n.sent()),c(!1),[3,5];case 3:return e=n.sent(),i(null),k(oC(e)),[3,5];case 4:return y(null),[7];case 5:return[2]}})})()},[t,d,h]),C=(0,w.useCallback)(function(){return cx(function(){var e;return ck(this,function(t){switch(t.label){case 0:if(!a||s)return[2];y("import"),k(null),t.label=1;case 1:return t.trys.push([1,4,5,6]),[4,n({conflictPolicy:d,restoreActive:h})];case 2:return e=t.sent(),j(),[4,r(e)];case 3:return t.sent(),[3,6];case 4:return k(oC(t.sent())),[3,6];case 5:return y(null),[7];case 6:return[2]}})})()},[a,s,n,d,h,j,r]),N=(null==a?void 0:a.conflictPolicy)===d&&(null==a?void 0:a.restoreActive)===h;return{preview:a,conflictPolicy:d,restoreActive:h,pending:v,error:x,setError:k,stale:s||null!==a&&!N,canImport:null!==a&&N&&!s&&null===v,inspect:O,confirm:C,invalidate:j,reset:S,changePolicy:(0,w.useCallback)(function(e){f(e),c(!0)},[]),changeRestoreActive:(0,w.useCallback)(function(e){m(e),c(!0)},[])}}function cS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cO(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function cC(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){cO(a,r,o,i,l,"next",e)}function l(e){cO(a,r,o,i,l,"throw",e)}i(void 0)})}}function cN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function cP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cS(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cE(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function c_(e){var t=e.onDone,n=(0,S.Bd)().t,r=aA(function(e){return e.loadHarnesses}),o=aA(function(e){return e.setNotice}),a=(0,w.useRef)(null),i=cP((0,w.useState)("import"),2),l=i[0],s=i[1],c=cP((0,w.useState)(""),2),u=c[0],d=c[1],f=cP((0,w.useState)(""),2),p=f[0],h=f[1],m=cP((0,w.useState)(!1),2),g=m[0],v=m[1],y=cP((0,w.useState)(!1),2),b=y[0],k=y[1],j=cP((0,w.useState)(null),2),O=j[0],C=j[1],N=cP((0,w.useState)(null),2),P=N[0],E=N[1],_=cP((0,w.useState)(null),2),A=_[0],I=_[1],T=cP((0,w.useState)(""),2),R=T[0],M=T[1],z=cP((0,w.useState)(""),2),D=z[0],L=z[1],F=cP((0,w.useState)(null),2),$=F[0],U=F[1],H=cj({fetchPreview:function(e){return om("/api/transfer/preview",{method:"POST",body:JSON.stringify(cN({envelope:A,passphrase:D},e))})},runImport:function(e){var t,n;return om("/api/transfer/import",{method:"POST",body:JSON.stringify((t=cN({envelope:A,passphrase:D},e),n=n={migrateCodexLoginCache:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))})},onImported:function(e){return cC(function(){return cE(this,function(a){switch(a.label){case 0:return[4,r()];case 1:return a.sent(),o(cg(n,e)),t(),[2]}})})()}}),B=u.length>=8&&u===p&&!g,V=null!==A&&D.length>=8&&null===H.pending,K="export"===l?O:null!=$?$:H.error;return(0,x.jsxs)("div",{className:"space-y-5",children:[(0,x.jsx)("div",{className:"grid grid-cols-2 rounded-lg bg-muted p-1",children:["import","export"].map(function(e){return(0,x.jsxs)("button",{type:"button","aria-pressed":l===e,className:l===e?"flex items-center justify-center gap-2 rounded-md bg-background py-1.5 text-sm font-medium text-foreground shadow-sm":"flex cursor-pointer items-center justify-center gap-2 rounded-md py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground",onClick:function(){return s(e)},children:["import"===e?(0,x.jsx)(a$,{className:"size-4"}):(0,x.jsx)(aU,{className:"size-4"}),"import"===e?n("transfer.importTitle"):n("transfer.exportTitle")]},e)})}),"export"===l?(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:n("transfer.exportIntro")}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("favorites.exportVersion")}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(ik,{id:"legacy-export",checked:b,onCheckedChange:function(e){return k(!0===e)}}),(0,x.jsx)(iO,{htmlFor:"legacy-export",children:n("favorites.legacyExport")})]}),(0,x.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iO,{htmlFor:"export-passphrase",children:n("transfer.passphrase")}),(0,x.jsx)(cv,{id:"export-passphrase",type:"password",autoComplete:"new-password",value:u,onChange:function(e){return d(e.target.value)},placeholder:n("transfer.passphrasePlaceholder",{min:8})})]}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iO,{htmlFor:"export-passphrase-confirm",children:n("transfer.passphraseConfirm")}),(0,x.jsx)(cv,{id:"export-passphrase-confirm",type:"password",autoComplete:"new-password",value:p,onChange:function(e){return h(e.target.value)},placeholder:n("transfer.passphraseConfirmPlaceholder")})]})]}),p&&u!==p?(0,x.jsx)("p",{className:"text-xs text-destructive",children:n("transfer.passphraseMismatch")}):null,(0,x.jsxs)(tE,{type:"button",onClick:function(){cC(function(){return cE(this,function(e){switch(e.label){case 0:v(!0),C(null),E(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,om("/api/transfer/export",{method:"POST",body:JSON.stringify(cN({passphrase:u,includeCodexLoginCache:!0},b?{legacy:!0}:{}))})];case 2:var t,r,o,a,i;return t=e.sent(),r=new Date().toISOString().slice(0,10),o=new Blob(["".concat(JSON.stringify(t,null,2),"\n")],{type:"application/json"}),a=URL.createObjectURL(o),(i=document.createElement("a")).href=a,i.download="harness-switch-".concat(r,".hsw-backup"),i.click(),URL.revokeObjectURL(a),E(n("transfer.exported")),[3,5];case 3:return C(oC(e.sent())),[3,5];case 4:return v(!1),[7];case 5:return[2]}})})()},disabled:!B,children:[(0,x.jsx)(aU,{}),g?n("transfer.encrypting"):n("transfer.download")]})]}):(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:n("transfer.importIntro")}),(0,x.jsx)("input",{ref:a,type:"file",accept:".hsw-backup,application/json",className:"sr-only",onChange:function(e){var t,n;n=null==(t=e.target.files)?void 0:t[0],cC(function(){var e,t,r;return cE(this,function(o){switch(o.label){case 0:if(H.reset(),U(null),E(null),!n)return I(null),M(""),[2];o.label=1;case 1:return o.trys.push([1,3,,4]),t=JSON.parse,[4,n.text()];case 2:if("harness-switch-encrypted-export"!==(e=t.apply(JSON,[o.sent()])).format||1!==e.version)return U({key:"transfer.notAnExport"}),I(null),M(""),[2];return I(e),M(n.name),[3,4];case 3:return r=o.sent(),I(null),M(""),U(oC(r)),[3,4];case 4:return[2]}})})()}}),(0,x.jsxs)("button",{type:"button",className:"flex w-full cursor-pointer items-center gap-3 rounded-xl border border-dashed bg-muted/20 px-4 py-4 text-left transition-colors hover:border-primary/40 hover:bg-primary/5",onClick:function(){var e;return null==(e=a.current)?void 0:e.click()},children:[(0,x.jsx)(aL,{className:"size-5 text-primary"}),(0,x.jsxs)("span",{className:"min-w-0",children:[(0,x.jsx)("span",{className:"block truncate text-sm font-medium",children:R||n("transfer.pickFile")}),(0,x.jsx)("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:n("transfer.pickFileHint")})]})]}),(0,x.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[(0,x.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,x.jsx)(iO,{htmlFor:"import-passphrase",children:n("transfer.passphrase")}),(0,x.jsx)(cv,{id:"import-passphrase",type:"password",value:D,onChange:function(e){L(e.target.value),H.invalidate()},placeholder:n("transfer.importPassphrasePlaceholder")})]}),(0,x.jsx)(tE,{type:"button",variant:"outline",disabled:!V,onClick:function(){H.inspect()},children:"preview"===H.pending?n("transfer.inspecting"):n("transfer.inspect")})]}),H.preview?(0,x.jsx)(cm,{idPrefix:"file",preview:H.preview,conflictPolicy:H.conflictPolicy,restoreActive:H.restoreActive,stale:H.stale,pending:"import"===H.pending,canImport:H.canImport,onPolicyChange:H.changePolicy,onRestoreActiveChange:H.changeRestoreActive,onConfirm:function(){H.confirm()}}):null]}),P?(0,x.jsx)("p",{className:"text-sm text-emerald-600 dark:text-emerald-400",children:P}):null,K?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(n,K)}):null]})}cf.displayName=sq.displayName,w.forwardRef(function(e,t){var n=ci([e,t]),r=n[0],o=n.slice(1),a=r.className,i=co(r,["className"]),l=ca(o,1)[0];return(0,x.jsx)(s1,cn({ref:l,className:e4("-mx-1 my-1 h-px bg-border",a)},i))}).displayName=s1.displayName;let cA=_("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),cI=_("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),cT=_("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),cR=_("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),cM=_("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);function cz(e){var t=e.status,n=e.refreshing,r=e.onRefresh,o=e.onDisconnect,a=(0,S.Bd)().t,i=(0,S.s9)().locale;return(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 rounded-xl border bg-muted/40 p-4",children:[(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[t.avatarUrl?(0,x.jsx)("img",{src:t.avatarUrl,alt:t.username,className:"size-10 rounded-full border"}):(0,x.jsx)(cI,{className:"size-10 text-muted-foreground"}),(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("span",{className:"font-semibold",children:t.username}),(0,x.jsxs)(e5,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:[(0,x.jsx)(cT,{className:"mr-1 size-3"}),a("githubSync.connectedBadge")]})]}),(0,x.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a("githubSync.lastSynced")," ",t.lastSyncedAt?new Date(t.lastSyncedAt).toLocaleString(i):a("githubSync.neverSynced")]}),t.gistId?(0,x.jsxs)("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,x.jsx)("span",{children:a("githubSync.cloudGist")}),(0,x.jsxs)("a",{href:"https://gist.github.com/".concat(t.username?"".concat(t.username,"/"):"").concat(t.gistId),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 font-mono text-primary hover:underline",children:[t.gistId.slice(0,8),"…",(0,x.jsx)(cR,{className:"size-3"})]})]}):null]})]}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(tE,{variant:"outline",size:"sm",onClick:r,disabled:n,"aria-label":a("githubSync.refreshStatus"),children:(0,x.jsx)(cM,{className:e4("size-4",n&&"animate-spin")})}),(0,x.jsxs)(tE,{variant:"outline",size:"sm",className:"text-destructive hover:border-destructive/30 hover:bg-destructive/10 hover:text-destructive",onClick:o,children:[(0,x.jsx)(U,{className:"mr-1.5 size-4"}),a("githubSync.disconnect")]})]})]})}let cD=_("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),cL=_("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);function cF(e,t){return"".concat(e,"-tab-").concat(t)}function c$(e,t){return"".concat(e,"-panel-").concat(t)}function cU(e){var t=e.label,n=e.idPrefix,r=e.items,o=e.value,a=e.onChange,i=e.orientation,l=e.className,s=e.tabClassName,c=e.children;return(0,x.jsx)("div",{role:"tablist","aria-label":t,"aria-orientation":void 0===i?"horizontal":i,className:l,children:r.map(function(e,t){var i=e.id===o;return(0,x.jsx)("button",{type:"button",role:"tab",id:cF(n,e.id),"aria-controls":c$(n,e.id),"aria-selected":i,tabIndex:i?0:-1,onClick:function(){return a(e.id)},onKeyDown:function(e){return function(e,t){var n,o,i=function(e,t,n){if("Home"===e)return 0;if("End"===e)return n-1;var r="ArrowRight"===e||"ArrowDown"===e;return r||"ArrowLeft"===e||"ArrowUp"===e?(t+(r?1:-1)+n)%n:null}(e.key,t,r.length);if(null!==i){e.preventDefault();var l=r[i];if(l){a(l.id);var s=null==(n=e.currentTarget.parentElement)?void 0:n.querySelectorAll('[role="tab"]');null==s||null==(o=s[i])||o.focus()}}}(e,t)},className:e4("flex shrink-0 cursor-pointer items-center rounded-xl text-left transition-[color,background-color,box-shadow,transform] duration-150 active:translate-y-px",i?"bg-primary/[0.09] text-primary shadow-[inset_0_0_0_1px_rgb(99_91_255/0.13)]":"text-muted-foreground hover:bg-card hover:text-foreground",s),children:c(e,i)},e.id)})})}function cH(e){var t,n=e.options,r=e.value,o=e.onChange,a=e.className,i=e.children;return(0,x.jsx)("div",{className:e4("grid rounded-lg bg-muted p-1",a),style:(t=n.length,{gridTemplateColumns:"repeat(".concat(t,", minmax(0, 1fr))")}),children:n.map(function(e){return(0,x.jsx)("button",{type:"button","aria-pressed":e===r,onClick:function(){return o(e)},className:e4("flex items-center justify-center gap-2 rounded-md py-1.5 text-sm font-medium transition-colors",e===r?"bg-background text-foreground shadow-sm":"cursor-pointer text-muted-foreground hover:text-foreground"),children:i(e)},e)})})}function cB(e){var t=e.idPrefix,n=e.value,r=e.as,o=e.className,a=e.children;return(0,x.jsx)(void 0===r?"div":r,{role:"tabpanel",id:c$(t,n),"aria-labelledby":cF(t,n),className:o,children:a})}function cV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cK(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function cq(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){cK(a,r,o,i,l,"next",e)}function l(e){cK(a,r,o,i,l,"throw",e)}i(void 0)})}}function cW(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cV(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cV(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cG(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function cZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cY(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function cX(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cZ(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var cJ=["device","token"];function cQ(e){var t=e.onConnected,n=e.onMessage,r=e.onError,o=e.onClear,a=(0,S.Bd)().t,i=cX((0,w.useState)("device"),2),l=i[0],s=i[1],c=cX((0,w.useState)(""),2),u=c[0],d=c[1],f=cX((0,w.useState)(!1),2),p=f[0],h=f[1],m=function(e){var t=cW((0,w.useState)(null),2),n=t[0],r=t[1],o=cW((0,w.useState)(!1),2),a=o[0],i=o[1],l=cW((0,w.useState)(!1),2),s=l[0],c=l[1],u=cW((0,w.useState)(!1),2),d=u[0],f=u[1],p=cW((0,w.useState)(5),2),h=p[0],m=p[1],g=(0,w.useRef)(null),v=(0,w.useRef)(e);function y(){g.current&&(clearInterval(g.current),g.current=null),c(!1)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;g.current&&clearInterval(g.current),c(!0),m(t),g.current=setInterval(function(){x(e,!1)},1e3*Math.max(t,5))}function x(e,t){return cq(function(){var n;return cG(this,function(o){switch(o.label){case 0:t&&(f(!0),v.current.onStarted()),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,om("/api/github/device/poll",{method:"POST",body:JSON.stringify({deviceCode:e})})];case 2:return function(e,t){if("authorized"===e.status){var n;y(),r(null),v.current.onAuthorized(null!=(n=e.username)?n:"");return}if("expired"===e.status||"error"===e.status){y();var o="expired"===e.status?"githubSync.codeExpired":"githubSync.authFailed";v.current.onError(e.error?oC(e.error):{key:o});return}e.interval&&e.interval>5&&b(t,e.interval)}(o.sent(),e),[3,5];case 3:return n=o.sent(),t&&v.current.onError(oC(n)),[3,5];case 4:return t&&f(!1),[7];case 5:return[2]}})})()}return v.current=e,(0,w.useEffect)(function(){return function(){return y()}},[]),{code:n,requesting:a,polling:s,checking:d,intervalSeconds:h,requestCode:function(){return cq(function(){var e,t;return cG(this,function(n){switch(n.label){case 0:i(!0),v.current.onStarted(),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,om("/api/github/device/code",{method:"POST",body:JSON.stringify({})})];case 2:return r(e=n.sent()),b(e.deviceCode,e.interval),[3,5];case 3:return t=n.sent(),v.current.onError(oC(t)),[3,5];case 4:return i(!1),[7];case 5:return[2]}})})()},checkNow:function(){return cq(function(){return cG(this,function(e){switch(e.label){case 0:if(!(null==n?void 0:n.deviceCode))return[3,2];return[4,x(n.deviceCode,!0)];case 1:e.sent(),e.label=2;case 2:return[2]}})})()}}}({onStarted:o,onError:r,onAuthorized:function(e){return n({key:"githubSync.authorized",params:{user:e}})}});return(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:a("githubSync.intro")}),(0,x.jsx)(cH,{options:cJ,value:l,onChange:s,children:function(e){return"device"===e?a("githubSync.tabDevice"):a("githubSync.tabToken")}}),"device"===l?(0,x.jsx)(c0,{device:m}):(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iO,{htmlFor:"github-pat",children:a("githubSync.tokenLabel")}),(0,x.jsxs)("div",{className:"relative",children:[(0,x.jsx)(cD,{className:"absolute left-3 top-2.5 size-4 text-muted-foreground"}),(0,x.jsx)(cv,{id:"github-pat",type:"password",className:"pl-9",placeholder:a("githubSync.tokenPlaceholder"),value:u,onChange:function(e){return d(e.target.value)}})]}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:a("githubSync.tokenScopeHint")})]}),(0,x.jsxs)(tE,{disabled:!u.trim()||p,onClick:function(){var e;(e=function(){var e,a;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:if(!u.trim())return[2];h(!0),o(),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,om("/api/github/token",{method:"POST",body:JSON.stringify({token:u.trim()})})];case 2:return t(a=i.sent()),d(""),n({key:"githubSync.connected",params:{user:null!=(e=a.username)?e:""}}),[3,5];case 3:return r(oC(i.sent())),[3,5];case 4:return h(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){cY(a,r,o,i,l,"next",e)}function l(e){cY(a,r,o,i,l,"throw",e)}i(void 0)})})()},children:[(0,x.jsx)(cI,{className:"mr-2 size-4"}),p?a("githubSync.connecting"):a("githubSync.connectToken")]})]})]})}function c0(e){var t=e.device,n=(0,S.Bd)().t,r=cX((0,w.useState)(!1),2),o=r[0],a=r[1];function i(){var e;(null==(e=t.code)?void 0:e.userCode)&&(navigator.clipboard.writeText(t.code.userCode),a(!0),setTimeout(function(){return a(!1)},2e3))}return t.code?(0,x.jsxs)("div",{className:"space-y-5 rounded-2xl border bg-muted/20 p-5",children:[(0,x.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-2",children:[(0,x.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:n("githubSync.userCode")}),(0,x.jsxs)("button",{type:"button",onClick:i,className:"group inline-flex cursor-pointer items-center gap-3 rounded-xl border border-primary/20 bg-background/90 px-5 py-2.5 font-mono text-3xl font-extrabold tracking-widest text-primary transition-colors hover:border-primary/50 hover:bg-primary/5",title:n("githubSync.copyCode"),children:[(0,x.jsx)("span",{children:t.code.userCode}),(0,x.jsx)("span",{className:"rounded-md bg-primary/10 p-1 text-primary transition-colors group-hover:bg-primary/20",children:o?(0,x.jsx)(iw,{className:"size-4 text-emerald-600 dark:text-emerald-400"}):(0,x.jsx)(cL,{className:"size-4"})})]}),o?(0,x.jsx)("p",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:n("githubSync.copied")}):null]}),(0,x.jsxs)("div",{className:"flex flex-col items-center space-y-3",children:[(0,x.jsx)(tE,{className:"px-6 font-semibold",asChild:!0,children:(0,x.jsxs)("a",{href:t.code.verificationUri,target:"_blank",rel:"noopener noreferrer",onClick:i,children:[(0,x.jsx)(cR,{className:"mr-1.5 size-4"}),n("githubSync.openAuthPage")]})}),(0,x.jsxs)("div",{className:"flex w-full items-center justify-between rounded-xl border border-border/40 bg-background/50 px-3 py-2 text-xs text-muted-foreground",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(cM,{className:e4("size-3.5 text-primary",(t.polling||t.checking)&&"animate-spin")}),(0,x.jsx)("span",{children:t.checking?n("githubSync.checkingAuth"):t.polling&&t.intervalSeconds>5?n("githubSync.waitingAuthInterval",{seconds:t.intervalSeconds}):n("githubSync.waitingAuth")})]}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("button",{type:"button",className:"cursor-pointer font-medium text-primary hover:underline disabled:opacity-50",disabled:t.checking,onClick:function(){t.checkNow()},children:n("githubSync.checkNow")}),(0,x.jsx)("span",{children:"\xb7"}),(0,x.jsx)("button",{type:"button",className:"cursor-pointer text-muted-foreground hover:text-foreground",onClick:function(){t.requestCode()},children:n("githubSync.regenerateCode")})]})]})]})]}):(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("githubSync.deviceIntro")}),(0,x.jsx)("div",{className:"flex justify-center",children:(0,x.jsxs)(tE,{className:"px-6",disabled:t.requesting,onClick:function(){t.requestCode()},children:[(0,x.jsx)(cI,{className:"mr-2 size-4"}),n(t.requesting?"githubSync.checkingAuth":"githubSync.getCode")]})})]})}let c1=_("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]),c2=_("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);function c4(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c3(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function c5(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){c3(a,r,o,i,l,"next",e)}function l(e){c3(a,r,o,i,l,"throw",e)}i(void 0)})}}function c6(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function c8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c4(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c9(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var c7=["push","pull"];function ue(e){var t=e.onDone,n=e.onSynced,r=e.onMessage,o=e.onError,a=e.onClear,i=(0,S.Bd)().t,l=(0,S.s9)().locale,s=aA(function(e){return e.loadHarnesses}),c=aA(function(e){return e.setNotice}),u=c8((0,w.useState)("push"),2),d=u[0],f=u[1],p=c8((0,w.useState)(""),2),h=p[0],m=p[1],g=c8((0,w.useState)(!1),2),v=g[0],y=g[1],b=c8((0,w.useState)(""),2),k=b[0],j=b[1],O=c8((0,w.useState)(null),2),C=O[0],N=O[1],P=cj({fetchPreview:function(e){return c5(function(){var t;return c9(this,function(n){switch(n.label){case 0:return[4,om("/api/github/pull/preview",{method:"POST",body:JSON.stringify(c6({passphrase:k},e))})];case 1:return N((t=n.sent()).gistUpdatedAt),[2,t.preview]}})})()},runImport:function(e){var t,n;return om("/api/github/pull",{method:"POST",body:JSON.stringify((t=c6({passphrase:k},e),n=n={migrateCodexLoginCache:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))})},onImported:function(e){return c5(function(){return c9(this,function(n){switch(n.label){case 0:return[4,s()];case 1:return n.sent(),c(cg(i,e)),t(),[2]}})})()}});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(cH,{options:c7,value:d,onChange:f,children:function(e){return(0,x.jsxs)(x.Fragment,{children:["push"===e?(0,x.jsx)(c1,{className:"size-4"}):(0,x.jsx)(c2,{className:"size-4"}),"push"===e?i("githubSync.pushTitle"):i("githubSync.pullTitle")]})}}),"push"===d?(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:i("githubSync.pushIntro")}),(0,x.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[(0,x.jsx)(ut,{id:"push-passphrase",placeholder:i("githubSync.passphrasePlaceholder"),value:h,onChange:m}),(0,x.jsxs)(tE,{disabled:!h||v,onClick:function(){c5(function(){var e;return c9(this,function(t){switch(t.label){case 0:if(!h)return[2];y(!0),a(),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,om("/api/github/push",{method:"POST",body:JSON.stringify({passphrase:h,includeCodexLoginCache:!0})})];case 2:return r({key:"githubSync.pushSuccess",params:{profiles:(e=t.sent()).exportedProfilesCount,vault:e.exportedVaultCount}}),n(),[3,5];case 3:return o(oC(t.sent())),[3,5];case 4:return y(!1),[7];case 5:return[2]}})})()},children:[(0,x.jsx)(c1,{className:"mr-1.5 size-4"}),v?i("githubSync.pushing"):i("githubSync.pushTitle")]})]})]}):(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:i("githubSync.pullIntro")}),(0,x.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[(0,x.jsx)(ut,{id:"pull-passphrase",placeholder:i("githubSync.pullPassphrasePlaceholder"),value:k,onChange:function(e){j(e),P.invalidate()}}),(0,x.jsxs)(tE,{variant:"outline",disabled:!k||null!==P.pending,onClick:function(){P.inspect()},children:[(0,x.jsx)(cM,{className:e4("mr-1.5 size-4","preview"===P.pending&&"animate-spin")}),"preview"===P.pending?i("transfer.inspecting"):i("githubSync.inspect")]})]}),P.preview?(0,x.jsx)(cm,{idPrefix:"gist",preview:P.preview,conflictPolicy:P.conflictPolicy,restoreActive:P.restoreActive,stale:P.stale,pending:"import"===P.pending,canImport:P.canImport,onPolicyChange:P.changePolicy,onRestoreActiveChange:P.changeRestoreActive,onConfirm:function(){P.confirm()},meta:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{className:"font-medium text-foreground",children:i("githubSync.previewTitle")}),C?(0,x.jsx)("span",{children:i("githubSync.backedUpAt",{time:new Date(C).toLocaleString(l)})}):null]})}):null]})]})}function ut(e){var t=e.id,n=e.placeholder,r=e.value,o=e.onChange,a=(0,S.Bd)().t;return(0,x.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,x.jsx)(iO,{htmlFor:t,children:a("githubSync.passphrase")}),(0,x.jsxs)("div",{className:"relative",children:[(0,x.jsx)($,{className:"absolute left-3 top-2.5 size-4 text-muted-foreground"}),(0,x.jsx)(cv,{id:t,type:"password",className:"pl-9",placeholder:n,value:r,onChange:function(e){return o(e.target.value)}})]})]})}function un(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ur(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function uo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return un(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return un(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ua(e){var t=e.onDone,n=(0,S.Bd)().t,r=aA(function(e){return e.githubStatus}),o=aA(function(e){return e.githubStatusLoading}),a=aA(function(e){return e.githubStatusError}),i=aA(function(e){return e.loadGithubStatus}),l=aA(function(e){return e.setGithubStatus}),s=aA(function(e){return e.disconnectGithub}),c=uo((0,w.useState)(null),2),u=c[0],d=c[1],f=uo((0,w.useState)(null),2),p=f[0],h=f[1];function m(){d(null),h(null)}(0,w.useEffect)(function(){null===r&&i()},[r,i]);var g=null!=u?u:a,v=null===r&&null===a;return(0,x.jsxs)("div",{className:"space-y-5",children:[g?(0,x.jsx)("div",{className:"rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:oE(n,g)}):null,p?(0,x.jsx)("div",{className:"rounded-lg border border-emerald-500/40 bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400",children:oE(n,p)}):null,v?(0,x.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,x.jsx)(cA,{className:"size-4 animate-spin"}),n("githubSync.loading")]}):(null==r?void 0:r.connected)?(0,x.jsxs)("div",{className:"space-y-5",children:[(0,x.jsx)(cz,{status:r,refreshing:o,onRefresh:function(){i()},onDisconnect:function(){var e;(e=function(){return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:m(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s()];case 2:return e.sent(),h({key:"githubSync.disconnected"}),[3,4];case 3:return d(oC(e.sent())),[3,4];case 4:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){ur(a,r,o,i,l,"next",e)}function l(e){ur(a,r,o,i,l,"throw",e)}i(void 0)})})()}}),(0,x.jsx)(ue,{onDone:t,onSynced:function(){i()},onMessage:h,onError:d,onClear:m})]}):(0,x.jsx)(cQ,{onConnected:l,onMessage:function(e){h(e),i()},onError:d,onClear:m})]})}let ui=_("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);function ul(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function us(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function uc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){uc(e,t,n[t])})}return e}function ud(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ul(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ul(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uf(){var e=(0,S.Bd)().t,t=aA(function(e){return e.scan}),n=aA(function(e){return e.scanLoading}),r=aA(function(e){return e.scanError}),o=aA(function(e){return e.loadScan}),a=aA(function(e){return e.importScan}),i=aA(function(e){return e.providers}),l=aA(function(e){return e.loadProviders}),s=ud((0,w.useState)({}),2),c=s[0],u=s[1],d=ud((0,w.useState)(!1),2),f=d[0],p=d[1],h=ud((0,w.useState)(null),2),m=h[0],g=h[1],v=ud((0,w.useState)(null),2),y=v[0],b=v[1];(0,w.useEffect)(function(){o(),l()},[o,l]),(0,w.useEffect)(function(){t&&u(function(e){var n={},r=!0,o=!1,a=void 0;try{for(var i,l=t[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var s=i.value,c=!0,u=!1,d=void 0;try{for(var f,p=s.candidates[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var h,m,g=f.value;n[g.id]=null!=(h=e[g.id])?h:{selected:!1,name:g.suggestedName,target:g.matchesProvider?"vault":"profile",providerId:null!=(m=g.matchesProvider)?m:"",apiKey:"",overwrite:!1}}}catch(e){u=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(u)throw d}}}}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n})},[t]);var k=(null!=t?t:[]).flatMap(function(e){return e.candidates}).filter(function(e){var t;return null==(t=c[e.id])?void 0:t.selected}),j=k.filter(function(e){var t=c[e.id],n=!e.apiKeyPresent&&!t.apiKey.trim(),r="vault"===t.target&&""!==t.providerId;return!t.name.trim()||n&&!r});return(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:e("import.intro")}),n?(0,x.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,x.jsx)(cA,{className:"size-4 animate-spin"}),e("import.scanning")]}):null,r?(0,x.jsx)("p",{className:"py-6 text-sm text-destructive",children:oE(e,r)}):null,y?(0,x.jsxs)("div",{className:"rounded-xl border border-emerald-500/40 bg-emerald-500/5 px-4 py-3 text-sm",children:[(0,x.jsxs)("p",{className:"flex items-center gap-2 font-medium",children:[(0,x.jsx)(ui,{className:"size-4 text-emerald-600"}),e("import.summary",{imported:y.imported,skipped:y.skipped,providersCreated:y.providersCreated})]}),y.warnings.map(function(t){return(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:oE(e,t)},t.key+t.scope)})]}):null,(null!=t?t:[]).map(function(t){var n,r;return(0,x.jsxs)("section",{className:"rounded-2xl border bg-card px-4 py-3",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,x.jsx)("h3",{className:"text-sm font-semibold",children:t.label}),t.candidates.length>0?(0,x.jsx)(e5,{variant:"secondary",children:e("import.providerCount",{count:t.candidates.length})}):null]}),(0,x.jsx)("ul",{className:"mt-2 space-y-0.5",children:t.sources.map(function(t){return(0,x.jsxs)("li",{className:"truncate font-mono text-[11px] text-muted-foreground",children:[t.path," \xb7"," ",t.exists?t.parsable?e("import.sourceRead"):e("import.sourceUnparsable"):e("import.sourceMissing")]},t.key)})}),0===t.candidates.length?(0,x.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:(n=e,(r=t).noteCode?oE(n,{key:r.noteCode,params:r.noteData}):"")}):(0,x.jsx)("ul",{className:"mt-3 space-y-3",children:t.candidates.map(function(e){return(0,x.jsx)(up,{candidate:e,choice:c[e.id],providers:null!=i?i:[],onChange:function(t){var n;return n=e.id,void u(function(e){var r,o;return r=uu({},e),o=null!=(o=uc({},n,uu({},e[n],t)))?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r})}},e.id)})})]},t.harness)}),m?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(e,m)}):null,(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,x.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:k.length>0?e("import.selected",{count:k.length}):e("import.selectPrompt")}),(0,x.jsxs)(tE,{variant:"outline",onClick:function(){o()},disabled:n,children:[(0,x.jsx)(az,{}),e("import.rescan")]}),(0,x.jsxs)(tE,{disabled:0===k.length||j.length>0||f,onClick:function(){var e;(e=function(){var e;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:p(!0),g(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,a(k.map(function(e){var t=c[e.id];return uu({id:e.id,name:t.name.trim(),target:t.target},"vault"===t.target&&t.providerId?{providerId:t.providerId}:{},t.apiKey.trim()?{apiKey:t.apiKey.trim()}:{},t.overwrite?{overwrite:!0}:{})}))];case 2:return b({imported:(e=t.sent()).imported,skipped:e.skipped,providersCreated:e.providersCreated,warnings:e.warnings.map(oO)}),u({}),[3,5];case 3:return g(oN(t.sent(),"import.failed")),[3,5];case 4:return p(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){us(a,r,o,i,l,"next",e)}function l(e){us(a,r,o,i,l,"throw",e)}i(void 0)})})()},children:[f?(0,x.jsx)(cA,{className:"animate-spin"}):null,e("import.importSelected")]})]})]})}function up(e){var t=e.candidate,n=e.choice,r=e.providers,o=e.onChange,a=(0,S.Bd)().t;if(!n)return null;var i="vault"===n.target&&""!==n.providerId,l=!t.apiKeyPresent&&!i;return(0,x.jsx)("li",{className:"rounded-xl border bg-background px-3 py-3",children:(0,x.jsxs)("div",{className:"flex items-start gap-3",children:[(0,x.jsx)(ik,{className:"mt-1",checked:n.selected,onCheckedChange:function(e){return o({selected:!0===e})},"aria-label":a("import.select",{name:t.sourceKey})}),(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)("span",{className:"truncate font-mono text-sm",children:t.sourceKey}),t.active?(0,x.jsx)(e5,{children:a("import.inUse")}):null,t.conflictsWith?(0,x.jsx)(e5,{variant:"secondary",children:a("import.nameTaken")}):null,t.matchesProvider?(0,x.jsx)(e5,{variant:"secondary",children:a("import.matchesProvider",{name:t.matchesProvider})}):null]}),(0,x.jsxs)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[t.baseUrl||a("import.noBaseUrl"),t.model?" \xb7 ".concat(t.model):"",t.apiKeyPresent?" \xb7 ".concat(t.apiKeyPreview):" \xb7 ".concat(a("import.keyOutsideConfig"))]}),n.selected?(0,x.jsxs)("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsx)(iO,{htmlFor:"name-".concat(t.id),children:a("import.profileName")}),(0,x.jsx)(cv,{id:"name-".concat(t.id),value:n.name,onChange:function(e){return o({name:e.target.value})}})]}),(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsx)(iO,{htmlFor:"target-".concat(t.id),children:a("import.credentialTarget")}),(0,x.jsxs)(sx,{value:"vault"===n.target?n.providerId||"new-vault":"profile",onValueChange:function(e){return o("profile"===e?{target:"profile",providerId:""}:"new-vault"===e?{target:"vault",providerId:""}:{target:"vault",providerId:e})},children:[(0,x.jsx)(cs,{id:"target-".concat(t.id),children:(0,x.jsx)(sk,{})}),(0,x.jsxs)(cd,{children:[(0,x.jsx)(cf,{value:"profile",children:a("import.targetProfile")}),(0,x.jsx)(cf,{value:"new-vault",children:a("import.targetNewVault")}),r.map(function(e){return(0,x.jsx)(cf,{value:e.id,children:a("import.targetExisting",{name:e.name})},e.id)})]})]})]}),l?(0,x.jsxs)("div",{className:"space-y-1.5 sm:col-span-2",children:[(0,x.jsx)(iO,{htmlFor:"key-".concat(t.id),children:a("common.apiKey")}),(0,x.jsx)(cv,{id:"key-".concat(t.id),type:"password",value:n.apiKey,placeholder:a("import.apiKeyFromEnv"),onChange:function(e){return o({apiKey:e.target.value})}})]}):null,t.conflictsWith?(0,x.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground sm:col-span-2",children:[(0,x.jsx)(ik,{checked:n.overwrite,onCheckedChange:function(e){return o({overwrite:!0===e})}}),a("import.overwriteExisting")]}):null]}):null]})]})})}function uh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function um(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ug(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){um(a,r,o,i,l,"next",e)}function l(e){um(a,r,o,i,l,"throw",e)}i(void 0)})}}function uv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||ub(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uy(e){return function(e){if(Array.isArray(e))return uh(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ub(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ub(e,t){if(e){if("string"==typeof e)return uh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uh(e,t)}}function ux(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function uw(e){var t=e.onDone,n=(0,S.Bd)().t,r=aA(function(e){return e.users}),o=aA(function(e){return e.currentUser}),a=aA(function(e){return e.loadHarnesses}),i=aA(function(e){return e.loadProviders}),l=aA(function(e){return e.setNotice}),s=(0,w.useMemo)(function(){return r.filter(function(e){return e.username!==o&&!1!==e.manageable})},[r,o]),c=uv((0,w.useState)(""),2),u=c[0],d=c[1],f=uv((0,w.useState)(null),2),p=f[0],h=f[1],m=uv((0,w.useState)([]),2),g=m[0],v=m[1],y=uv((0,w.useState)(!1),2),b=y[0],k=y[1],j=uv((0,w.useState)(!1),2),C=j[0],N=j[1],P=uv((0,w.useState)(!1),2),E=P[0],_=P[1],A=uv((0,w.useState)(null),2),I=A[0],T=A[1],R=(0,w.useMemo)(function(){return O.oo.flatMap(function(e){var t,n=null!=(t=null==p?void 0:p.conflicts.filter(function(t){return t.harness===e}).length)?t:0;return n>0?[{harness:e,count:n}]:[]})},[p]),M=o||n("notice.currentUser");function z(){return ug(function(){var e;return ux(this,function(n){switch(n.label){case 0:if(!u||!p)return[2];_(!0),T(null),n.label=1;case 1:return n.trys.push([1,4,5,6]),[4,om("/api/users/sync",{method:"POST",body:JSON.stringify({sourceUser:u,conflictPolicy:"skip",overwriteHarnesses:g,migrateCodexLoginCache:b})})];case 2:return e=n.sent(),[4,Promise.all([a(),i()])];case 3:return n.sent(),l([{key:"sync.done",params:{imported:e.imported,overwritten:e.overwritten,skipped:e.skipped,providersCopied:e.providersCopied}},{key:e.codexLoginCacheMigrated?"sync.cacheMigrated":"sync.cacheNotMigrated"}].concat(uy(e.warnings.map(function(e){return oO(e)})))),t(),[3,6];case 4:return T(oC(n.sent())),[3,6];case 5:return _(!1),[7];case 6:return[2]}})})()}return(0,w.useEffect)(function(){d(function(e){var t,n;return s.some(function(t){return t.username===e})?e:null!=(t=null==(n=s[0])?void 0:n.username)?t:""})},[s]),0===s.length?(0,x.jsxs)("div",{className:"flex items-start gap-3 rounded-2xl border bg-muted/25 p-4",children:[(0,x.jsx)(aD,{className:"mt-0.5 size-5 text-muted-foreground"}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("sync.noOtherUsers")})]}):(0,x.jsxs)("div",{className:"space-y-5",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:n("sync.intro",{user:M})}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iO,{htmlFor:"sync-source-user",children:n("sync.sourceUser")}),(0,x.jsxs)(sx,{value:u,onValueChange:function(e){d(e),h(null),v([]),k(!1)},children:[(0,x.jsx)(cs,{id:"sync-source-user",children:(0,x.jsx)(sk,{placeholder:n("sync.selectUser")})}),(0,x.jsx)(cd,{children:s.map(function(e){return(0,x.jsxs)(cf,{value:e.username,children:[e.username," \xb7 ",e.homeDir]},e.username)})})]})]}),p?(0,x.jsxs)("div",{className:"space-y-4 rounded-2xl border bg-muted/25 p-4",children:[(0,x.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,x.jsx)(e5,{variant:"secondary",children:n("sync.profileCount",{count:p.profileCount})}),(0,x.jsx)(e5,{variant:"secondary",children:n("sync.providerCount",{count:p.providerCount})}),(0,x.jsx)(e5,{variant:p.conflicts.length>0?"destructive":"outline",children:n("sync.conflictCount",{count:p.conflicts.length})})]}),p.conflicts.length>0?(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsxs)("div",{className:"space-y-1",children:[(0,x.jsx)(iO,{children:n("sync.overwriteByHarness")}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:n("sync.overwriteHint")})]}),(0,x.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:R.map(function(e){var t=e.harness,r=e.count;return(0,x.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-xl border bg-background/70 p-3 text-sm",children:[(0,x.jsx)(ik,{checked:g.includes(t),onCheckedChange:function(e){return v(function(n){return!0===e?uy(n).concat([t]):n.filter(function(e){return e!==t})})},className:"mt-0.5"}),(0,x.jsxs)("span",{children:[(0,x.jsx)("span",{className:"block font-medium",children:n("sync.overwriteHarness",{harness:O.RP[t]})}),(0,x.jsx)("span",{className:"mt-1 block text-xs text-muted-foreground",children:n("sync.conflictsInHarness",{count:r})})]})]},t)})})]}):null,p.codexLoginCache.available&&p.codexLoginCache.migrationNeeded?(0,x.jsxs)("label",{className:"block space-y-3 rounded-xl border bg-background/70 p-3 text-sm",children:[(0,x.jsxs)("span",{className:"flex cursor-pointer items-start gap-3",children:[(0,x.jsx)(ik,{checked:b,onCheckedChange:function(e){return k(!0===e)},className:"mt-0.5"}),(0,x.jsxs)("span",{children:[(0,x.jsx)("span",{className:"block font-medium",children:n("sync.migrateCache")}),(0,x.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:n("sync.migrateCacheHint")})]})]}),p.codexLoginCache.targetExists?(0,x.jsx)("span",{className:"block rounded-lg bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:n("sync.migrateCacheOverwrite")}):null]}):null,(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:n("sync.storeOnlyHint")})]}):null,I?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(n,I)}):null,p?b?(0,x.jsxs)(aW,{open:C,onOpenChange:N,children:[(0,x.jsxs)(tE,{disabled:E,onClick:function(){return N(!0)},children:[(0,x.jsx)(cL,{}),E?n("sync.syncing"):n("sync.syncTo",{user:M})]}),(0,x.jsxs)(a6,{children:[(0,x.jsxs)(a8,{children:[(0,x.jsx)(a7,{children:n("sync.confirmCacheTitle")}),(0,x.jsx)(ie,{children:n("sync.confirmCacheBody",{source:u,target:M,extra:p.codexLoginCache.targetExists?n("sync.confirmCacheOverwrite"):n("sync.confirmCacheFresh")})})]}),(0,x.jsxs)(a9,{children:[(0,x.jsx)(ir,{children:n("common.cancel")}),(0,x.jsx)(it,{onClick:function(){z()},children:n("sync.confirmCacheAction")})]})]})]}):(0,x.jsxs)(tE,{disabled:E,onClick:function(){z()},children:[(0,x.jsx)(cL,{}),E?n("sync.syncing"):n("sync.syncTo",{user:M})]}):(0,x.jsxs)(tE,{disabled:!u||E,onClick:function(){ug(function(){var e;return ux(this,function(t){switch(t.label){case 0:if(!u)return[2];_(!0),T(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,om("/api/users/sync/preview",{method:"POST",body:JSON.stringify({sourceUser:u})})];case 2:return h(t.sent()),v([]),k(!1),N(!1),[3,5];case 3:return e=t.sent(),h(null),v([]),T(oC(e)),[3,5];case 4:return _(!1),[7];case 5:return[2]}})})()},children:[(0,x.jsx)(cL,{}),E?n("sync.inspecting"):n("sync.inspect")]})]})}function uk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var uj=[{id:"scan",icon:az},{id:"user",icon:aD},{id:"file",icon:aL},{id:"gist",icon:aF}];function uS(e){var t,n=e.open,r=e.onOpenChange,o=(0,S.Bd)().t,a=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)("scan"))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return uk(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return uk(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],l=a[1];return(0,x.jsx)(rA,{open:n,onOpenChange:r,children:(0,x.jsxs)(r0,{className:"flex h-[calc(100dvh-1rem)] max-h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] max-w-4xl flex-col gap-0 overflow-hidden p-0 sm:h-[min(90dvh,40rem)] sm:max-h-[90dvh] sm:w-full",children:[(0,x.jsxs)(r1,{className:"shrink-0 border-b px-5 py-4 pr-12 text-left sm:px-6",children:[(0,x.jsx)(r4,{children:o("transfer.title")}),(0,x.jsx)(r3,{children:o("transfer.intro")})]}),(0,x.jsxs)("div",{className:"grid min-h-0 flex-1 grid-rows-[auto_minmax(0,1fr)] sm:grid-cols-[13rem_minmax(0,1fr)] sm:grid-rows-[minmax(0,1fr)]",children:[(0,x.jsx)(cU,{label:o("transfer.sourceLabel"),idPrefix:"transfer",orientation:"vertical",items:uj,value:i,onChange:l,className:"flex gap-2 overflow-x-auto border-b bg-card/45 p-3 sm:flex-col sm:overflow-x-visible sm:overflow-y-auto sm:border-b-0 sm:border-r",tabClassName:"gap-2.5 px-3 py-2.5 text-sm sm:w-full",children:function(e){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(e.icon,{className:"size-4 shrink-0"}),(0,x.jsx)("span",{className:"whitespace-nowrap font-medium sm:whitespace-normal",children:o("transfer.sources.".concat(e.id))})]})}}),(0,x.jsxs)(cB,{idPrefix:"transfer",value:i,className:"min-h-0 overflow-y-auto overscroll-contain px-4 py-5 pb-[max(1.25rem,env(safe-area-inset-bottom))] sm:px-6",children:["scan"===i?(0,x.jsx)(uf,{}):null,"user"===i?(0,x.jsx)(uw,{onDone:function(){return r(!1)}}):null,"file"===i?(0,x.jsx)(c_,{onDone:function(){return r(!1)}}):null,"gist"===i?(0,x.jsx)(ua,{onDone:function(){return r(!1)}}):null]})]})]})})}let uO=_("stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]),uC=_("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),uN=_("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var uP={ok:"bg-emerald-500",warn:"bg-amber-500",error:"bg-red-500",unknown:"bg-slate-400"};function uE(e){var t,n=e.harnessId,r=e.open,o=e.onOpenChange,a=(0,S.Bd)().t,i=aA(function(e){return e.doctor}),l=aA(function(e){return e.doctorLoading}),s=aA(function(e){return e.doctorError}),c=aA(function(e){return e.doctorUpdatedAvailable}),u=aA(function(e){return e.loadDoctor}),d=null!=(t=null==i?void 0:i.find(function(e){return e.harness===n}))?t:null;(0,w.useEffect)(function(){r&&null===d&&u(n)},[r,d,n,u]);var f=function(e){var t={ok:0,warn:0,error:0,unknown:0};if(!e)return t;var n=!0,r=!1,o=void 0;try{for(var a,i=e.checks[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var l=a.value;t[l.status]++}}catch(e){r=!0,o=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw o}}return t}(d),p=O.RP[n];return(0,x.jsx)(rA,{open:r,onOpenChange:o,children:(0,x.jsxs)(r0,{className:"flex max-h-[88vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl",children:[(0,x.jsxs)(r1,{className:"shrink-0 space-y-1.5 px-6 pb-4 pt-6 pr-12",children:[(0,x.jsx)(r4,{children:a("doctor.titleFor",{harness:p})}),(0,x.jsx)(r3,{children:a("doctor.intro")})]}),(0,x.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-6",children:[l&&null===d?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a("doctor.checking")}):null,s?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(a,s)}):null,d?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[f.ok>0?(0,x.jsx)(e5,{variant:"secondary",children:a("doctor.countOk",{count:f.ok})}):null,f.warn>0?(0,x.jsx)(e5,{variant:"outline",className:"border-amber-500/30 text-amber-700 dark:text-amber-300",children:a("doctor.countWarn",{count:f.warn})}):null,f.error>0?(0,x.jsx)(e5,{variant:"destructive",children:a("doctor.countError",{count:f.error})}):null,f.unknown>0?(0,x.jsx)(e5,{variant:"outline",children:a("doctor.countUnknown",{count:f.unknown})}):null,c?(0,x.jsxs)("span",{className:"ml-auto flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400",children:[(0,x.jsx)(uN,{className:"size-3.5"}),a("doctor.updateAvailable")]}):null]}),(0,x.jsx)(u_,{checks:d.checks})]}):null,null!==d||l||s?null:(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a("doctor.notRun")})]}),(0,x.jsxs)(r2,{className:"shrink-0 px-6 py-4",children:[(0,x.jsxs)(tE,{variant:"outline",disabled:l,onClick:function(){u(n)},children:[(0,x.jsx)(uC,{className:l?"animate-spin":void 0}),a("doctor.rerun")]}),(0,x.jsx)(tE,{onClick:function(){return o(!1)},children:a("doctor.close")})]})]})})}function u_(e){var t=e.checks,n=(0,S.Bd)().t;return 0===t.length?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("doctor.noChecks")}):(0,x.jsx)("ul",{className:"divide-y rounded-xl border",children:t.map(function(e){return(0,x.jsxs)("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[(0,x.jsx)("span",{className:e4("mt-1.5 size-2 shrink-0 rounded-full",uP[e.status]),"aria-hidden":!0}),(0,x.jsx)("div",{className:"min-w-0 flex-1",children:(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed",children:oE(n,{key:e.code,params:e.data})}),(0,x.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:n("doctor.status.".concat(e.status))})]})})]},e.id)})})}function uA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uA(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uT(e){switch(e){case"in-sync":return"border-transparent bg-emerald-500/15 text-emerald-600 dark:text-emerald-400";case"drifted":return"border-amber-500/30 text-amber-700 dark:text-amber-300";case"missing":case"invalid":return"border-transparent bg-destructive/15 text-destructive";default:return""}}function uR(e){var t,n=e.harness,r=e.open,o=e.onOpenChange,a=(0,S.Bd)().t,i=aA(function(e){return e.drift}),l=aA(function(e){return e.driftLoading}),s=aA(function(e){return e.reapplyDrift}),c=aA(function(e){return e.adoptDrift}),u=uI((0,w.useState)(null),2),d=u[0],f=u[1],p=uI((0,w.useState)(null),2),h=p[0],m=p[1],g=(0,w.useMemo)(function(){var e;return null!=(e=null==i?void 0:i.find(function(e){return e.harness===n.id}))?e:null},[i,n.id]),v=null!=(t=null==g?void 0:g.files.filter(function(e){return"in-sync"!==e.status}))?t:[],y=(null==g?void 0:g.active)===!0;return(0,x.jsxs)(rA,{open:r,onOpenChange:o,children:[(0,x.jsxs)(r0,{className:"flex max-h-[85vh] w-[min(64rem,calc(100vw-2rem))] max-w-5xl flex-col overflow-hidden",children:[(0,x.jsxs)(r1,{children:[(0,x.jsx)(r4,{children:a("drift.dialogTitle",{harness:n.label})}),(0,x.jsx)(r3,{children:a(y?"drift.legend":"drift.noActiveProfile")})]}),(0,x.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[l&&null===g?(0,x.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:a("drift.checking")}):null,null!==g||l?null:(0,x.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:a("drift.noData")}),g&&!y?(0,x.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:a("drift.nothingToCompare")}):null,g&&y?(0,x.jsx)("div",{className:"space-y-3",children:0===v.length?(0,x.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:a("drift.allInSync")}):v.map(function(e){return(0,x.jsx)(uM,{file:e},e.key)})}):null]}),h?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(a,h)}):null,(0,x.jsxs)(r2,{children:[(0,x.jsx)(tE,{variant:"outline",disabled:null===g||!y,onClick:function(){return f("adopt")},children:a("drift.adopt")}),(0,x.jsx)(tE,{disabled:null===g||!y,onClick:function(){return f("reapply")},children:a("drift.reapply")})]})]}),(0,x.jsx)(aW,{open:"reapply"===d,onOpenChange:function(e){return!e&&f(null)},children:(0,x.jsxs)(a6,{children:[(0,x.jsxs)(a8,{children:[(0,x.jsx)(a7,{children:a("drift.reapplyTitle")}),(0,x.jsx)(ie,{children:a("drift.reapplyBody",{harness:n.label})})]}),(0,x.jsxs)(a9,{children:[(0,x.jsx)(ir,{children:a("common.cancel")}),(0,x.jsx)(it,{onClick:function(){f(null),m(null),s(n.id).then(function(){return o(!1)}).catch(function(e){m(oN(e,"drift.reapplyFailed"))})},children:a("drift.confirmReapply")})]})]})}),(0,x.jsx)(aW,{open:"adopt"===d,onOpenChange:function(e){return!e&&f(null)},children:(0,x.jsxs)(a6,{children:[(0,x.jsxs)(a8,{children:[(0,x.jsx)(a7,{children:a("drift.adoptTitle")}),(0,x.jsx)(ie,{children:a("drift.adoptBody")})]}),(0,x.jsxs)(a9,{children:[(0,x.jsx)(ir,{children:a("common.cancel")}),(0,x.jsx)(it,{onClick:function(){f(null),m(null),c(n.id).then(function(){return o(!1)}).catch(function(e){m(oN(e,"drift.adoptFailed"))})},children:a("drift.confirmAdopt")})]})]})})]})}function uM(e){var t=e.file,n=(0,S.Bd)().t;return(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,x.jsx)(e5,{className:uT(t.status),children:n("drift.status.".concat(t.status))}),(0,x.jsx)("p",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",title:t.path,children:t.path})]}),(0,x.jsx)(tr,{files:[{path:t.path,existed:null!==t.currentContent,content:t.expectedContent,currentContent:t.currentContent}]})]})}function uz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uD(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uz(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uL(e){var t,n,r,o=e.harness,a=(0,S.Bd)().t,i=aA(function(e){return e.doctor}),l=aA(function(e){return e.doctorLoading}),s=aA(function(e){return e.doctorError}),c=aA(function(e){return e.loadDoctor}),u=aA(function(e){return e.drift}),d=aA(function(e){return e.driftLoading}),f=aA(function(e){return e.driftError}),p=aA(function(e){return e.loadDrift}),h=uD((0,w.useState)(!1),2),m=h[0],g=h[1],v=uD((0,w.useState)(!1),2),y=v[0],b=v[1],k=null!=(t=null==i?void 0:i.find(function(e){return e.harness===o.id}))?t:null,j=null!=(n=null==u?void 0:u.find(function(e){return e.harness===o.id}))?n:null,O=null!=(r=null==j?void 0:j.files.filter(function(e){return"in-sync"!==e.status}))?r:[],C=null!==j&&j.active&&O.length>0&&"in-sync"!==j.status;return(0,w.useEffect)(function(){c(o.id)},[o.id,c]),(0,w.useEffect)(function(){null===u&&p()},[u,p]),(0,x.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(uO,{className:"size-4 text-primary"}),(0,x.jsx)("h3",{className:"font-semibold",children:a("doctor.title")}),(0,x.jsx)("span",{className:"ml-auto",children:(0,x.jsx)(tE,{size:"icon",variant:"ghost","aria-label":a("doctor.rerun"),onClick:function(){c(o.id),p()},children:(0,x.jsx)(uC,{className:l||d?"animate-spin":void 0})})})]}),(0,x.jsxs)("div",{className:"mt-4 space-y-3",children:[s?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(a,s)}):null===k?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:a("doctor.checking")}):(0,x.jsx)(uF,{report:k}),f?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(a,f)}):null===j?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:a("drift.checking")}):(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(u$,{report:j}),O.length>0?(0,x.jsxs)("ul",{className:"space-y-1",children:[O.slice(0,3).map(function(e){return(0,x.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,x.jsx)("span",{className:"size-1.5 shrink-0 rounded-full bg-destructive/70"}),(0,x.jsx)("span",{className:"truncate font-mono text-muted-foreground",children:e.path.split("/").pop()}),(0,x.jsx)("span",{className:"ml-auto shrink-0 font-mono text-[11px] text-muted-foreground",children:a("drift.status.".concat(e.status))})]},e.key)}),O.length>3?(0,x.jsx)("li",{className:"pl-3.5 text-xs text-muted-foreground",children:a("drift.moreFiles",{count:O.length-3})}):null]}):null]})]}),(0,x.jsxs)("div",{className:"mt-4 grid gap-2 ".concat(C?"grid-cols-2":"grid-cols-1"),children:[(0,x.jsx)(tE,{size:"sm",variant:"outline",disabled:null===k,onClick:function(){return g(!0)},children:a("doctor.viewDetails")}),C?(0,x.jsx)(tE,{size:"sm",variant:"outline",onClick:function(){return b(!0)},children:a("drift.viewDiff")}):null]}),(0,x.jsx)(uE,{harnessId:o.id,open:m,onOpenChange:g}),(0,x.jsx)(uR,{harness:o,open:y,onOpenChange:b})]})}function uF(e){var t=e.report,n=(0,S.Bd)().t,r=function(e){var t={ok:0,warn:0,error:0,unknown:0},n=!0,r=!1,o=void 0;try{for(var a,i=e.checks[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var l=a.value;t[l.status]++}}catch(e){r=!0,o=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw o}}return t}(t),o=["error","warn","ok","unknown"].filter(function(e){return r[e]>0});return 0===o.length?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("doctor.noChecks")}):(0,x.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(function(e){var t,o;return(0,x.jsx)(e5,{variant:"error"===(t=e)?"destructive":"ok"===t?"secondary":"outline",className:"warn"===e?"border-amber-500/30 text-amber-700 dark:text-amber-300":void 0,children:n("doctor.count".concat((o=e,"".concat(o[0].toUpperCase()).concat(o.slice(1)))),{count:r[e]})},e)})})}function u$(e){var t=e.report,n=(0,S.Bd)().t;if(!t.active)return(0,x.jsx)(e5,{variant:"secondary",children:n("harness.inactive")});if("in-sync"===t.status)return(0,x.jsx)(e5,{variant:"secondary",children:n("drift.none")});if("drifted"===t.status){var r=t.files.filter(function(e){return"in-sync"!==e.status}).length;return(0,x.jsx)(e5,{variant:"outline",className:"border-amber-500/30 text-amber-700 dark:text-amber-300",children:n("drift.mismatch",{count:r})})}return(0,x.jsx)(e5,{className:uT(t.status),children:n("drift.status.".concat(t.status))})}function uU(e){return(uU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uH=["size","style"];function uB(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 uV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uB(Object(n),!0).forEach(function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!=uU(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=uU(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uU(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var uK=(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,uH);return(0,x.jsxs)("svg",uV(uV({height:n,style:uV({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:"Claude Code"}),(0,x.jsx)("path",{clipRule:"evenodd",d:"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z",fill:"#D97757",fillRule:"evenodd"})]}))});let uq=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;var uW=function(e){var t=(0,w.useId)(),n="lobe-icons-".concat(Array.from(e.match(uq)??[]).map(e=>e.toLowerCase()).join("-"),"-").concat(t);return(0,w.useMemo)(function(){return{fill:"url(#".concat(n,")"),id:n}},[e])},uG="Codex";function uZ(e){return(uZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uY=["size","style"];function uX(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 uJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uX(Object(n),!0).forEach(function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!=uZ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=uZ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uZ(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var uQ=(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,uY),a=uW(uG),i=a.id,l=a.fill;return(0,x.jsxs)("svg",uJ(uJ({height:n,style:uJ({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:uG}),(0,x.jsx)("path",{d:"M19.503 0H4.496A4.496 4.496 0 000 4.496v15.007A4.496 4.496 0 004.496 24h15.007A4.496 4.496 0 0024 19.503V4.496A4.496 4.496 0 0019.503 0z",fill:"#fff"}),(0,x.jsx)("path",{d:"M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z",fill:l}),(0,x.jsx)("defs",{children:(0,x.jsxs)("linearGradient",{gradientUnits:"userSpaceOnUse",id:i,x1:"12",x2:"12",y1:"3",y2:"21",children:[(0,x.jsx)("stop",{stopColor:"#B1A7FF"}),(0,x.jsx)("stop",{offset:".5",stopColor:"#7A9DFF"}),(0,x.jsx)("stop",{offset:"1",stopColor:"#3941FF"})]})})]}))});function u0(e){return(u0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var u1=["size","style"];function u2(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 u4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u2(Object(n),!0).forEach(function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!=u0(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=u0(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u0(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var u3=(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,u1);return(0,x.jsxs)("svg",u4(u4({height:n,style:u4({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:"DeepSeek"}),(0,x.jsx)("path",{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z",fill:"#4D6BFE"})]}))});function u5(e){return(u5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var u6=["size","style"];function u8(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 u9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u8(Object(n),!0).forEach(function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!=u5(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=u5(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u5(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var u7=(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,u6);return(0,x.jsxs)("svg",u9(u9({fill:"currentColor",fillRule:"evenodd",height:n,style:u9({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:"Kimi"}),(0,x.jsx)("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),(0,x.jsx)("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]}))});function de(e){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var dt=["size","style"];function dn(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 dr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(n),!0).forEach(function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!=de(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=de(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==de(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var da={claude:uK,codex:uQ,kimi:u7,pi:(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,dt);return(0,x.jsxs)("svg",dr(dr({fill:"currentColor",fillRule:"evenodd",height:n,style:dr({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:"Pi"}),(0,x.jsx)("path",{clipRule:"evenodd",d:"M1 1h16.5v11H12v5.5H6.5V23H1V1zm5.5 5.5V12H12V6.5H6.5z"}),(0,x.jsx)("path",{d:"M17.5 12H23v11h-5.5V12z"})]}))}),dsh:u3};function di(e){var t=e.id,n=e.className,r=da[t];return(0,x.jsx)(r,{"aria-hidden":!0,className:e4("size-5",n)})}function dl(e){var t=e.harnesses,n=e.value,r=e.onChange,o=(0,S.Bd)().t;return(0,x.jsx)(cU,{label:o("nav.switchHarness"),idPrefix:"harness",orientation:"vertical",items:t,value:n,onChange:r,className:"flex gap-2 overflow-x-auto border-b bg-card/45 p-3 xl:sticky xl:top-20 xl:h-[calc(100dvh-80px)] xl:flex-col xl:self-start xl:overflow-x-visible xl:overflow-y-auto xl:border-b-0 xl:border-r xl:p-4",tabClassName:"min-w-[12rem] gap-3 px-3 py-3 xl:min-w-0 xl:w-full",children:function(e,t){var n,r,a,i=(null==(r=e.active)?void 0:r.official)?o("harness.official"):null!=(n=null==(a=e.active)?void 0:a.name)?n:null;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{className:e4("flex size-10 shrink-0 items-center justify-center rounded-xl border bg-card shadow-[0_4px_12px_-8px_rgb(36_39_70/0.28)]",t?"border-primary/20":"border-border"),children:(0,x.jsx)(di,{id:e.id})}),(0,x.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,x.jsx)("span",{className:"block truncate text-sm font-medium text-current",children:e.label}),(0,x.jsx)("span",{className:"mt-0.5 block truncate font-mono text-[11px] text-muted-foreground",children:null===i?o("harness.currentInactive"):o("harness.current",{name:i})})]}),(0,x.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:e.profiles.length})]})}})}let ds=_("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);function dc(){var e=(0,S.Bd)().t,t=(0,S.s9)(),n=t.language,r=t.setLanguage,o="en"===n,a=e(o?"language.toChinese":"language.toEnglish");return(0,x.jsxs)(tE,{type:"button",size:"sm",variant:"outline","aria-label":a,title:a,onClick:function(){return r(o?"zh-CN":"en")},children:[(0,x.jsx)(ds,{}),(0,x.jsx)("span",{className:"hidden sm:inline",children:e("language.short")})]})}let du=_("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),dd=_("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),df=_("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),dp=_("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var dh=K("text-sm",{variants:{variant:{destructive:"text-destructive",warning:"text-amber-600 dark:text-amber-500",muted:"text-muted-foreground"},size:{default:"text-sm",sm:"text-xs"}},defaultVariants:{variant:"destructive",size:"default"}});function dm(e){var t=e.className,n=e.variant,r=e.size,o=function(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}(e,["className","variant","size"]);return(0,x.jsx)("p",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"alert",role:"muted"===n?void 0:"alert",className:e4(dh({variant:n,size:r}),t)},o))}var dg=Object.defineProperty,dv=(e,t)=>dg(e,"name",{value:t,configurable:!0}),dy=!1;function db(){let[e,t]=w.useState(dy);return w.useEffect(()=>{dy||(dy=!0,t(!0))},[]),e}dv(db,"useIsHydrated");var dx=k[" useSyncExternalStore ".trim().toString()];function dw(){return()=>{}}function dk(){return dx(dw,()=>!0,()=>!1)}dv(dw,"subscribe"),dv(dk,"useIsHydratedModern");var dj="function"==typeof dx?dk:db,dS=Object.defineProperty,dO=(e,t)=>dS(e,"name",{value:t,configurable:!0}),dC="rovingFocusGroup.onEntryFocus",dN={bubbles:!1,cancelable:!0},dP="RovingFocusGroup",[dE,d_,dA]=iE(dP),[dI,dT]=tL(dP,[dA]),[dR,dM]=dI(dP),dz=w.forwardRef(dO(function(e,t){return(0,x.jsx)(dE.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(dE.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(dD,{...e,ref:t})})})},"RovingFocusGroup")),dD=w.forwardRef(dO(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:s,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=w.useRef(null),p=td(t,f),h=iU(a),[m,g]=tJ({prop:i,defaultProp:l??null,onChange:s,caller:dP}),[v,y]=w.useState(!1),b=t6(c),k=d_(n),j=w.useRef(!1),[S,O]=w.useState(0);return w.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(dC,b),()=>e.removeEventListener(dC,b)},[b]),(0,x.jsx)(dR,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:m,onItemFocus:w.useCallback(e=>g(e),[g]),onItemShiftTab:w.useCallback(()=>y(!0),[]),onFocusableItemAdd:w.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>O(e=>e-1),[]),children:(0,x.jsx)(t3.div,{tabIndex:v||0===S?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:tT(e.onMouseDown,()=>{j.current=!0}),onFocus:tT(e.onFocus,e=>{let t=!j.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(dC,dN);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=k().filter(e=>e.focusable);dH([e.find(e=>e.active),e.find(e=>e.id===m),...e].filter(Boolean).map(e=>e.ref.current),u)}}j.current=!1}),onBlur:tT(e.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),dL=w.forwardRef(dO(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...l}=e,s=tV(),c=a||s,u=dM("RovingFocusGroupItem",n),d=u.currentTabStopId===c,f=d_(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:m}=u,g=dj();return t$(()=>{if(g&&r)return p(),()=>h()},[g,r,p,h]),w.useEffect(()=>{if(!g&&r)return p(),()=>h()},[g,r,p,h]),(0,x.jsx)(dE.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:(0,x.jsx)(t3.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:tT(e.onMouseDown,e=>{r?u.onItemFocus(c):e.preventDefault()}),onFocus:tT(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:tT(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void u.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=dU(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?dB(n,r+1):n.slice(r+1)}setTimeout(()=>dH(n))}}),children:"function"==typeof i?i({isCurrentTabStop:d,hasTabStop:null!=m}):i})})},"RovingFocusGroupItem")),dF={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function d$(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function dU(e,t,n){let r=d$(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return dF[r]}function dH(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}dO(d$,"getDirectionAwareKey"),dO(dU,"getFocusIntent"),dO(dH,"focusFirst"),dO(dB,"wrapArray");var dV=Object.defineProperty,dK=(e,t)=>dV(e,"name",{value:t,configurable:!0}),dq="Radio",[dW,dG]=tL(dq),[dZ,dY]=dW(dq);function dX(e){let{__scopeRadio:t,checked:n=!1,children:r,disabled:o,form:a,name:i,onCheck:l,required:s,value:c="on",internal_do_not_use_render:u}=e,[d,f]=w.useState(null),[p,h]=w.useState(null),m=w.useRef(!1),[g,v]=w.useReducer(e=>e+1,0),y=!d||!!a||!!d.closest("form"),b={checked:n,disabled:o,required:s,name:i,form:a,value:c,control:d,setControl:f,hasConsumerStoppedPropagationRef:m,userInteractionCount:g,onUserInteraction:v,isFormControl:y,bubbleInput:p,setBubbleInput:h,onCheck:dK(()=>l?.(),"onCheck")};return(0,x.jsx)(dZ,{scope:t,...b,children:d1(u)?u(b):r})}dK(dX,"RadioProvider");var dJ=w.forwardRef(dK(function({__scopeRadio:e,onClick:t,...n},r){let{checked:o,disabled:a,value:i,setControl:l,onCheck:s,hasConsumerStoppedPropagationRef:c,onUserInteraction:u,isFormControl:d,bubbleInput:f}=dY("RadioTrigger",e),p=td(r,l);return(0,x.jsx)(t3.button,{type:"button",role:"radio","aria-checked":o,"data-state":d2(o),"data-disabled":a?"":void 0,disabled:a,value:i,...n,ref:p,onClick:tT(t,e=>{o||(u(),s()),f&&d&&(c.current=e.isPropagationStopped(),c.current||e.stopPropagation())})})},"RadioTrigger")),dQ=w.forwardRef(dK(function(e,t){let{__scopeRadio:n,forceMount:r,...o}=e,a=dY("RadioIndicator",n);return(0,x.jsx)(n_,{present:r||a.checked,children:(0,x.jsx)(t3.span,{"data-state":d2(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})},"RadioIndicator")),d0=w.forwardRef(dK(function({__scopeRadio:e,onClick:t,...n},r){let{control:o,checked:a,required:i,disabled:l,name:s,value:c,form:u,bubbleInput:d,setBubbleInput:f,hasConsumerStoppedPropagationRef:p,userInteractionCount:h}=dY("RadioBubbleInput",e),m=td(r,f),g=io(o),v=w.useRef(!1),y=w.useRef(a),b=w.useRef(h);w.useEffect(()=>{if(!d)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=h!==b.current;b.current=h;let n=y.current!==a;y.current=a;let r=!(t&&p.current);if(n&&e){v.current=!t;let n=new Event("click",{bubbles:r});e.call(d,a),d.dispatchEvent(n),v.current=!1}},[d,a,p,h]);let k=w.useRef(a);return(0,x.jsx)(t3.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:i,disabled:l,name:s,value:c,form:u,...n,tabIndex:-1,ref:m,onClick:tT(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function d1(e){return"function"==typeof e}function d2(e){return e?"checked":"unchecked"}dK(d1,"isFunction"),dK(d2,"getState");var d4=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],d3="RadioGroup",[d5,d6]=tL(d3,[dT,dG]),d8=dT(),d9=dG(),[d7,fe]=d5(d3),ft=w.forwardRef(dK(function(e,t){let{__scopeRadioGroup:n,name:r,form:o,defaultValue:a,value:i,required:l=!1,disabled:s=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...p}=e,h=d8(n),m=iU(u),[g,v]=tJ({prop:i,defaultProp:a??null,onChange:f,caller:d3}),[y,b]=w.useState(null),k=td(t,b),j=w.useRef(g);return w.useEffect(()=>{let e=o?y?.ownerDocument.getElementById(o):y?.closest("form");if(e instanceof HTMLFormElement){let t=dK(()=>v(j.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[y,o,v]),(0,x.jsx)(d7,{scope:n,name:r,form:o,required:l,disabled:s,value:g,onValueChange:v,children:(0,x.jsx)(dz,{asChild:!0,...h,orientation:c,dir:m,loop:d,children:(0,x.jsx)(t3.div,{role:"radiogroup","aria-required":l,"aria-orientation":c,"data-disabled":s?"":void 0,dir:m,...p,ref:k})})})},"RadioGroup"));function fn(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:o,internal_do_not_use_render:a}=e,i=fe("RadioGroupItemProvider",t),l=d9(t),s=i.disabled||r;return(0,x.jsx)(dX,{...l,checked:i.value===n,disabled:s,required:i.required,name:i.name,form:i.form,value:n,onCheck:()=>i.onValueChange(n),internal_do_not_use_render:a,children:o})}dK(fn,"RadioGroupItemProvider");var fr=w.forwardRef(dK(function(e,t){let{__scopeRadioGroup:n,...r}=e,o=d8(n),a=d9(n),{checked:i,disabled:l}=dY("RadioGroupItemTrigger",a.__scopeRadio),s=w.useRef(null),c=td(t,s),u=w.useRef(!1);return w.useEffect(()=>{let e=dK(e=>{d4.includes(e.key)&&(u.current=!0)},"handleKeyDown"),t=dK(()=>u.current=!1,"handleKeyUp");return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),(0,x.jsx)(dL,{asChild:!0,...o,focusable:!l,active:i,children:(0,x.jsx)(dJ,{...a,...r,ref:c,onKeyDown:tT(r.onKeyDown,e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:tT(r.onFocus,()=>{u.current&&s.current?.click()})})})},"RadioGroupItemTrigger")),fo=w.forwardRef(dK(function(e,t){let{__scopeRadioGroup:n,value:r,disabled:o,...a}=e;return(0,x.jsx)(fn,{__scopeRadioGroup:n,value:r,disabled:o,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(fr,{...a,ref:t,__scopeRadioGroup:n}),e&&(0,x.jsx)(fa,{__scopeRadioGroup:n})]})})},"RadioGroupItem")),fa=w.forwardRef(dK(function(e,t){let{__scopeRadioGroup:n,...r}=e,o=d9(n);return(0,x.jsx)(d0,{...o,...r,ref:t})},"RadioGroupItemBubbleInput")),fi=w.forwardRef(dK(function(e,t){let{__scopeRadioGroup:n,...r}=e,o=d9(n);return(0,x.jsx)(dQ,{...o,...r,ref:t})},"RadioGroupIndicator"));let fl=_("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function fs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function fc(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}function fu(e){var t=e.className,n=fc(e,["className"]);return(0,x.jsx)(ft,fs({className:e4("grid gap-3",t)},n))}function fd(e){var t,n,r=e.className,o=fc(e,["className"]);return(0,x.jsx)(fo,(t=fs({className:e4("size-4 shrink-0 rounded-full border border-input bg-background text-primary shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary",r)},o),n=n={children:(0,x.jsx)(fi,{className:"flex items-center justify-center",children:(0,x.jsx)(fl,{className:"size-2 fill-current"})})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function ff(e,t,n){return e.connections.filter(function(e){var r;return null==n||null==(r=n.find(function(e){return e.harness===t}))?void 0:r.connections.some(function(t){return t.id===e.id&&!t.projection.blockers.length})})}function fp(e,t,n,r){var o,a=ff(e,t.id,n),i=t.profiles.filter(function(t){var n;return(null==(n=t.modelFavorite)?void 0:n.favoriteId)===e.id}),l=i.find(function(e){var n,r;return!(null==(n=t.active)?void 0:n.official)&&e.name===(null==(r=t.active)?void 0:r.name)}),s=null!=l?l:1===i.length?i[0]:void 0,c=null==s||null==(o=s.modelFavorite)?void 0:o.connectionId;return{harness:t.id,connectionId:a.some(function(e){return e.id===c})?c:1===a.length?a[0].id:"",existing:!!s,profile:null==s?void 0:s.name,mode:r,ignorePreference:!1,overwriteDiverged:!1}}let fh=_("file-code-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);function fm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fg(e){var t,n=e.title,r=e.children,o=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return fm(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fm(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o[1],l=(0,w.useId)();return(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsxs)(tE,{type:"button",variant:"ghost","aria-expanded":a,"aria-controls":l,onClick:function(){return i(!a)},children:[n,(0,x.jsx)(L,{className:"size-4 transition-transform ".concat(a?"rotate-180":"")})]}),(0,x.jsx)("div",{id:l,hidden:!a,className:"space-y-3",children:r})]})}function fv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||fx(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fb(e){return function(e){if(Array.isArray(e))return fv(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||fx(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fx(e,t){if(e){if("string"==typeof e)return fv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fv(e,t)}}function fw(e){var t=e.item,n=(0,S.Bd)().t;return(0,x.jsxs)("article",{className:"overflow-hidden rounded-xl border bg-card shadow-sm",children:[(0,x.jsxs)("header",{className:"flex items-center gap-3 border-b p-4",children:[(0,x.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl border bg-muted/30",children:(0,x.jsx)(di,{id:t.harness,className:"size-6"})}),(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsx)("h3",{className:"font-semibold",children:n("favorites.toolNames.".concat(t.harness))}),(0,x.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:t.profile})]}),(0,x.jsx)(e5,{variant:"secondary",children:n(t.existing?"favorites.updateProfile":"favorites.newProfile")})]}),(0,x.jsxs)("div",{className:"space-y-4 p-4",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,x.jsx)("p",{className:"break-all font-mono text-sm font-medium",children:t.projection.projection.model}),(0,x.jsx)(e5,{variant:"outline",children:n("favorites.modeLabel.".concat(t.mode))})]}),t.projection.notRepresented.length?(0,x.jsxs)(dm,{variant:"warning",children:[n("favorites.notRepresented"),":"," ",t.projection.notRepresented.map(function(e){return n("favorites.".concat(e))}).join(", ")]}):null,fb(t.projection.warnings).concat(fb(t.projection.blockers)).map(function(e,t){return(0,x.jsx)(dm,{variant:"warning",children:n((0,O.Vz)(e.code))},"".concat(e.code,"-").concat(t))}),"activate"===t.mode?(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,x.jsx)(fh,{className:"size-4"}),n("favorites.liveComparison")]}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:n("favorites.liveComparisonHint")}),t.nativeFiles.length?(0,x.jsx)(tr,{collapseUnchanged:!0,intent:"apply",files:t.nativeFiles.map(function(e){return{path:e.key,existed:null!==e.before,currentContent:e.before,content:e.after}})}):(0,x.jsx)(dm,{variant:"warning",children:n("favorites.previewBlocked")})]}):(0,x.jsx)("p",{className:"rounded-lg bg-muted/40 p-3 text-xs text-muted-foreground",children:n("favorites.saveOnlyHint")}),(0,x.jsxs)(fg,{title:n(t.diff.length?"favorites.savedComparison":"favorites.savedUnchanged"),children:[(0,x.jsx)("p",{className:"mb-3 text-xs text-muted-foreground",children:n("favorites.savedComparisonHint")}),t.diff.length?(0,x.jsx)("div",{className:"overflow-x-auto rounded-lg border",children:(0,x.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,x.jsx)("thead",{className:"bg-muted/40 text-muted-foreground",children:(0,x.jsxs)("tr",{children:[(0,x.jsx)("th",{className:"px-3 py-2 font-medium",children:n("favorites.parameter")}),(0,x.jsx)("th",{className:"px-3 py-2 font-medium",children:n("favorites.savedBefore")}),(0,x.jsx)("th",{className:"px-3 py-2 font-medium",children:n("favorites.savedAfter")})]})}),(0,x.jsx)("tbody",{children:t.diff.map(function(e){var t,n;return(0,x.jsxs)("tr",{className:"border-t",children:[(0,x.jsx)("td",{className:"px-3 py-2 font-mono",children:e.field}),(0,x.jsx)("td",{className:"max-w-60 break-all px-3 py-2 text-muted-foreground",children:null!=(t=e.before)?t:"—"}),(0,x.jsx)("td",{className:"max-w-60 break-all bg-primary/[0.025] px-3 py-2 font-medium",children:null!=(n=e.after)?n:"—"})]},e.field)})})]})}):(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("favorites.savedUnchangedHint")})]}),(0,x.jsxs)(fg,{title:n("favorites.mappingDetails"),children:[(0,x.jsx)("dl",{className:"grid gap-2 text-xs sm:grid-cols-2",children:Object.entries(t.resolved.sources).map(function(e){var t=fy(e,2),r=t[0],o=t[1];return(0,x.jsxs)("div",{className:"flex justify-between gap-2 rounded-lg bg-muted/40 p-2",children:[(0,x.jsx)("dt",{children:n("favorites.".concat(r))}),(0,x.jsx)("dd",{className:"text-muted-foreground",children:n("favorite"===o?"favorites.inherited":"connection"===o?"favorites.overridden":"favorites.unknown")})]},r)})}),t.preservedFields.length?(0,x.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n("favorites.preserved"),": ",t.preservedFields.join(", ")]}):null,Object.entries(t.projection.rendererDefaults).map(function(e){var t=fy(e,2),r=t[0],o=t[1];return(0,x.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n("favorites.rendererDefault"),": ",r," = ",o]},r)})]})]})]})}function fk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fj(e){var t,n,r,o=e.items,a=e.history,i=(0,S.Bd)().t,l=(0,w.useId)(),s=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(null==(r=o[0])?void 0:r.harness))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return fk(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fk(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=s[0],u=s[1],d=null!=(n=o.find(function(e){return e.harness===c}))?n:o[0];return d?(0,x.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[(0,x.jsx)(cU,{label:i("favorites.targetTools"),idPrefix:l,items:o.map(function(e){var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={id:e.harness},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t}),value:d.harness,onChange:u,className:"flex shrink-0 gap-2 overflow-x-auto border-b pb-3",tabClassName:"gap-2 px-4 py-3 text-sm font-medium",children:function(e){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(di,{id:e.harness,className:"size-5"}),i("favorites.toolNames.".concat(e.harness)),(0,x.jsx)(e5,{variant:e.projection.blockers.length?"destructive":"secondary",children:e.projection.blockers.length?i("favorites.tabBlocked"):i("favorites.tabChanges",{count:e.nativeFiles.filter(function(e){return e.changed}).length})})]})}}),(0,x.jsxs)(cB,{idPrefix:l,value:d.harness,className:"min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain pr-1",children:[(void 0===a?[]:a).flatMap(function(e){return e.items.filter(function(e){return e.harness===d.harness}).map(function(t){return(0,x.jsx)(dm,{variant:"failed"===t.status?"destructive":"muted",children:(0,x.jsxs)("span",{role:"status",children:[t.profile,": ",i("favorites.".concat(t.status))," ",t.code?i((0,O.Vz)(t.code)):""]})},e.requestId)})}),(0,x.jsx)(fw,{item:d})]},d.harness)]}):null}function fS(e){var t=e.id,n=e.label,r=e.error,o=e.hint,a=e.className,i=e.labelClassName,l=e.children;return(0,x.jsxs)("div",{className:e4("space-y-2",a),children:[(0,x.jsx)(iO,{htmlFor:t,className:i,children:n}),l(fO(t,r)),(0,x.jsx)(fC,{id:t,children:r}),o?(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:o}):null]})}function fO(e,t){return{id:e,"aria-invalid":!!t||void 0,"aria-describedby":t?fN(e):void 0}}function fC(e){var t=e.id,n=e.children;return n?(0,x.jsx)("p",{id:fN(t),className:"text-xs text-destructive",children:n}):null}function fN(e){return"".concat(e,"-error")}function fP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fE(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){fE(e,t,n[t])})}return e}function fA(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function fI(e){return function(e){if(Array.isArray(e))return fP(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return fP(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fP(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fT(e){var t=e.id,n=e.label,r=e.value,o=e.options,a=e.onChange,i=e.placeholder;return(0,x.jsx)(fS,{id:t,label:n,children:function(e){return(0,x.jsxs)(sx,{value:r||void 0,onValueChange:a,children:[(0,x.jsx)(cs,fA(f_({},e),{children:(0,x.jsx)(sk,{placeholder:i})})),(0,x.jsx)(cd,{children:o.map(function(e){return(0,x.jsx)(cf,{value:e.value,children:e.label},e.value)})})]})}})}function fR(e){var t=e.id,n=e.facts,r=e.effort,o=e.onFacts,a=e.onEffort,i=(0,S.Bd)().t;return(0,x.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[["contextWindow","maxOutputTokens"].map(function(e){return(0,x.jsx)(fS,{id:"".concat(t,"-").concat(e),label:i("favorites.".concat(e)),hint:i("favorites.declared"),children:function(t){var r;return(0,x.jsx)(cv,fA(f_({},t),{type:"number",min:1,max:1e8,value:null!=(r=n[e])?r:"",onChange:function(t){return o(fA(f_({},n),fE({},e,t.target.value?Number(t.target.value):void 0)))}}))}},e)}),(0,x.jsx)(fT,{id:"".concat(t,"-reasoning"),label:i("favorites.reasoningSupported"),value:void 0===n.reasoningSupported?"unknown":String(n.reasoningSupported),options:["unknown","true","false"].map(function(e){return{value:e,label:i("favorites.".concat(e))}}),onChange:function(e){return o(fA(f_({},n),{reasoningSupported:"unknown"===e?void 0:"true"===e}))}}),(0,x.jsx)(fT,{id:"".concat(t,"-effort"),label:i("favorites.reasoningEffort"),value:r||"unknown",options:["unknown"].concat(fI(O.wl.options)).map(function(e){return{value:e,label:"unknown"===e?i("favorites.unknown"):e}}),onChange:function(e){return a("unknown"===e?"":e)}}),(0,x.jsxs)("fieldset",{className:"space-y-2 sm:col-span-2",children:[(0,x.jsx)("legend",{children:i("favorites.supportedReasoningEfforts")}),(0,x.jsx)("div",{className:"flex flex-wrap gap-3",children:O.wl.options.map(function(e){var t,r;return(0,x.jsxs)("label",{className:"flex items-center gap-1",children:[(0,x.jsx)(ik,{checked:null!=(t=null==(r=n.supportedReasoningEfforts)?void 0:r.includes(e))&&t,onCheckedChange:function(t){var r,a,i=t?fI(null!=(r=n.supportedReasoningEfforts)?r:[]).concat([e]):null==(a=n.supportedReasoningEfforts)?void 0:a.filter(function(t){return t!==e});o(fA(f_({},n),{supportedReasoningEfforts:(null==i?void 0:i.length)?i:void 0}))}}),e]},e)})})]})]})}function fM(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)""!==(r=fM(e[n]))&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var fz={value:()=>{}};function fD(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw Error("illegal type: "+e);r[e]=[]}return new fL(r)}function fL(e){this._=e}function fF(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=fz,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}function f$(){}function fU(e){return null==e?f$:function(){return this.querySelector(e)}}function fH(){return[]}function fB(e){return null==e?fH:function(){return this.querySelectorAll(e)}}function fV(e){return function(){return this.matches(e)}}function fK(e){return function(t){return t.matches(e)}}fL.prototype=fD.prototype={constructor:fL,on:function(e,t){var n,r=this._,o=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),a=-1,i=o.length;if(arguments.length<2){for(;++a<i;)if((n=(e=o[a]).type)&&(n=function(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}(r[n],e.name)))return n;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++a<i;)if(n=(e=o[a]).type)r[n]=fF(r[n],e.name,t);else if(null==t)for(n in r)r[n]=fF(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new fL(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=Array(n),a=0;a<n;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(r=this._[e],a=0,n=r.length;a<n;++a)r[a].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],o=0,a=r.length;o<a;++o)r[o].value.apply(t,n)}};var fq=Array.prototype.find;function fW(){return this.firstElementChild}var fG=Array.prototype.filter;function fZ(){return Array.from(this.children)}function fY(e){return Array(e.length)}function fX(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function fJ(e,t,n,r,o,a){for(var i,l=0,s=t.length,c=a.length;l<c;++l)(i=t[l])?(i.__data__=a[l],r[l]=i):n[l]=new fX(e,a[l]);for(;l<s;++l)(i=t[l])&&(o[l]=i)}function fQ(e,t,n,r,o,a,i){var l,s,c,u=new Map,d=t.length,f=a.length,p=Array(d);for(l=0;l<d;++l)(s=t[l])&&(p[l]=c=i.call(s,s.__data__,l,t)+"",u.has(c)?o[l]=s:u.set(c,s));for(l=0;l<f;++l)c=i.call(e,a[l],l,a)+"",(s=u.get(c))?(r[l]=s,s.__data__=a[l],u.delete(c)):n[l]=new fX(e,a[l]);for(l=0;l<d;++l)(s=t[l])&&u.get(p[l])===s&&(o[l]=s)}function f0(e){return e.__data__}function f1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}fX.prototype={constructor:fX,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var f2="http://www.w3.org/1999/xhtml";let f4={svg:"http://www.w3.org/2000/svg",xhtml:f2,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function f3(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),f4.hasOwnProperty(t)?{space:f4[t],local:e}:e}function f5(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function f6(e,t){return e.style.getPropertyValue(t)||f5(e).getComputedStyle(e,null).getPropertyValue(t)}function f8(e){return e.trim().split(/^|\s+/)}function f9(e){return e.classList||new f7(e)}function f7(e){this._node=e,this._names=f8(e.getAttribute("class")||"")}function pe(e,t){for(var n=f9(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function pt(e,t){for(var n=f9(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function pn(){this.textContent=""}function pr(){this.innerHTML=""}function po(){this.nextSibling&&this.parentNode.appendChild(this)}function pa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function pi(e){var t=f3(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===f2&&t.documentElement.namespaceURI===f2?t.createElement(e):t.createElementNS(n,e)}})(t)}function pl(){return null}function ps(){var e=this.parentNode;e&&e.removeChild(this)}function pc(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pu(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pd(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,a=t.length;r<a;++r)(n=t[r],e.type&&n.type!==e.type||n.name!==e.name)?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function pf(e,t,n){return function(){var r,o=this.__on,a=function(e){t.call(this,e,this.__data__)};if(o){for(var i=0,l=o.length;i<l;++i)if((r=o[i]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),r.value=t;return}}this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(r):this.__on=[r]}}function pp(e,t,n){var r=f5(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}f7.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ph=[null];function pm(e,t){this._groups=e,this._parents=t}function pg(){return new pm([[document.documentElement]],ph)}function pv(e){return"string"==typeof e?new pm([[document.querySelector(e)]],[document.documentElement]):new pm([[e]],ph)}function py(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}pm.prototype=pg.prototype={constructor:pm,select:function(e){"function"!=typeof e&&(e=fU(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var a,i,l=t[o],s=l.length,c=r[o]=Array(s),u=0;u<s;++u)(a=l[u])&&(i=e.call(a,a.__data__,u,l))&&("__data__"in a&&(i.__data__=a.__data__),c[u]=i);return new pm(r,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=fB(e);for(var n=this._groups,r=n.length,o=[],a=[],i=0;i<r;++i)for(var l,s=n[i],c=s.length,u=0;u<c;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),a.push(l));return new pm(o,a)},selectChild:function(e){var t;return this.select(null==e?fW:(t="function"==typeof e?e:fK(e),function(){return fq.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?fZ:(t="function"==typeof e?e:fK(e),function(){return fG.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=fV(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var a,i=t[o],l=i.length,s=r[o]=[],c=0;c<l;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&s.push(a);return new pm(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,f0);var n=t?fQ:fJ,r=this._parents,o=this._groups;"function"!=typeof e&&(y=e,e=function(){return y});for(var a=o.length,i=Array(a),l=Array(a),s=Array(a),c=0;c<a;++c){var u=r[c],d=o[c],f=d.length,p="object"==typeof(v=e.call(u,u&&u.__data__,c,r))&&"length"in v?v:Array.from(v),h=p.length,m=l[c]=Array(h),g=i[c]=Array(h);n(u,d,m,g,s[c]=Array(f),p,t);for(var v,y,b,x,w=0,k=0;w<h;++w)if(b=m[w]){for(w>=k&&(k=w+1);!(x=g[k])&&++k<h;);b._next=x||null}}return(i=new pm(i,r))._enter=l,i._exit=s,i},enter:function(){return new pm(this._enter||this._groups.map(fY),this._parents)},exit:function(){return new pm(this._exit||this._groups.map(fY),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,a=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?a.remove():n(a),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,a=r.length,i=Math.min(o,a),l=Array(o),s=0;s<i;++s)for(var c,u=n[s],d=r[s],f=u.length,p=l[s]=Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;s<o;++s)l[s]=n[s];return new pm(l,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],a=o.length-1,i=o[a];--a>=0;)(r=o[a])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=f1);for(var n=this._groups,r=n.length,o=Array(r),a=0;a<r;++a){for(var i,l=n[a],s=l.length,c=o[a]=Array(s),u=0;u<s;++u)(i=l[u])&&(c[u]=i);c.sort(t)}return new pm(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var i=r[o];if(i)return i}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,a=t[n],i=0,l=a.length;i<l;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this},attr:function(e,t){var n=f3(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?n.local?function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}:function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}:n.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):f6(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=f8(e+"");if(arguments.length<2){for(var r=f9(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?pe:pt)(this,e)}}:t?function(e){return function(){pe(this,e)}}:function(e){return function(){pt(this,e)}})(n,t))},text:function(e){return arguments.length?this.each(null==e?pn:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?pr:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(po)},lower:function(){return this.each(pa)},append:function(e){var t="function"==typeof e?e:pi(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:pi(e),r=null==t?pl:"function"==typeof t?t:fU(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(ps)},clone:function(e){return this.select(e?pu:pc)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,a=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}),i=a.length;if(arguments.length<2){var l=this.node().__on;if(l){for(var s,c=0,u=l.length;c<u;++c)for(r=0,s=l[c];r<i;++r)if((o=a[r]).type===s.type&&o.name===s.name)return s.value}return}for(r=0,l=t?pf:pd;r<i;++r)this.each(l(a[r],t,n));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return pp(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return pp(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],a=0,i=o.length;a<i;++a)(r=o[a])&&(yield r)}};let pb={passive:!1},px={capture:!0,passive:!1};function pw(e){e.stopImmediatePropagation()}function pk(e){e.preventDefault(),e.stopImmediatePropagation()}function pj(e){var t=e.document.documentElement,n=pv(e).on("dragstart.drag",pk,px);"onselectstart"in t?n.on("selectstart.drag",pk,px):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function pS(e,t){var n=e.document.documentElement,r=pv(e).on("dragstart.drag",null);t&&(r.on("click.drag",pk,px),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let pO=e=>()=>e;function pC(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:a,x:i,y:l,dx:s,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function pN(e){return!e.ctrlKey&&!e.button}function pP(){return this.parentNode}function pE(e,t){return null==t?{x:e.x,y:e.y}:t}function p_(){return navigator.maxTouchPoints||"ontouchstart"in this}function pA(){var e,t,n,r,o=pN,a=pP,i=pE,l=p_,s={},c=fD("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(l).on("touchstart.drag",g).on("touchmove.drag",v,pb).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(i,l){if(!r&&o.call(this,i,l)){var s=b(this,a.call(this,i,l),i,l,"mouse");s&&(pv(i.view).on("mousemove.drag",h,px).on("mouseup.drag",m,px),pj(i.view),pw(i),n=!1,e=i.clientX,t=i.clientY,s("start",i))}}function h(r){if(pk(r),!n){var o=r.clientX-e,a=r.clientY-t;n=o*o+a*a>d}s.mouse("drag",r)}function m(e){pv(e.view).on("mousemove.drag mouseup.drag",null),pS(e.view,n),pk(e),s.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,i=e.changedTouches,l=a.call(this,e,t),s=i.length;for(n=0;n<s;++n)(r=b(this,l,e,t,i[n].identifier,i[n]))&&(pw(e),r("start",e,i[n]))}}function v(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=s[r[t].identifier])&&(pk(e),n("drag",e,r[t]))}function y(e){var t,n,o=e.changedTouches,a=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<a;++t)(n=s[o[t].identifier])&&(pw(e),n("end",e,o[t]))}function b(e,t,n,r,o,a){var l,d,p,h=c.copy(),m=py(a||n,t);if(null!=(p=i.call(e,new pC("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return l=p.x-m[0]||0,d=p.y-m[1]||0,function n(a,i,c){var g,v=m;switch(a){case"start":s[o]=n,g=u++;break;case"end":delete s[o],--u;case"drag":m=py(c||i,t),g=u}h.call(a,e,new pC(a,{sourceEvent:i,subject:p,target:f,identifier:o,active:g,x:m[0]+l,y:m[1]+d,dx:m[0]-v[0],dy:m[1]-v[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:pO(!!e),f):o},f.container=function(e){return arguments.length?(a="function"==typeof e?e:pO(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:pO(e),f):i},f.touchable=function(e){return arguments.length?(l="function"==typeof e?e:pO(!!e),f):l},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e*=1)*e,f):Math.sqrt(d)},f}function pI(e){return((e=Math.exp(e))+1/e)/2}pC.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let pT=function e(t,n,r){function o(e,o){var a,i,l=e[0],s=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-l,h=d-s,m=p*p+h*h;if(m<1e-12)i=Math.log(f/c)/t,a=function(e){return[l+e*p,s+e*h,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(m),v=(f*f-c*c+r*m)/(2*c*n*g),y=(f*f-c*c-r*m)/(2*f*n*g),b=Math.log(Math.sqrt(v*v+1)-v);i=(Math.log(Math.sqrt(y*y+1)-y)-b)/t,a=function(e){var r,o,a=e*i,u=pI(b),d=c/(n*g)*(u*(((r=Math.exp(2*(r=t*a+b)))-1)/(r+1))-((o=Math.exp(o=b))-1/o)/2);return[l+d*p,s+d*h,c*u/pI(t*a+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4);var pR,pM,pz,pD,pL,pF,p$,pU,pH,pB,pV=0,pK=0,pq=0,pW=0,pG=0,pZ=0,pY="object"==typeof performance&&performance.now?performance:Date,pX="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function pJ(){return pG||(pX(pQ),pG=pY.now()+pZ)}function pQ(){pG=0}function p0(){this._call=this._time=this._next=null}function p1(e,t,n){var r=new p0;return r.restart(e,t,n),r}function p2(){pG=(pW=pY.now())+pZ,pV=pK=0;try{pJ(),++pV;for(var e,t=pH;t;)(e=pG-t._time)>=0&&t._call.call(void 0,e),t=t._next;--pV}finally{pV=0,function(){for(var e,t,n=pH,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:pH=t);pB=e,p3(r)}(),pG=0}}function p4(){var e=pY.now(),t=e-pW;t>1e3&&(pZ-=t,pW=e)}function p3(e){!pV&&(pK&&(pK=clearTimeout(pK)),e-pG>24?(e<1/0&&(pK=setTimeout(p2,e-pY.now()-pZ)),pq&&(pq=clearInterval(pq))):(pq||(pW=pY.now(),pq=setInterval(p4,1e3)),pV=1,pX(p2)))}function p5(e,t,n){var r=new p0;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}p0.prototype=p1.prototype={constructor:p0,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?pJ():+n)+(null==t?0:+t),this._next||pB===this||(pB?pB._next=this:pH=this,pB=this),this._call=e,this._time=n,p3()},stop:function(){this._call&&(this._call=null,this._time=1/0,p3())}};var p6=fD("start","end","cancel","interrupt"),p8=[];function p9(e,t,n,r,o,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function a(s){var c,u,d,f;if(1!==n.state)return l();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return p5(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(p5(function(){3===n.state&&(n.state=4,n.timer.restart(i,n.delay,n.time),i(s))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(c=0,n.state=3,r=Array(d=n.tween.length),u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function i(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,i=r.length;++a<i;)r[a].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=p1(function(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:o,on:p6,tween:p8,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function p7(e,t){var n=ht(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function he(e,t){var n=ht(e,t);if(n.state>3)throw Error("too late; already running");return n}function ht(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function hn(e,t){var n,r,o,a=e.__transition,i=!0;if(a){for(o in t=null==t?null:t+"",a){if((n=a[o]).name!==t){i=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[o]}i&&delete e.__transition}}function hr(e,t){return e*=1,t*=1,function(n){return e*(1-n)+t*n}}var ho=180/Math.PI,ha={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function hi(e,t,n,r,o,a){var i,l,s;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(s=e*n+t*r)&&(n-=e*s,r-=t*s),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,s/=l),e*r<t*n&&(e=-e,t=-t,s=-s,i=-i),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*ho,skewX:Math.atan(s)*ho,scaleX:i,scaleY:l}}function hl(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(a,i){var l,s,c,u,d=[],f=[];return a=e(a),i=e(i),!function(e,r,o,a,i,l){if(e!==o||r!==a){var s=i.push("translate(",null,t,null,n);l.push({i:s-4,x:hr(e,o)},{i:s-2,x:hr(r,a)})}else(o||a)&&i.push("translate("+o+t+a+n)}(a.translateX,a.translateY,i.translateX,i.translateY,d,f),l=a.rotate,s=i.rotate,l!==s?(l-s>180?s+=360:s-l>180&&(l+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:hr(l,s)})):s&&d.push(o(d)+"rotate("+s+r),c=a.skewX,u=i.skewX,c!==u?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:hr(c,u)}):u&&d.push(o(d)+"skewX("+u+r),!function(e,t,n,r,a,i){if(e!==n||t!==r){var l=a.push(o(a)+"scale(",null,",",null,")");i.push({i:l-4,x:hr(e,n)},{i:l-2,x:hr(t,r)})}else(1!==n||1!==r)&&a.push(o(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,d,f),a=i=null,function(e){for(var t,n=-1,r=f.length;++n<r;)d[(t=f[n]).i]=t.x(e);return d.join("")}}}var hs=hl(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ha:hi(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),hc=hl(function(e){return null==e?ha:(u||(u=document.createElementNS("http://www.w3.org/2000/svg","g")),u.setAttribute("transform",e),e=u.transform.baseVal.consolidate())?hi((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ha},", ",")",")");function hu(e,t,n){var r=e._id;return e.each(function(){var e=he(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return ht(e,r).value[t]}}function hd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hf(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hp(){}var hh="\\s*([+-]?\\d+)\\s*",hm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",hg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hv=/^#([0-9a-f]{3,8})$/,hy=RegExp(`^rgb\\(${hh},${hh},${hh}\\)$`),hb=RegExp(`^rgb\\(${hg},${hg},${hg}\\)$`),hx=RegExp(`^rgba\\(${hh},${hh},${hh},${hm}\\)$`),hw=RegExp(`^rgba\\(${hg},${hg},${hg},${hm}\\)$`),hk=RegExp(`^hsl\\(${hm},${hg},${hg}\\)$`),hj=RegExp(`^hsla\\(${hm},${hg},${hg},${hm}\\)$`),hS={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function hO(){return this.rgb().formatHex()}function hC(){return this.rgb().formatRgb()}function hN(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=hv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?hP(t):3===n?new hA(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?hE(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?hE(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=hy.exec(e))?new hA(t[1],t[2],t[3],1):(t=hb.exec(e))?new hA(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=hx.exec(e))?hE(t[1],t[2],t[3],t[4]):(t=hw.exec(e))?hE(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=hk.exec(e))?hD(t[1],t[2]/100,t[3]/100,1):(t=hj.exec(e))?hD(t[1],t[2]/100,t[3]/100,t[4]):hS.hasOwnProperty(e)?hP(hS[e]):"transparent"===e?new hA(NaN,NaN,NaN,0):null}function hP(e){return new hA(e>>16&255,e>>8&255,255&e,1)}function hE(e,t,n,r){return r<=0&&(e=t=n=NaN),new hA(e,t,n,r)}function h_(e,t,n,r){var o;return 1==arguments.length?((o=e)instanceof hp||(o=hN(o)),o)?new hA((o=o.rgb()).r,o.g,o.b,o.opacity):new hA:new hA(e,t,n,null==r?1:r)}function hA(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function hI(){return`#${hz(this.r)}${hz(this.g)}${hz(this.b)}`}function hT(){let e=hR(this.opacity);return`${1===e?"rgb(":"rgba("}${hM(this.r)}, ${hM(this.g)}, ${hM(this.b)}${1===e?")":`, ${e})`}`}function hR(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hM(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function hz(e){return((e=hM(e))<16?"0":"")+e.toString(16)}function hD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hF(e,t,n,r)}function hL(e){if(e instanceof hF)return new hF(e.h,e.s,e.l,e.opacity);if(e instanceof hp||(e=hN(e)),!e)return new hF;if(e instanceof hF)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,l=a-o,s=(a+o)/2;return l?(i=t===a?(n-r)/l+(n<r)*6:n===a?(r-t)/l+2:(t-n)/l+4,l/=s<.5?a+o:2-a-o,i*=60):l=s>0&&s<1?0:i,new hF(i,l,s,e.opacity)}function hF(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function h$(e){return(e=(e||0)%360)<0?e+360:e}function hU(e){return Math.max(0,Math.min(1,e||0))}function hH(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function hB(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}hd(hp,hN,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:hO,formatHex:hO,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return hL(this).formatHsl()},formatRgb:hC,toString:hC}),hd(hA,h_,hf(hp,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new hA(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new hA(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hA(hM(this.r),hM(this.g),hM(this.b),hR(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hI,formatHex:hI,formatHex8:function(){return`#${hz(this.r)}${hz(this.g)}${hz(this.b)}${hz((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:hT,toString:hT})),hd(hF,function(e,t,n,r){return 1==arguments.length?hL(e):new hF(e,t,n,null==r?1:r)},hf(hp,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new hF(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new hF(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new hA(hH(e>=240?e-240:e+120,o,r),hH(e,o,r),hH(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new hF(h$(this.h),hU(this.s),hU(this.l),hR(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=hR(this.opacity);return`${1===e?"hsl(":"hsla("}${h$(this.h)}, ${100*hU(this.s)}%, ${100*hU(this.l)}%${1===e?")":`, ${e})`}`}}));let hV=e=>()=>e;function hK(e,t){var n=t-e;return n?function(t){return e+t*n}:hV(isNaN(e)?t:e)}let hq=function e(t){var n,r=1==(n=+t)?hK:function(e,t){var r,o,a;return t-e?(r=e,o=t,r=Math.pow(r,a=n),o=Math.pow(o,a)-r,a=1/a,function(e){return Math.pow(r+e*o,a)}):hV(isNaN(e)?t:e)};function o(e,t){var n=r((e=h_(e)).r,(t=h_(t)).r),o=r(e.g,t.g),a=r(e.b,t.b),i=hK(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function hW(e){return function(t){var n,r,o=t.length,a=Array(o),i=Array(o),l=Array(o);for(n=0;n<o;++n)r=h_(t[n]),a[n]=r.r||0,i[n]=r.g||0,l[n]=r.b||0;return a=e(a),i=e(i),l=e(l),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=l(e),r+""}}}hW(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,l=r<t-1?e[r+2]:2*a-o;return hB((n-r/t)*t,i,o,a,l)}}),hW(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],l=e[(r+2)%t];return hB((n-r/t)*t,o,a,i,l)}});var hG=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hZ=RegExp(hG.source,"g");function hY(e,t){var n,r,o,a,i,l=hG.lastIndex=hZ.lastIndex=0,s=-1,c=[],u=[];for(e+="",t+="";(o=hG.exec(e))&&(a=hZ.exec(t));)(i=a.index)>l&&(i=t.slice(l,i),c[s]?c[s]+=i:c[++s]=i),(o=o[0])===(a=a[0])?c[s]?c[s]+=a:c[++s]=a:(c[++s]=null,u.push({i:s,x:hr(o,a)})),l=hZ.lastIndex;return l<t.length&&(i=t.slice(l),c[s]?c[s]+=i:c[++s]=i),c.length<2?u[0]?(n=u[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=u.length,function(e){for(var n,r=0;r<t;++r)c[(n=u[r]).i]=n.x(e);return c.join("")})}function hX(e,t){var n;return("number"==typeof t?hr:t instanceof hN?hq:(n=hN(t))?(t=n,hq):hY)(e,t)}var hJ=pg.prototype.constructor;function hQ(e){return function(){this.style.removeProperty(e)}}var h0=0;function h1(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}var h2=pg.prototype;h1.prototype=(function(e){return pg().transition(e)}).prototype={constructor:h1,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=fU(e));for(var r=this._groups,o=r.length,a=Array(o),i=0;i<o;++i)for(var l,s,c=r[i],u=c.length,d=a[i]=Array(u),f=0;f<u;++f)(l=c[f])&&(s=e.call(l,l.__data__,f,c))&&("__data__"in l&&(s.__data__=l.__data__),d[f]=s,p9(d[f],t,n,f,d,ht(l,n)));return new h1(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=fB(e));for(var r=this._groups,o=r.length,a=[],i=[],l=0;l<o;++l)for(var s,c=r[l],u=c.length,d=0;d<u;++d)if(s=c[d]){for(var f,p=e.call(s,s.__data__,d,c),h=ht(s,n),m=0,g=p.length;m<g;++m)(f=p[m])&&p9(f,t,n,m,p,h);a.push(p),i.push(s)}return new h1(a,i,t,n)},selectChild:h2.selectChild,selectChildren:h2.selectChildren,filter:function(e){"function"!=typeof e&&(e=fV(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var a,i=t[o],l=i.length,s=r[o]=[],c=0;c<l;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&s.push(a);return new h1(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,o=n.length,a=Math.min(r,o),i=Array(r),l=0;l<a;++l)for(var s,c=t[l],u=n[l],d=c.length,f=i[l]=Array(d),p=0;p<d;++p)(s=c[p]||u[p])&&(f[p]=s);for(;l<r;++l)i[l]=t[l];return new h1(i,this._parents,this._name,this._id)},selection:function(){return new hJ(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=++h0,r=this._groups,o=r.length,a=0;a<o;++a)for(var i,l=r[a],s=l.length,c=0;c<s;++c)if(i=l[c]){var u=ht(i,t);p9(i,e,n,c,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new h1(r,this._parents,e,n)},call:h2.call,nodes:h2.nodes,node:h2.node,size:h2.size,empty:h2.empty,each:h2.each,on:function(e,t){var n,r,o,a,i,l,s=this._id;return arguments.length<2?ht(this.node(),s).on.on(e):this.each((n=s,r=e,o=t,l=(r+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?p7:he,function(){var e=l(this,n),t=e.on;t!==a&&(i=(a=t).copy()).on(r,o),e.on=i}))},attr:function(e,t){var n=f3(e),r="transform"===n?hc:hX;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,o,a;return function(){var i,l,s=n(this);return null==s?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local))===(l=s+"")?null:i===r&&l===o?a:(o=l,a=t(r=i,s))}}:function(e,t,n){var r,o,a;return function(){var i,l,s=n(this);return null==s?void this.removeAttribute(e):(i=this.getAttribute(e))===(l=s+"")?null:i===r&&l===o?a:(o=l,a=t(r=i,s))}})(n,r,hu(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===r?o:o=t(r=i,n)}}:function(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===r?o:o=t(r=i,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();var r=f3(e);return this.tween(n,(r.local?function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttributeNS(e.space,e.local,o.call(this,t))}),n}return o._value=t,o}:function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttribute(e,o.call(this,t))}),n}return o._value=t,o})(r,t))},style:function(e,t,n){var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w,k,j,S="transform"==(e+="")?hs:hX;return null==t?this.styleTween(e,(r=e,function(){var e=f6(this,r),t=(this.style.removeProperty(r),f6(this,r));return e===t?null:e===o&&t===a?i:i=S(o=e,a=t)})).on("end.style."+e,hQ(e)):"function"==typeof t?this.styleTween(e,(l=e,s=hu(this,"style."+e,t),function(){var e=f6(this,l),t=s(this),n=t+"";return null==t&&(this.style.removeProperty(l),n=t=f6(this,l)),e===n?null:e===c&&n===u?d:(u=n,d=S(c=e,t))})).each((f=this._id,b="end."+(y="style."+(p=e)),function(){var e=he(this,f),t=e.on,n=null==e.value[y]?v||(v=hQ(p)):void 0;(t!==h||g!==n)&&(m=(h=t).copy()).on(b,g=n),e.on=m})):this.styleTween(e,(x=e,j=t+"",function(){var e=f6(this,x);return e===j?null:e===w?k:k=S(w=e,t)}),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw Error();return this.tween(r,function(e,t,n){var r,o;function a(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&function(t){this.style.setProperty(e,a.call(this,t),n)}),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){var t,n;return this.tween("text","function"==typeof e?(t=hu(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(n=null==e?"":e+"",function(){this.textContent=n}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){this.textContent=r.call(this,e)}),t}return r._value=e,r}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=ht(this.node(),n).tween,a=0,i=o.length;a<i;++a)if((r=o[a]).name===e)return r.value;return null}return this.each((null==t?function(e,t){var n,r;return function(){var o=he(this,e),a=o.tween;if(a!==n){r=n=a;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){(r=r.slice()).splice(i,1);break}}o.tween=r}}:function(e,t,n){var r,o;if("function"!=typeof n)throw Error();return function(){var a=he(this,e),i=a.tween;if(i!==r){o=(r=i).slice();for(var l={name:t,value:n},s=0,c=o.length;s<c;++s)if(o[s].name===t){o[s]=l;break}s===c&&o.push(l)}a.tween=o}})(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){p7(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){p7(this,e).delay=t}})(t,e)):ht(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){he(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){he(this,e).duration=t}})(t,e)):ht(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){he(this,e).ease=t}}(t,e)):ht(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw Error();he(this,t).ease=n}))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(a,i){var l={value:i},s={value:function(){0==--o&&a()}};n.each(function(){var n=he(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),n.on=t}),0===o&&a()})},[Symbol.iterator]:h2[Symbol.iterator]};var h4={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};pg.prototype.interrupt=function(e){return this.each(function(){hn(this,e)})},pg.prototype.transition=function(e){var t,n;e instanceof h1?(t=e._id,e=e._name):(t=++h0,(n=h4).time=pJ(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,a=0;a<o;++a)for(var i,l=r[a],s=l.length,c=0;c<s;++c)(i=l[c])&&p9(i,e,t,c,l,n||function(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}(i,t));return new h1(r,this._parents,e,t)};let h3=e=>()=>e;function h5(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function h6(e,t,n){this.k=e,this.x=t,this.y=n}h6.prototype={constructor:h6,scale:function(e){return 1===e?this:new h6(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new h6(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var h8=new h6(1,0,0);function h9(e){for(;!e.__zoom;)if(!(e=e.parentNode))return h8;return e.__zoom}function h7(e){e.stopImmediatePropagation()}function me(e){e.preventDefault(),e.stopImmediatePropagation()}function mt(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function mn(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function mr(){return this.__zoom||h8}function mo(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ma(){return navigator.maxTouchPoints||"ontouchstart"in this}function mi(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}function ml(){var e,t,n,r=mt,o=mn,a=mi,i=mo,l=ma,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=pT,f=fD("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",mr).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",S).filter(l).on("touchstart.zoom",O).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(s[0],Math.min(s[1],t)))===e.k?e:new h6(t,e.x,e.y)}function v(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new h6(e.k,r,o)}function y(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){x(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(r).end()}).tween("zoom",function(){var e=arguments,a=x(this,e).event(r),i=o.apply(this,e),l=null==n?y(i):"function"==typeof n?n.apply(this,e):n,s=Math.max(i[1][0]-i[0][0],i[1][1]-i[0][1]),c=this.__zoom,u="function"==typeof t?t.apply(this,e):t,f=d(c.invert(l).concat(s/c.k),u.invert(l).concat(s/u.k));return function(e){if(1===e)e=u;else{var t=f(e),n=s/t[2];e=new h6(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.zoom(null,e)}})}function x(e,t,n){return!n&&e.__zooming||new w(e,t)}function w(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function k(e,...t){if(r.apply(this,arguments)){var n=x(this,t).event(e),o=this.__zoom,l=Math.max(s[0],Math.min(s[1],o.k*Math.pow(2,i.apply(this,arguments)))),u=py(e);if(n.wheel)(n.mouse[0][0]!==u[0]||n.mouse[0][1]!==u[1])&&(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===l)return;n.mouse=[u,o.invert(u)],hn(this),n.start()}me(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(v(g(o,l),n.mouse[0],n.mouse[1]),n.extent,c))}}function j(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,i=x(this,t,!0).event(e),l=pv(e.view).on("mousemove.zoom",function(e){if(me(e),!i.moved){var t=e.clientX-u,n=e.clientY-d;i.moved=t*t+n*n>p}i.event(e).zoom("mouse",a(v(i.that.__zoom,i.mouse[0]=py(e,o),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){l.on("mousemove.zoom mouseup.zoom",null),pS(e.view,i.moved),me(e),i.event(e).end()},!0),s=py(e,o),u=e.clientX,d=e.clientY;pj(e.view),h7(e),i.mouse=[s,this.__zoom.invert(s)],hn(this),i.start()}}function S(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,i=py(e.changedTouches?e.changedTouches[0]:e,this),l=n.invert(i),s=n.k*(e.shiftKey?.5:2),d=a(v(g(n,s),i,l),o.apply(this,t),c);me(e),u>0?pv(this).transition().duration(u).call(b,d,i,e):pv(this).call(m.transform,d,i,e)}}function O(n,...o){if(r.apply(this,arguments)){var a,i,l,s,c=n.touches,u=c.length,d=x(this,o,n.changedTouches.length===u).event(n);for(h7(n),i=0;i<u;++i)s=[s=py(l=c[i],this),this.__zoom.invert(s),l.identifier],d.touch0?d.touch1||d.touch0[2]===s[2]||(d.touch1=s,d.taps=0):(d.touch0=s,a=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),a&&(d.taps<2&&(t=s[0],e=setTimeout(function(){e=null},500)),hn(this),d.start())}}function C(e,...t){if(this.__zooming){var n,r,o,i,l=x(this,t).event(e),s=e.changedTouches,u=s.length;for(me(e),n=0;n<u;++n)o=py(r=s[n],this),l.touch0&&l.touch0[2]===r.identifier?l.touch0[0]=o:l.touch1&&l.touch1[2]===r.identifier&&(l.touch1[0]=o);if(r=l.that.__zoom,l.touch1){var d=l.touch0[0],f=l.touch0[1],p=l.touch1[0],h=l.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,y=(y=h[0]-f[0])*y+(y=h[1]-f[1])*y;r=g(r,Math.sqrt(m/y)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],i=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!l.touch0)return;o=l.touch0[0],i=l.touch0[1]}l.zoom("touch",a(v(r,o,i),l.extent,c))}}function N(e,...r){if(this.__zooming){var o,a,i=x(this,r).event(e),l=e.changedTouches,s=l.length;for(h7(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<s;++o)a=l[o],i.touch0&&i.touch0[2]===a.identifier?delete i.touch0:i.touch1&&i.touch1[2]===a.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(a=py(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<h)){var c=pv(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",mr),e!==o?b(e,t,n,r):o.interrupt().each(function(){x(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,i=null==n?y(e):"function"==typeof n?n.apply(this,arguments):n,l=r.invert(i),s="function"==typeof t?t.apply(this,arguments):t;return a(v(g(r,s),i,l),e,c)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)},null,r)},m.translateTo=function(e,t,n,r,i){m.transform(e,function(){var e=o.apply(this,arguments),i=this.__zoom,l=null==r?y(e):"function"==typeof r?r.apply(this,arguments):r;return a(h8.translate(l[0],l[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,i)},w.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=pv(this.that).datum();f.call(e,this.that,new h5(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:h3(+e),m):i},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:h3(!!e),m):r},m.touchable=function(e){return arguments.length?(l="function"==typeof e?e:h3(!!e),m):l},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:h3([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(s[0]=+e[0],s[1]=+e[1],m):[s[0],s[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(a=e,m):a},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e*=1)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}function ms(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?hV(t):("number"===o?hr:"string"===o?(r=hN(t))?(t=r,hq):hY:t instanceof hN?hq:t instanceof Date?function(e,t){var n=new Date;return e*=1,t*=1,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=Array(o),i=Array(r);for(n=0;n<o;++n)a[n]=ms(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},o={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=ms(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}:hr:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}})(e,t)}h9.prototype=h6.prototype;let mc=[[-1/0,-1/0],[1/0,1/0]],mu=["Enter"," ","Escape"],md={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};(n=f||(f={})).Strict="strict",n.Loose="loose",(r=p||(p={})).Free="free",r.Vertical="vertical",r.Horizontal="horizontal",(o=h||(h={})).Partial="partial",o.Full="full";let mf={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};(a=m||(m={})).Bezier="default",a.Straight="straight",a.Step="step",a.SmoothStep="smoothstep",a.SimpleBezier="simplebezier",(i=g||(g={})).Arrow="arrow",i.ArrowClosed="arrowclosed",(l=v||(v={})).Left="left",l.Top="top",l.Right="right",l.Bottom="bottom";let mp={[v.Left]:v.Right,[v.Right]:v.Left,[v.Top]:v.Bottom,[v.Bottom]:v.Top},mh=e=>!!e&&"object"==typeof e&&"id"in e&&"source"in e&&"target"in e,mm=e=>!!e&&"object"==typeof e&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),mg=(e,t=[0,0])=>{let{width:n,height:r}=mK(e),o=e.origin??t,a=n*o[0],i=r*o[1];return{x:e.position.x-a,y:e.position.y-i}},mv=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=mN(n,mA(e)),r=!0)}),r?mE(n):{x:0,y:0,width:0,height:0}},my=(e,t,[n,r,o]=[0,0,1],a=!1,i=!1)=>{let l=(t.x-n)/o,s=(t.y-r)/o,c=t.width/o,u=t.height/o,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(i&&!n||r)continue;let o=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:h}=t.internals.positionAbsolute,m=mT(l,s,c,u,p,h,o,f),g=o*f,v=a&&m>0;(!t.internals.handleBounds||v||m>=g||t.dragging)&&d.push(t)}return d};async function mb({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:a},i){let l,s;if(0===e.size)return!0;let c=mH(mv((l=new Map,s=i?.nodes?new Set(i.nodes.map(e=>e.id)):null,e.forEach(e=>{let t;if(i?.includeHiddenNodes){let{width:n,height:r}=mK(e);t=n>0&&r>0}else t=!!(e.measured.width&&e.measured.height&&!e.hidden);t&&(!s||s.has(e.id))&&l.set(e.id,e)}),l)),t,n,i?.minZoom??o,i?.maxZoom??a,i?.padding??.1);return await r.setViewport(c,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),!0}function mx({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:a}){let i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:s,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},u=i.origin??r,d=i.extent||o;if("parent"!==i.extent||i.expandParent)l&&mV(i.extent)&&(d=[[i.extent[0][0]+s,i.extent[0][1]+c],[i.extent[1][0]+s,i.extent[1][1]+c]]);else if(l){let{width:e,height:t}=mK(l);e&&t&&(d=[[s,c],[s+e,c+t]])}else a?.("005","Only child nodes can use a parent extent.");let f=mV(d)?mj(t,d,i.measured):t;return(void 0===i.measured.width||void 0===i.measured.height)&&a?.("015","It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."),{position:{x:f.x-s+(i.measured.width??0)*u[0],y:f.y-c+(i.measured.height??0)*u[1]},positionAbsolute:f}}async function mw({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){let a,i=new Set(e.map(e=>e.id)),l=[];for(let e of n){if(!1===e.deletable)continue;let t=i.has(e.id),n=!t&&e.parentId&&l.find(t=>t.id===e.parentId);(t||n)&&l.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>!1!==e.deletable),u=(a=new Set,l.forEach(e=>{a.add(e.id)}),c.filter(e=>a.has(e.source)||a.has(e.target)));for(let e of c)s.has(e.id)&&!u.find(t=>t.id===e.id)&&u.push(e);if(!o)return{edges:u,nodes:l};let d=await o({nodes:l,edges:u});return"boolean"==typeof d?d?{edges:u,nodes:l}:{edges:[],nodes:[]}:d}let mk=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),mj=(e={x:0,y:0},t,n)=>({x:mk(e.x,t[0][0],t[1][0]-(n?.width??0)),y:mk(e.y,t[0][1],t[1][1]-(n?.height??0))});function mS(e,t,n){let{width:r,height:o}=mK(n),{x:a,y:i}=n.internals.positionAbsolute;return mj(e,[[a,i],[a+r,i+o]],t)}let mO=(e,t,n)=>e<t?mk(Math.abs(e-t),1,t)/t:e>n?-mk(Math.abs(e-n),1,t)/t:0,mC=(e,t,n=15,r=40)=>[mO(e.x,r,t.width-r)*n,mO(e.y,r,t.height-r)*n],mN=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),mP=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),mE=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),m_=(e,t=[0,0])=>{let{x:n,y:r}=mm(e)?e.internals.positionAbsolute:mg(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},mA=(e,t=[0,0])=>{let{x:n,y:r}=mm(e)?e.internals.positionAbsolute:mg(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},mI=(e,t)=>mE(mN(mP(e),mP(t))),mT=(e,t,n,r,o,a,i,l)=>Math.ceil(Math.max(0,Math.min(e+n,o+i)-Math.max(e,o))*Math.max(0,Math.min(t+r,a+l)-Math.max(t,a))),mR=(e,t)=>mT(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),mM=e=>mz(e.width)&&mz(e.height)&&mz(e.x)&&mz(e.y),mz=e=>!isNaN(e)&&isFinite(e),mD=(e,t)=>(e,t)=>{},mL=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),mF=({x:e,y:t},[n,r,o],a=!1,i=[1,1])=>{let l={x:(e-n)/o,y:(t-r)/o};return a?mL(l,i):l},m$=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function mU(e,t){if("number"==typeof e)return Math.floor((t-t/(1+e))*.5);if("string"==typeof e&&e.endsWith("px")){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let mH=(e,t,n,r,o,a)=>{let i=function(e,t,n){if("string"==typeof e||"number"==typeof e){let r=mU(e,n),o=mU(e,t);return{top:r,right:o,bottom:r,left:o,x:2*o,y:2*r}}if("object"==typeof e){let r=mU(e.top??e.y??0,n),o=mU(e.bottom??e.y??0,n),a=mU(e.left??e.x??0,t),i=mU(e.right??e.x??0,t);return{top:r,right:i,bottom:o,left:a,x:a+i,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(a,t,n),l=mk(Math.min((t-i.x)/e.width,(n-i.y)/e.height),r,o),s=e.x+e.width/2,c=e.y+e.height/2,u=t/2-s*l,d=n/2-c*l,f=function(e,t,n,r,o,a){let{x:i,y:l}=m$(e,[t,n,r]),{x:s,y:c}=m$({x:e.x+e.width,y:e.y+e.height},[t,n,r]);return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(o-s),bottom:Math.floor(a-c)}}(e,u,d,l,t,n),p={left:Math.min(f.left-i.left,0),top:Math.min(f.top-i.top,0),right:Math.min(f.right-i.right,0),bottom:Math.min(f.bottom-i.bottom,0)};return{x:u-p.left+p.right,y:d-p.top+p.bottom,zoom:l}},mB=()=>"u">typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function mV(e){return null!=e&&"parent"!==e}function mK(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function mq(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function mW(e,t={width:0,height:0},n,r,o){let a={...e},i=r.get(n);if(i){let e=i.origin||o;a.x+=i.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=i.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function mG(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function mZ(e){return null===e?null:e?"valid":"invalid"}function mY(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){let{x:a,y:i}=m1(e),l=mF({x:a-(o?.left??0),y:i-(o?.top??0)},r),{x:s,y:c}=n?mL(l,t):l;return{xSnapped:s,ySnapped:c,...l}}let mX=e=>({width:e.offsetWidth,height:e.offsetHeight}),mJ=e=>e?.getRootNode?.()||window?.document,mQ=["INPUT","SELECT","TEXTAREA"];function m0(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1&&(mQ.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}let m1=(e,t)=>{let n="clientX"in e,r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},m2=(e,t,n,r,o)=>{let a=t.querySelectorAll(`.${e}`);return a&&a.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:o,position:t.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...mX(t)}}):null};function m4({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:a,targetControlX:i,targetControlY:l}){let s=.125*e+.375*o+.375*i+.125*n,c=.125*t+.375*a+.375*l+.125*r,u=Math.abs(s-e),d=Math.abs(c-t);return[s,c,u,d]}function m3(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function m5({pos:e,x1:t,y1:n,x2:r,y2:o,c:a}){switch(e){case v.Left:return[t-m3(t-r,a),n];case v.Right:return[t+m3(r-t,a),n];case v.Top:return[t,n-m3(n-o,a)];case v.Bottom:return[t,n+m3(o-n,a)]}}function m6({sourceX:e,sourceY:t,sourcePosition:n=v.Bottom,targetX:r,targetY:o,targetPosition:a=v.Top,curvature:i=.25}){let[l,s]=m5({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,u]=m5({pos:a,x1:r,y1:o,x2:e,y2:t,c:i}),[d,f,p,h]=m4({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${s} ${c},${u} ${r},${o}`,d,f,p,h]}function m8({sourceX:e,sourceY:t,targetX:n,targetY:r}){let o=Math.abs(n-e)/2,a=Math.abs(r-t)/2;return[n<e?n+o:n-o,r<t?r+a:r-a,o,a]}let m9=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`;function m7({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[o,a,i,l]=m8({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,a,i,l]}let ge={[v.Left]:{x:-1,y:0},[v.Right]:{x:1,y:0},[v.Top]:{x:0,y:-1},[v.Bottom]:{x:0,y:1}},gt=({source:e,sourcePosition:t=v.Bottom,target:n})=>t===v.Left||t===v.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},gn=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gr({sourceX:e,sourceY:t,sourcePosition:n=v.Bottom,targetX:r,targetY:o,targetPosition:a=v.Top,borderRadius:i=5,centerX:l,centerY:s,offset:c=20,stepPosition:u=.5}){let[d,f,p,h,m]=function({source:e,sourcePosition:t=v.Bottom,target:n,targetPosition:r=v.Top,center:o,offset:a,stepPosition:i}){let l,s,c=ge[t],u=ge[r],d={x:e.x+c.x*a,y:e.y+c.y*a},f={x:n.x+u.x*a,y:n.y+u.y*a},p=gt({source:d,sourcePosition:t,target:f}),h=0!==p.x?"x":"y",m=p[h],g=[],y={x:0,y:0},b={x:0,y:0},[,,x,w]=m8({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[h]*u[h]==-1){"x"===h?(l=o.x??d.x+(f.x-d.x)*i,s=o.y??(d.y+f.y)/2):(l=o.x??(d.x+f.x)/2,s=o.y??d.y+(f.y-d.y)*i);let e=[{x:l,y:d.y},{x:l,y:f.y}],t=[{x:d.x,y:s},{x:f.x,y:s}];g=c[h]===m?"x"===h?e:t:"x"===h?t:e}else{let o=[{x:d.x,y:f.y}],i=[{x:f.x,y:d.y}];if(g="x"===h?c.x===m?i:o:c.y===m?o:i,t===r){let t=Math.abs(e[h]-n[h]);if(t<=a){let r=Math.min(a-1,a-t);c[h]===m?y[h]=(d[h]>e[h]?-1:1)*r:b[h]=(f[h]>n[h]?-1:1)*r}}if(t!==r){let e="x"===h?"y":"x",t=c[h]===u[e],n=d[e]>f[e],r=d[e]<f[e];(1===c[h]&&(!t&&n||t&&r)||1!==c[h]&&(!t&&r||t&&n))&&(g="x"===h?o:i)}let p={x:d.x+y.x,y:d.y+y.y},v={x:f.x+b.x,y:f.y+b.y};Math.max(Math.abs(p.x-g[0].x),Math.abs(v.x-g[0].x))>=Math.max(Math.abs(p.y-g[0].y),Math.abs(v.y-g[0].y))?(l=(p.x+v.x)/2,s=g[0].y):(l=g[0].x,s=(p.y+v.y)/2)}let k={x:d.x+y.x,y:d.y+y.y},j={x:f.x+b.x,y:f.y+b.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...j.x!==g[g.length-1].x||j.y!==g[g.length-1].y?[j]:[],n],l,s,x,w]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:a,center:{x:l,y:s},offset:c,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=function(e,t,n,r){let o=Math.min(gn(e,t)/2,gn(t,n)/2,r),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+o*t},${i}Q ${a},${i} ${a},${i+o*r}`}let l=e.x<n.x?1:-1,s=e.y<n.y?-1:1;return`L ${a},${i+o*s}Q ${a},${i} ${a+o*l},${i}`}(d[e-1],d[e],d[e+1],i);return[g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,f,p,h,m]}function go(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function ga(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function gi(e,t,n=v.Left,r=!1){let o=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??mK(e);if(r)return{x:o+i/2,y:a+l/2};switch(t?.position??n){case v.Top:return{x:o+i/2,y:a};case v.Right:return{x:o+i,y:a+l/2};case v.Bottom:return{x:o+i/2,y:a+l};case v.Left:return{x:o,y:a+l/2}}}function gl(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function gs(e,t){if(!e)return"";if("string"==typeof e)return e;let n=t?`${t}__`:"";return`${n}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}let gc={nodeOrigin:[0,0],nodeExtent:mc,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},gu={...gc,checkEquality:!0};function gd(e,t){let n={...e};for(let e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function gf(e){return"manual"===e}function gp(e,t,n,r={}){let o=gd(gu,r),a={i:0},i=new Map(t),l=o?.elevateNodesOnSelect&&!gf(o.zIndexMode)?1e3:0,s=e.length>0,c=!1;for(let u of(t.clear(),n.clear(),e)){let e=i.get(u.id);if(o.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=mj(mg(u,o.nodeOrigin),mV(u.extent)?u.extent:o.nodeExtent,mK(u));e={...o.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:function(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let o={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(o):"target"===t.type&&r.push(o)}return{source:n,target:r}}(u,e),z:gm(u,l,o.zIndexMode),userNode:u}},t.set(u.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(s=!1),u.parentId&&gh(e,t,n,r,a),c||=u.selected??!1}return{nodesInitialized:s,hasSelectedNodes:c}}function gh(e,t,n,r,o){let{elevateNodesOnSelect:a,nodeOrigin:i,nodeExtent:l,zIndexMode:s}=gd(gc,r),c=e.parentId,u=t.get(c);if(!u)return void console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),o&&!u.parentId&&void 0===u.internals.rootParentIndex&&"auto"===s&&(u.internals.rootParentIndex=++o.i,u.internals.z=u.internals.z+10*o.i),o&&void 0!==u.internals.rootParentIndex&&(o.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=function(e,t,n,r,o,a){let{x:i,y:l}=t.internals.positionAbsolute,s=mK(e),c=mg(e,n),u=mV(e.extent)?mj(c,e.extent,s):c,d=mj({x:i+u.x,y:l+u.y},r,s);"parent"===e.extent&&(d=mS(d,s,t));let f=gm(e,o,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}(e,u,i,l,a&&!gf(s)?1e3:0,s),{positionAbsolute:h}=e.internals,m=d!==h.x||f!==h.y;(m||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:m?{x:d,y:f}:h,z:p}})}function gm(e,t,n){let r=mz(e.zIndex)?e.zIndex:0;return gf(n)?r:r+(e.selected?t:0)}function gg(e,t,n,r=[0,0]){let o=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=mI(a.get(n.parentId)?.expandedRect??m_(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},i)=>{let l=a.internals.positionAbsolute,s=mK(a),c=a.origin??r,u=t.x<l.x?Math.round(Math.abs(l.x-t.x)):0,d=t.y<l.y?Math.round(Math.abs(l.y-t.y)):0,f=Math.max(s.width,Math.round(t.width)),p=Math.max(s.height,Math.round(t.height)),h=(f-s.width)*c[0],m=(p-s.height)*c[1];(u>0||d>0||h||m)&&(o.push({id:i,type:"position",position:{x:a.position.x-u+h,y:a.position.y-d+m}}),n.get(i)?.forEach(t=>{e.some(e=>e.id===t.id)||o.push({id:t.id,type:"position",position:{x:t.position.x+u,y:t.position.y+d}})})),(s.width<t.width||s.height<t.height||u||d)&&o.push({id:i,type:"dimensions",setAttributes:!0,dimensions:{width:f+(u?c[0]*u-h:0),height:p+(d?c[1]*d-m:0)}})}),o}async function gv({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:a}){if(!t||!e.x&&!e.y)return!1;let i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,a]],r);return!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2])}function gy(e,t,n,r,o,a){let i=o,l=r.get(i)||new Map;r.set(i,l.set(n,t)),i=`${o}-${e}`;let s=r.get(i)||new Map;if(r.set(i,s.set(n,t)),a){i=`${o}-${e}-${a}`;let l=r.get(i)||new Map;r.set(i,l.set(n,t))}}function gb(e,t,n){for(let r of(e.clear(),t.clear(),n)){let{source:n,target:o,sourceHandle:a=null,targetHandle:i=null}=r,l={edgeId:r.id,source:n,target:o,sourceHandle:a,targetHandle:i},s=`${n}-${a}--${o}-${i}`;gy("source",l,`${o}-${i}--${n}-${a}`,e,n,a),gy("target",l,s,e,o,i),t.set(r.id,r)}}function gx(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)break;r=r?.parentElement}while(r);return!1}function gw({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let o=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&o.push({...t,position:a.position,dragging:r})}if(!e)return[o[0],o];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:o[0],o]}function gk(e,t,n,r,o,a=!1){let i=r.get(e);if(!i)return null;let l="strict"===o?i.internals.handleBounds?.[t]:[...i.internals.handleBounds?.source??[],...i.internals.handleBounds?.target??[]],s=(n?l?.find(e=>e.id===n):l?.[0])??null;return s&&a?{...s,...gi(i,s,s.position,!0)}:s}function gj(e,t){return e?e:t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null}let gS=()=>!0;function gO(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:a,doc:i,lib:l,flowId:s,isValidConnection:c=gS,nodeLookup:u}){let d="target"===a,p=t?i.querySelector(`.${l}-flow__handle[data-id="${s}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:m}=m1(e),g=i.elementFromPoint(h,m),v=g?.classList.contains(`${l}-flow__handle`)?g:p,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){let e=gj(void 0,v),t=v.getAttribute("data-nodeid"),a=v.getAttribute("data-handleid"),i=v.classList.contains("connectable"),l=v.classList.contains("connectableend");if(!t||!e)return y;let s={source:d?t:r,sourceHandle:d?a:o,target:d?r:t,targetHandle:d?o:a};y.connection=s,y.isValid=i&&l&&(n===f.Strict?d&&"source"===e||!d&&"target"===e:t!==r||a!==o)&&c(s),y.toHandle=gk(t,e,a,u,n,!0)}return y}let gC=function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:a,isTarget:i,domNode:l,nodeLookup:s,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:h,onConnect:m,onConnectEnd:g,isValidConnection:y=gS,onReconnectEnd:b,updateConnection:x,getTransform:w,getFromHandle:k,autoPanSpeed:j,dragThreshold:S=1,handleDomNode:O}){let C,N=mJ(e.target),P=0,{x:E,y:_}=m1(e),A=gj(a,O),I=l?.getBoundingClientRect(),T=!1;if(!I||!A)return;let R=gk(o,A,r,s,t);if(!R)return;let M=m1(e,I),z=!1,D=null,L=!1,F=null,$={...R,nodeId:o,type:A,position:R.position},U=s.get(o),H={inProgress:!0,isValid:null,from:gi(U,$,v.Left,!0),fromHandle:$,fromPosition:$.position,fromNode:U,to:M,toHandle:null,toPosition:mp[$.position],toNode:null,pointer:M};function B(){T=!0,x(H),h?.(e,{nodeId:o,handleId:r,handleType:A})}function V(e){var a,l;let p;if(!T){let{x:t,y:n}=m1(e),r=t-E,o=n-_;if(!(r*r+o*o>S*S))return;B()}if(!k()||!$)return void K(e);let h=w();C=function(e,t,n,r){let o=[],a=1/0;for(let i of function(e,t,n){let r=[],o={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(let e of t.values())mR(o,m_(e))>0&&r.push(e);return r}(e,n,t+250))for(let n of[...i.internals.handleBounds?.source??[],...i.internals.handleBounds?.target??[]]){if(r.nodeId===n.nodeId&&r.type===n.type&&r.id===n.id)continue;let{x:l,y:s}=gi(i,n,n.position,!0),c=Math.sqrt(Math.pow(l-e.x,2)+Math.pow(s-e.y,2));c>t||(c<a?(o=[{...n,x:l,y:s}],a=c):c===a&&o.push({...n,x:l,y:s}))}if(!o.length)return null;if(o.length>1){let e="source"===r.type?"target":"source";return o.find(t=>t.type===e)??o[0]}return o[0]}(mF(M=m1(e,I),h,!1,[1,1]),n,s,$),z||(!function e(){if(!u||!I)return;let[t,n]=mC(M,I,j);f({x:t,y:n}),P=requestAnimationFrame(e)}(),z=!0);let m=gO(e,{handle:C,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:i?"target":"source",isValidConnection:y,doc:N,lib:c,flowId:d,nodeLookup:s});F=m.handleDomNode,D=m.connection,a=!!C,l=m.isValid,p=null,l?p=!0:a&&!l&&(p=!1),L=p;let g=s.get(o),b=g?gi(g,$,v.Left,!0):H.from,O={...H,from:b,isValid:L,to:m.toHandle&&L?m$({x:m.toHandle.x,y:m.toHandle.y},h):M,toHandle:m.toHandle,toPosition:L&&m.toHandle?m.toHandle.position:mp[$.position],toNode:m.toHandle?s.get(m.toHandle.nodeId):null,pointer:M};x(O),H=O}function K(e){if(!("touches"in e)||!(e.touches.length>0)){if(T){(C||F)&&D&&L&&m?.(D);let{inProgress:t,...n}=H,r={...n,toPosition:H.toHandle?H.toPosition:null};g?.(e,r),a&&b?.(e,r)}p(),cancelAnimationFrame(P),z=!1,L=!1,D=null,F=null,N.removeEventListener("mousemove",V),N.removeEventListener("mouseup",K),N.removeEventListener("touchmove",V),N.removeEventListener("touchend",K)}}0===S&&B(),N.addEventListener("mousemove",V),N.addEventListener("mouseup",K),N.addEventListener("touchmove",V),N.addEventListener("touchend",K)},gN=e=>({x:e.x,y:e.y,zoom:e.k}),gP=({x:e,y:t,zoom:n})=>h8.translate(e,t).scale(n),gE=(e,t)=>e.target.closest(`.${t}`),g_=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),gA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,gI=(e,t=0,n=gA,r=()=>{})=>{let o="number"==typeof t&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},gT=e=>{let t=e.ctrlKey&&mB()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function gR(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:e.includes("left"),affectsY:e.includes("top")}}function gM(e,t){return Math.max(0,t-e)}function gz(e,t){return Math.max(0,e-t)}function gD(e,t,n){return Math.max(0,t-e,e-n)}(s=y||(y={})).Line="line",s.Handle="handle";let gL={width:0,height:0,x:0,y:0},gF={...gL,pointerX:0,pointerY:0,aspectRatio:1};var g$=d(7121);let gU=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(r,o,a);return a},{useDebugValue:gH}=w,{useSyncExternalStoreWithSelector:gB}=g$,gV=e=>e;function gK(e,t=gV,n){let r=gB(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return gH(r),r}let gq=(e,t)=>{let n=e?gU(e):gU,r=(e,r=t)=>gK(n,e,r);return Object.assign(r,n),r};function gW(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}let gG=(0,w.createContext)(null),gZ=gG.Provider,gY=((e="react")=>`Seems like you have not used ${"svelte"===e?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`)("react");function gX(e,t){let n=(0,w.useContext)(gG);if(null===n)throw Error(gY);return gK(n,e,t)}function gJ(){let e=(0,w.useContext)(gG);if(null===e)throw Error(gY);return(0,w.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}let gQ={display:"none"},g0={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},g1="react-flow__node-desc",g2="react-flow__edge-desc",g4=e=>e.ariaLiveMessage,g3=e=>e.ariaLabelConfig;function g5({rfId:e}){let t=gX(g4);return(0,x.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:g0,children:t})}function g6({rfId:e,disableKeyboardA11y:t}){let n=gX(g3);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{id:`${g1}-${e}`,style:gQ,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,x.jsx)("div",{id:`${g2}-${e}`,style:gQ,children:n["edge.a11yDescription.default"]}),!t&&(0,x.jsx)(g5,{rfId:e})]})}let g8=(0,w.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...o},a)=>{let i=`${e}`.split("-");return(0,x.jsx)("div",{className:fM(["react-flow__panel",n,...i]),style:r,ref:a,...o,children:t})});g8.displayName="Panel";let g9="https://reactflow.dev?utm_source=attribution";function g7({proOptions:e,position:t="bottom-right"}){return((0,w.useEffect)(()=>{},[]),e?.hideAttribution)?null:(0,x.jsx)(g8,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${g9}`,children:(0,x.jsx)("a",{href:g9,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}let ve=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},vt=e=>e.id;function vn(e,t){return gW(e.selectedNodes.map(vt),t.selectedNodes.map(vt))&&gW(e.selectedEdges.map(vt),t.selectedEdges.map(vt))}function vr({onSelectionChange:e}){let t=gJ(),{selectedNodes:n,selectedEdges:r}=gX(ve,vn);return(0,w.useEffect)(()=>{let o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChangeHandlers.forEach(e=>e(o))},[n,r,e]),null}let vo=e=>!!e.onSelectionChangeHandlers;function va({onSelectionChange:e}){let t=gX(vo);return e||t?(0,x.jsx)(vr,{onSelectionChange:e}):null}let vi=[0,0],vl={x:0,y:0,zoom:1},vs=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],vc=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),vu={translateExtent:mc,nodeOrigin:vi,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function vd(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:s}=gX(vc,gW),c=gJ();(0,w.useEffect)(()=>(s(e.defaultNodes,e.defaultEdges),()=>{u.current=vu,l()}),[]);let u=(0,w.useRef)(vu);return(0,w.useEffect)(()=>{for(let l of vs){let s=e[l];if(s!==u.current[l]&&void 0!==e[l])if("nodes"===l)t(s);else if("edges"===l)n(s);else if("minZoom"===l)r(s);else if("maxZoom"===l)o(s);else if("translateExtent"===l)a(s);else if("nodeExtent"===l)i(s);else if("ariaLabelConfig"===l)c.setState({ariaLabelConfig:{...md,...s||{}}});else"fitView"===l?c.setState({fitViewQueued:s}):"fitViewOptions"===l?c.setState({fitViewOptions:s}):c.setState({[l]:s})}u.current=e},vs.map(t=>e[t])),null}function vf(){return"u"<typeof window||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}let vp="u">typeof document?document:null;function vh(e=null,t={target:vp,actInsideInputWithModifier:!0}){let[n,r]=(0,w.useState)(!1),o=(0,w.useRef)(!1),a=(0,w.useRef)(new Set([])),[i,l]=(0,w.useMemo)(()=>{if(null!==e){let t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace(/\+/g,"\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,w.useEffect)(()=>{let n=t?.target??vp,s=t?.actInsideInputWithModifier??!0;if(null!==e){let e=e=>{if(o.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!o.current||o.current&&!s)&&m0(e))return!1;let n=vg(e.code,l);if(a.current.add(e[n]),vm(i,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName==="BUTTON"||n?.nodeName==="A";!1!==t.preventDefault&&(o.current||!a)&&e.preventDefault(),r(!0)}},c=e=>{let t=vg(e.code,l);vm(i,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),"Meta"===e.key&&a.current.clear(),o.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,r]),n}function vm(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function vg(e,t){return t.includes(e)?"code":"key"}function vv(e,t){let n=[],r=new Map,o=[];for(let t of e)if("add"===t.type){o.push(t);continue}else if("remove"===t.type||"replace"===t.type)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}let o={...e};for(let e of t){var a=e,i=o;switch(a.type){case"select":i.selected=a.selected;break;case"position":void 0!==a.position&&(i.position=a.position),void 0!==a.dragging&&(i.dragging=a.dragging);break;case"dimensions":void 0!==a.dimensions&&(i.measured={...a.dimensions},a.setAttributes&&((!0===a.setAttributes||"width"===a.setAttributes)&&(i.width=a.dimensions.width),(!0===a.setAttributes||"height"===a.setAttributes)&&(i.height=a.dimensions.height))),"boolean"==typeof a.resizing&&(i.resizing=a.resizing)}}n.push(o)}return o.length&&o.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function vy(e,t){return{id:e,type:"select",selected:t}}function vb(e,t=new Set,n=!1){let r=[];for(let[o,a]of e){let e=t.has(o);(void 0!==a.selected||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(vy(a.id,e)))}return r}function vx({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,o]of e.entries()){let e=t.get(o.id),a=e?.internals?.userNode??e;void 0!==a&&a!==o&&n.push({id:o.id,item:o,type:"replace"}),void 0===a&&n.push({item:o,type:"add",index:r})}for(let[e]of t)void 0===r.get(e)&&n.push({id:e,type:"remove"});return n}function vw(e){return{id:e.id,type:"remove"}}let vk=mD("React Flow","https://reactflow.dev/"),vj=e=>!!e&&"object"==typeof e&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e);function vS(e){return(0,w.forwardRef)(e)}let vO="u">typeof window?w.useLayoutEffect:w.useEffect;function vC(e){let[t,n]=(0,w.useState)(BigInt(0)),[r]=(0,w.useState)(()=>{var e;let t;return e=()=>n(e=>e+BigInt(1)),t=[],{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}});return vO(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}let vN=(0,w.createContext)(null);function vP({children:e}){let t=gJ(),n=vC((0,w.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:o,onNodesChange:a,nodeLookup:i,fitViewQueued:l,onNodesChangeMiddlewareMap:s}=t.getState(),c=n;for(let t of e)c="function"==typeof t?t(c):t;let u=vx({items:c,lookup:i});for(let e of s.values())u=e(u);o&&r(c),u.length>0?a?.(u):l&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=vC((0,w.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:a,edgeLookup:i}=t.getState(),l=n;for(let t of e)l="function"==typeof t?t(l):t;o?r(l):a&&a(vx({items:l,lookup:i}))},[])),o=(0,w.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,x.jsx)(vN.Provider,{value:o,children:e})}let vE=e=>!!e.panZoom;function v_(){let e,t=(e=gJ(),(0,w.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return!!n&&n.scaleBy(1.2,t)},zoomOut:async t=>{let{panZoom:n}=e.getState();return!!n&&n.scaleBy(1/1.2,t)},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return!!r&&r.scaleTo(t,n)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,o,a],panZoom:i}=e.getState();return!!i&&(await i.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??a},n),!0)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:o,minZoom:a,maxZoom:i,panZoom:l}=e.getState(),s=mH(t,r,o,a,i,n?.padding??.1);return!!l&&(await l.setViewport(s,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0)},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:o,snapToGrid:a,domNode:i}=e.getState();if(!i)return t;let{x:l,y:s}=i.getBoundingClientRect(),c={x:t.x-l,y:t.y-s},u=n.snapGrid??o;return mF(c,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:o,y:a}=r.getBoundingClientRect(),i=m$(t,n);return{x:i.x+o,y:i.y+a}}}),[])),n=gJ(),r=function(){let e=(0,w.useContext)(vN);if(!e)throw Error("useBatchContext must be used within a BatchProvider");return e}(),o=gX(vE),a=(0,w.useMemo)(()=>{let e=e=>n.getState().nodeLookup.get(e),t=e=>{r.nodeQueue.push(e)},o=e=>{r.edgeQueue.push(e)},a=e=>{let{nodeLookup:t,nodeOrigin:r}=n.getState(),o=vj(e)?e:t.get(e.id),a=o.parentId?mW(o.position,o.measured,o.parentId,t,r):o.position;return m_({...o,position:a,width:o.measured?.width??o.width,height:o.measured?.height??o.height})},i=(e,n,r={replace:!1})=>{t(t=>t.map(t=>{if(t.id===e){let e="function"==typeof n?n(t):n;return r.replace&&vj(e)?e:{...t,...e}}return t}))},l=(e,t,n={replace:!1})=>{o(r=>r.map(r=>{if(r.id===e){let e="function"==typeof t?t(r):t;return n.replace&&mh(e)?e:{...r,...e}}return r}))};return{getNodes:()=>n.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=n.getState();return e.map(e=>({...e}))},getEdge:e=>n.getState().edgeLookup.get(e),setNodes:t,setEdges:o,addNodes:e=>{let t=Array.isArray(e)?e:[e];r.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];r.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:t=[],transform:r}=n.getState(),[o,a,i]=r;return{nodes:e.map(e=>({...e})),edges:t.map(e=>({...e})),viewport:{x:o,y:a,zoom:i}}},deleteElements:async({nodes:e=[],edges:t=[]})=>{let{nodes:r,edges:o,onNodesDelete:a,onEdgesDelete:i,triggerNodeChanges:l,triggerEdgeChanges:s,onDelete:c,onBeforeDelete:u}=n.getState(),{nodes:d,edges:f}=await mw({nodesToRemove:e,edgesToRemove:t,nodes:r,edges:o,onBeforeDelete:u}),p=f.length>0,h=d.length>0;if(p){let e=f.map(vw);i?.(f),s(e)}if(h){let e=d.map(vw);a?.(d),l(e)}return(h||p)&&c?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,t=!0,r)=>{let o=mM(e),i=o?e:a(e),l=void 0!==r;return i?(r||n.getState().nodes).filter(r=>{let a=n.getState().nodeLookup.get(r.id);if(a&&!o&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let s=m_(l?r:a),c=mR(s,i);return t&&c>0||c>=s.width*s.height||c>=i.width*i.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=mM(e)?e:a(e);if(!r)return!1;let o=mR(r,t);return n&&o>0||o>=t.width*t.height||o>=r.width*r.height},updateNode:i,updateNodeData:(e,t,n={replace:!1})=>{i(e,e=>{let r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:l,updateEdgeData:(e,t,n={replace:!1})=>{l(e,e=>{let r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:t,nodeOrigin:r}=n.getState();return((e,t={nodeOrigin:[0,0]})=>{if(0===e.length)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let o="string"==typeof r,a=t.nodeLookup||o?void 0:r;return(t.nodeLookup&&(a=o?t.nodeLookup.get(r):mm(r)?r:t.nodeLookup.get(r.id)),a)?(n=!0,mN(e,mA(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?mE(r):{x:0,y:0,width:0,height:0}})(e,{nodeLookup:t,nodeOrigin:r})},getHandleConnections:({type:e,id:t,nodeId:r})=>Array.from(n.getState().connectionLookup.get(`${r}-${e}${t?`-${t}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:t,nodeId:r})=>Array.from(n.getState().connectionLookup.get(`${r}${e?t?`-${e}-${t}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{let t,o,a=n.getState().fitViewResolver??{promise:new Promise((e,n)=>{t=e,o=n}),resolve:t,reject:o};return n.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:a}),r.nodeQueue.push(e=>[...e]),a.promise}}},[]);return(0,w.useMemo)(()=>({...a,...t,viewportInitialized:o}),[o])}let vA=e=>e.selected,vI="u">typeof window?window:void 0,vT={position:"absolute",width:"100%",height:"100%",top:0,left:0},vR=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function vM({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:o,panOnScrollSpeed:a=.5,panOnScrollMode:i=p.Free,zoomOnDoubleClick:l=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:v,noPanClassName:y,onViewportChange:b,isControlledViewport:k,paneClickDistance:j,selectionOnDrag:S}){let O,C=gJ(),N=(0,w.useRef)(null),{userSelectionActive:P,lib:E,connectionInProgress:_}=gX(vR,gW),A=vh(h),I=(0,w.useRef)();O=gJ(),(0,w.useEffect)(()=>{let e=()=>{if(!N.current||!(N.current.checkVisibility?.()??!0))return!1;let e=mX(N.current);(0===e.height||0===e.width)&&O.getState().onError?.("004","The parent container needs a width and a height to render the graph."),O.setState({width:e.width||500,height:e.height||500})};if(N.current){e(),window.addEventListener("resize",e);let t=new ResizeObserver(()=>e());return t.observe(N.current),()=>{window.removeEventListener("resize",e),t&&N.current&&t.unobserve(N.current)}}},[]);let T=(0,w.useCallback)(e=>{b?.({x:e[0],y:e[1],zoom:e[2]}),k||C.setState({transform:e})},[b,k]);return(0,w.useEffect)(()=>{if(N.current){I.current=function({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:a,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:s}){let c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]],f="u">typeof ResizeObserver?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null;f?.observe(e);let h=ml().extent(()=>d).scaleExtent([t,n]).translateExtent(r),m=pv(e).call(h);x({x:o.x,y:o.y,zoom:mk(o.zoom,t,n)},[[0,0],[u.width,u.height]],r);let g=m.on("wheel.zoom"),v=m.on("dblclick.zoom");async function y(e,t){return!!m&&new Promise(n=>{h?.interpolate(t?.interpolate==="linear"?ms:pT).transform(gI(m,t?.duration,t?.ease,()=>n(!0)),e)})}function b(){h.on("zoom",null)}async function x(e,t,n){let r=gP(e),o=h?.constrain()(r,t,n);return o&&await y(o),o}return h.wheelDelta(gT),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:o,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:f,preventScrolling:y,zoomOnPinch:x,zoomOnScroll:w,zoomOnDoubleClick:k,panActivationKeyPressed:j=!1,zoomActivationKeyPressed:S,lib:O,onTransformChange:C,connectionInProgress:N,paneClickDistance:P,selectionOnDrag:E}){r&&!c.isZoomingOrPanning&&b();let _=o&&!S&&!r;h.clickDistance(E?1/0:!mz(P)||P<0?0:P);let A=_?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}){return u=>{if(gE(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property("__zoom").k||1;if(u.ctrlKey&&i){let e=py(u),t=d*Math.pow(2,gT(u));r.scaleTo(n,t,e,u);return}let f=1===u.deltaMode?20:1,h=o===p.Vertical?0:u.deltaX*f,m=o===p.Horizontal?0:u.deltaY*f;!mB()&&u.shiftKey&&o!==p.Vertical&&(h=u.deltaY*f,m=0),r.translateBy(n,-(h/d)*a,-(m/d)*a,{internal:!0});let g=gN(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?s?.(u,g):(e.isPanScrolling=!0,l?.(u,g)),e.panScrollTimeout=setTimeout(()=>{c?.(u,g),e.isPanScrolling=!1},150)}}({zoomPanValues:c,noWheelClassName:e,d3Selection:m,d3Zoom:h,panOnScrollMode:d,panOnScrollSpeed:f,zoomOnPinch:x,onPanZoomStart:i,onPanZoom:a,onPanZoomEnd:l}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){let a="wheel"===r.type,i=!t&&a&&!r.ctrlKey,l=gE(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,o)}}({noWheelClassName:e,preventScrolling:y,d3ZoomHandler:g});m.on("wheel.zoom",A,{passive:!1});let I=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let o=gN(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,o)}}({zoomPanValues:c,onDraggingChange:s,onPanZoomStart:i});h.on("start",I);let T=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return a=>{e.usedRightMouseButton=!!(n&&g_(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),o&&!a.sourceEvent?.internal&&o?.(a.sourceEvent,gN(a.transform))}}({zoomPanValues:c,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:C});h.on("zoom",T);let R=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:a}){return i=>{if(!i.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&g_(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&a(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){let t=gN(i.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(i.sourceEvent,t)},150*!!n)}}}({zoomPanValues:c,panOnDrag:u,panOnScroll:o,onPaneContextMenu:n,onPanZoomEnd:l,onDraggingChange:s});h.on("end",R);let M=function({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:o,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:s,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{let p=t||n,h=r&&f.ctrlKey,m="wheel"===f.type;if(1===f.button&&"mousedown"===f.type&&(gE(f,`${u}-flow__node`)||gE(f,`${u}-flow__edge`)||gE(f,`${u}-flow__selection`)||gE(f,`${u}-flow__nodesselection`)))return!0;if(!o&&!p&&!a&&!i&&!r||l||d&&!m||gE(f,s)&&m||gE(f,c)&&(!m||a&&m&&!t)||!r&&f.ctrlKey&&m)return!1;if(!r&&"touchstart"===f.type&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!h&&m||!o&&("mousedown"===f.type||"touchstart"===f.type)||Array.isArray(o)&&!o.includes(f.button)&&"mousedown"===f.type)return!1;let g=Array.isArray(o)&&o.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m||e)&&g}}({panActivationKeyPressed:j,zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:w,panOnScroll:o,zoomOnDoubleClick:k,zoomOnPinch:x,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:O,connectionInProgress:N});h.filter(M),k?m.on("dblclick.zoom",v):m.on("dblclick.zoom",null)},destroy:b,setViewport:async function e(e,t){let n=gP(e);return await y(n,t),n},setViewportConstrained:x,getViewport:function(){let e=m?h9(m.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:async function e(e,t){return!!m&&new Promise(n=>{h?.interpolate(t?.interpolate==="linear"?ms:pT).scaleTo(gI(m,t?.duration,t?.ease,()=>n(!0)),e)})},scaleBy:async function e(e,t){return!!m&&new Promise(n=>{h?.interpolate(t?.interpolate==="linear"?ms:pT).scaleBy(gI(m,t?.duration,t?.ease,()=>n(!0)),e)})},setScaleExtent:function(e){h?.scaleExtent(e)},setTranslateExtent:function(e){h?.translateExtent(e)},syncViewport:function(e){if(m){let t=gP(e),n=m.property("__zoom");(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&h?.transform(m,t,null,{sync:!0})}},setClickDistance:function(e){let t=!mz(e)||e<0?0:e;h?.clickDistance(t)}}}({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=I.current.getViewport();return C.setState({panZoom:I.current,transform:[e,t,n],domNode:N.current.closest(".react-flow")}),()=>{I.current?.destroy()}}},[]),(0,w.useEffect)(()=>{I.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:o,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:s,zoomActivationKeyPressed:A,preventScrolling:m,noPanClassName:y,userSelectionActive:P,noWheelClassName:v,lib:E,onTransformChange:T,connectionInProgress:_,selectionOnDrag:S,paneClickDistance:j})},[e,t,n,r,o,a,i,l,s,A,m,y,P,v,E,T,_,S,j]),(0,x.jsx)("div",{className:"react-flow__renderer",ref:N,style:vT,children:g})}let vz=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function vD(){let{userSelectionActive:e,userSelectionRect:t}=gX(vz,gW);return e&&t?(0,x.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}let vL=(e,t)=>n=>{n.target===t.current&&e?.(n)},vF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function v$({isSelecting:e,selectionKeyPressed:t,selectionMode:n=h.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:a,selectionOnDrag:i,onSelectionStart:l,onSelectionEnd:s,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:g}){let v=(0,w.useRef)(0),y=gJ(),{userSelectionActive:b,elementsSelectable:k,dragging:j,panBy:S,autoPanSpeed:O}=gX(vF,gW),C=k&&(e||b),N=(0,w.useRef)(null),P=(0,w.useRef)(),E=(0,w.useRef)(new Set),_=(0,w.useRef)(new Set),A=(0,w.useRef)(!1),I=(0,w.useRef)(!1),T=(0,w.useRef)({x:0,y:0}),R=(0,w.useRef)(!1),M=e=>{if(I.current||A.current||y.getState().connection.inProgress){I.current=!1,A.current=!1;return}c?.(e),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})};function z(e,t){let{userSelectionRect:r}=y.getState();if(!r)return;let{transform:o,nodeLookup:a,edgeLookup:i,connectionLookup:l,triggerNodeChanges:s,triggerEdgeChanges:c,defaultEdgeOptions:u}=y.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=m$(d,o),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},g=E.current,v=_.current;E.current=new Set(my(a,m,o,n===h.Partial,!0).map(e=>e.id)),_.current=new Set;let b=u?.selectable??!0;for(let e of E.current){let t=l.get(e);if(t)for(let{edgeId:e}of t.values()){let t=i.get(e);t&&(t.selectable??b)&&_.current.add(e)}}mG(g,E.current)||s(vb(a,E.current,!0)),mG(v,_.current)||c(vb(i,_.current)),y.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}let D=()=>{cancelAnimationFrame(v.current),v.current=0,R.current=!1};(0,w.useEffect)(()=>()=>D(),[]);let L=!0===r||Array.isArray(r)&&r.includes(0);return(0,x.jsxs)("div",{className:fM(["react-flow__pane",{draggable:L,dragging:j,selection:e}]),onClick:C?void 0:vL(M,N),onContextMenu:vL(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},N),onWheel:vL(d?e=>d(e):void 0,N),onPointerEnter:C?void 0:f,onPointerMove:C?e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=y.getState();if(!P.current||!n)return;let{x:s,y:c}=m1(e.nativeEvent,P.current);T.current={x:s,y:c};let u=m$({x:n.startX,y:n.startY},r);if(!I.current){if(Math.hypot(s-u.x,c-u.y)<=(t?0:a))return;i(),l?.(e)}I.current=!0,R.current||(!function e(){if(!o||!P.current)return;let[t,n]=mC(T.current,P.current,O);S({x:t,y:n}).then(t=>{if(!I.current||!t){v.current=requestAnimationFrame(e);return}let{x:n,y:r}=T.current;z(n,r),v.current=requestAnimationFrame(e)})}(),R.current=!0),z(s,c)}:p,onPointerUp:e=>{if(!C){e.target===N.current&&y.getState().connection.inProgress&&(A.current=!0);return}0===e.button&&(e.target?.releasePointerCapture?.(e.pointerId),!b&&e.target===N.current&&y.getState().userSelectionRect&&M?.(e),y.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(s?.(e),y.setState({nodesSelectionActive:E.current.size>0})),D())},onPointerCancel:C?e=>{e.target?.releasePointerCapture?.(e.pointerId),D()}:void 0,onPointerDownCapture:C?n=>{if("touch"===n.pointerType&&!1!==r&&!t)return;let{domNode:o,transform:a}=y.getState();if(P.current=o?.getBoundingClientRect(),!P.current)return;let l=n.target===N.current;if(!l&&n.target.closest(".nokey")||!e||!(i&&l||t)||0!==n.button||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),I.current=!1;let{x:s,y:c}=m1(n.nativeEvent,P.current),u=mF({x:s,y:c},a);y.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:s,y:c}}),l||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:C?e=>{I.current&&(e.stopPropagation(),I.current=!1)}:void 0,onPointerLeave:m,ref:N,style:vT,children:[g,(0,x.jsx)(vD,{})]})}function vU({id:e,store:t,unselect:n=!1,nodeRef:r}){let o,{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:s,onError:c}=t.getState(),u=s.get(e);u?(t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):a([e])):c?.("012",(o=e,`Node with id "${o}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`))}function vH({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:a,nodeClickDistance:i}){let l=gJ(),[s,c]=(0,w.useState)(!1),u=(0,w.useRef)();return(0,w.useEffect)(()=>{if(!t)return u.current=function({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let a={x:null,y:null},i=0,l=new Map,s=!1,c={x:0,y:0},u=null,d=!1,f=null,p=!1,h=!1,m=null;return{update:function({noDragClassName:g,handleSelector:v,domNode:y,isSelectable:b,nodeId:x,nodeClickDistance:w=0}){function k({x:e,y:n}){let{nodeLookup:o,nodeExtent:i,snapGrid:s,snapToGrid:c,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let v=!1,y=l.size>1,b=y&&i?mP(mv(l)):null,w=y&&c?function({dragItems:e,snapGrid:t,x:n,y:r}){let o=e.values().next().value;if(!o)return null;let a={x:n-o.distance.x,y:r-o.distance.y},i=mL(a,t);return{x:i.x-a.x,y:i.y-a.y}}({dragItems:l,snapGrid:s,x:e,y:n}):null;for(let[t,r]of l){if(!o.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};c&&(a=w?{x:Math.round(a.x+w.x),y:Math.round(a.y+w.y)}:mL(a,s));let l=null;if(y&&i&&!r.extent&&b){let{positionAbsolute:e}=r.internals,t=e.x-b.x+i[0][0],n=e.x+r.measured.width-b.x2+i[1][0];l=[[t,e.y-b.y+i[0][1]],[n,e.y+r.measured.height-b.y2+i[1][1]]]}let{position:d,positionAbsolute:f}=mx({nodeId:t,nextPosition:a,nodeLookup:o,nodeExtent:l||i,nodeOrigin:u,onError:p});v=v||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(h=h||v,v&&(g(l,!0),m&&(r||d||!x&&f))){let[e,t]=gw({nodeId:x,dragItems:l,nodeLookup:o});r?.(m,l,e,t),d?.(m,e,t),x||f?.(m,t)}}async function j(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:o}=t();if(!o){s=!1,cancelAnimationFrame(i);return}let[l,d]=mC(c,u,r);(0!==l||0!==d)&&(a.x=(a.x??0)-l/e[2],a.y=(a.y??0)-d/e[2],await n({x:l,y:d})&&k(a)),i=requestAnimationFrame(j)}function S(r){let{nodeLookup:o,multiSelectionActive:i,nodesDraggable:s,transform:c,snapGrid:f,snapToGrid:p,selectNodesOnDrag:h,onNodeDragStart:m,onSelectionDragStart:g,unselectNodesAndEdges:v}=t();d=!0,h&&b||i||!x||o.get(x)?.selected||v(),b&&h&&x&&e?.(x);let y=mY(r.sourceEvent,{transform:c,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=y,(l=function(e,t,n,r){let o=new Map;for(let[a,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!function e(t,n){if(!t.parentId)return!1;let r=n.get(t.parentId);return!!r&&(!!r.selected||e(r,n))}(i,e))&&(i.draggable||t&&void 0===i.draggable)){let t=e.get(a);t&&o.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return o}(o,s,y,x)).size>0&&(n||m||!x&&g)){let[e,t]=gw({nodeId:x,dragItems:l,nodeLookup:o});n?.(r.sourceEvent,l,e,t),m?.(r.sourceEvent,e,t),x||g?.(r.sourceEvent,t)}}f=pv(y);let O=pA().clickDistance(w).on("start",e=>{let{domNode:n,nodeDragThreshold:r,transform:o,snapGrid:i,snapToGrid:l}=t();u=n?.getBoundingClientRect()||null,p=!1,h=!1,m=e.sourceEvent,0===r&&S(e),a=mY(e.sourceEvent,{transform:o,snapGrid:i,snapToGrid:l,containerBounds:u}),c=m1(e.sourceEvent,u)}).on("drag",e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:o,snapToGrid:i,nodeDragThreshold:f,nodeLookup:h}=t(),g=mY(e.sourceEvent,{transform:r,snapGrid:o,snapToGrid:i,containerBounds:u});if(m=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||x&&!h.has(x))&&(p=!0),!p){if(!s&&n&&d&&(s=!0,j()),!d){let t=m1(e.sourceEvent,u),n=t.x-c.x,r=t.y-c.y;Math.sqrt(n*n+r*r)>f&&S(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&l&&d&&(c=m1(e.sourceEvent,u),k(g))}}).on("end",e=>{if(!d||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(s=!1,d=!1,cancelAnimationFrame(i),l.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:i}=t();if(h&&(r(l,!1),h=!1),o||a||!x&&i){let[t,r]=gw({nodeId:x,dragItems:l,nodeLookup:n,dragging:!1});o?.(e.sourceEvent,l,t,r),a?.(e.sourceEvent,t,r),x||i?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!gx(t,`.${g}`,y))&&(!v||gx(t,v,y))});f.call(O)},destroy:function(){f?.on(".drag",null)}}}({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{vU({id:t,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,l,e]),(0,w.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:o,nodeClickDistance:i})},[n,r,t,a,e,o,i]),s}function vB(){let e=gJ();return(0,w.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:o,nodesDraggable:a,onError:i,updateNodePositions:l,nodeLookup:s,nodeOrigin:c}=e.getState(),u=new Map,d=e=>e.selected&&(e.draggable||a&&void 0===e.draggable),f=r?o[0]:5,p=r?o[1]:5,h=t.direction.x*f*t.factor,m=t.direction.y*p*t.factor;for(let[,e]of s){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+h,y:e.internals.positionAbsolute.y+m};r&&(t=mL(t,o));let{position:a,positionAbsolute:l}=mx({nodeId:e.id,nextPosition:t,nodeLookup:s,nodeExtent:n,nodeOrigin:c,onError:i});e.position=a,e.internals.positionAbsolute=l,u.set(e.id,e)}l(u)},[])}let vV=(0,w.createContext)(null),vK=vV.Provider;vV.Consumer;let vq=()=>(0,w.useContext)(vV),vW=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),vG=(0,w.createContext)(null);function vZ({children:e}){let t=gX(vW,gW);return(0,x.jsx)(vG.Provider,{value:t,children:e})}let vY={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},vX=(0,w.memo)(vS(function({type:e="source",position:t=v.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:i,onConnect:l,children:s,className:c,onMouseDown:u,onTouchStart:d,...p},h){let m=i||null,g="target"===e,y=gJ(),b=vq(),{connectOnClick:k,noPanClassName:j,rfId:S}=function(){let e=(0,w.useContext)(vG);if(!e)throw Error("useHandleConfig must be used within a HandleConfigProvider");return e}(),{connectingFrom:O,connectingTo:C,clickConnecting:N,isPossibleEndHandle:P,connectionInProcess:E,clickConnectionInProcess:_,valid:A}=gX(t=>{let{connectionClickStartHandle:n,connectionMode:r,connection:o}=t,{fromHandle:a,toHandle:i,isValid:l}=o;if(!a&&!n)return vY;let s=i?.nodeId===b&&i?.id===m&&i?.type===e;return{connectingFrom:a?.nodeId===b&&a?.id===m&&a?.type===e,connectingTo:s,clickConnecting:n?.nodeId===b&&n?.id===m&&n?.type===e,isPossibleEndHandle:r===f.Strict?a?.type!==e:b!==a?.nodeId||m!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!n,valid:s&&l}},gW);b||y.getState().onError?.("010","Handle: No node id found. Make sure to only use a Handle inside a custom Node.");let I=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=y.getState(),o={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=y.getState();t(function(e,t,n={}){return((e,t,n={})=>{let r,o;if(!e.source||!e.target)return n.onError?.("006","Can't create edge. An edge needs a source and a target."),t;let a=n.getEdgeId||m9;return(o=r=mh(e)?{...e}:{...e,id:a(e)},t.some(e=>e.source===o.source&&e.target===o.target&&(e.sourceHandle===o.sourceHandle||!e.sourceHandle&&!o.sourceHandle)&&(e.targetHandle===o.targetHandle||!e.targetHandle&&!o.targetHandle)))?t:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,t.concat(r))})(e,t,{...n,onError:n.onError??vk})}(o,e,{onError:n}))}n?.(o),l?.(o)},T=e=>{if(!b)return;let t="clientX"in e.nativeEvent;if(o&&(t&&0===e.button||!t)){let t=y.getState();gC(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:g,handleId:m,nodeId:b,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>y.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:I,isValidConnection:n||((...e)=>y.getState().isValidConnection?.(...e)??!0),getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,x.jsx)("div",{"data-handleid":m,"data-nodeid":b,"data-handlepos":t,"data-id":`${S}-${b}-${m}-${e}`,className:fM(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",j,c,{source:!g,target:g,connectable:r,connectablestart:o,connectableend:a,clickconnecting:N,connectingfrom:O,connectingto:C,valid:A,connectionindicator:r&&(!E||P)&&(E||_?a:o)}]),onMouseDown:T,onTouchStart:T,onClick:k?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:i,connectionMode:l,isValidConnection:s,lib:c,rfId:u,nodeLookup:d,connection:f}=y.getState();if(!b||!i&&!o)return;if(!i){r?.(t.nativeEvent,{nodeId:b,handleId:m,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:b,type:e,id:m}});return}let p=mJ(t.target),h=n||s,{connection:g,isValid:v}=gO(t.nativeEvent,{handle:{nodeId:b,id:m,type:e},connectionMode:l,fromNodeId:i.nodeId,fromHandleId:i.id||null,fromType:i.type,isValidConnection:h,flowId:u,doc:p,lib:c,nodeLookup:d});v&&g&&I(g);let x=structuredClone(f);delete x.inProgress,x.toPosition=x.toHandle?x.toHandle.position:null,a?.(t,x),y.setState({connectionClickStartHandle:null})}:void 0,ref:h,...p,children:s})})),vJ={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vQ={input:function({data:e,isConnectable:t,sourcePosition:n=v.Bottom}){return(0,x.jsxs)(x.Fragment,{children:[e?.label,(0,x.jsx)(vX,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=v.Top,sourcePosition:r=v.Bottom}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(vX,{type:"target",position:n,isConnectable:t}),e?.label,(0,x.jsx)(vX,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=v.Top}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(vX,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},v0=e=>{let{width:t,height:n,x:r,y:o}=mv(e.nodeLookup,{filter:e=>!!e.selected});return{width:mz(t)?t:null,height:mz(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function v1({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=gJ(),{width:o,height:a,transformString:i,userSelectionActive:l}=gX(v0,gW),s=vB(),c=(0,w.useRef)(null);(0,w.useEffect)(()=>{n||c.current?.focus({preventScroll:!0})},[n]);let u=!l&&null!==o&&null!==a;if(vH({nodeRef:c,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,x.jsx)("div",{className:fM(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:(0,x.jsx)("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(vJ,e.key)&&(e.preventDefault(),s({direction:vJ[e.key],factor:e.shiftKey?4:1}))},style:{width:o,height:a}})})}let v2="u">typeof window?window:void 0,v4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function v3({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:s,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:h,panActivationKeyCode:m,zoomActivationKeyCode:g,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:k,panOnScrollSpeed:j,panOnScrollMode:S,zoomOnDoubleClick:O,panOnDrag:C,autoPanOnSelection:N,defaultViewport:P,translateExtent:E,minZoom:_,maxZoom:A,preventScrolling:I,onSelectionContextMenu:T,noWheelClassName:R,noPanClassName:M,disableKeyboardA11y:z,onViewportChange:D,isControlledViewport:L}){let{nodesSelectionActive:F,userSelectionActive:$}=gX(v4,gW),U=vh(c,{target:v2}),H=vh(m,{target:v2}),B=H||C,V=H||k,K=u&&!0!==B,q=U||$||K;return!function({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=gJ(),{deleteElements:r}=v_(),o=vh(e,{actInsideInputWithModifier:!1}),a=vh(t,{target:vI});(0,w.useEffect)(()=>{if(o){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(vA),edges:e.filter(vA)}),n.setState({nodesSelectionActive:!1})}},[o]),(0,w.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}({deleteKeyCode:s,multiSelectionKeyCode:h}),(0,x.jsx)(vM,{onPaneContextMenu:a,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:V,panActivationKeyPressed:H,panOnScrollSpeed:j,panOnScrollMode:S,zoomOnDoubleClick:O,panOnDrag:!U&&B,defaultViewport:P,translateExtent:E,minZoom:_,maxZoom:A,zoomActivationKeyCode:g,preventScrolling:I,noWheelClassName:R,noPanClassName:M,onViewportChange:D,isControlledViewport:L,paneClickDistance:l,selectionOnDrag:K,children:(0,x.jsxs)(v$,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:i,panOnDrag:B,autoPanOnSelection:N,isSelecting:!!q,selectionMode:d,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:K,children:[e,F&&(0,x.jsx)(v1,{onSelectionContextMenu:T,noPanClassName:M,disableKeyboardA11y:z})]})})}v3.displayName="FlowRenderer";let v5=(0,w.memo)(v3),v6=e=>e.updateNodeInternals;var v8=(0,w.memo)(function({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:a,onDoubleClick:i,nodesDraggable:l,elementsSelectable:s,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:h,rfId:m,nodeTypes:g,nodeClickDistance:v,onError:y}){let b,{node:k,internals:j,isParent:S}=gX(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},gW),O=k.type||"default",C=g?.[O]||vQ[O];void 0===C&&(y?.("003",(b=O,`Node type "${b}" not found. Using fallback type "default".`)),O="default",C=g?.default||vQ.default);let N=!!(k.draggable||l&&void 0===k.draggable),P=!!(k.selectable||s&&void 0===k.selectable),E=!!(k.connectable||c&&void 0===k.connectable),_=!!(k.focusable||u&&void 0===k.focusable),A=gJ(),I=mq(k),T=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let o=gJ(),a=(0,w.useRef)(null),i=(0,w.useRef)(null),l=(0,w.useRef)(e.sourcePosition),s=(0,w.useRef)(e.targetPosition),c=(0,w.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,w.useEffect)(()=>{!a.current||e.hidden||u&&i.current===a.current||(i.current&&r?.unobserve(i.current),r?.observe(a.current),i.current=a.current)},[u,e.hidden]),(0,w.useEffect)(()=>()=>{i.current&&(r?.unobserve(i.current),i.current=null)},[]),(0,w.useEffect)(()=>{if(a.current){let n=c.current!==t,r=l.current!==e.sourcePosition,i=s.current!==e.targetPosition;(n||r||i)&&(c.current=t,l.current=e.sourcePosition,s.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}({node:k,nodeType:O,hasDimensions:I,resizeObserver:d}),R=vH({nodeRef:T,disabled:k.hidden||!N,noDragClassName:f,handleSelector:k.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:v}),M=vB();if(k.hidden)return null;let z=mK(k),D=void 0===k.internals.handleBounds?{width:k.width??k.initialWidth??k.style?.width,height:k.height??k.initialHeight??k.style?.height}:{width:k.width??k.style?.width,height:k.height??k.style?.height},L=P||N||t||n||r||o,F=n?e=>n(e,{...j.userNode}):void 0,$=r?e=>r(e,{...j.userNode}):void 0,U=o?e=>o(e,{...j.userNode}):void 0,H=a?e=>a(e,{...j.userNode}):void 0,B=i?e=>i(e,{...j.userNode}):void 0;return(0,x.jsx)("div",{className:fM(["react-flow__node",`react-flow__node-${O}`,{[p]:N},k.className,{selected:k.selected,selectable:P,parent:S,draggable:N,dragging:R}]),ref:T,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:I?"visible":"hidden",...k.style,...D},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:F,onMouseMove:$,onMouseLeave:U,onContextMenu:H,onClick:n=>{let{selectNodesOnDrag:r,nodeDragThreshold:o}=A.getState();P&&(!r||!N||o>0)&&vU({id:e,store:A,nodeRef:T}),t&&t(n,{...j.userNode})},onDoubleClick:B,onKeyDown:_?t=>{if(!m0(t.nativeEvent)&&!h){if(mu.includes(t.key)&&P)vU({id:e,store:A,unselect:"Escape"===t.key,nodeRef:T});else if(N&&k.selected&&Object.prototype.hasOwnProperty.call(vJ,t.key)){t.preventDefault();let{ariaLabelConfig:e}=A.getState();A.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),M({direction:vJ[t.key],factor:t.shiftKey?4:1})}}}:void 0,tabIndex:_?0:void 0,onFocus:_?()=>{if(h||!T.current?.matches(":focus-visible"))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:o,setCenter:a}=A.getState();!o||my(new Map([[e,k]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(k.position.x+z.width/2,k.position.y+z.height/2,{zoom:t[2]})}:void 0,role:k.ariaRole??(_?"group":void 0),"aria-roledescription":"node","aria-describedby":h?void 0:`${g1}-${m}`,"aria-label":k.ariaLabel,...k.domAttributes,children:(0,x.jsx)(vK,{value:e,children:(0,x.jsx)(C,{id:e,data:k.data,type:O,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:k.selected??!1,selectable:P,draggable:N,deletable:k.deletable??!0,isConnectable:E,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:R,dragHandle:k.dragHandle,zIndex:j.z,parentId:k.parentId,...z})})})});let v9=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function v7(e){var t;let{nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:a}=gX(v9,gW),i=(t=e.onlyRenderVisibleElements,gX((0,w.useCallback)(e=>t?my(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(e=>e.id):Array.from(e.nodeLookup.keys()),[t]),gW)),l=function(){let e=gX(v6),[t]=(0,w.useState)(()=>"u"<typeof ResizeObserver?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,w.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,x.jsx)("div",{className:"react-flow__nodes",style:vT,children:i.map(t=>(0,x.jsx)(v8,{id:t,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:a},t))})}v7.displayName="NodeRenderer";let ye=(0,w.memo)(v7),yt={[g.Arrow]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,x.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[g.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,x.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},yn=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{let s,c=(s=gJ(),(0,w.useMemo)(()=>{let e;return Object.prototype.hasOwnProperty.call(yt,t)?yt[t]:(s.getState().onError?.("009",(e=t,`Marker type "${e}" doesn't exist.`)),null)},[t]));return c?(0,x.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:(0,x.jsx)(c,{color:n,strokeWidth:i})}):null},yr=({defaultColor:e,rfId:t})=>{let n=gX(e=>e.edges),r=gX(e=>e.defaultEdgeOptions),o=(0,w.useMemo)(()=>(function(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){let a=new Set;return e.reduce((e,i)=>([i.markerStart||r,i.markerEnd||o].forEach(r=>{if(r&&"object"==typeof r){let o=gs(r,t);a.has(o)||(e.push({id:o,color:r.color||n,...r}),a.add(o))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))})(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return o.length?(0,x.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,x.jsx)("defs",{children:o.map(e=>(0,x.jsx)(yn,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};yr.displayName="MarkerDefinitions";var yo=(0,w.memo)(yr);function ya({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:s,className:c,...u}){let[d,f]=(0,w.useState)({x:1,y:0,width:0,height:0}),p=fM(["react-flow__edge-textwrapper",c]),h=(0,w.useRef)(null);return((0,w.useEffect)(()=>{if(h.current){let e=h.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n)?(0,x.jsxs)("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...u,children:[o&&(0,x.jsx)("rect",{width:d.width+2*i[0],x:-i[0],y:-i[1],height:d.height+2*i[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),(0,x.jsx)("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:h,style:r,children:n}),s]}):null}ya.displayName="EdgeText";let yi=(0,w.memo)(ya);function yl({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:s,interactionWidth:c=20,...u}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{...u,d:e,fill:"none",className:fM(["react-flow__edge-path",u.className])}),c?(0,x.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&mz(t)&&mz(n)?(0,x.jsx)(yi,{x:t,y:n,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function ys({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===v.Left||e===v.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function yc({sourceX:e,sourceY:t,sourcePosition:n=v.Bottom,targetX:r,targetY:o,targetPosition:a=v.Top}){let[i,l]=ys({pos:n,x1:e,y1:t,x2:r,y2:o}),[s,c]=ys({pos:a,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=m4({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:l,targetControlX:s,targetControlY:c});return[`M${e},${t} C${i},${l} ${s},${c} ${r},${o}`,u,d,f,p]}function yu(e){return(0,w.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:i,targetPosition:l,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:g,interactionWidth:v})=>{let[y,b,w]=yc({sourceX:n,sourceY:r,sourcePosition:i,targetX:o,targetY:a,targetPosition:l}),k=e.isInternal?void 0:t;return(0,x.jsx)(yl,{id:k,path:y,labelX:b,labelY:w,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:g,interactionWidth:v})})}let yd=yu({isInternal:!1}),yf=yu({isInternal:!0});function yp(e){return(0,w.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=v.Bottom,targetPosition:h=v.Top,markerEnd:m,markerStart:g,pathOptions:y,interactionWidth:b})=>{let[w,k,j]=gr({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:a,targetPosition:h,borderRadius:y?.borderRadius,offset:y?.offset,stepPosition:y?.stepPosition}),S=e.isInternal?void 0:t;return(0,x.jsx)(yl,{id:S,path:w,labelX:k,labelY:j,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:g,interactionWidth:b})})}yd.displayName="SimpleBezierEdge",yf.displayName="SimpleBezierEdgeInternal";let yh=yp({isInternal:!1}),ym=yp({isInternal:!0});function yg(e){return(0,w.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,x.jsx)(yh,{...n,id:r,pathOptions:(0,w.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}yh.displayName="SmoothStepEdge",ym.displayName="SmoothStepEdgeInternal";let yv=yg({isInternal:!1}),yy=yg({isInternal:!0});function yb(e){return(0,w.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:m})=>{let[g,v,y]=m7({sourceX:n,sourceY:r,targetX:o,targetY:a}),b=e.isInternal?void 0:t;return(0,x.jsx)(yl,{id:b,path:g,labelX:v,labelY:y,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:m})})}yv.displayName="StepEdge",yy.displayName="StepEdgeInternal";let yx=yb({isInternal:!1}),yw=yb({isInternal:!0});function yk(e){return(0,w.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:i=v.Bottom,targetPosition:l=v.Top,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:g,pathOptions:y,interactionWidth:b})=>{let[w,k,j]=m6({sourceX:n,sourceY:r,sourcePosition:i,targetX:o,targetY:a,targetPosition:l,curvature:y?.curvature}),S=e.isInternal?void 0:t;return(0,x.jsx)(yl,{id:S,path:w,labelX:k,labelY:j,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}yx.displayName="StraightEdge",yw.displayName="StraightEdgeInternal";let yj=yk({isInternal:!1}),yS=yk({isInternal:!0});yj.displayName="BezierEdge",yS.displayName="BezierEdgeInternal";let yO={default:yS,straight:yw,step:yy,smoothstep:ym,simplebezier:yf},yC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},yN="react-flow__edgeupdater";function yP({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:a,onMouseOut:i,type:l}){return(0,x.jsx)("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:i,className:fM([yN,`${yN}-${l}`]),cx:e===v.Left?t-r:e===v.Right?t+r:t,cy:e===v.Top?n-r:e===v.Bottom?n+r:n,r:r,stroke:"transparent",fill:"transparent"})}function yE({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:a,targetY:i,sourcePosition:l,targetPosition:s,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let h=gJ(),m=(e,t)=>{if(0!==e.button)return;let{autoPanOnConnect:r,domNode:o,connectionMode:a,connectionRadius:i,lib:l,onConnectStart:s,cancelConnection:p,nodeLookup:m,rfId:g,panBy:v,updateConnection:y}=h.getState(),b="target"===t.type;gC(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:i,domNode:o,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:b,edgeUpdaterType:t.type,lib:l,flowId:g,cancelConnection:p,panBy:v,isValidConnection:(...e)=>h.getState().isValidConnection?.(...e)??!0,onConnect:e=>c?.(n,e),onConnectStart:(r,o)=>{f(!0),u?.(e,n,t.type),s?.(r,o)},onConnectEnd:(...e)=>h.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:y,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle,dragThreshold:h.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=()=>p(!0),v=()=>p(!1);return(0,x.jsxs)(x.Fragment,{children:[(!0===e||"source"===e)&&(0,x.jsx)(yP,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:e=>m(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:g,onMouseOut:v,type:"source"}),(!0===e||"target"===e)&&(0,x.jsx)(yP,{position:s,centerX:a,centerY:i,radius:t,onMouseDown:e=>m(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:g,onMouseOut:v,type:"target"})]})}var y_=(0,w.memo)(function({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:a,onContextMenu:i,onMouseEnter:l,onMouseMove:s,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:p,onReconnectEnd:h,rfId:m,edgeTypes:g,noPanClassName:y,onError:b,disableKeyboardA11y:k}){let j,S=gX(t=>t.edgeLookup.get(e)),O=gX(e=>e.defaultEdgeOptions),C=(S=O?{...O,...S}:S).type||"default",N=g?.[C]||yO[C];void 0===N&&(b?.("011",(j=C,`Edge type "${j}" not found. Using fallback type "default".`)),C="default",N=g?.default||yO.default);let P=!!(S.focusable||t&&void 0===S.focusable),E=void 0!==d&&(S.reconnectable||n&&void 0===S.reconnectable),_=!!(S.selectable||r&&void 0===S.selectable),A=(0,w.useRef)(null),[I,T]=(0,w.useState)(!1),[R,M]=(0,w.useState)(!1),z=gJ(),{zIndex:D=S.zIndex,sourceX:L,sourceY:F,targetX:$,targetY:U,sourcePosition:H,targetPosition:B}=gX((0,w.useCallback)(t=>{let n=t.nodeLookup.get(S.source),r=t.nodeLookup.get(S.target);if(!n||!r)return yC;let o=function(e){let{sourceNode:t,targetNode:n}=e;if(!go(t)||!go(n))return null;let r=t.internals.handleBounds||ga(t.handles),o=n.internals.handleBounds||ga(n.handles),a=gl(r?.source??[],e.sourceHandle),i=gl(e.connectionMode===f.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!a||!i)return e.onError?.("008",((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`)(!a?"source":"target",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=a?.position||v.Bottom,s=i?.position||v.Top,c=gi(t,a,l),u=gi(n,i,s);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:s}}({id:e,sourceNode:n,targetNode:r,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:t.connectionMode,onError:b}),a=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:a="basic"}){if("manual"===a)return r;let i=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return(o&&n?r+1e3:r)+i}({selected:S.selected,zIndex:S.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...o||yC,zIndex:a}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex,b]),gW),V=(0,w.useMemo)(()=>S.markerStart?`url('#${gs(S.markerStart,m)}')`:void 0,[S.markerStart,m]),K=(0,w.useMemo)(()=>S.markerEnd?`url('#${gs(S.markerEnd,m)}')`:void 0,[S.markerEnd,m]);if(S.hidden||null===L||null===F||null===$||null===U)return null;let q=a?e=>{a(e,{...S})}:void 0,W=i?e=>{i(e,{...S})}:void 0,G=l?e=>{l(e,{...S})}:void 0,Z=s?e=>{s(e,{...S})}:void 0,Y=c?e=>{c(e,{...S})}:void 0;return(0,x.jsx)("svg",{style:{zIndex:D},children:(0,x.jsxs)("g",{className:fM(["react-flow__edge",`react-flow__edge-${C}`,S.className,y,{selected:S.selected,animated:S.animated,inactive:!_&&!o,updating:I,selectable:_}]),onClick:t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=z.getState();_&&(z.setState({nodesSelectionActive:!1}),S.selected&&a?(r({nodes:[],edges:[S]}),A.current?.blur()):n([e])),o&&o(t,S)},onDoubleClick:q,onContextMenu:W,onMouseEnter:G,onMouseMove:Z,onMouseLeave:Y,onKeyDown:P?t=>{if(!k&&mu.includes(t.key)&&_){let{unselectNodesAndEdges:n,addSelectedEdges:r}=z.getState();"Escape"===t.key?(A.current?.blur(),n({edges:[S]})):r([e])}}:void 0,tabIndex:P?0:void 0,role:S.ariaRole??(P?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===S.ariaLabel?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":P?`${g2}-${m}`:void 0,ref:A,...S.domAttributes,children:[!R&&(0,x.jsx)(N,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:_,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:L,sourceY:F,targetX:$,targetY:U,sourcePosition:H,targetPosition:B,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:V,markerEnd:K,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),E&&(0,x.jsx)(yE,{edge:S,isReconnectable:E,reconnectRadius:u,onReconnect:d,onReconnectStart:p,onReconnectEnd:h,sourceX:L,sourceY:F,targetX:$,targetY:U,sourcePosition:H,targetPosition:B,setUpdateHover:T,setReconnecting:M})]})})});let yA=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function yI({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:a,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,disableKeyboardA11y:m}){let{edgesFocusable:g,edgesReconnectable:v,elementsSelectable:y,onError:b}=gX(yA,gW),k=gX((0,w.useCallback)(e=>{if(!t)return e.edges.map(e=>e.id);let n=[];if(e.width&&e.height)for(let t of e.edges){let r=e.nodeLookup.get(t.source),o=e.nodeLookup.get(t.target);r&&o&&function({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){let a=mN(mA(e),mA(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),mR({x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]},mE(a))>0}({sourceNode:r,targetNode:o,width:e.width,height:e.height,transform:e.transform})&&n.push(t.id)}return n},[t]),gW);return(0,x.jsxs)("div",{className:"react-flow__edges",children:[(0,x.jsx)(yo,{defaultColor:e,rfId:n}),k.map(e=>(0,x.jsx)(y_,{id:e,edgesFocusable:g,edgesReconnectable:v,elementsSelectable:y,noPanClassName:o,onReconnect:a,onContextMenu:i,onMouseEnter:l,onMouseMove:s,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:m},e))]})}yI.displayName="EdgeRenderer";let yT=(0,w.memo)(yI),yR=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function yM({children:e}){let t=gJ(),n=(0,w.useRef)(null),[r]=(0,w.useState)(()=>t.getState().transform);return vO(()=>{let e=null,r=()=>{let r=t.getState().transform;(!e||r[0]!==e[0]||r[1]!==e[1]||r[2]!==e[2])&&(e=r,n.current&&(n.current.style.transform=yR(r)))};return r(),t.subscribe(r)},[t]),(0,x.jsx)("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:yR(r)},children:e})}let yz=e=>e.panZoom?.syncViewport;function yD(e){return e.connection.inProgress?{...e.connection,to:mF(e.connection.to,e.transform)}:{...e.connection}}let yL=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function yF({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:o,width:a,height:i,isValid:l,inProgress:s}=gX(yL,gW);return a&&o&&s?(0,x.jsx)("svg",{style:e,width:a,height:i,className:"react-flow__connectionline react-flow__container",children:(0,x.jsx)("g",{className:fM(["react-flow__connection",mZ(l)]),children:(0,x.jsx)(y$,{style:t,type:n,CustomComponent:r,isValid:l})})}):null}let y$=({style:e,type:t=m.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:o,from:a,fromNode:i,fromHandle:l,fromPosition:s,to:c,toNode:u,toHandle:d,toPosition:f,pointer:p}=gX(yD,gW);if(!o)return;if(n)return(0,x.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:a.x,fromY:a.y,toX:c.x,toY:c.y,fromPosition:s,toPosition:f,connectionStatus:mZ(r),toNode:u,toHandle:d,pointer:p});let h="",g={sourceX:a.x,sourceY:a.y,sourcePosition:s,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case m.Bezier:[h]=m6(g);break;case m.SimpleBezier:[h]=yc(g);break;case m.Step:[h]=gr({...g,borderRadius:0});break;case m.SmoothStep:[h]=gr(g);break;default:[h]=m7(g)}return(0,x.jsx)("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};y$.displayName="ConnectionLine";let yU={};function yH(e=yU){(0,w.useRef)(e),gJ(),(0,w.useEffect)(()=>{},[e])}function yB({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:h,connectionLineStyle:m,connectionLineComponent:g,connectionLineContainerStyle:v,selectionKeyCode:y,selectionOnDrag:b,selectionMode:k,multiSelectionKeyCode:j,panActivationKeyCode:S,zoomActivationKeyCode:O,deleteKeyCode:C,onlyRenderVisibleElements:N,elementsSelectable:P,defaultViewport:E,translateExtent:_,minZoom:A,maxZoom:I,preventScrolling:T,defaultMarkerColor:R,zoomOnScroll:M,zoomOnPinch:z,panOnScroll:D,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:$,panOnDrag:U,autoPanOnSelection:H,onPaneClick:B,onPaneMouseEnter:V,onPaneMouseMove:K,onPaneMouseLeave:q,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:Z,nodeClickDistance:Y,onEdgeContextMenu:X,onEdgeMouseEnter:J,onEdgeMouseMove:Q,onEdgeMouseLeave:ee,reconnectRadius:et,onReconnect:en,onReconnectStart:er,onReconnectEnd:eo,noDragClassName:ea,noWheelClassName:ei,noPanClassName:el,disableKeyboardA11y:es,nodeExtent:ec,rfId:eu,viewport:ed,onViewportChange:ef,nodesDraggable:ep}){let eh,em,eg,ev;return yH(e),yH(t),gJ(),(0,w.useRef)(!1),(0,w.useEffect)(()=>{},[]),eh=v_(),em=(0,w.useRef)(!1),(0,w.useEffect)(()=>{!em.current&&eh.viewportInitialized&&n&&(setTimeout(()=>n(eh),1),em.current=!0)},[n,eh.viewportInitialized]),eg=gX(yz),ev=gJ(),(0,w.useEffect)(()=>{ed&&(eg?.(ed),ev.setState({transform:[ed.x,ed.y,ed.zoom]}))},[ed,eg]),(0,x.jsx)(v5,{onPaneClick:B,onPaneMouseEnter:V,onPaneMouseMove:K,onPaneMouseLeave:q,onPaneContextMenu:G,onPaneScroll:W,paneClickDistance:Z,deleteKeyCode:C,selectionKeyCode:y,selectionOnDrag:b,selectionMode:k,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:j,panActivationKeyCode:S,zoomActivationKeyCode:O,elementsSelectable:P,zoomOnScroll:M,zoomOnPinch:z,zoomOnDoubleClick:$,panOnScroll:D,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:U,autoPanOnSelection:H,defaultViewport:E,translateExtent:_,minZoom:A,maxZoom:I,onSelectionContextMenu:d,preventScrolling:T,noDragClassName:ea,noWheelClassName:ei,noPanClassName:el,disableKeyboardA11y:es,onViewportChange:ef,isControlledViewport:!!ed,children:(0,x.jsxs)(yM,{children:[(0,x.jsx)(yT,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:i,onReconnect:en,onReconnectStart:er,onReconnectEnd:eo,onlyRenderVisibleElements:N,onEdgeContextMenu:X,onEdgeMouseEnter:J,onEdgeMouseMove:Q,onEdgeMouseLeave:ee,reconnectRadius:et,defaultMarkerColor:R,noPanClassName:el,disableKeyboardA11y:es,rfId:eu}),(0,x.jsx)(yF,{style:m,type:h,component:g,containerStyle:v}),(0,x.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,x.jsx)(ye,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:Y,onlyRenderVisibleElements:N,noPanClassName:el,noDragClassName:ea,disableKeyboardA11y:es,nodeExtent:ec,rfId:eu,nodesDraggable:ep}),(0,x.jsx)("div",{className:"react-flow__viewport-portal"})]})})}yB.displayName="GraphView";let yV=(0,w.memo)(yB),yK=mD("React Flow","https://reactflow.dev/"),yq=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:i,fitViewOptions:l,minZoom:s=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d,zIndexMode:p="basic"}={})=>{let h=new Map,m=new Map,g=new Map,v=new Map,y=r??t??[],b=n??e??[],x=u??[0,0],w=d??mc;gb(g,v,y);let{nodesInitialized:k}=gp(b,h,m,{nodeOrigin:x,nodeExtent:w,zIndexMode:p}),j=[0,0,1];if(i&&o&&a){let{x:e,y:t,zoom:n}=mH(mv(h,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),o,a,s,c,l?.padding??.1);j=[e,t,n]}return{rfId:"1",width:o??0,height:a??0,transform:j,nodes:b,nodesInitialized:k,nodeLookup:h,parentLookup:m,edges:y,edgeLookup:v,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==r,panZoom:null,minZoom:s,maxZoom:c,translateExtent:mc,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:f.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:l,fitViewResolver:null,connection:{...mf},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:yK,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:md,zIndexMode:p,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}};function yW({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:a,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:s,fitView:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[h]=(0,w.useState)(()=>(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:i,fitViewOptions:l,minZoom:s,maxZoom:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>{let p,h;return p=(p,h)=>{async function m(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:o,height:a,minZoom:i,maxZoom:l}=h();t&&(await mb({nodes:e,width:o,height:a,panZoom:t,minZoom:i,maxZoom:l},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...yq({nodes:e,edges:t,width:o,height:a,fitView:i,fitViewOptions:l,minZoom:s,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:o,elevateNodesOnSelect:a,fitViewQueued:i,zIndexMode:l,nodesSelectionActive:s}=h(),{nodesInitialized:c,hasSelectedNodes:u}=gp(e,t,n,{nodeOrigin:r,nodeExtent:o,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:l}),d=s&&u;i&&c?(m(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=h();gb(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=h();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=h();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:o,nodeOrigin:a,nodeExtent:i,debug:l,fitViewQueued:s,zIndexMode:c}=h(),{changes:u,updatedInternals:d}=function(e,t,n,r,o,a,i){let l=r?.querySelector(".xyflow__viewport"),s=!1;if(!l)return{changes:[],updatedInternals:s};let c=[],u=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),s=!0;continue}let l=mX(r.nodeElement),u=e.measured.width!==l.width||e.measured.height!==l.height;if(l.width&&l.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),h=mV(e.extent)?e.extent:a,{positionAbsolute:m}=e.internals;if(e.parentId&&"parent"===e.extent){let n=t.get(e.parentId);n&&(m=mS(m,l,n))}else h&&(m=mj(m,h,l));let g={...e,measured:l,internals:{...e.internals,positionAbsolute:m,handleBounds:{source:m2("source",r.nodeElement,p,d,e.id),target:m2("target",r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&gh(g,t,n,{nodeOrigin:o,zIndexMode:i}),s=!0,u&&(c.push({id:e.id,type:"dimensions",dimensions:l}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:m_(g,o)}))}}if(f.length>0){let e=gg(f,t,n,o);c.push(...e)}return{changes:c,updatedInternals:s}}(e,n,r,o,a,i,c);d&&(!function(e,t,n){let r=gd(gc,n);for(let n of e.values())if(n.parentId)gh(n,e,t,r);else{let e=mj(mg(n,r.nodeOrigin),mV(n.extent)?n.extent:r.nodeExtent,mK(n));n.internals.positionAbsolute=e}}(n,r,{nodeOrigin:a,nodeExtent:i,zIndexMode:c}),s?(m(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(l&&console.log("React Flow: trigger node changes",u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:o,triggerNodeChanges:a,connection:i,updateConnection:l,onNodesChangeMiddlewareMap:s}=h();for(let[a,s]of e){let e=o.get(a),c=!!(e?.expandParent&&e?.parentId&&s?.position),u={id:a,type:"position",position:c?{x:Math.max(0,s.position.x),y:Math.max(0,s.position.y)}:s.position,dragging:t};if(e&&i.inProgress&&i.fromNode.id===e.id){let t=gi(e,i.fromHandle,v.Left,!0);l({...i,from:t})}c&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...s.internals.positionAbsolute,width:s.measured.width??0,height:s.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=h(),a=gg(n,o,e,t);r.push(...a)}for(let e of s.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:o,debug:a}=h();e?.length&&(o&&n(vv(e,r)),a&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:o,debug:a}=h();e?.length&&(o&&n(vv(e,r)),a&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:a}=h();t?o(e.map(e=>vy(e,!0))):(o(vb(r,new Set([...e]),!0)),a(vb(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:a}=h();t?a(e.map(e=>vy(e,!0))):(a(vb(n,new Set([...e]))),o(vb(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:o,triggerNodeChanges:a,triggerEdgeChanges:i}=h(),l=[];for(let t of e||r){if(!t.selected)continue;let e=o.get(t.id);e&&(e.selected=!1),l.push(vy(t.id,!1))}let s=[];for(let e of t||n)e.selected&&s.push(vy(e.id,!1));a(l),i(s)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=h();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=h();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{h().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:o}=h();if(!o)return;let a=t.reduce((e,t)=>t.selected?[...e,vy(t.id,!1)]:e,[]),i=e.reduce((e,t)=>t.selected?[...e,vy(t.id,!1)]:e,[]);n(a),r(i)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:o,elevateNodesOnSelect:a,nodeExtent:i,zIndexMode:l}=h();(e[0][0]!==i[0][0]||e[0][1]!==i[0][1]||e[1][0]!==i[1][0]||e[1][1]!==i[1][1])&&(gp(t,n,r,{nodeOrigin:o,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:l}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:o,translateExtent:a}=h();return gv({delta:e,panZoom:o,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:o,maxZoom:a,panZoom:i}=h();if(!i)return!1;let l=void 0!==n?.zoom?n.zoom:a;return await i.setViewport({x:r/2-e*l,y:o/2-t*l,zoom:l},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...mf}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...yq()})}},h=Object.is,p?gq(p,h):gq})({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:c,minZoom:i,maxZoom:l,fitViewOptions:s,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,x.jsx)(gZ,{value:h,children:(0,x.jsx)(vP,{children:(0,x.jsx)(vZ,{children:p})})})}function yG({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:a,height:i,fitView:l,fitViewOptions:s,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,w.useContext)(gG)?(0,x.jsx)(x.Fragment,{children:e}):(0,x.jsx)(yW,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:a,initialHeight:i,fitView:l,initialFitViewOptions:s,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}let yZ={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var yY=vS(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:a,edgeTypes:i,onNodeClick:l,onEdgeClick:s,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:g,onConnectStart:v,onConnectEnd:y,onClickConnectStart:b,onClickConnectEnd:k,onNodeMouseEnter:j,onNodeMouseMove:S,onNodeMouseLeave:O,onNodeContextMenu:C,onNodeDoubleClick:N,onNodeDragStart:P,onNodeDrag:E,onNodeDragStop:_,onNodesDelete:A,onEdgesDelete:I,onDelete:T,onSelectionChange:R,onSelectionDragStart:M,onSelectionDrag:z,onSelectionDragStop:D,onSelectionContextMenu:L,onSelectionStart:F,onSelectionEnd:$,onBeforeDelete:U,connectionMode:H,connectionLineType:B=m.Bezier,connectionLineStyle:V,connectionLineComponent:K,connectionLineContainerStyle:q,deleteKeyCode:W="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:Z=!1,selectionMode:Y=h.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:J=mB()?"Meta":"Control",zoomActivationKeyCode:Q=mB()?"Meta":"Control",snapToGrid:ee,snapGrid:et,onlyRenderVisibleElements:en=!1,selectNodesOnDrag:er,nodesDraggable:eo,autoPanOnNodeFocus:ea,nodesConnectable:ei,nodesFocusable:el,nodeOrigin:es=vi,edgesFocusable:ec,edgesReconnectable:eu,elementsSelectable:ed=!0,defaultViewport:ef=vl,minZoom:ep=.5,maxZoom:eh=2,translateExtent:em=mc,preventScrolling:eg=!0,nodeExtent:ev,defaultMarkerColor:ey="#b1b1b7",zoomOnScroll:eb=!0,zoomOnPinch:ex=!0,panOnScroll:ew=!1,panOnScrollSpeed:ek=.5,panOnScrollMode:ej=p.Free,zoomOnDoubleClick:eS=!0,panOnDrag:eO=!0,onPaneClick:eC,onPaneMouseEnter:eN,onPaneMouseMove:eP,onPaneMouseLeave:eE,onPaneScroll:e_,onPaneContextMenu:eA,paneClickDistance:eI=1,nodeClickDistance:eT=0,children:eR,onReconnect:eM,onReconnectStart:ez,onReconnectEnd:eD,onEdgeContextMenu:eL,onEdgeDoubleClick:eF,onEdgeMouseEnter:e$,onEdgeMouseMove:eU,onEdgeMouseLeave:eH,reconnectRadius:eB=10,onNodesChange:eV,onEdgesChange:eK,noDragClassName:eq="nodrag",noWheelClassName:eW="nowheel",noPanClassName:eG="nopan",fitView:eZ,fitViewOptions:eY,connectOnClick:eX,attributionPosition:eJ,proOptions:eQ,defaultEdgeOptions:e0,elevateNodesOnSelect:e1=!0,elevateEdgesOnSelect:e2=!1,disableKeyboardA11y:e4=!1,autoPanOnConnect:e3,autoPanOnNodeDrag:e5,autoPanOnSelection:e6=!0,autoPanSpeed:e8,connectionRadius:e9,isValidConnection:e7,onError:te,style:tt,id:tn,nodeDragThreshold:tr,connectionDragThreshold:to,viewport:ta,onViewportChange:ti,width:tl,height:ts,colorMode:tc="light",debug:tu,onScroll:td,ariaLabelConfig:tf,zIndexMode:tp="basic",...th},tm){let tg=tn||"1",tv=function(e){let[t,n]=(0,w.useState)("system"===e?null:e);return(0,w.useEffect)(()=>{if("system"!==e)return void n(e);let t=vf(),r=()=>n(t?.matches?"dark":"light");return r(),t?.addEventListener("change",r),()=>{t?.removeEventListener("change",r)}},[e]),null!==t?t:vf()?.matches?"dark":"light"}(tc),ty=(0,w.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),td?.(e)},[td]);return(0,x.jsx)("div",{"data-testid":"rf__wrapper",...th,onScroll:ty,style:{...tt,...yZ},ref:tm,className:fM(["react-flow",o,tv]),id:tn,role:"application",children:(0,x.jsxs)(yG,{nodes:e,edges:t,width:tl,height:ts,fitView:eZ,fitViewOptions:eY,minZoom:ep,maxZoom:eh,nodeOrigin:es,nodeExtent:ev,zIndexMode:tp,children:[(0,x.jsx)(vd,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:v,onConnectEnd:y,onClickConnectStart:b,onClickConnectEnd:k,nodesDraggable:eo,autoPanOnNodeFocus:ea,nodesConnectable:ei,nodesFocusable:el,edgesFocusable:ec,edgesReconnectable:eu,elementsSelectable:ed,elevateNodesOnSelect:e1,elevateEdgesOnSelect:e2,minZoom:ep,maxZoom:eh,nodeExtent:ev,onNodesChange:eV,onEdgesChange:eK,snapToGrid:ee,snapGrid:et,connectionMode:H,translateExtent:em,connectOnClick:eX,defaultEdgeOptions:e0,fitView:eZ,fitViewOptions:eY,onNodesDelete:A,onEdgesDelete:I,onDelete:T,onNodeDragStart:P,onNodeDrag:E,onNodeDragStop:_,onSelectionDrag:z,onSelectionDragStart:M,onSelectionDragStop:D,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:eG,nodeOrigin:es,rfId:tg,autoPanOnConnect:e3,autoPanOnNodeDrag:e5,autoPanSpeed:e8,onError:te,connectionRadius:e9,isValidConnection:e7,selectNodesOnDrag:er,nodeDragThreshold:tr,connectionDragThreshold:to,onBeforeDelete:U,debug:tu,ariaLabelConfig:tf,zIndexMode:tp}),(0,x.jsx)(yV,{onInit:c,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:j,onNodeMouseMove:S,onNodeMouseLeave:O,onNodeContextMenu:C,onNodeDoubleClick:N,nodeTypes:a,edgeTypes:i,connectionLineType:B,connectionLineStyle:V,connectionLineComponent:K,connectionLineContainerStyle:q,selectionKeyCode:G,selectionOnDrag:Z,selectionMode:Y,deleteKeyCode:W,multiSelectionKeyCode:J,panActivationKeyCode:X,zoomActivationKeyCode:Q,onlyRenderVisibleElements:en,defaultViewport:ef,translateExtent:em,minZoom:ep,maxZoom:eh,preventScrolling:eg,zoomOnScroll:eb,zoomOnPinch:ex,zoomOnDoubleClick:eS,panOnScroll:ew,panOnScrollSpeed:ek,panOnScrollMode:ej,panOnDrag:eO,autoPanOnSelection:e6,onPaneClick:eC,onPaneMouseEnter:eN,onPaneMouseMove:eP,onPaneMouseLeave:eE,onPaneScroll:e_,onPaneContextMenu:eA,paneClickDistance:eI,nodeClickDistance:eT,onSelectionContextMenu:L,onSelectionStart:F,onSelectionEnd:$,onReconnect:eM,onReconnectStart:ez,onReconnectEnd:eD,onEdgeContextMenu:eL,onEdgeDoubleClick:eF,onEdgeMouseEnter:e$,onEdgeMouseMove:eU,onEdgeMouseLeave:eH,reconnectRadius:eB,defaultMarkerColor:ey,noDragClassName:eq,noWheelClassName:eW,noPanClassName:eG,rfId:tg,disableKeyboardA11y:e4,nodeExtent:ev,viewport:ta,onViewportChange:ti,nodesDraggable:eo}),(0,x.jsx)(va,{onSelectionChange:R}),eR,(0,x.jsx)(g7,{proOptions:eQ,position:eJ}),(0,x.jsx)(g6,{rfId:tg,disableKeyboardA11y:e4})]})})});function yX({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,x.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:fM(["react-flow__background-pattern",n,r])})}function yJ({radius:e,className:t}){return(0,x.jsx)("circle",{cx:e,cy:e,r:e,className:fM(["react-flow__background-pattern","dots",t])})}(c=b||(b={})).Lines="lines",c.Dots="dots",c.Cross="cross";let yQ={[b.Dots]:1,[b.Lines]:1,[b.Cross]:6},y0=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function y1({id:e,variant:t=b.Dots,gap:n=20,size:r,lineWidth:o=1,offset:a=0,color:i,bgColor:l,style:s,className:c,patternClassName:u}){let d=(0,w.useRef)(null),{transform:f,patternId:p}=gX(y0,gW),h=r||yQ[t],m=t===b.Dots,g=t===b.Cross,v=Array.isArray(n)?n:[n,n],y=[v[0]*f[2]||1,v[1]*f[2]||1],k=h*f[2],j=Array.isArray(a)?a:[a,a],S=g?[k,k]:y,O=[j[0]*f[2]+S[0]/2,j[1]*f[2]+S[1]/2],C=`${p}${e||""}`;return(0,x.jsxs)("svg",{className:fM(["react-flow__background",c]),style:{...s,...vT,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[(0,x.jsx)("pattern",{id:C,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${O[0]},-${O[1]})`,children:m?(0,x.jsx)(yJ,{radius:k/2,className:u}):(0,x.jsx)(yX,{dimensions:S,lineWidth:o,variant:t,className:u})}),(0,x.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}function y2(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,x.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function y4(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,x.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function y3(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,x.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function y5(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,x.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function y6(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,x.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function y8({children:e,className:t,...n}){return(0,x.jsx)("button",{type:"button",className:fM(["react-flow__controls-button",t]),...n,children:e})}y1.displayName="Background",(0,w.memo)(y1);let y9=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function y7({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:i,onFitView:l,onInteractiveChange:s,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":p}){let h=gJ(),{isInteractive:m,minZoomReached:g,maxZoomReached:v,ariaLabelConfig:y}=gX(y9,gW),{zoomIn:b,zoomOut:w,fitView:k}=v_();return(0,x.jsxs)(g8,{className:fM(["react-flow__controls","horizontal"===f?"horizontal":"vertical",c]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??y["controls.ariaLabel"],children:[t&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(y8,{onClick:()=>{b(),a?.()},className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:v,children:(0,x.jsx)(y2,{})}),(0,x.jsx)(y8,{onClick:()=>{w(),i?.()},className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:g,children:(0,x.jsx)(y4,{})})]}),n&&(0,x.jsx)(y8,{className:"react-flow__controls-fitview",onClick:()=>{k(o),l?.()},title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:(0,x.jsx)(y3,{})}),r&&(0,x.jsx)(y8,{className:"react-flow__controls-interactive",onClick:()=>{h.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),s?.(!m)},title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:m?(0,x.jsx)(y6,{}):(0,x.jsx)(y5,{})}),u]})}y7.displayName="Controls",(0,w.memo)(y7);let be=(0,w.memo)(function({id:e,x:t,y:n,width:r,height:o,style:a,color:i,strokeColor:l,strokeWidth:s,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:h,backgroundColor:m}=a||{};return(0,x.jsx)("rect",{className:fM(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:o,style:{fill:i||h||m,stroke:l,strokeWidth:s},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}),bt=e=>e.nodes.map(e=>e.id),bn=e=>e instanceof Function?e:()=>e,br=(0,w.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:i,NodeComponent:l,onClick:s}){let{node:c,x:u,y:d,width:f,height:p}=gX(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:o,y:a}=n.internals.positionAbsolute,{width:i,height:l}=mK(r);return{node:r,x:o,y:a,width:i,height:l}},gW);return c&&!c.hidden&&mq(c)?(0,x.jsx)(l,{x:u,y:d,width:f,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:o,strokeColor:n(c),strokeWidth:a,shapeRendering:i,onClick:s,id:c.id}):null});var bo=(0,w.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:a=be,onClick:i}){let l=gX(bt,gW),s=bn(t),c=bn(e),u=bn(n),d="u"<typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,x.jsx)(x.Fragment,{children:l.map(e=>(0,x.jsx)(br,{id:e,nodeColorFunc:s,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:a,onClick:i,shapeRendering:d},e))})});let ba=e=>!e.hidden,bi=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?mI(mv(e.nodeLookup,{filter:ba}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},bl=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,bs=(e,t)=>bl(e.viewBB,t.viewBB)&&bl(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig;function bc({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:s,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:h,pannable:m=!1,zoomable:g=!1,ariaLabel:v,inversePan:y,zoomStep:b=1,offsetScale:k=5}){let j=gJ(),S=(0,w.useRef)(null),{boundingRect:O,panZoom:C,viewBB:N,rfId:P,translateExtent:E,flowWidth:_,flowHeight:A,ariaLabelConfig:I}=gX(bi,bs),T=e?.width??200,R=e?.height??150,M=Math.max(O.width/T,O.height/R),z=M*T,D=M*R,L=k*M,F=O.x-(z-O.width)/2-L,$=O.y-(D-O.height)/2-L,U=z+2*L,H=D+2*L,B=`react-flow__minimap-desc-${P}`,V=(0,w.useRef)(0),K=(0,w.useRef)();V.current=M,(0,w.useEffect)(()=>{let e=j.getState().panZoom;if(S.current&&e)return K.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let o=pv(e);return{update:function({translateExtent:e,width:a,height:i,zoomStep:l=1,pannable:s=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0],f=ml().on("start",e=>{("mousedown"===e.sourceEvent.type||"touchstart"===e.sourceEvent.type)&&(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",s?o=>{let l=n();if("mousemove"!==o.sourceEvent.type&&"touchmove"!==o.sourceEvent.type||!t)return;let s=[o.sourceEvent.clientX??o.sourceEvent.touches[0].clientX,o.sourceEvent.clientY??o.sourceEvent.touches[0].clientY],c=[s[0]-d[0],s[1]-d[1]];d=s;let f=r()*Math.max(l[2],Math.log(l[2]))*(u?-1:1),p={x:l[0]-c[0]*f,y:l[1]-c[1]*f};t.setViewportConstrained({x:p.x,y:p.y,zoom:l[2]},[[0,0],[a,i]],e)}:null).on("zoom.wheel",c?e=>{if("wheel"!==e.sourceEvent.type||!t)return;let r=n(),o=e.sourceEvent.ctrlKey&&mB()?10:1,a=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*l,i=r[2]*Math.pow(2,a*o);t.scaleTo(i)}:null);o.call(f,{})},destroy:function(){o.on("zoom",null)},pointer:py}}({domNode:S.current,panZoom:e,getTransform:()=>j.getState().transform,getViewScale:()=>V.current}),()=>{K.current?.destroy()}},[C]),(0,w.useEffect)(()=>{K.current?.update({translateExtent:E,width:_,height:A,inversePan:y,pannable:m,zoomStep:b,zoomable:g})},[m,g,y,b,E,_,A]);let q=p?e=>{let[t,n]=K.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,W=(0,w.useCallback)((e,t)=>{let n=j.getState().nodeLookup.get(t).internals.userNode;h?.(e,n)},[h]),G=v??I["minimap.ariaLabel"];return(0,x.jsx)(g8,{position:f,style:{...e,"--xy-minimap-background-color-props":"string"==typeof s?s:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof c?c:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof d?d*M:void 0,"--xy-minimap-node-background-color-props":"string"==typeof r?r:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof i?i:void 0},className:fM(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,x.jsxs)("svg",{width:T,height:R,viewBox:`${F} ${$} ${U} ${H}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":B,ref:S,onClick:q,children:[G&&(0,x.jsx)("title",{id:B,children:G}),(0,x.jsx)(bo,{onClick:h?W:void 0,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:l}),(0,x.jsx)("path",{className:"react-flow__minimap-mask",d:`M${F-L},${$-L}h${U+2*L}v${H+2*L}h${-U-2*L}z
|
|
63
|
+
M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}bc.displayName="MiniMap",(0,w.memo)(bc);let bu={[y.Line]:"right",[y.Handle]:"bottom-right"};(0,w.memo)(function({nodeId:e,position:t,variant:n=y.Handle,className:r,style:o,children:a,color:i,minWidth:l=10,minHeight:s=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:h,onResizeStart:m,onResize:g,onResizeEnd:v}){let b,k=vq(),j="string"==typeof e?e:k,S=gJ(),O=(0,w.useRef)(null),C=n===y.Handle,N=gX((0,w.useCallback)((b=C&&p,e=>b?`${Math.max(1/e.transform[2],1)}`:void 0),[C,p]),gW),P=(0,w.useRef)(null),E=t??bu[n];(0,w.useEffect)(()=>{if(O.current&&j)return P.current||(P.current=function({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){let a=pv(e),i={controlDirection:gR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};return{update:function({controlPosition:e,boundaries:l,keepAspectRatio:s,resizeDirection:c,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let h,m,g,v,y={...gL},b={...gF};i={boundaries:l,resizeDirection:c,keepAspectRatio:s,controlDirection:gR(e)};let x=null,w=[],k=!1,j=pA().on("start",e=>{let{nodeLookup:r,transform:o,snapGrid:a,snapToGrid:i,nodeOrigin:l,paneDomNode:s}=n();if(!(h=r.get(t)))return;x=s?.getBoundingClientRect()??null;let{xSnapped:c,ySnapped:d}=mY(e.sourceEvent,{transform:o,snapGrid:a,snapToGrid:i,containerBounds:x});for(let[e,n]of(b={...y={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},pointerX:c,pointerY:d,aspectRatio:y.width/y.height},m=void 0,g=mV(h.extent)?h.extent:void 0,h.parentId&&("parent"===h.extent||h.expandParent)&&(m=r.get(h.parentId)),m&&"parent"===h.extent&&(g=[[0,0],[m.measured.width,m.measured.height]]),w=[],v=void 0,r))if(n.parentId===t&&(w.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){let e=function(e,t,n){let r=t.position.x+e.position.x,o=t.position.y+e.position.y,a=e.measured.width??0,i=e.measured.height??0,l=n[0]*a,s=n[1]*i;return[[r-l,o-s],[r+a-l,o+i-s]]}(n,h,n.origin??l);v=v?[[Math.min(e[0][0],v[0][0]),Math.min(e[0][1],v[0][1])],[Math.max(e[1][0],v[1][0]),Math.max(e[1][1],v[1][1])]]:e}u?.(e,{...y})}).on("drag",e=>{let{transform:t,snapGrid:o,snapToGrid:a,nodeOrigin:l}=n(),s=mY(e.sourceEvent,{transform:t,snapGrid:o,snapToGrid:a,containerBounds:x}),c=[];if(!h)return;let{x:u,y:f,width:j,height:S}=y,O={},C=h.origin??l,{width:N,height:P,x:E,y:_}=function(e,t,n,r,o,a,i,l){var s,c,u,d;let{affectsX:f,affectsY:p}=t,{isHorizontal:h,isVertical:m}=t,g=h&&m,{xSnapped:v,ySnapped:y}=n,{minWidth:b,maxWidth:x,minHeight:w,maxHeight:k}=r,{x:j,y:S,width:O,height:C,aspectRatio:N}=e,P=Math.floor(h?v-e.pointerX:0),E=Math.floor(m?y-e.pointerY:0),_=O+(f?-P:P),A=C+(p?-E:E),I=-a[0]*O,T=-a[1]*C,R=gD(_,b,x),M=gD(A,w,k);if(i){let e=0,t=0;f&&P<0?e=gM(j+P+I,i[0][0]):!f&&P>0&&(e=gz(j+_+I,i[1][0])),p&&E<0?t=gM(S+E+T,i[0][1]):!p&&E>0&&(t=gz(S+A+T,i[1][1])),R=Math.max(R,e),M=Math.max(M,t)}if(l){let e=0,t=0;f&&P>0?e=gz(j+P,l[0][0]):!f&&P<0&&(e=gM(j+_,l[1][0])),p&&E>0?t=gz(S+E,l[0][1]):!p&&E<0&&(t=gM(S+A,l[1][1])),R=Math.max(R,e),M=Math.max(M,t)}if(o){if(h){(R=Math.max(R,gD(_/N,w,k)*N),i)&&(R=Math.max(R,(f||p)&&(!f||p||!g)?gM(S+T+(f?P:-P)/N,i[0][1])*N:gz(S+T+_/N,i[1][1])*N));l&&(R=Math.max(R,(f||p)&&(!f||p||!g)?gz(S+(f?P:-P)/N,l[0][1])*N:gM(S+_/N,l[1][1])*N))}if(m){(M=Math.max(M,gD(A*N,b,x)/N),i)&&(M=Math.max(M,(f||p)&&(!p||f||!g)?gM(j+(p?E:-E)*N+I,i[0][0])/N:gz(j+A*N+I,i[1][0])/N));l&&(M=Math.max(M,(f||p)&&(!p||f||!g)?gz(j+(p?E:-E)*N,l[0][0])/N:gM(j+A*N,l[1][0])/N))}}E+=E<0?M:-M,P+=P<0?R:-R,o&&(g?_>A*N?E=((s=f,c=p,s?!c:c)?-P:P)/N:P=((u=f,d=p,u?!d:d)?-E:E)*N:h?(E=P/N,p=f):(P=E*N,f=p));let z=f?j+P:j,D=p?S+E:S;return{width:O+(f?-P:P),height:C+(p?-E:E),x:a[0]*P*(f?-1:1)+z,y:a[1]*E*(p?-1:1)+D}}(b,i.controlDirection,s,i.boundaries,i.keepAspectRatio,C,g,v),A=N!==j,I=P!==S,T=E!==u&&A,R=_!==f&&I;if(!T&&!R&&!A&&!I)return;if((T||R||1===C[0]||1===C[1])&&(O.x=T?E:y.x,O.y=R?_:y.y,y.x=O.x,y.y=O.y,w.length>0)){let e=E-u,t=_-f;for(let n of w)n.position={x:n.position.x-e+C[0]*(N-j),y:n.position.y-t+C[1]*(P-S)},c.push(n)}if((A||I)&&(O.width=A&&(!i.resizeDirection||"horizontal"===i.resizeDirection)?N:y.width,O.height=I&&(!i.resizeDirection||"vertical"===i.resizeDirection)?P:y.height,y.width=O.width,y.height=O.height),m&&h.expandParent){let e=C[0]*(O.width??0);O.x&&O.x<e&&(y.x=e,b.x=b.x-(O.x-e));let t=C[1]*(O.height??0);O.y&&O.y<t&&(y.y=t,b.y=b.y-(O.y-t))}let M=function({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:a}){let i=e-t,l=n-r,s=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&o&&(s[0]=-1*s[0]),l&&a&&(s[1]=-1*s[1]),s}({width:y.width,prevWidth:j,height:y.height,prevHeight:S,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),z={...y,direction:M};!1!==p?.(e,z)&&(k=!0,d?.(e,z),r(O,c))}).on("end",e=>{k&&(f?.(e,{...y}),o?.({...y}),k=!1)});a.call(j)},destroy:function(){a.on(".drag",null)}}}({domNode:O.current,nodeId:j,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,domNode:a}=S.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:o,nodeOrigin:a}=S.getState(),i=[],l={x:e.x,y:e.y},s=r.get(j);if(s&&s.expandParent&&s.parentId){let t=s.origin??a,n=e.width??s.measured.width??0,c=e.height??s.measured.height??0,u=gg([{id:s.id,parentId:s.parentId,rect:{width:n,height:c,...mW({x:e.x??s.position.x,y:e.y??s.position.y},{width:n,height:c},s.parentId,r,t)}}],r,o,a);i.push(...u),l.x=e.x?Math.max(t[0]*n,e.x):void 0,l.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==l.x&&void 0!==l.y){let e={id:j,type:"position",position:{...l}};i.push(e)}if(void 0!==e.width&&void 0!==e.height){let t={id:j,type:"dimensions",resizing:!0,setAttributes:!f||("horizontal"===f?"width":"height"),dimensions:{width:e.width,height:e.height}};i.push(t)}for(let e of t){let t={...e,type:"position"};i.push(t)}n(i)},onEnd:({width:e,height:t})=>{S.getState().triggerNodeChanges([{id:j,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}}])}})),P.current.update({controlPosition:E,boundaries:{minWidth:l,minHeight:s,maxWidth:c,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:m,onResize:g,onResizeEnd:v,shouldResize:h}),()=>{P.current?.destroy()}},[E,l,s,c,u,d,m,g,v,h]);let _=E.split("-");return(0,x.jsx)("div",{className:fM(["react-flow__resize-control","nodrag",..._,n,r]),ref:O,style:{...o,scale:N,...i&&{[C?"backgroundColor":"borderColor"]:i}},children:a})});var bd=Object.defineProperty,bf=(e,t)=>bd(e,"name",{value:t,configurable:!0}),[bp,bh]=tL("Tooltip",[lJ]),bm=lJ(),bg="tooltip.open",[bv,by]=bp("TooltipProvider"),bb=bf(e=>{let{__scopeTooltip:t,delayDuration:n=700,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,i=w.useRef(!0),l=w.useRef(!1),s=w.useRef(0);return w.useEffect(()=>{let e=s.current;return()=>window.clearTimeout(e)},[]),(0,x.jsx)(bv,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:w.useCallback(()=>{r<=0||(window.clearTimeout(s.current),i.current=!1)},[r]),onClose:w.useCallback(()=>{r<=0||(window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:a})},"TooltipProvider"),bx="Tooltip",[bw,bk]=bp(bx),bj=bf(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:l}=e,s=by(bx,e.__scopeTooltip),c=bm(t),[u,d]=w.useState(null),[f,p]=w.useState(void 0),h=tV(),m=w.useRef(0),g=i??s.disableHoverableContent,v=l??s.delayDuration,y=w.useRef(!1),[b,k]=tJ({prop:r,defaultProp:o??!1,onChange:bf(e=>{e?(s.onOpen(),document.dispatchEvent(new CustomEvent(bg))):s.onClose(),a?.(e)},"onChange"),caller:bx}),j=w.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),S=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,k(!0)},[k]),O=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,k(!1)},[k]),C=w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,k(!0),m.current=0},v)},[v,k]);return w.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),(0,x.jsx)(l1,{...c,children:(0,x.jsx)(bw,{scope:t,contentId:f??h,setContentId:p,open:b,stateAttribute:j,trigger:u,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{s.isOpenDelayedRef.current?C():S()},[s.isOpenDelayedRef,C,S]),onTriggerLeave:w.useCallback(()=>{g?O():(window.clearTimeout(m.current),m.current=0)},[O,g]),onOpen:S,onClose:O,disableHoverableContent:g,children:n})})},"Tooltip"),bS="TooltipTrigger",bO=w.forwardRef(bf(function(e,t){let{__scopeTooltip:n,...r}=e,o=bk(bS,n),a=by(bS,n),i=bm(n),l=td(t,w.useRef(null),o.onTriggerChange),s=w.useRef(!1),c=w.useRef(!1),u=w.useCallback(()=>s.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),(0,x.jsx)(l2,{asChild:!0,...i,children:(0,x.jsx)(t3.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:tT(e.onPointerMove,e=>{"touch"!==e.pointerType&&(c.current||a.isPointerInTransitRef.current||(o.onTriggerEnter(),c.current=!0))}),onPointerLeave:tT(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:tT(e.onPointerDown,()=>{o.open&&o.onClose(),s.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:tT(e.onFocus,()=>{s.current||o.onOpen()}),onBlur:tT(e.onBlur,o.onClose),onClick:tT(e.onClick,o.onClose)})})},"TooltipTrigger")),bC="TooltipPortal",[bN,bP]=bp(bC,{forceMount:void 0}),bE=bf(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,a=bk(bC,t);return(0,x.jsx)(bN,{scope:t,forceMount:n,children:(0,x.jsx)(n_,{present:n||a.open,children:(0,x.jsx)(nC,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),b_="TooltipContent",bA=w.forwardRef(bf(function(e,t){let n=bP(b_,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,i=bk(b_,e.__scopeTooltip);return(0,x.jsx)(n_,{present:r||i.open,children:i.disableHoverableContent?(0,x.jsx)(bR,{side:o,...a,ref:t}):(0,x.jsx)(bI,{side:o,...a,ref:t})})},"TooltipContent")),bI=w.forwardRef(bf(function(e,t){let n=bk(b_,e.__scopeTooltip),r=by(b_,e.__scopeTooltip),o=w.useRef(null),a=td(t,o),[i,l]=w.useState(null),{trigger:s,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{l(null),d(!1)},[d]),p=w.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=bM(r,n.getBoundingClientRect());l(bF([...bz(r,o),...bD(t.getBoundingClientRect())])),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(s&&u){let e=bf(e=>p(e,u),"handleTriggerLeave"),t=bf(e=>p(e,s),"handleContentLeave");return s.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{s.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}},[s,u,p,f]),w.useEffect(()=>{if(i){let e=bf(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=s?.contains(t)||u?.contains(t),o=!bL(n,i);r?f():o&&(f(),c())},"handleTrackPointerGrace");return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[s,u,i,c,f]),(0,x.jsx)(bR,{...e,ref:a})},"TooltipContentHoverable")),bT=tv("TooltipContent"),bR=w.forwardRef(bf(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":o,id:a,onEscapeKeyDown:i,onPointerDownOutside:l,...s}=e,c=bk(b_,n),u=bm(n),{onClose:d}=c;w.useEffect(()=>(document.addEventListener(bg,d),()=>document.removeEventListener(bg,d)),[d]),w.useEffect(()=>{if(c.trigger){let e=bf(e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&d()},"handleScroll");return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,d]);let{setContentId:f}=c;return t$(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,x.jsx)(nt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,x.jsxs)(l6,{"data-state":c.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:c.contentId,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,x.jsx)(bT,{children:r}),o?(0,x.jsx)(sr,{id:c.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl"));function bM(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw Error("unreachable")}}function bz(e,t,n=5){let r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function bD(e){let{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function bL(e,t){let{x:n,y:r}=e,o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let i=t[e],l=t[a],s=i.x,c=i.y,u=l.x,d=l.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(o=!o)}return o}function bF(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),b$(t)}function b$(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}function bU(e){var t=e.className,n=e.sideOffset,r=function(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}(e,["className","sideOffset"]);return(0,x.jsx)(bE,{children:(0,x.jsx)(bA,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({sideOffset:void 0===n?6:n,className:e4("z-50 max-w-sm rounded-md bg-popover px-2 py-1 text-xs text-popover-foreground shadow-md",t)},r))})}bf(bM,"getExitSideFromRect"),bf(bz,"getPaddedExitPoints"),bf(bD,"getPointsFromRect"),bf(bL,"isPointInPolygon"),bf(bF,"getHull"),bf(b$,"getHullPresorted");let bH=_("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);function bB(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("tool"===e)return t?[{id:"current",type:"target",position:v.Left,x:-4,y:17.12,width:8,height:8},{id:"new",type:"target",position:v.Left,x:-4,y:40.88,width:8,height:8}]:[{type:"target",position:v.Left,x:-4,y:29,width:8,height:8}];var n={type:"source",position:v.Right,x:186,y:29,width:8,height:8};return"model"===e?[n,{type:"target",position:v.Left,x:-4,y:29,width:8,height:8}]:[n]}function bV(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default";return{id:"".concat(e,"-").concat(t),source:e,target:t,targetHandle:n,type:o,animated:!0,style:{stroke:r?"var(--primary)":"color-mix(in srgb, var(--primary) 58%, var(--border))",strokeWidth:2}}}function bK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bq(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return bK(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bK(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var bW={route:function(e){var t,n=e.data,r="model"===n.kind;return(0,x.jsxs)("div",{className:"next"===n.lane||n.selected?"switch-flow-node switch-flow-node-next":"switch-flow-node",children:["model"===n.kind?(0,x.jsx)(vX,{type:"target",position:v.Left,className:"switch-flow-handle"}):null,"tool"===n.kind&&n.dual?(0,x.jsx)(vX,{type:"target",id:"current",position:v.Left,className:"switch-flow-handle",style:{top:"32%"}}):null,"tool"===n.kind&&n.dual?(0,x.jsx)(vX,{type:"target",id:"new",position:v.Left,className:"switch-flow-handle",style:{top:"68%"}}):null,"tool"!==n.kind||n.dual?null:(0,x.jsx)(vX,{type:"target",position:v.Left,className:"switch-flow-handle"}),n.action?(0,x.jsx)(tE,{variant:"ghost",className:"pointer-events-auto absolute inset-0 z-10 h-full w-full rounded-[14px]","aria-label":null!=(t=n.actionLabel)?t:n.value,disabled:n.disabled,onClick:function(e){var t;e.stopPropagation(),null==(t=n.action)||t.call(n)}}):null,"source"===n.kind||"model"===n.kind?(0,x.jsx)(vX,{type:"source",position:v.Right,className:"switch-flow-handle"}):null,"tool"===n.kind&&n.harnessId?(0,x.jsx)(di,{id:n.harnessId}):r?(0,x.jsx)(df,{className:"text-primary"}):(0,x.jsx)(bH,{className:"text-primary"}),(0,x.jsxs)("span",{className:"min-w-0",children:[(0,x.jsx)("span",{className:"block text-xs text-muted-foreground",children:n.label}),r?(0,x.jsxs)(bj,{children:[(0,x.jsx)(bO,{asChild:!0,children:(0,x.jsx)("strong",{className:"block truncate font-mono text-xs",children:n.value})}),(0,x.jsx)(bU,{className:"font-mono",children:n.value})]}):(0,x.jsx)("strong",{className:"block truncate text-sm",children:n.value})]})]})}};function bG(e,t,n,r){return{id:e,type:"route",position:{x:t,y:n},data:r,style:{pointerEvents:r.action?"all":void 0},width:190,height:66,handles:bB(r.kind,r.dual)}}function bZ(e){var t=e.nodes,n=e.edges,r=e.height,o=void 0===r?160:r,a=e.children,i=(0,w.useRef)(null),l=bq((0,w.useState)(820),2),s=l[0],c=l[1];(0,w.useEffect)(function(){var e=i.current;if(e){var t=0,n=new ResizeObserver(function(e){var n=bq(e,1)[0];cancelAnimationFrame(t);var r=Math.floor(n.contentRect.width);t=requestAnimationFrame(function(){r>0&&c(function(e){return e===r?e:r})})});return n.observe(e),function(){cancelAnimationFrame(t),n.disconnect()}}},[]);var u=Math.min(1,s/820),d=(s-820*u)/2;return(0,x.jsx)(bb,{delayDuration:250,children:(0,x.jsxs)("div",{ref:i,className:"switch-flow-canvas",style:{height:o*u},children:[a?(0,x.jsx)("div",{style:{position:"absolute",inset:0,transformOrigin:"top left",transform:"translateX(".concat(d,"px) scale(").concat(u,")"),pointerEvents:"none",zIndex:2},children:a}):null,(0,x.jsx)(yY,{width:s,height:o*u,viewport:{x:d,y:0,zoom:u},minZoom:.1,nodes:t,edges:n,nodeTypes:bW,onNodeClick:function(e,t){if(!t.data.disabled){var n,r;null==(n=(r=t.data).action)||n.call(r)}},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1})]})})}function bY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bX(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null==e?void 0:e.model;return(null==r?void 0:r.trim())?r:t(((null==e?void 0:e.harness)==="claude"?function(e){if(Array.isArray(e))return bY(e)}(n=new Set(["sonnetModel","opusModel","fableModel","haikuModel","subagentModel"].map(function(t){var n;return null==(n=e.extras[t])?void 0:n.trim()}).filter(Boolean)))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e){if(e){if("string"==typeof e)return bY(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return bY(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():[]).length?"workspace.mappedModels":"workspace.toolDefaultModel")}function bJ(e){var t=e.current,n=e.candidate,r=e.harness,o=(0,S.Bd)().t,a=(0,w.useMemo)(function(){var e,a;return[{id:"current-source",type:"route",position:{x:24,y:38},data:{label:null!=(e=t.sourceLabel)?e:o("workspace.configuration"),value:t.provider,kind:"source",lane:"current"}},{id:"current-model",type:"route",position:{x:260,y:38},data:{label:o("favorites.modelPicker"),value:t.model,kind:"model",lane:"current"}},{id:"new-source",type:"route",position:{x:24,y:154},data:{label:null!=(a=n.sourceLabel)?a:o("templates.tag"),value:n.provider,kind:"source",lane:"next"}},{id:"new-model",type:"route",position:{x:260,y:154},data:{label:o("favorites.modelPicker"),value:n.model,kind:"model",lane:"next"}},{id:"tool",type:"route",position:{x:606,y:96},data:{dual:!0,label:o("workspace.tool"),value:r.label,kind:"tool",harnessId:r.id}}].map(function(e){var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={data:e.data,width:190,height:66,handles:bB(e.data.kind,"tool"===e.data.kind)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t})},[t.provider,t.model,t.sourceLabel,n.provider,n.model,n.sourceLabel,r.id,r.label,o]),i=[bV("current-source","current-model",void 0,!1,"straight"),bV("current-model","tool","current"),bV("new-source","new-model",void 0,!0,"straight"),bV("new-model","tool","new",!0)];return(0,x.jsxs)(bZ,{nodes:a,edges:i,height:250,children:[(0,x.jsx)("span",{className:"switch-flow-label switch-flow-label-current",children:o("workspace.currentChain")}),(0,x.jsxs)("span",{className:"switch-flow-label switch-flow-label-new",children:[o("workspace.candidateChain"),(0,x.jsx)("span",{children:o("workspace.appliesAfterConfirm")})]})]})}function bQ(e){var t=e.harness,n=(0,S.Bd)().t,r=b1(t,n);return(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("section",{"aria-label":n("workspace.currentChain"),className:"space-y-4",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)("p",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:n("workspace.currentChain")}),(0,x.jsx)("span",{className:"rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:text-emerald-300",children:n("workspace.activeNow")})]}),(0,x.jsx)(bZ,{nodes:[bG("source",24,40,{kind:"source",label:r.sourceLabel,value:r.provider}),bG("model",315,40,{kind:"model",label:n("favorites.modelPicker"),value:r.model}),bG("tool",606,40,{kind:"tool",label:n("workspace.tool"),value:t.label,harnessId:t.id})],edges:[bV("source","model"),bV("model","tool")]}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:n("workspace.currentChainHint")})]})})}function b0(e){var t=e.connection,n=e.harness,r=e.templateName,o=(0,S.Bd)().t,a={provider:r,model:t.requestModelId};return(0,x.jsxs)("section",{"aria-label":o("workspace.candidateChain",{name:n.label}),className:"space-y-4",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,x.jsx)("p",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:o("workspace.switchMap")}),(0,x.jsx)("span",{className:"rounded-full border border-primary/20 bg-primary/5 px-2 py-0.5 text-xs font-medium text-primary",children:o("workspace.notWritten")})]}),(0,x.jsx)(bJ,{current:b1(n,o),candidate:a,harness:n}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:o("workspace.switchTargetHint",{name:n.label})})]})}function b1(e,t){var n,r,o,a=e.profiles.find(function(t){var n,r;return!(null==(n=e.active)?void 0:n.official)&&t.name===(null==(r=e.active)?void 0:r.name)});return{sourceLabel:t((null==a||null==(r=a.modelFavorite)?void 0:r.favoriteId)?"templates.tag":"workspace.configuration"),provider:null!=(n=null==a?void 0:a.name)?n:t((null==(o=e.active)?void 0:o.official)?"harness.official":"harness.currentInactive"),model:e.active?bX(a,t,e.active.model):t("harness.currentInactive")}}function b2(e){var t=e.connections,n=e.connection,r=e.selectedChannel,o=e.setChannel,a=e.targetsLoaded,i=e.reviewTab,l=e.setReviewTab,s=e.quickHarness,c=e.templateName,u=e.quickReady,d=e.plan,f=(0,S.Bd)().t;return(0,x.jsxs)(x.Fragment,{children:[t.length>1?(0,x.jsx)(fT,{id:"quick-channel",label:f("favorites.connection"),placeholder:f("workspace.chooseChannel"),value:r,options:t.map(function(e){return{value:e.id,label:e.label+" \xb7 "+e.requestModelId}}),onChange:o}):null,n?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(cU,{idPrefix:"quick-preview",label:f("favorites.reviewChanges"),items:[{id:"route",label:f("workspace.switchMap")},{id:"diff",label:f("workspace.fileDiffTab")}],value:i,onChange:l,className:"flex gap-2",tabClassName:"px-4 py-2 text-sm",children:function(e){return e.label}}),(0,x.jsx)(cB,{idPrefix:"quick-preview",value:i,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:"route"===i?(0,x.jsx)(b0,{connection:n,harness:s,templateName:c}):u&&d?(0,x.jsx)("div",{className:"space-y-4",children:d.items.map(function(e){return(0,x.jsx)(fw,{item:e},e.harness)})}):(0,x.jsx)("p",{role:"status",children:f("activate.loading")})})]}):(0,x.jsx)("p",{role:"status",children:f(t.length?"workspace.chooseChannel":a?"favorites.noCompatibleChannel":"workspace.checking")})]})}function b4(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b5(e){return function(e){if(Array.isArray(e))return b4(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return b4(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b4(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b6(e){var t=e.favorite,n=e.items,r=e.setItems,o=e.mode,a=e.plan,i=e.targets,l=e.clear,s=e.change,c=(0,S.Bd)().t,u=aA(function(e){return e.harnesses});return(0,x.jsxs)("div",{className:"space-y-3",children:[" ",O.oo.map(function(e){var d,f,p,h,m=t.connections.filter(function(t){var n;return null==i||null==(n=i.find(function(t){return t.harness===e}))?void 0:n.connections.some(function(e){return e.id===t.id&&0===e.projection.blockers.length})}),g=n.find(function(t){return t.harness===e}),v=null!=(d=null==(f=u.find(function(t){return t.id===e}))?void 0:f.profiles.filter(function(e){var n;return(null==(n=e.modelFavorite)?void 0:n.favoriteId)===t.id}))?d:[];return(0,x.jsxs)("section",{className:e4("overflow-hidden rounded-xl border transition-colors",g?"border-primary/40 bg-primary/[0.035] shadow-sm":"bg-card",!m.length&&"bg-muted/35"),children:[(0,x.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,x.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl border bg-background",children:(0,x.jsx)(di,{id:e,className:"size-6"})}),(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsx)("label",{htmlFor:"target-".concat(e),className:"block cursor-pointer font-semibold",children:(null==(p=u.find(function(t){return t.id===e}))?void 0:p.label)||c("favorites.toolNames.".concat(e))}),(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i?m.length?1===m.length?"".concat(m[0].label," \xb7 ").concat(m[0].requestModelId):c("favorites.compatibleCount",{count:m.length}):c("favorites.noCompatibleChannel"):c("favorites.loading")})]}),g?(0,x.jsx)(e5,{variant:"secondary",children:c("favorites.selected")}):null,(0,x.jsx)(ik,{"aria-label":(null==(h=u.find(function(t){return t.id===e}))?void 0:h.label)||c("favorites.toolNames.".concat(e)),id:"target-".concat(e),checked:!!g,disabled:!m.length,onCheckedChange:function(t){l(),r(t?b5(n).concat([{harness:e,connectionId:1===v.length&&m.some(function(e){return e.id===v[0].modelFavorite.connectionId})?v[0].modelFavorite.connectionId:1===m.length?m[0].id:"",existing:1===v.length,profile:1===v.length?v[0].name:void 0,mode:o,ignorePreference:!1,overwriteDiverged:!1}]):n.filter(function(t){return t.harness!==e}))}})]}),g?(0,x.jsxs)("div",{className:"space-y-3 border-t border-primary/10 px-4 py-3",children:[m.length>1?(0,x.jsx)(fT,{id:"connection-".concat(e),label:c("favorites.connection"),value:g.connectionId,options:m.map(function(e){return{value:e.id,label:"".concat(e.label," \xb7 ").concat(e.protocol," \xb7 ").concat(e.requestModelId)}}),onChange:function(t){return s(e,{connectionId:t})}}):null,(0,x.jsxs)("p",{className:"text-sm text-muted-foreground",children:[c(g.existing?"favorites.updateProfile":"favorites.newProfile"),":"," ",g.profile||t.name]}),(0,x.jsxs)(fg,{title:c("favorites.targetAdvanced"),children:[(0,x.jsx)(fT,{id:"existing-".concat(e),label:c("favorites.target"),value:g.existing?g.profile:"__new__",options:[{value:"__new__",label:c("favorites.newProfile")}].concat(b5(v.map(function(e){return{value:e.name,label:e.name}}))),onChange:function(t){return s(e,{existing:"__new__"!==t,profile:"__new__"===t?void 0:t})}}),g.existing?null:(0,x.jsx)(fS,{id:"profile-".concat(e),label:c("favorites.profileName"),children:function(n){var r,o,a;return(0,x.jsx)(cv,(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){b3(e,t,n[t])})}return e}({},n),a=a={value:null!=(r=g.profile)?r:"",placeholder:t.name,onChange:function(t){return s(e,{profile:t.target.value||void 0})}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(a,e))}),o))}})]}),["ignorePreference","overwriteDiverged"].filter(function(t){var n,r,o=null==i||null==(r=i.find(function(t){return t.harness===e}))||null==(n=r.connections.find(function(e){return e.id===g.connectionId}))?void 0:n.projection;return"ignorePreference"===t?null==o?void 0:o.notRepresented.includes("reasoningEffort"):g.overwriteDiverged||(null==a?void 0:a.items.some(function(t){return t.harness===e&&t.projection.blockers.some(function(e){return e.code===O.OQ.favoriteProfileDiverged})}))}).map(function(t){return(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(ik,{id:"".concat(t,"-").concat(e),checked:g[t],onCheckedChange:function(n){return s(e,b3({},t,!0===n))}}),(0,x.jsx)("label",{htmlFor:"".concat(t,"-").concat(e),children:c("favorites.".concat(t))})]},t)}),"activate"===g.mode&&v.some(function(e){return e.name===g.profile&&"openai_auth"===e.extras.authMode})?(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(ik,{id:"auth-overwrite-".concat(e),checked:!0===g.allowAuthOverwrite,onCheckedChange:function(t){return s(e,{allowAuthOverwrite:!0===t})}}),(0,x.jsx)("label",{htmlFor:"auth-overwrite-".concat(e),children:c("favorites.allowAuthOverwrite")})]}):null]}):null]},e)})]})}function b8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b9(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function b7(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){b9(a,r,o,i,l,"next",e)}function l(e){b9(a,r,o,i,l,"throw",e)}i(void 0)})}}function xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function xt(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function xn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b8(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xr(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function xo(e){var t,n=e.favorite,r=e.onClose,o=e.initialItems,a=e.initialMode,i=e.initialPreview,l=e.onApplied,s=e.quickHarness,c=(0,S.Bd)().t,u=aA(function(e){return e.favoritePlan}),d=aA(function(e){return e.favoriteOperation}),f=aA(function(e){return e.favoriteOperationHistory}),p=xn((0,w.useState)(function(){return new Set(f.map(function(e){return e.requestId}))}),1)[0],h=aA(function(e){return e.planFavorite}),m=aA(function(e){return e.applyFavorite}),g=aA(function(e){return e.clearFavoritePlan}),v=aA(function(e){return e.favoriteTargets[n.id]}),y=aA(function(e){return e.loadFavoriteTargets}),b=xn((0,w.useState)(void 0===o?[]:o),2),k=b[0],j=b[1],O=xn((0,w.useState)(void 0===a?"save":a),2),C=O[0],N=O[1],P=xn((0,w.useState)(+!!(void 0!==i&&i)),2),E=P[0],_=P[1],A=xn((0,w.useState)(!1),2),I=A[0],T=A[1],R=xn((0,w.useState)(""),2),M=R[0],D=R[1],L=xn((0,w.useState)("route"),2),F=L[0],$=L[1],U=xn((0,w.useState)(""),2),H=U[0],B=U[1],V=xn((0,w.useState)(!1),2),K=V[0],q=V[1],W=xn((0,w.useState)(0),2),G=W[0],Z=W[1],Y=s?ff(n,s.id,v):[],X=H||(s?fp(n,s,v,"activate").connectionId:""),J=Y.find(function(e){return e.id===X}),Q=xn((0,w.useState)(function(){return crypto.randomUUID()}),2),ee=Q[0],et=Q[1],en=(0,w.useRef)(null),er=(0,w.useRef)(!1);(0,w.useEffect)(function(){y(n.id).catch(function(e){return D(oE(c,oC(e)))})},[n.id,y,c]),(0,w.useEffect)(function(){var e;null==(e=en.current)||e.focus({preventScroll:!0})},[E]),(0,w.useEffect)(function(){if(s&&X&&!er.current){var e=!0;g(),q(!1),D("");var t=[xt(xe({},fp(n,s,v,"activate")),{connectionId:X})];return j(t),et(crypto.randomUUID()),h({favoriteId:n.id,expectedRevision:n.revision,items:t}).then(function(){e&&q(!0)}).catch(function(t){e&&D(oE(c,oC(t)))}),function(){e=!1}}},[s,X,n,v,g,h,c,G]);var eo=function(e){return b7(function(){return xr(this,function(t){switch(t.label){case 0:T(!0),D(""),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,e()];case 2:return t.sent(),[2,!0];case 3:return D(oE(c,oC(t.sent()))),[2,!1];case 4:return T(!1),[7];case 5:return[2]}})})()},ea=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k;return b7(function(){return xr(this,function(t){switch(t.label){case 0:return et(crypto.randomUUID()),[4,h({favoriteId:n.id,expectedRevision:n.revision,items:e})];case 1:return t.sent(),_(1),[2]}})})()},ei=null==d?void 0:d.items.some(function(e){return"failed"===e.status||"skipped"===e.status}),el=!!d&&!ei,es=null==u?void 0:u.items.some(function(e){return e.projection.blockers.length>0}),ec=function(){I||(g(),r())};return(0,x.jsx)(rA,{open:!0,onOpenChange:function(e){return!e&&ec()},children:(0,x.jsxs)(r0,{style:{height:s&&"route"===F?"min(580px, 90dvh)":"min(820px, 90dvh)"},className:"flex h-[min(720px,90dvh)] max-w-4xl flex-col gap-0 overflow-hidden p-0 data-[state=open]:animate-none data-[state=closed]:animate-none",onEscapeKeyDown:function(e){return I&&e.preventDefault()},children:[(0,x.jsxs)(r1,{className:"shrink-0 border-b px-6 pb-5 pt-6 text-left sm:px-8",children:[s?null:(0,x.jsxs)("div",{className:"mb-4 flex items-center gap-2 pr-8 text-xs font-medium text-muted-foreground","aria-label":c("favorites.workflow"),children:[(0,x.jsxs)("span",{className:e4("flex items-center gap-2",0===E&&"text-primary"),"aria-current":0===E?"step":void 0,children:[(0,x.jsx)("span",{className:"flex size-6 items-center justify-center rounded-full bg-primary/10 text-primary",children:1===E?(0,x.jsx)(iw,{className:"size-3.5"}):"1"}),c("favorites.chooseTools")]}),(0,x.jsx)("span",{className:"h-px w-8 bg-border"}),(0,x.jsxs)("span",{className:e4("flex items-center gap-2",1===E&&"text-primary"),"aria-current":1===E?"step":void 0,children:[(0,x.jsx)("span",{className:"flex size-6 items-center justify-center rounded-full bg-muted",children:"2"}),c("favorites.reviewChanges")]})]}),(0,x.jsx)(r4,{ref:en,tabIndex:-1,className:"text-xl outline-none",children:c(0===E?"favorites.configure":"favorites.reviewChanges")}),(0,x.jsxs)(r3,{children:[n.name," \xb7 ",c(0===E?"favorites.chooseHint":"favorites.reviewHint")]})]}),(0,x.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:(0,x.jsxs)("div",{className:"flex h-full w-[200%] transition-transform duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none",style:{transform:"translateX(".concat(1===E?"-50%":"0",")")},children:[(0,x.jsxs)("section",{"aria-label":c("favorites.chooseTools"),"aria-hidden":0!==E,inert:0!==E||I,className:"h-full w-1/2 shrink-0 space-y-5 overflow-y-auto p-6 sm:px-8",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,x.jsx)("p",{className:"text-sm font-medium",children:c("favorites.targetTools")}),(0,x.jsx)(fu,{"aria-label":c("favorites.mode"),className:"flex flex-wrap items-center gap-x-6 gap-y-3",value:C,onValueChange:function(e){var t="activate"===e?"activate":"save";N(t),g(),j(k.map(function(e){return xt(xe({},e),{mode:t})}))},children:["save","activate"].map(function(e){return(0,x.jsxs)("label",{className:"flex cursor-pointer items-center gap-2.5 py-2 text-sm font-medium",htmlFor:"favorite-mode-".concat(e),children:[(0,x.jsx)(fd,{value:e,id:"favorite-mode-".concat(e)}),c("favorites.modeLabel.".concat(e))]},e)})})]}),(0,x.jsx)(b6,{favorite:n,items:k,setItems:j,mode:C,plan:u,targets:v,clear:g,change:function(e,t){g(),j(k.map(function(n){return n.harness===e?xe({},n,t):n}))}})]}),(0,x.jsx)("section",{"aria-label":c("favorites.reviewChanges"),"aria-hidden":1!==E,inert:1!==E||I,className:"flex h-full w-1/2 shrink-0 flex-col gap-4 overflow-hidden bg-muted/20 p-6 sm:px-8",children:s?(0,x.jsx)(b2,{connections:Y,connection:J,selectedChannel:X,setChannel:B,targetsLoaded:!!v,reviewTab:F,setReviewTab:$,quickHarness:s,templateName:n.name,quickReady:K,plan:u}):u?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("p",{className:"shrink-0 text-sm font-medium",children:c("favorites.batchSummary",{count:u.items.length,activate:u.items.filter(function(e){return"activate"===e.mode}).length,files:u.items.reduce(function(e,t){return e+t.nativeFiles.filter(function(e){return e.changed}).length},0)})}),(0,x.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,x.jsx)(cT,{className:"size-4 shrink-0"}),c("favorites.autoBackupNotice")]}),(0,x.jsx)(fj,{items:u.items,history:f.filter(function(e){return!p.has(e.requestId)})},u.id)]}):null})]})}),(0,x.jsxs)("div",{className:"shrink-0 space-y-3 border-t bg-card px-6 py-4 sm:px-8",children:[M?(0,x.jsxs)(dm,{children:[M,s&&!K?(0,x.jsx)(tE,{variant:"link",onClick:function(){return Z(function(e){return e+1})},children:c("activate.retryPreview")}):null]}):null,1===E&&es?(0,x.jsx)(dm,{variant:"warning",children:c("favorites.resolveBeforeApply")}):null,(0,x.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[s?(0,x.jsx)(tE,{variant:"outline",disabled:I,onClick:ec,children:c("common.cancel")}):0===E?(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:c("favorites.selectedCount",{count:k.length})}):(0,x.jsxs)(tE,{variant:"outline",disabled:I||!!d,onClick:function(){D(""),_(0)},children:[(0,x.jsx)(z,{}),c("favorites.backToSelection")]}),0===E?(0,x.jsxs)(tE,{disabled:I||!k.length||k.some(function(e){return!e.connectionId}),onClick:function(){eo(function(){return ea()})},children:[I?(0,x.jsx)(cA,{className:"animate-spin"}):null,c("favorites.preview"),(0,x.jsx)(dp,{})]}):el?(0,x.jsxs)(tE,{onClick:ec,children:[(0,x.jsx)(iw,{}),c("favorites.done")]}):ei?(0,x.jsx)(tE,{disabled:I,onClick:function(){eo(function(){return b7(function(){var e;return xr(this,function(t){switch(t.label){case 0:return j(e=k.filter(function(e){return null==d?void 0:d.items.some(function(t){return t.harness===e.harness&&("failed"===t.status||"skipped"===t.status)})})),[4,ea(e)];case 1:return t.sent(),[2]}})})()})},children:c("favorites.retryFailed")}):(0,x.jsxs)(tE,{disabled:I||!u||!!d||es||!!s&&!K,onClick:function(){b7(function(){return xr(this,function(e){switch(e.label){case 0:return er.current=!0,[4,eo(function(){return m(ee)})];case 1:return e.sent()?(g(),null==l||l(),r()):er.current=!1,[2]}})})()},children:[I?(0,x.jsx)(cA,{className:"animate-spin"}):(0,x.jsx)(iw,{}),c("activate"===C?"favorites.confirmBatchActivate":"favorites.confirmBatchSave",{count:null!=(t=null==u?void 0:u.items.length)?t:0})]})]})]})]})})}function xa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xi(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function xl(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){xi(a,r,o,i,l,"next",e)}function l(e){xi(a,r,o,i,l,"throw",e)}i(void 0)})}}function xs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xa(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xc(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function xu(e){var t,n,r=e.onClose,o=e.initialSource,a=(0,S.Bd)().t,i=aA(function(e){return e.captureFavorite}),l=aA(function(e){return e.harnesses}),s=xs((0,w.useState)(function(){return o?JSON.stringify([o.harness,o.name]):""}),2),c=s[0],u=s[1],d=xs((0,w.useState)(null!=(t=null==o?void 0:o.name)?t:""),2),f=d[0],p=d[1],h=xs((0,w.useState)(!1),2),m=h[0],g=h[1],v=xs((0,w.useState)(!1),2),y=v[0],b=v[1],k=xs((0,w.useState)(!1),2),j=k[0],O=k[1],C=xs((0,w.useState)(""),2),N=C[0],P=C[1],E=l.flatMap(function(e){return e.profiles.filter(function(t){var n;return!t.modelFavorite&&!t.overriddenTargets.length&&t.name!==(null==(n=e.official)?void 0:n.linkedProfileName)}).map(function(t){return{harness:e.id,profile:t,value:JSON.stringify([e.id,t.name])}})});return(0,x.jsx)(rA,{open:!0,onOpenChange:function(e){return!e&&!j&&r()},children:(0,x.jsxs)(r0,{className:"flex max-h-[90dvh] flex-col overflow-hidden p-0",children:[(0,x.jsxs)(r1,{className:"shrink-0 border-b p-6",children:[(0,x.jsx)(r4,{children:a("favorites.capture")}),(0,x.jsx)(r3,{children:a("workspace.captureHint")})]}),(0,x.jsxs)("div",{className:"min-h-0 overflow-y-auto p-6",children:[(0,x.jsxs)("fieldset",{disabled:j,className:"grid gap-4 sm:grid-cols-2",children:[(0,x.jsx)(fT,{id:"favorite-source",label:a("favorites.capture"),value:c,options:E.map(function(e){return{value:e.value,label:"".concat(e.harness," / ").concat(e.profile.name)}}),onChange:function(e){u(e);var t,n=E.find(function(t){return t.value===e});p(null!=(t=null==n?void 0:n.profile.name)?t:"")}}),(0,x.jsx)(fS,{id:"capture-name",label:a("favorites.name"),children:function(e){var t,n;return(0,x.jsx)(cv,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={maxLength:120,value:f,onChange:function(e){return p(e.target.value)}},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}}),!c||(null==(n=E.find(function(e){return e.value===c}))?void 0:n.profile.providerId)?null:(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(ik,{id:"capture-credential",checked:m,onCheckedChange:function(e){return g(!0===e)}}),(0,x.jsx)("label",{htmlFor:"capture-credential",children:a("favorites.extractCredential")})]}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(ik,{id:"capture-link",checked:y,onCheckedChange:function(e){return b(!0===e)}}),(0,x.jsx)("label",{htmlFor:"capture-link",children:a("favorites.linkSource")})]}),(0,x.jsx)(tE,{disabled:j||!c||!f,onClick:function(){xl(function(){return xc(this,function(e){switch(e.label){case 0:O(!0),P(""),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,function(){return xl(function(){var e;return xc(this,function(t){switch(t.label){case 0:if(!(e=E.find(function(e){return e.value===c})))return[3,2];return[4,i(e.harness,e.profile.name,f,m,y)];case 1:t.sent(),r(),t.label=2;case 2:return[2]}})})()}()];case 2:return e.sent(),[3,5];case 3:return P(oE(a,oC(e.sent()))),[3,5];case 4:return O(!1),[7];case 5:return[2]}})})()},children:a("favorites.capture")})]}),N?(0,x.jsx)("p",{role:"alert",className:"mt-3 text-sm text-destructive",children:N}):null]})]})})}function xd(e){var t=e.className,n=function(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}(e,["className"]);return(0,x.jsx)("textarea",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"textarea",className:e4("flex min-h-[60px] w-full rounded-[10px] border border-input bg-card px-3 py-2 text-base shadow-[0_1px_2px_rgb(20_24_40/0.04)] transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t)},n))}let xf=_("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);function xp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function xh(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}function xm(e){var t=e.className,n=xh(e,["className"]);return(0,x.jsx)("div",xp({"data-slot":"card",className:e4("rounded-2xl border bg-card text-card-foreground shadow-[0_12px_34px_-26px_rgb(36_39_70/0.38)]",t)},n))}function xg(e){var t=e.className,n=xh(e,["className"]);return(0,x.jsx)("div",xp({"data-slot":"card-title",className:e4("font-semibold leading-none tracking-tight",t)},n))}function xv(e){var t=e.className,n=xh(e,["className"]);return(0,x.jsx)("div",xp({"data-slot":"card-description",className:e4("text-sm text-muted-foreground",t)},n))}function xy(e){var t=e.className,n=xh(e,["className"]);return(0,x.jsx)("div",xp({"data-slot":"card-content",className:e4("p-5 pt-0",t)},n))}var xb=Object.defineProperty,xx=(e,t)=>xb(e,"name",{value:t,configurable:!0}),xw="Popover",[xk,xj]=tL(xw,[lJ]),xS=lJ(),[xO,xC]=xk(xw),xN=xx(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,l=xS(t),s=w.useRef(null),[c,u]=w.useState(!1),[d,f]=tJ({prop:r,defaultProp:o??!1,onChange:a,caller:xw});return(0,x.jsx)(l1,{...l,children:(0,x.jsx)(xO,{scope:t,contentId:tV(),triggerRef:s,open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:c,onCustomAnchorAdd:w.useCallback(()=>u(!0),[]),onCustomAnchorRemove:w.useCallback(()=>u(!1),[]),modal:i,children:n})})},"Popover"),xP=w.forwardRef(xx(function(e,t){let{__scopePopover:n,...r}=e,o=xC("PopoverTrigger",n),a=xS(n),i=td(t,o.triggerRef),l=(0,x.jsx)(t3.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":xF(o.open),...r,ref:i,onClick:tT(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:(0,x.jsx)(l2,{asChild:!0,...a,children:l})},"PopoverTrigger")),xE="PopoverPortal",[x_,xA]=xk(xE,{forceMount:void 0}),xI=xx(e=>{let{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=xC(xE,t);return(0,x.jsx)(x_,{scope:t,forceMount:n,children:(0,x.jsx)(n_,{present:n||a.open,children:(0,x.jsx)(nC,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),xT="PopoverContent",xR=w.forwardRef(xx(function(e,t){let n=xA(xT,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=xC(xT,e.__scopePopover);return(0,x.jsx)(n_,{present:r||a.open,children:a.modal?(0,x.jsx)(xz,{...o,ref:t}):(0,x.jsx)(xD,{...o,ref:t})})},"PopoverContent")),xM=th("PopoverContent.RemoveScroll"),xz=w.forwardRef(xx(function(e,t){let n=xC(xT,e.__scopePopover),r=w.useRef(null),o=td(t,r),a=w.useRef(!1);return w.useEffect(()=>{let e=r.current;if(e)return rj(e)},[]),(0,x.jsx)(rg,{as:xM,allowPinchZoom:!0,children:(0,x.jsx)(xL,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tT(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:tT(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;a.current=2===t.button||n},{checkForDefaultPrevented:!1}),onFocusOutside:tT(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),xD=w.forwardRef(xx(function(e,t){let n=xC(xT,e.__scopePopover),r=w.useRef(!1),o=w.useRef(!1);return(0,x.jsx)(xL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})},"PopoverContentNonModal")),xL=w.forwardRef(xx(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:u,...d}=e,f=xC(xT,n),p=xS(n);return n$(),(0,x.jsx)(np,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:(0,x.jsx)(nt,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,x.jsx)(l6,{"data-state":xF(f.open),role:"dialog",id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function xF(e){return e?"open":"closed"}xx(xF,"getState");var x$=/[\\\/_+.#"@\[\(\{&]/,xU=/[\\\/_+.#"@\[\(\{&]/g,xH=/[\s-]/,xB=/[\s-]/g;function xV(e){return e.toLowerCase().replace(xB," ")}var xK='[cmdk-group=""]',xq='[cmdk-group-items=""]',xW='[cmdk-item=""]',xG=`${xW}:not([aria-disabled="true"])`,xZ="cmdk-item-select",xY="data-value",xX=(e,t,n)=>{var r;return r=e,function e(t,n,r,o,a,i,l){if(i===n.length)return a===t.length?1:.99;var s=`${a},${i}`;if(void 0!==l[s])return l[s];for(var c,u,d,f,p=o.charAt(i),h=r.indexOf(p,a),m=0;h>=0;)(c=e(t,n,r,o,h+1,i+1,l))>m&&(h===a?c*=1:x$.test(t.charAt(h-1))?(c*=.8,(d=t.slice(a,h-1).match(xU))&&a>0&&(c*=Math.pow(.999,d.length))):xH.test(t.charAt(h-1))?(c*=.9,(f=t.slice(a,h-1).match(xB))&&a>0&&(c*=Math.pow(.999,f.length))):(c*=.17,a>0&&(c*=Math.pow(.999,h-a))),t.charAt(h)!==n.charAt(i)&&(c*=.9999)),(c<.1&&r.charAt(h-1)===o.charAt(i+1)||o.charAt(i+1)===o.charAt(i)&&r.charAt(h-1)!==o.charAt(i))&&.1*(u=e(t,n,r,o,h+1,i+2,l))>c&&(c=.1*u),c>m&&(m=c),h=r.indexOf(p,h+1);return l[s]=m,m}(r=n&&n.length>0?`${r+" "+n.join(" ")}`:r,t,xV(r),xV(t),0,0,{})},xJ=w.createContext(void 0),xQ=w.createContext(void 0),x0=w.createContext(void 0),x1=w.forwardRef((e,t)=>{let n=wt(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=wt(()=>new Set),o=wt(()=>new Map),a=wt(()=>new Map),i=wt(()=>new Set),l=x7(e),{label:s,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:h,disablePointerSelection:m=!1,vimBindings:g=!0,...v}=e,y=tV(),b=tV(),x=tV(),k=w.useRef(null),j=wo();we(()=>{if(void 0!==u){let e=u.trim();n.current.value=e,S.emit()}},[u]),we(()=>{j(6,_)},[]);let S=w.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,a,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)E(),N(),j(1,P);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(o=document.getElementById(y))||o.focus()}if(j(7,()=>{var e;n.current.selectedItemId=null==(e=A())?void 0:e.id,S.emit()}),r||j(5,_),(null==(a=l.current)?void 0:a.value)!==void 0){null==(s=(i=l.current).onValueChange)||s.call(i,null!=t?t:"");return}}S.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),O=w.useMemo(()=>({value:(e,t,r)=>{var o;t!==(null==(o=a.current.get(e))?void 0:o.value)&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,C(t,r)),j(2,()=>{N(),S.emit()}))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),j(3,()=>{E(),N(),n.current.value||P(),S.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();j(4,()=>{E(),(null==t?void 0:t.getAttribute("id"))===e&&P(),S.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{a.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:s||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:k}),[]);function C(e,t){var r,o;let a=null!=(o=null==(r=l.current)?void 0:r.filter)?o:xX;return e?a(e,n.current.search,t):0}function N(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=o.current.get(n),a=0;r.forEach(t=>{a=Math.max(e.get(t),a)}),t.push([n,a])});let r=k.current;I().sort((t,n)=>{var r,o;let a=t.getAttribute("id"),i=n.getAttribute("id");return(null!=(r=e.get(i))?r:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(xq);t?t.appendChild(e.parentElement===t?e:e.closest(`${xq} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${xq} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${xK}[${xY}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function P(){let e=I().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(xY);S.setState("value",t||void 0)}function E(){var e,t,i,s;if(!n.current.search||!1===l.current.shouldFilter){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let c=0;for(let o of r.current){let r=C(null!=(t=null==(e=a.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(i=a.current.get(o))?void 0:i.keywords)?s:[]);n.current.filtered.items.set(o,r),r>0&&c++}for(let[e,t]of o.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=c}function _(){var e,t,n;let r=A();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(xK))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function A(){var e;return null==(e=k.current)?void 0:e.querySelector(`${xW}[aria-selected="true"]`)}function I(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(xG))||[])}function T(e){let t=I()[e];t&&S.setState("value",t.getAttribute(xY))}function R(e){var t;let n=A(),r=I(),o=r.findIndex(e=>e===n),a=r[o+e];null!=(t=l.current)&&t.loop&&(a=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),a&&S.setState("value",a.getAttribute(xY))}function M(e){let t=A(),n=null==t?void 0:t.closest(xK),r;for(;n&&!r;)r=null==(n=e>0?function(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}(n,xK):function(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}(n,xK))?void 0:n.querySelector(xG);r?S.setState("value",r.getAttribute(xY)):R(e)}let z=()=>T(I().length-1),D=e=>{e.preventDefault(),e.metaKey?z():e.altKey?M(1):R(1)},L=e=>{e.preventDefault(),e.metaKey?T(0):e.altKey?M(-1):R(-1)};return w.createElement(t3.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||n))switch(e.key){case"n":case"j":g&&e.ctrlKey&&D(e);break;case"ArrowDown":D(e);break;case"p":case"k":g&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),T(0);break;case"End":e.preventDefault(),z();break;case"Enter":{e.preventDefault();let t=A();if(t){let e=new Event(xZ);t.dispatchEvent(e)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:wi},s),wa(e,e=>w.createElement(xQ.Provider,{value:S},w.createElement(xJ.Provider,{value:O},e))))}),x2=w.forwardRef((e,t)=>{var n,r;let o=tV(),a=w.useRef(null),i=w.useContext(x0),l=w.useContext(xJ),s=x7(e),c=null!=(r=null==(n=s.current)?void 0:n.forceMount)?r:null==i?void 0:i.forceMount;we(()=>{if(!c)return l.item(o,null==i?void 0:i.id)},[c]);let u=wr(o,a,[e.value,e.children,a],e.keywords),d=w.useContext(xQ),f=wn(e=>e.value&&e.value===u.current),p=wn(e=>!!c||!1===l.filter()||!e.search||e.filtered.items.get(o)>0);function h(){var e,t;m(),null==(t=(e=s.current).onSelect)||t.call(e,u.current)}function m(){d.setState("value",u.current,!0)}if(w.useEffect(()=>{let t=a.current;if(!(!t||e.disabled))return t.addEventListener(xZ,h),()=>t.removeEventListener(xZ,h)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:g,value:v,onSelect:y,forceMount:b,keywords:x,...k}=e;return w.createElement(t3.div,{ref:tu(a,t),...k,id:o,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||l.getDisablePointerSelection()?void 0:m,onClick:g?void 0:h},e.children)}),x4=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...a}=e,i=tV(),l=w.useRef(null),s=w.useRef(null),c=tV(),u=w.useContext(xJ),d=wn(e=>!!o||!1===u.filter()||!e.search||e.filtered.groups.has(i));we(()=>u.group(i),[]),wr(i,l,[e.value,e.heading,s]);let f=w.useMemo(()=>({id:i,forceMount:o}),[o]);return w.createElement(t3.div,{ref:tu(l,t),...a,"cmdk-group":"",role:"presentation",hidden:!d||void 0},n&&w.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),wa(e,e=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},w.createElement(x0.Provider,{value:f},e))))}),x3=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=w.useRef(null),a=wn(e=>!e.search);return n||a?w.createElement(t3.div,{ref:tu(o,t),...r,"cmdk-separator":"",role:"separator"}):null}),x5=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,a=w.useContext(xQ),i=wn(e=>e.search),l=wn(e=>e.selectedItemId),s=w.useContext(xJ);return w.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),w.createElement(t3.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":l,id:s.inputId,type:"text",value:o?e.value:i,onChange:e=>{o||a.setState("search",e.target.value),null==n||n(e.target.value)}})}),x6=w.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,a=w.useRef(null),i=w.useRef(null),l=wn(e=>e.selectedItemId),s=w.useContext(xJ);return w.useEffect(()=>{if(i.current&&a.current){let e=i.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),w.createElement(t3.div,{ref:tu(a,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:s.listId},wa(e,e=>w.createElement("div",{ref:tu(i,s.listInnerRef),"cmdk-list-sizer":""},e)))}),x8=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:a,container:i,...l}=e;return w.createElement(rA,{open:n,onOpenChange:r},w.createElement(rz,{container:i},w.createElement(rL,{"cmdk-overlay":"",className:o}),w.createElement(rH,{"aria-label":e.label,"cmdk-dialog":"",className:a},w.createElement(x1,{ref:t,...l}))))}),x9=Object.assign(x1,{List:x6,Item:x2,Input:x5,Group:x4,Separator:x3,Dialog:x8,Empty:w.forwardRef((e,t)=>wn(e=>0===e.filtered.count)?w.createElement(t3.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:w.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...a}=e;return w.createElement(t3.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},wa(e,e=>w.createElement("div",{"aria-hidden":!0},e)))})});function x7(e){let t=w.useRef(e);return we(()=>{t.current=e}),t}var we="u"<typeof window?w.useEffect:w.useLayoutEffect;function wt(e){let t=w.useRef();return void 0===t.current&&(t.current=e()),t}function wn(e){let t=w.useContext(xQ),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function wr(e,t,n,r=[]){let o=w.useRef(),a=w.useContext(xJ);return we(()=>{var i;let l=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),s=r.map(e=>e.trim());a.value(e,l,s),null==(i=t.current)||i.setAttribute(xY,l),o.current=l}),o}var wo=()=>{let[e,t]=w.useState(),n=wt(()=>new Map);return we(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function wa({asChild:e,children:t},n){let r;return e&&w.isValidElement(t)?w.cloneElement("function"==typeof(r=t.type)?r(t.props):"render"in r?r.render(t.props):t,{ref:t.ref},n(t.props.children)):n(t)}var wi={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};let wl=_("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),ws=_("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);function wc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||wf(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wd(e){return function(e){if(Array.isArray(e))return wc(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||wf(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wf(e,t){if(e){if("string"==typeof e)return wc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wc(e,t)}}function wp(e){var t,n,r=e.value,o=e.options,a=e.onChange,i=e.placeholder,l=e.searchLabel,s=e.emptyHint,c=e.customLabel,u=e.getLabel,d=void 0===u?function(e){return e}:u,f=e.disabled,p=e.trigger,h=function(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}(e,["value","options","onChange","placeholder","searchLabel","emptyHint","customLabel","getLabel","disabled","trigger"]),m=wu((0,w.useState)(!1),2),g=m[0],v=m[1],y=wu((0,w.useState)(""),2),b=y[0],k=y[1],j=wd(new Set(r?[r].concat(wd(o)):o)),S=j.filter(function(e){return"".concat(d(e)," ").concat(e).toLowerCase().includes(b.toLowerCase())}),O=b.trim(),C=function(e){a(e),v(!1)};return(0,x.jsxs)(xN,{open:g,onOpenChange:function(e){v(e),k("")},children:[(0,x.jsx)(xP,{asChild:!0,children:null!=p?p:(0,x.jsxs)(tE,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},h),n=n={variant:"outline",role:"combobox","aria-expanded":g,disabled:f,className:"h-auto min-h-11 w-full justify-between gap-3 px-3 py-2 text-left font-normal",children:[(0,x.jsx)("span",{className:e4("min-w-0 truncate",r?"font-mono":"text-muted-foreground"),children:r?d(r):i}),(0,x.jsx)(wl,{className:"shrink-0 text-muted-foreground"})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}),(0,x.jsx)(xI,{children:(0,x.jsx)(xR,{align:"start",sideOffset:6,className:"z-[60] min-w-64 w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-xl",onEscapeKeyDown:function(e){return e.stopPropagation()},children:(0,x.jsxs)(x9,{label:l,shouldFilter:!1,loop:!0,className:"w-full",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 border-b px-3",children:[(0,x.jsx)(ws,{className:"size-4 shrink-0 text-muted-foreground"}),(0,x.jsx)(x9.Input,{"aria-label":l,placeholder:l,maxLength:120,value:b,onValueChange:k,className:"h-11 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),(0,x.jsxs)(x9.List,{label:l,className:"max-h-64 overflow-y-auto overscroll-contain p-1.5",children:[S.length||O&&c?null:(0,x.jsx)("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:s}),S.map(function(e){return(0,x.jsxs)(x9.Item,{value:e,onSelect:function(){return C(e)},className:"flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-2.5 text-sm data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground",children:[(0,x.jsx)(iw,{className:e4("size-4 shrink-0",r!==e&&"invisible")}),(0,x.jsx)("span",{className:"break-all",children:d(e)})]},e)}),c&&O&&!j.includes(O)?(0,x.jsxs)(x9.Item,{value:O,onSelect:function(){return C(O)},className:"flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-2.5 text-sm data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground",children:[(0,x.jsx)(dd,{className:"size-4 shrink-0"}),(0,x.jsx)("span",{className:"break-all",children:c(O)})]}):null]})]})})})]})}function wh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function wg(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function wv(e){return function(e){if(Array.isArray(e))return wh(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return wh(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wh(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var wy=function(e){return void 0===e?"inherit":null===e?"unknown":String(e)};function wb(e){var t,n,r,o=e.favorite,a=e.connection,i=e.onChange,l=(0,S.Bd)().t,s=a.factOverrides,c=s.supportedReasoningEfforts,u=[{value:"inherit",label:l("favorites.inherit")},{value:"unknown",label:l("favorites.unknown")}];return(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsx)(fT,{id:"".concat(a.id,"-reasoning-override"),label:"".concat(l("favorites.reasoningSupported")," (").concat(l("favorites.inherited"),": ").concat(void 0===o.defaults.reasoningSupported?l("favorites.unknown"):l("favorites.".concat(o.defaults.reasoningSupported)),")"),value:wy(s.reasoningSupported),options:wv(u).concat(wv(["true","false"].map(function(e){return{value:e,label:l("favorites.".concat(e))}}))),onChange:function(e){return i({factOverrides:wg(wm({},s),{reasoningSupported:"inherit"===e?void 0:"unknown"===e?null:"true"===e})})}}),(0,x.jsx)(fT,{id:"".concat(a.id,"-preference-override"),label:"".concat(l("favorites.reasoningEffort")," (").concat(l("favorites.inherited"),": ").concat(null!=(t=o.preferences.reasoningEffort)?t:l("favorites.unknown"),")"),value:wy(a.preferenceOverrides.reasoningEffort),options:wv(u).concat(wv(O.wl.options.map(function(e){return{value:e,label:e}}))),onChange:function(e){return i({preferenceOverrides:{reasoningEffort:"inherit"===e?void 0:"unknown"===e?null:O.wl.parse(e)}})}}),(0,x.jsx)(fT,{id:"".concat(a.id,"-efforts-mode"),label:"".concat(l("favorites.supportedReasoningEfforts")," (").concat(l("favorites.inherited"),": ").concat(null!=(n=null==(r=o.defaults.supportedReasoningEfforts)?void 0:r.join(", "))?n:l("favorites.unknown"),")"),value:void 0===c?"inherit":null===c?"unknown":"override",options:wv(u).concat([{value:"override",label:l("favorites.overridden")}]),onChange:function(e){return i({factOverrides:wg(wm({},s),{supportedReasoningEfforts:"inherit"===e?void 0:"unknown"===e?null:[]})})}}),Array.isArray(c)?(0,x.jsx)("div",{className:"flex flex-wrap gap-3",children:O.wl.options.map(function(e){return(0,x.jsxs)("label",{className:"flex items-center gap-1",children:[(0,x.jsx)(ik,{checked:c.includes(e),onCheckedChange:function(t){return i({factOverrides:wg(wm({},s),{supportedReasoningEfforts:t?wv(c).concat([e]):c.filter(function(t){return t!==e})})})}}),e]},e)})}):null]})}function wx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ww(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){wx(e,t,n[t])})}return e}function wk(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function wj(e){var t=e.favorite,n=e.connection,r=e.onChange,o=(0,S.Bd)().t;return(0,x.jsxs)(fg,{title:o("favorites.channelAdvanced"),children:[["contextWindow","maxOutputTokens"].map(function(e){var a;return(0,x.jsx)(fS,{id:"".concat(n.id,"-").concat(e),label:o("favorites.".concat(e)),hint:void 0===n.factOverrides[e]?"".concat(o("favorites.inherited"),": ").concat(null!=(a=t.defaults[e])?a:o("favorites.unknown")):o("favorites.overridden"),children:function(t){var a;return(0,x.jsxs)("div",{className:"flex gap-2",children:[(0,x.jsx)(cv,wk(ww({},t),{type:"number",min:1,max:1e8,value:null!=(a=n.factOverrides[e])?a:"",onChange:function(t){return r({factOverrides:wk(ww({},n.factOverrides),wx({},e,t.target.value?Number(t.target.value):null))})}})),(0,x.jsx)(tE,{variant:"outline",onClick:function(){var t=ww({},n.factOverrides);delete t[e],r({factOverrides:t})},children:o("favorites.inherit")})]})}},e)}),(0,x.jsx)(wb,{favorite:t,connection:n,onChange:function(e){return r(e)}})]})}function wS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wO(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function wC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function wN(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function wP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wS(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wE(e){var t,n,r=e.favorite,o=e.connection,a=e.index,i=e.disabled,l=e.onChange,s=e.onRemove,c=(0,S.Bd)().t,u=null!=(t=aA(function(e){return e.providers}))?t:[],d=aA(function(e){return e.favoriteCatalogs["".concat(o.providerId,"/").concat(o.endpointKey)]}),f=aA(function(e){return e.loadFavoriteCatalog}),p=wP((0,w.useState)(!1),2),h=p[0],m=p[1],g=wP((0,w.useState)(""),2),v=g[0],y=g[1],b=(0,w.useRef)(0),k=u.find(function(e){return e.id===o.providerId}),j=o.label||(null==k?void 0:k.name)||c("favorites.channelNumber",{count:a+1}),O=u.flatMap(function(e){return e.endpoints.map(function(t){return{value:"".concat(e.id,"/").concat(t.key),label:"".concat(e.name," \xb7 ").concat(t.label||t.key),providerId:e.id,endpointKey:t.key}})});return(0,x.jsxs)(xm,{className:"overflow-hidden",children:[(0,x.jsxs)("div",{className:"flex items-center gap-3 border-b bg-muted/25 px-4 py-3",children:[(0,x.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:(0,x.jsx)(bH,{className:"size-4"})}),(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsx)("h4",{className:"truncate text-sm font-semibold",children:j}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:c("favorites.channelHint")})]}),(0,x.jsx)(tE,{variant:"ghost",size:"icon",disabled:i,"aria-label":c("favorites.removeChannelNamed",{name:j}),onClick:s,className:"shrink-0 text-muted-foreground hover:text-destructive",children:(0,x.jsx)(xf,{className:"size-4"})})]}),(0,x.jsxs)("fieldset",{disabled:i,className:"min-w-0 space-y-4 p-4",children:[(0,x.jsxs)("div",{className:"grid gap-4 sm:grid-cols-[minmax(0,1.3fr)_minmax(0,1fr)]",children:[(0,x.jsx)(fT,{id:"".concat(o.id,"-provider"),label:c("favorites.channelProvider"),value:o.providerId?"".concat(o.providerId,"/").concat(o.endpointKey):"",placeholder:c("favorites.chooseProvider"),options:O,onChange:function(e){var t=O.find(function(t){return t.value===e});t&&(b.current++,m(!1),y(""),l({providerId:t.providerId,endpointKey:t.endpointKey}))}}),(0,x.jsx)(fT,{id:"".concat(o.id,"-protocol"),label:c("favorites.protocol"),value:o.protocol,options:["openai-chat","openai-responses","anthropic-messages"].map(function(e){return{value:e,label:e}}),onChange:function(e){return l({protocol:e})}})]}),(0,x.jsxs)("div",{className:"relative pt-1",children:[(0,x.jsxs)(tE,{variant:"ghost",size:"sm",className:"absolute -top-1 right-0 h-7 gap-1.5 px-1.5 text-xs text-primary",disabled:i||h||!k||!o.endpointKey,title:c("favorites.catalog"),onClick:function(){var e;return(e=function(){var e,t;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:e=++b.current,m(!0),y(""),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,f(o.providerId,o.endpointKey)];case 2:return n.sent(),[3,5];case 3:return t=n.sent(),e===b.current&&y(oE(c,oC(t))),[3,5];case 4:return e===b.current&&m(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){wO(a,r,o,i,l,"next",e)}function l(e){wO(a,r,o,i,l,"throw",e)}i(void 0)})})()},children:[h?(0,x.jsx)(cA,{className:"size-3.5 animate-spin"}):(0,x.jsx)(cM,{className:"size-3.5"}),c(h?"favorites.catalogLoading":d?"favorites.catalogRefresh":"favorites.catalogLoad")]}),(0,x.jsx)(fS,{id:"".concat(o.id,"-model"),label:c("favorites.modelPicker"),labelClassName:"pr-28",hint:c("favorites.modelPickerHint"),children:function(e){var t;return(0,x.jsx)(wp,wN(wC({},e),{value:o.requestModelId,options:null!=(t=null==d?void 0:d.models)?t:[],disabled:i,onChange:function(e){return l({requestModelId:e})},placeholder:c("favorites.modelPlaceholder"),searchLabel:c("favorites.modelSearch"),emptyHint:c("favorites.modelEmpty"),customLabel:function(e){return c("favorites.modelCustom",{value:e})}}),"".concat(o.providerId,"/").concat(o.endpointKey))}}),v?(0,x.jsx)("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:v}):d?(0,x.jsx)("p",{role:"status",className:"mt-2 text-xs text-muted-foreground",children:(null==(n=d.models)?void 0:n.length)?c("favorites.catalogCount",{count:d.models.length}):c("favorites.noCatalogManual")}):null]}),(0,x.jsxs)("div",{className:"space-y-2 border-t pt-2",children:[(0,x.jsx)(fg,{title:c("favorites.channelName"),children:(0,x.jsx)(fS,{id:"".concat(o.id,"-label"),label:c("favorites.label"),children:function(e){return(0,x.jsx)(cv,wN(wC({},e),{value:o.label,maxLength:120,onChange:function(e){return l({label:e.target.value})}}))}})}),(0,x.jsx)(wj,{favorite:r,connection:o,onChange:l})]})]})]})}function w_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wA(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function wI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function wT(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function wR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||wM(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wM(e,t){if(e){if("string"==typeof e)return w_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w_(e,t)}}function wz(e){var t,n=e.favorite,r=e.onClose,o=(0,S.Bd)().t,a=null!=(t=aA(function(e){return e.providers}))?t:[],i=aA(function(e){return e.saveFavorite}),l=wR((0,w.useState)(null!=n?n:{name:"",notes:"",defaults:{},preferences:{},connections:[{id:crypto.randomUUID(),label:"",providerId:"",endpointKey:"",protocol:"openai-responses",requestModelId:"",factOverrides:{},preferenceOverrides:{}}]}),2),s=l[0],c=l[1],u=wR((0,w.useState)(""),2),d=u[0],f=u[1],p=wR((0,w.useState)(!1),2),h=p[0],m=p[1],g=function(){var e;return(e=function(){var e,t;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(l){switch(l.label){case 0:if(!(t=O.Hr.safeParse(wT(wI({},s),{name:s.name||(null==(e=s.connections[0])?void 0:e.requestModelId),connections:s.connections.map(function(e){var t;return wT(wI({},e),{label:e.label||(null==(t=a.find(function(t){return t.id===e.providerId}))?void 0:t.name)||e.requestModelId})})}))).success)return f(o("favorites.invalid")),[2];m(!0),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,i(t.data,n)];case 2:return l.sent(),r(),[3,5];case 3:return f(oE(o,oC(l.sent()))),[3,5];case 4:return m(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){wA(a,r,o,i,l,"next",e)}function l(e){wA(a,r,o,i,l,"throw",e)}i(void 0)})})()};return(0,x.jsx)(rA,{open:!0,onOpenChange:function(e){return!e&&!h&&r()},children:(0,x.jsxs)(r0,{className:"flex max-h-[90dvh] max-w-3xl flex-col gap-0 overflow-hidden p-0",children:[(0,x.jsxs)(r1,{className:"shrink-0 border-b px-6 py-5 pr-12",children:[(0,x.jsx)(r4,{children:o(n?"favorites.edit":"favorites.add")}),(0,x.jsx)(r3,{children:o("favorites.declared")})]}),(0,x.jsxs)("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:[(0,x.jsx)(fS,{id:"favorite-name",label:o("favorites.name"),children:function(e){var t;return(0,x.jsx)(cv,wT(wI({},e),{maxLength:120,placeholder:(null==(t=s.connections[0])?void 0:t.requestModelId)||o("favorites.autoName"),value:s.name,onChange:function(e){return c(wT(wI({},s),{name:e.target.value}))}}))}}),(0,x.jsxs)(fg,{title:o("favorites.modelAdvanced"),children:[(0,x.jsx)(fS,{id:"favorite-notes",label:o("favorites.notes"),children:function(e){return(0,x.jsx)(xd,wT(wI({},e),{maxLength:4096,value:s.notes,onChange:function(e){return c(wT(wI({},s),{notes:e.target.value}))}}))}}),(0,x.jsx)(fR,{id:"favorite",facts:s.defaults,effort:s.preferences.reasoningEffort,onFacts:function(e){return c(wT(wI({},s),{defaults:e}))},onEffort:function(e){return c(wT(wI({},s),{preferences:{reasoningEffort:O.wl.optional().parse(e||void 0)}}))}})]}),(0,x.jsx)("h3",{className:"font-semibold",children:o("favorites.connections")}),s.connections.map(function(e,t){return(0,x.jsx)(wE,{favorite:s,connection:e,index:t,disabled:h,onChange:function(t){var n;return n=e.id,c(wT(wI({},s),{connections:s.connections.map(function(e){return e.id===n?wI({},e,t):e})}))},onRemove:function(){return c(wT(wI({},s),{connections:s.connections.filter(function(t){return t.id!==e.id})}))}},e.id)}),(0,x.jsx)(tE,{variant:"outline",className:"w-full border-dashed text-muted-foreground",disabled:h||s.connections.length>=50,onClick:function(){var e;return c(wT(wI({},s),{connections:((function(e){if(Array.isArray(e))return w_(e)})(e=s.connections)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||wM(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{id:crypto.randomUUID(),label:"",providerId:"",endpointKey:"",protocol:"openai-responses",requestModelId:"",factOverrides:{},preferenceOverrides:{}}])}))},children:o("favorites.addConnection")})]}),(0,x.jsxs)("div",{className:"shrink-0 space-y-3 border-t bg-muted/20 px-6 py-4",children:[d?(0,x.jsx)("p",{role:"alert",className:"text-destructive",children:d}):null,(0,x.jsx)(tE,{className:"w-full",disabled:h,onClick:function(){g()},children:o("favorites.saveFavorite")})]})]})})}function wD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wL(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wD(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w$(e){return function(e){if(Array.isArray(e))return wF(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||wU(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wU(e,t){if(e){if("string"==typeof e)return wF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wF(e,t)}}function wH(e){var t,n,r,o,a,i,l,s,c,u,d,f,p=e.favorite,h=e.onApply,m=(0,S.Bd)().t,g=aA(function(e){return e.harnesses}),v=aA(function(e){return e.providers}),y=(t=(0,S.Bd)().t,n=aA(function(e){return e.loadFavoriteTargets}),r=aA(function(e){return e.favoriteTargets[p.id]}),a=(o=wL((0,w.useState)(!0),2))[0],i=o[1],s=(l=wL((0,w.useState)(""),2))[0],c=l[1],(0,w.useEffect)(function(){var e=!0;return i(!0),c(""),n(p.id).catch(function(n){e&&c(oE(t,oC(n)))}).finally(function(){e&&i(!1)}),function(){e=!1}},[n,p.id,p.revision,t]),{targets:a||s?void 0:r,loading:a,error:s}),b=y.targets,k=y.loading,j=y.error,O=function(e){if(Array.isArray(e))return e}(u=(0,w.useState)(null==(f=p.connections[0])?void 0:f.id))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(u)||wU(u,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),C=O[0],N=O[1],P=p.connections.find(function(e){return e.id===C}),E=function(e){var t=p.references.filter(function(t){return t.harness===e.id&&e.profiles.some(function(e){var n;return e.name===t.name&&(null==(n=e.modelFavorite)?void 0:n.connectionId)===C})});return t.some(function(e){return e.connectionMissing||e.sourceMissing})?"workspace.linkMissing":t.some(function(e){return e.diverged})?"favorites.diverged":t.some(function(e){return e.needsUpdate})?"favorites.needsUpdate":t.some(function(t){var n,r;return!(null==(n=e.active)?void 0:n.official)&&t.name===(null==(r=e.active)?void 0:r.name)})?"workspace.inUse":t.length?"workspace.saved":"workspace.available"},_=88*Math.max(p.connections.length,g.length,1)+48,A=(_-66)/2,I=w$(p.connections.map(function(e,t){var n,r;return bG(e.id,24,A-(p.connections.length-1)*88/2+88*t,{kind:"source",label:e.label,value:null!=(n=null==v||null==(r=v.find(function(t){return t.id===e.providerId}))?void 0:r.name)?n:m("workspace.missingProvider"),selected:e.id===C,action:function(){return N(e.id)},actionLabel:e.label+" \xb7 "+e.protocol})})).concat([bG("model",260,A,{kind:"model",label:m("favorites.modelPicker"),value:null!=(d=null==P?void 0:P.requestModelId)?d:m("favorites.pending")})],w$(g.map(function(e,t){var n=ff(p,e.id,b).some(function(e){return e.id===C}),r=m(k?"favorites.loading":n?E(e):"favorites.noCompatibleChannel");return bG(e.id,606,A-(g.length-1)*88/2+88*t,{kind:"tool",harnessId:e.id,label:r,value:e.label,disabled:!n||k,actionLabel:e.label+" "+r,action:function(){var t,n;return h([(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},fp(p,e,b,"activate")),n=n={connectionId:C},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)])}})}))),T=P?[bV(P.id,"model")].concat(w$(g.filter(function(e){return ff(p,e.id,b).some(function(e){return e.id===C})}).map(function(e){return bV("model",e.id)}))):[];return(0,x.jsxs)("section",{className:"space-y-5","aria-label":m("workspace.relationship"),children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"text-lg font-semibold",children:m("workspace.relationship")}),(0,x.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:m("workspace.graphHint")})]}),j?(0,x.jsx)(dm,{children:j}):null,(0,x.jsx)(bZ,{nodes:I,edges:T,height:_}),p.connections.length?null:(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:m("favorites.pending")}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:m("workspace.relationshipHint")})]})}function wB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wV(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function wK(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||wq(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wq(e,t){if(e){if("string"==typeof e)return wB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wB(e,t)}}function wW(e){var t,n,r=e.initialSelectedId,o=(0,S.Bd)().t,a=aA(function(e){return e.favorites}),i=aA(function(e){return e.favoritesLoading}),l=aA(function(e){return e.favoritesError}),s=aA(function(e){return e.loadFavorites}),c=aA(function(e){return e.loadProviders}),u=aA(function(e){return e.deleteFavorite}),d=aA(function(e){return e.clearFavoritePlan}),f=wK((0,w.useState)(""),2),p=f[0],h=f[1],m=wK((0,w.useState)(void 0===r?"":r),2),g=m[0],v=m[1],y=wK((0,w.useState)(null),2),b=y[0],k=y[1],j=wK((0,w.useState)(null),2),O=j[0],C=j[1],N=wK((0,w.useState)(!1),2),P=N[0],E=N[1],_=wK((0,w.useState)(!1),2),A=_[0],T=_[1],R=wK((0,w.useState)(""),2),M=R[0],z=R[1];(0,w.useEffect)(function(){s(),c()},[s,c]);var D=function(e){var t;return(t=function(){return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:T(!0),z(""),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,e()];case 2:return t.sent(),[3,5];case 3:return z(oE(o,oC(t.sent()))),[3,5];case 4:return T(!1),[7];case 5:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function i(e){wV(a,r,o,i,l,"next",e)}function l(e){wV(a,r,o,i,l,"throw",e)}i(void 0)})})()},L=null!=(t=null==a?void 0:a.filter(function(e){var t;return[e.name].concat(function(e){if(Array.isArray(e))return wB(e)}(t=e.connections.flatMap(function(e){return[e.label,e.requestModelId]}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||wq(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).some(function(e){return e.toLowerCase().includes(p.toLowerCase())})}))?t:[],F=null!=(n=L.find(function(e){return e.id===g}))?n:L[0];return(0,x.jsxs)("main",{className:"workspace-page space-y-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"workspace-eyebrow",children:o("workspace.favoriteEyebrow")}),(0,x.jsx)("h2",{className:"mt-2 text-2xl font-semibold sm:text-3xl",children:o("favorites.title")}),(0,x.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:o("workspace.favoriteHint")})]}),(0,x.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,x.jsxs)(tE,{variant:"outline",onClick:function(){return E(!0)},children:[(0,x.jsx)(du,{}),o("favorites.capture")]}),(0,x.jsxs)(tE,{onClick:function(){return k("new")},children:[(0,x.jsx)(dd,{}),o("favorites.add")]})]})]}),i?(0,x.jsx)("p",{role:"status",children:o("favorites.loading")}):null,l?(0,x.jsx)(dm,{children:oE(o,l)}):null,M?(0,x.jsx)(dm,{children:M}):null,(null==a?void 0:a.length)||i||l?(0,x.jsxs)("div",{className:"grid items-start gap-6 xl:grid-cols-[16rem_minmax(0,1fr)]",children:[(0,x.jsxs)("aside",{className:"space-y-4",children:[(0,x.jsx)(fS,{id:"favorite-search",label:o("favorites.search"),children:function(e){var t,n;return(0,x.jsx)(cv,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={value:p,onChange:function(e){return h(e.target.value)}},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}}),(0,x.jsx)("div",{className:"space-y-2",children:L.map(function(e){var t,n;return(0,x.jsxs)("button",{type:"button","aria-pressed":e.id===(null==F?void 0:F.id),onClick:function(){return v(e.id)},className:e4("flex w-full items-start gap-3 rounded-xl border px-4 py-4 text-left transition-colors focus-visible:outline-2 focus-visible:outline-ring",e.id===(null==F?void 0:F.id)?"border-primary/50 bg-primary/5":"border-transparent hover:bg-card"),children:[(0,x.jsx)(df,{className:"mt-1 size-5 shrink-0 text-primary"}),(0,x.jsxs)("span",{className:"min-w-0",children:[(0,x.jsx)("h3",{className:"break-words font-semibold",children:e.name}),(0,x.jsx)("span",{className:"mt-1 block truncate font-mono text-xs text-muted-foreground",children:null!=(t=null==(n=e.connections[0])?void 0:n.requestModelId)?t:o("favorites.pending")})]})]},e.id)})}),L.length?null:(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:o("workspace.noMatches")})]}),F?(0,x.jsxs)("article",{className:"workspace-surface min-w-0 space-y-6 p-5 sm:p-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,x.jsx)("span",{className:"text-sm text-muted-foreground",children:F.notes||o("workspace.favoriteDetail")}),(0,x.jsxs)("div",{className:"flex gap-2",children:[(0,x.jsx)(tE,{variant:"ghost",size:"sm",onClick:function(){return k(F)},children:o("favorites.edit")}),(0,x.jsx)(tE,{disabled:!F.connections.length,onClick:function(){d(),C([])},children:o("favorites.configure")})]})]}),(0,x.jsx)(wH,{favorite:F,onApply:function(e){d(),C(e)}},F.id+"/"+F.revision),(0,x.jsx)(fg,{title:o("workspace.manageLinks"),children:(0,x.jsxs)("div",{className:"space-y-3",children:[F.references.map(function(e){return(0,x.jsx)("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b py-3",children:(0,x.jsxs)("p",{className:"min-w-0 break-all text-sm",children:[e.harness," / ",e.name," ",e.needsUpdate?o("favorites.needsUpdate"):""," ",e.diverged?o("favorites.diverged"):""]})},e.harness+"/"+e.name)}),(0,x.jsx)(tE,{variant:"ghost",className:"text-destructive",disabled:A||!!F.references.length,onClick:function(){D(function(){return u(F)})},children:o("favorites.delete")})]})})]}):null]}):(0,x.jsxs)("section",{className:"workspace-surface space-y-4 p-8 sm:p-12",children:[(0,x.jsx)(I,{className:"size-10 text-primary"}),(0,x.jsx)("h3",{className:"text-xl font-semibold",children:o("workspace.startTitle")}),(0,x.jsx)("p",{className:"max-w-xl text-sm leading-7 text-muted-foreground",children:o("workspace.startHint")}),(0,x.jsx)(tE,{onClick:function(){return E(!0)},children:o("favorites.capture")})]}),b?(0,x.jsx)(wz,{favorite:"new"===b?void 0:b,onClose:function(){return k(null)}}):null,P?(0,x.jsx)(xu,{onClose:function(){return E(!1)}}):null,O&&F?(0,x.jsx)(xo,{favorite:F,initialItems:O,initialMode:O.length?"activate":"save",onClose:function(){return C(null)}}):null]})}let wG=Array(12).fill(0),wZ=({visible:e,className:t})=>w.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},w.createElement("div",{className:"sonner-spinner"},wG.map((e,t)=>w.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),wY=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},w.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),wX=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},w.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),wJ=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),wQ=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),w0=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},w.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),w.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),w1=1,w2=e=>{var t;return"number"==typeof(null==e?void 0:e.id)||(null==e||null==(t=e.id)?void 0:t.length)>0?e.id:w1++},w4=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-100;e<=0||(this.toasts=this.toasts.filter(t=>!(e>0&&this.dismissedToasts.has(t.id))||(this.dismissedToasts.delete(t.id),e--,!1)))},this.create=e=>{let{message:t,...n}=e,r=w2(e),o=this.pendingDismissals.get(r);void 0!==o&&(cancelAnimationFrame(o),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),i=void 0===e.dismissible||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),(a?void 0:this.toasts.find(e=>e.id===r))?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:i,title:t}):n):this.addToast({title:t,...n,dismissible:i,id:r}),r},this.dismiss=e=>{if(null==e)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return void 0!==t&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let n,r;if(!t)return;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let o=Promise.resolve(e instanceof Function?e():e),a=void 0!==r,i=o.then(async e=>{if(n=["resolve",e],w.isValidElement(e))a=!1,this.create({id:r,type:"default",message:e});else if(w3(e)&&!e.ok){a=!1;let n="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,i="object"!=typeof n||w.isValidElement(n)?{message:n}:n;this.create({id:r,type:"error",description:o,...i})}else if(e instanceof Error){a=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"!=typeof n||w.isValidElement(n)?{message:n}:n;this.create({id:r,type:"error",description:o,...i})}else if(void 0!==t.success){a=!1;let n="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description,i="object"!=typeof n||w.isValidElement(n)?{message:n}:n;this.create({id:r,type:"success",description:o,...i})}}).catch(async e=>{if(n=["reject",e],void 0!==t.error){a=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"!=typeof n||w.isValidElement(n)?{message:n}:n;this.create({id:r,type:"error",description:o,...i})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),null==t.finally||t.finally.call(t)}),l=()=>new Promise((e,t)=>i.then(()=>"reject"===n[0]?t(n[1]):e(n[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let n=w2(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},w3=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,w5=Object.assign((e,t)=>w4.message(e,t),{success:w4.success,info:w4.info,warning:w4.warning,error:w4.error,custom:w4.custom,message:w4.message,promise:w4.promise,dismiss:w4.dismiss,loading:w4.loading},{getHistory:()=>w4.toasts,getToasts:()=>w4.getActiveToasts()});function w6(e){return void 0!==e.label}function w8(...e){return e.filter(Boolean).join(" ")}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");let w9=e=>{var t,n,r,o,a,i,l,s,c,u,d;let{invert:f,toast:p,unstyled:h,interacting:m,setHeights:g,visibleToasts:v,heights:y,index:b,toasts:x,expanded:k,removeToast:j,defaultRichColors:S,closeButton:O,style:C,cancelButtonStyle:N,actionButtonStyle:P,className:E="",descriptionClassName:_="",duration:A,position:I,gap:T,expandByDefault:R,classNames:M,icons:z,closeButtonAriaLabel:D="Close toast"}=e,[L,F]=w.useState(null),[$,U]=w.useState(null),[H,B]=w.useState(!1),[V,K]=w.useState(!1),[q,W]=w.useState(!1),[G,Z]=w.useState(!1),[Y,X]=w.useState(!1),[J,Q]=w.useState(0),[ee,et]=w.useState(0),en=w.useRef(p.duration||A||4e3),er=w.useRef(null),eo=w.useRef(null),ea=0===b,ei=b+1<=v,el=p.type,es=null!=el?el:"default",ec=!1!==p.dismissible,eu=p.className||"",ed=p.descriptionClassName||"",ef=w.useMemo(()=>y.findIndex(e=>e.toastId===p.id)||0,[y,p.id]),ep=w.useMemo(()=>{var e;return null!=(e=p.closeButton)?e:O},[p.closeButton,O]),eh=w.useMemo(()=>p.duration||A||4e3,[p.duration,A]),em=w.useRef(0),eg=w.useRef(0),ev=w.useRef(0),ey=w.useRef(null),[eb,ex]=I.split("-"),ew=w.useMemo(()=>y.reduce((e,t,n)=>n>=ef?e:e+t.height,0),[y,ef]),ek=(()=>{let[e,t]=w.useState(document.hidden);return w.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),e})(),ej=w.useMemo(()=>{var t;return null!=(t=e.swipeDirections)?t:function(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}(I)},[e.swipeDirections,I]),eS=p.invert||f,eO="loading"===el;eg.current=w.useMemo(()=>ef*T+ew,[ef,ew]),w.useEffect(()=>{en.current=eh},[eh]),w.useEffect(()=>{B(!0)},[]),w.useEffect(()=>{let e=eo.current;if(e){let t=e.getBoundingClientRect().height;return et(t),g(e=>[{toastId:p.id,height:t,position:p.position},...e]),()=>g(e=>e.filter(e=>e.toastId!==p.id))}},[g,p.id]),w.useLayoutEffect(()=>{if(!H)return;let e=eo.current,t=e.style.height;e.style.height="auto";let n=e.getBoundingClientRect().height;e.style.height=t,et(n),g(e=>e.find(e=>e.toastId===p.id)?e.map(e=>e.toastId===p.id?{...e,height:n}:e):[{toastId:p.id,height:n,position:p.position},...e])},[H,p.title,p.description,g,p.id,p.jsx,p.action,p.cancel]);let eC=w.useCallback(()=>{K(!0),Q(eg.current),g(e=>e.filter(e=>e.toastId!==p.id)),setTimeout(()=>{j(p)},200)},[p,j,g,eg]);function eN(){var e,t;return(null==z?void 0:z.loading)?w.createElement("div",{className:w8(null==M?void 0:M.loader,null==p||null==(t=p.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===el},z.loading):w.createElement(wZ,{className:w8(null==M?void 0:M.loader,null==p||null==(e=p.classNames)?void 0:e.loader),visible:"loading"===el})}w.useEffect(()=>{let e;if((!p.promise||"loading"!==el)&&p.duration!==1/0&&"loading"!==p.type){if(k||m||ek){if(ev.current<em.current){let e=new Date().getTime()-em.current;en.current=en.current-e}ev.current=new Date().getTime()}else en.current!==1/0&&(em.current=new Date().getTime(),e=setTimeout(()=>{null==p.onAutoClose||p.onAutoClose.call(p,p),eC()},en.current));return()=>clearTimeout(e)}},[k,m,p,el,ek,eC]),w.useEffect(()=>{p.delete&&(eC(),null==p.onDismiss||p.onDismiss.call(p,p))},[eC,p.delete]);let eP=p.icon||(null==z?void 0:z[el])||(e=>{switch(e){case"success":return wY;case"info":return wJ;case"warning":return wX;case"error":return wQ;default:return null}})(el);return w.createElement("li",{tabIndex:0,ref:eo,className:w8(E,eu,null==M?void 0:M.toast,null==p||null==(t=p.classNames)?void 0:t.toast,null==M?void 0:M[es],null==p||null==(n=p.classNames)?void 0:n[es]),"data-sonner-toast":"","data-rich-colors":null!=(u=p.richColors)?u:S,"data-styled":!(p.jsx||p.unstyled||h),"data-mounted":H,"data-promise":!!p.promise,"data-swiped":Y,"data-removed":V,"data-visible":ei,"data-y-position":eb,"data-x-position":ex,"data-index":b,"data-front":ea,"data-swiping":q,"data-dismissible":ec,"data-type":el,"data-invert":eS,"data-swipe-out":G,"data-swipe-direction":$,"data-expanded":!!(k||R&&H),"data-testid":p.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${V?J:eg.current}px`,"--initial-height":R?"auto":`${ee}px`,...C,...p.style},onDragEnd:()=>{W(!1),F(null),ey.current=null},onPointerDown:e=>{2===e.button||eO||!ec||(er.current=new Date,Q(eg.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(W(!0),ey.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,n,r,o;if(G||!ec)return;ey.current=null;let a=Number((null==(e=eo.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),i=Number((null==(t=eo.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),l=new Date().getTime()-(null==(n=er.current)?void 0:n.getTime()),s="x"===L?a:i,c=Math.abs(s)/l;if(("x"===L?ej.includes(a>0?"right":"left"):ej.includes(i>0?"bottom":"top"))&&(Math.abs(s)>=45||c>.11)){Q(eg.current),null==p.onDismiss||p.onDismiss.call(p,p),"x"===L?U(a>0?"right":"left"):U(i>0?"down":"up"),eC(),Z(!0);return}null==(r=eo.current)||r.style.setProperty("--swipe-amount-x","0px"),null==(o=eo.current)||o.style.setProperty("--swipe-amount-y","0px"),X(!1),W(!1),F(null)},onPointerMove:e=>{var t,n,r;if(!ey.current||!ec||(null==(t=window.getSelection())?void 0:t.toString().length)>0)return;let o=e.clientY-ey.current.y,a=e.clientX-ey.current.x;!L&&(Math.abs(a)>1||Math.abs(o)>1)&&F(Math.abs(a)>Math.abs(o)?"x":"y");let i={x:0,y:0},l=e=>1/(1.5+Math.abs(e)/20);if("y"===L){if(ej.includes("top")||ej.includes("bottom"))if(ej.includes("top")&&o<0||ej.includes("bottom")&&o>0)i.y=o;else{let e=o*l(o);i.y=Math.abs(e)<Math.abs(o)?e:o}}else if("x"===L&&(ej.includes("left")||ej.includes("right")))if(ej.includes("left")&&a<0||ej.includes("right")&&a>0)i.x=a;else{let e=a*l(a);i.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(i.x)>0||Math.abs(i.y)>0)&&X(!0),null==(n=eo.current)||n.style.setProperty("--swipe-amount-x",`${i.x}px`),null==(r=eo.current)||r.style.setProperty("--swipe-amount-y",`${i.y}px`)}},ep&&!p.jsx&&"loading"!==el?w.createElement("button",{"aria-label":D,"data-disabled":eO,"data-close-button":!0,onClick:eO||!ec?()=>{}:()=>{eC(),null==p.onDismiss||p.onDismiss.call(p,p)},className:w8(null==M?void 0:M.closeButton,null==p||null==(r=p.classNames)?void 0:r.closeButton)},null!=(d=null==z?void 0:z.close)?d:w0):null,(el||p.icon||p.promise)&&null!==p.icon&&((null==z?void 0:z[el])!==null||p.icon)?w.createElement("div",{"data-icon":"",className:w8(null==M?void 0:M.icon,null==p||null==(o=p.classNames)?void 0:o.icon)},"loading"===el?p.icon||eN():p.promise?eN():null,"loading"!==el?eP:null):null,w.createElement("div",{"data-content":"",className:w8(null==M?void 0:M.content,null==p||null==(a=p.classNames)?void 0:a.content)},w.createElement("div",{"data-title":"",className:w8(null==M?void 0:M.title,null==p||null==(i=p.classNames)?void 0:i.title)},p.jsx?p.jsx:"function"==typeof p.title?p.title():p.title),p.description?w.createElement("div",{"data-description":"",className:w8(_,ed,null==M?void 0:M.description,null==p||null==(l=p.classNames)?void 0:l.description)},"function"==typeof p.description?p.description():p.description):null),w.isValidElement(p.cancel)?p.cancel:p.cancel&&w6(p.cancel)?w.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||N,onClick:e=>{!w6(p.cancel)||ec&&(null==p.cancel.onClick||p.cancel.onClick.call(p.cancel,e),eC())},className:w8(null==M?void 0:M.cancelButton,null==p||null==(s=p.classNames)?void 0:s.cancelButton)},p.cancel.label):null,w.isValidElement(p.action)?p.action:p.action&&w6(p.action)?w.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:e=>{!w6(p.action)||(null==p.action.onClick||p.action.onClick.call(p.action,e),e.defaultPrevented||eC())},className:w8(null==M?void 0:M.actionButton,null==p||null==(c=p.classNames)?void 0:c.actionButton)},p.action.label):null)};function w7(){if("u"<typeof window||"u"<typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}let ke=w.forwardRef(function(e,t){let{id:n,invert:r,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:l,className:s,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:p,style:h,visibleToasts:m=3,toastOptions:g,dir:v=w7(),gap:y=14,icons:b,customAriaLabel:x,containerAriaLabel:k="Notifications"}=e,[j,S]=w.useState([]),O=w.useMemo(()=>n?j.filter(e=>e.toasterId===n):j.filter(e=>!e.toasterId),[j,n]),C=w.useMemo(()=>Array.from(new Set([o].concat(O.filter(e=>e.position).map(e=>e.position)))),[O,o]),[N,P]=w.useState([]),[E,_]=w.useState(!1),[A,I]=w.useState(!1),[T,R]=w.useState("system"!==d?d:"u">typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=w.useRef(null),z=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=w.useRef(null),L=w.useRef(!1),F=w.useCallback(e=>{S(t=>{var n;return(null==(n=t.find(t=>t.id===e.id))?void 0:n.delete)||w4.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return w.useEffect(()=>w4.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{t2.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return -1!==n?[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]:[e,...t]})})})}),[]),w.useEffect(()=>{if("system"!==d)return void R(d);if("system"===d&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?R("dark"):R("light")),"u"<typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{e?R("dark"):R("light")})}catch(t){e.addListener(({matches:e})=>{try{e?R("dark"):R("light")}catch(e){console.error(e)}})}},[d]),w.useEffect(()=>{j.length<=1&&_(!1)},[j]),w.useEffect(()=>{let e=e=>{var t,n;a.length>0&&a.every(t=>e[t]||e.code===t)&&(_(!0),null==(n=M.current)||n.focus()),"Escape"===e.code&&(document.activeElement===M.current||(null==(t=M.current)?void 0:t.contains(document.activeElement)))&&_(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),w.useEffect(()=>{if(M.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,L.current=!1)}},[M.current]),w.createElement("section",{ref:t,"aria-label":null!=x?x:`${k} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},C.map((t,n)=>{var o;let a,[d,x]=t.split("-");return O.length?w.createElement("ol",{key:t,dir:"auto"===v?w7():v,tabIndex:-1,ref:M,className:s,"data-sonner-toaster":!0,"data-sonner-theme":T,"data-y-position":d,"data-x-position":x,style:{"--front-toast-height":`${(null==(o=N[0])?void 0:o.height)||0}px`,"--width":"356px","--gap":`${y}px`,...h,...(a={},[c,u].forEach((e,t)=>{let n=1===t,r=n?"--mobile-offset":"--offset",o=n?"16px":"24px";function i(e){["top","right","bottom","left"].forEach(t=>{a[`${r}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?a[`${r}-${t}`]=o:a[`${r}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(o)}),a)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:e=>{!(e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible)&&(L.current||(L.current=!0,D.current=e.relatedTarget))},onMouseEnter:()=>_(!0),onMouseMove:()=>_(!0),onMouseLeave:()=>{A||_(!1)},onDragEnd:()=>_(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||I(!0)},onPointerUp:()=>I(!1)},O.filter(e=>!e.position&&0===n||e.position===t).map((n,o)=>{var a,s;return w.createElement(w9,{key:n.id,icons:b,index:o,toast:n,defaultRichColors:f,duration:null!=(a=null==g?void 0:g.duration)?a:p,className:null==g?void 0:g.className,descriptionClassName:null==g?void 0:g.descriptionClassName,invert:r,visibleToasts:m,closeButton:null!=(s=null==g?void 0:g.closeButton)?s:l,interacting:A,position:t,style:null==g?void 0:g.style,unstyled:null==g?void 0:g.unstyled,classNames:null==g?void 0:g.classNames,cancelButtonStyle:null==g?void 0:g.cancelButtonStyle,actionButtonStyle:null==g?void 0:g.actionButtonStyle,closeButtonAriaLabel:null==g?void 0:g.closeButtonAriaLabel,removeToast:F,toasts:O.filter(e=>e.position==n.position),heights:N.filter(e=>e.position==n.position),setHeights:P,expandByDefault:i,gap:y,expanded:E,swipeDirections:e.swipeDirections})})):null}))});var kt=d(2935);function kn(e){var t=(0,kt.ec)();return(0,x.jsx)(ke,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({theme:t,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"}},e))}function kr(){var e=(0,S.Bd)().t,t=aA(function(e){return e.notice}),n=aA(function(e){return e.clearNotice});return(0,w.useEffect)(function(){if(t){var r=!0,o=!1,a=void 0;try{for(var i,l=t[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var s=i.value,c=oE(e,s);s.key.startsWith("warning.")?w5.warning(c):w5.success(c)}}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}n()}},[t,n,e]),(0,x.jsx)(kn,{position:"top-center",richColors:!0})}let ko=_("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);function ka(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ki(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function kl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ka(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ka(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ks(e){var t,n,r=e.harnessId,o=e.open,a=e.onOpenChange,i=(0,S.s9)().locale,l=(0,S.Bd)().t,s=aA(function(e){return e.operations}),c=aA(function(e){return e.operationsLoading}),u=aA(function(e){return e.operationsError}),d=aA(function(e){return e.loadOperations}),f=aA(function(e){return e.undoOperation}),p=kl((0,w.useState)(null),2),h=p[0],m=p[1],g=kl((0,w.useState)(!1),2),v=g[0],y=g[1],b=kl((0,w.useState)(null),2),k=b[0],j=b[1],C=null!=(t=null==s?void 0:s.filter(function(e){return e.harness===r}))?t:[],N=O.RP[r];return(0,w.useEffect)(function(){o&&(j(null),d(r))},[o,r,d]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(rA,{open:o,onOpenChange:a,children:(0,x.jsxs)(r0,{className:"flex max-h-[85vh] w-[min(52rem,calc(100vw-2rem))] max-w-2xl flex-col gap-0 overflow-hidden p-0",children:[(0,x.jsxs)(r1,{className:"shrink-0 space-y-1.5 px-6 pb-4 pt-6 pr-12",children:[(0,x.jsx)(r4,{children:l("operations.titleFor",{harness:N})}),(0,x.jsx)(r3,{children:l("operations.intro")})]}),(0,x.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-6",children:[c&&0===C.length?(0,x.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,x.jsx)(cA,{className:"size-4 animate-spin"}),l("operations.loading")]}):null,u?(0,x.jsx)("p",{className:"py-6 text-sm text-destructive",children:oE(l,u)}):null,c||0!==C.length?null:(0,x.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:l("operations.empty")}),C.length>0?(0,x.jsx)("ul",{className:"divide-y rounded-xl border",children:C.map(function(e){var t,n,r,o,a;return(0,x.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsxs)("span",{className:"truncate text-sm font-medium",children:[l("operations.kind.".concat(e.kind))," \xb7 ",e.profile]}),(0,x.jsx)(e5,{variant:"degraded"===(n=e.state)?"destructive":"committed"===n?"default":"secondary",children:l("operations.state.".concat(e.state))})]}),(0,x.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(r=null!=(t=e.finishedAt)?t:e.startedAt,o=i,Number.isNaN((a=new Date(r)).getTime())?r:a.toLocaleString(o))," \xb7"," ",l("operations.user",{user:e.user})," \xb7"," ",l("operations.fileCount",{count:e.files.length})]}),e.note?(0,x.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:e.note}):null]}),(0,x.jsxs)(tE,{size:"sm",variant:"outline",className:"shrink-0",disabled:!e.undoable,onClick:function(){return m(e)},children:[(0,x.jsx)(ko,{}),l("operations.undo")]})]},e.id)})}):null]}),(0,x.jsx)(r2,{className:"shrink-0 px-6 py-4",children:(0,x.jsx)(tE,{onClick:function(){return a(!1)},children:l("operations.close")})})]})}),(0,x.jsx)(rA,{open:null!==h,onOpenChange:function(e){return!e&&m(null)},children:(0,x.jsxs)(r0,{className:"max-w-lg",children:[(0,x.jsxs)(r1,{children:[(0,x.jsx)(r4,{children:l("operations.undoTitle")}),(0,x.jsx)(r3,{children:h?l("operations.undoBody",{harness:null!=(n=O.RP[h.harness])?n:h.harness,count:h.files.length}):""})]}),k?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(l,k)}):null,(0,x.jsxs)(r2,{children:[(0,x.jsx)(tE,{variant:"outline",onClick:function(){return m(null)},children:l("common.cancel")}),(0,x.jsxs)(tE,{disabled:v,onClick:function(){var e;(e=function(){return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:if(!h)return[2];y(!0),j(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,f(h.id)];case 2:return e.sent(),m(null),[3,5];case 3:return j(oN(e.sent(),"operations.undoFailed")),[3,5];case 4:return y(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){ki(a,r,o,i,l,"next",e)}function l(e){ki(a,r,o,i,l,"throw",e)}i(void 0)})})()},children:[v?(0,x.jsx)(cA,{className:"animate-spin"}):null,l("operations.confirmUndo")]})]})]})})]})}function kc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ku(e){var t,n,r=e.harness,o=(0,S.Bd)().t,a=aA(function(e){return e.operations}),i=aA(function(e){return e.operationsLoading}),l=aA(function(e){return e.operationsError}),s=aA(function(e){return e.loadOperations}),c=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return kc(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kc(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=c[0],d=c[1],f=null!=(n=null==a?void 0:a.filter(function(e){return e.harness===r.id}))?n:[];return(0,w.useEffect)(function(){s(r.id)},[r.id,s]),(0,x.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(T,{className:"size-4 text-primary"}),(0,x.jsx)("h3",{className:"font-semibold",children:o("operations.title")}),(0,x.jsx)("span",{className:"ml-auto",children:(0,x.jsx)(tE,{size:"icon",variant:"ghost","aria-label":o("operations.refresh"),onClick:function(){s(r.id)},children:(0,x.jsx)(uC,{className:i?"animate-spin":void 0})})})]}),(0,x.jsx)("div",{className:"mt-4",children:l?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(o,l)}):null===a||i?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:o("operations.loading")}):0===f.length?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:o("operations.empty")}):(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:o("operations.count",{count:f.length})})}),(0,x.jsx)(tE,{className:"mt-4 w-full",size:"sm",variant:"outline",disabled:null===a,onClick:function(){return d(!0)},children:o("operations.viewDetails")}),(0,x.jsx)(ks,{harnessId:r.id,open:u,onOpenChange:d})]})}let kd=_("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);function kf(e){var t=e.result;return(0,x.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,x.jsx)(kp,{result:t}),t.completion?(0,x.jsx)(kh,{completion:t.completion}):null]})}function kp(e){var t=e.result,n=(0,S.Bd)().t;if(t.ok){var r,o,a,i,l=null!=(o=null==(i=t.models)?void 0:i.length)?o:0;return(0,x.jsx)(km,{ok:!0,children:n(l>0?"probe.ok":"probe.okNoCatalog",{latencyMs:null!=(a=t.latencyMs)?a:"?",count:l})})}return(0,x.jsx)(km,{ok:!1,children:oE(n,oO({code:null!=(r=t.code)?r:O.AF.networkError,data:t.data}))})}function kh(e){var t,n,r,o,a,i,l,s=e.completion,c=(0,S.Bd)().t,u=(0,S.s9)().locale,d=s.cachedAt?(t=s.cachedAt,n=u,Number.isNaN((r=new Date(t)).getTime())?t:r.toLocaleString(n,{dateStyle:"short",timeStyle:"short"})):"";if(s.ok)return(0,x.jsx)(km,{ok:!0,children:d?c("probe.completionCached",{model:null!=(a=s.model)?a:"?",at:d}):c("probe.completionOk",{model:null!=(i=s.model)?i:"?",latencyMs:null!=(l=s.latencyMs)?l:"?"})});var f=oE(c,oO({code:null!=(o=s.code)?o:O.AF.networkError,data:s.data}));return(0,x.jsx)(km,{ok:!1,children:d?"".concat(f,"(").concat(c("probe.completionFailedCached",{at:d}),")"):f})}function km(e){var t=e.ok,n=e.children;return(0,x.jsxs)("span",{className:t?"flex items-center gap-1.5 text-sm text-emerald-600 dark:text-emerald-400":"flex items-center gap-1.5 text-sm text-destructive",children:[(0,x.jsx)(t?ui:kd,{className:"size-4 shrink-0","aria-hidden":!0}),n]})}function kg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kv(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ky(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kg(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kb(e){var t=ky((0,w.useState)(!1),2),n=t[0],r=t[1],o=ky((0,w.useState)({signature:e,result:null}),2),a=o[0],i=o[1];return{pending:n,result:a.signature===e?a.result:null,run:function(t){var n;return(n=function(){var n;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:r(!0),i({signature:e,result:null}),o.label=1;case 1:return o.trys.push([1,,3,4]),n={signature:e},[4,t()];case 2:return i.apply(void 0,[(n.result=o.sent(),n)]),[3,4];case 3:return r(!1),[7];case 4:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var a=n.apply(e,t);function i(e){kv(a,r,o,i,l,"next",e)}function l(e){kv(a,r,o,i,l,"throw",e)}i(void 0)})})()}}}function kx(e,t){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];(0,w.useEffect)(function(){n&&null===e&&t()},[n,e,t])}function kw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function kj(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function kS(e){return function(e){if(Array.isArray(e))return kw(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return kw(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kw(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var kO=[{role:"Sonnet",modelKey:"sonnetModel",nameKey:"sonnetModelName",oneMKey:"sonnetModel1m"},{role:"Opus",modelKey:"opusModel",nameKey:"opusModelName",oneMKey:"opusModel1m"},{role:"Fable",modelKey:"fableModel",nameKey:"fableModelName",oneMKey:"fableModel1m"},{role:"Haiku",modelKey:"haikuModel",nameKey:"haikuModelName",oneMKey:null}],kC="subagentModel",kN="subagentModel1m",kP=new Set(kS(kO.flatMap(function(e){var t=e.modelKey,n=e.nameKey,r=e.oneMKey;return r?[t,n,r]:[t,n]})).concat([kC,kN])),kE="md:grid-cols-[6.5rem_minmax(0,1fr)_minmax(0,1fr)_8.5rem]",k_="grid gap-2 rounded-lg border bg-card/70 p-3 ".concat(kE," md:items-start md:gap-3 md:border-0 md:bg-transparent md:p-0");function kA(e){var t,n=e.fields,r=e.values,o=e.errors,a=e.modelOptions,i=e.onChange,l=e.fetchAction,s=(0,S.Bd)().t,c=new Map(n.map(function(e){return[e.key,e]})),u=c.get(kC);return(0,x.jsxs)("section",{"data-slot":"claude-model-mapping",className:"space-y-4 rounded-xl border bg-muted/15 p-4 sm:col-span-2 sm:p-5",children:[(0,x.jsxs)("div",{className:"space-y-1",children:[(0,x.jsx)("h3",{className:"text-base font-semibold",children:s("profile.mapping.title")}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:s("profile.mapping.intro")})]}),(0,x.jsxs)("div",{className:"grid items-center gap-3 px-1 text-xs font-medium text-muted-foreground ".concat(kE),children:[(0,x.jsx)("span",{className:"hidden md:block",children:s("profile.mapping.role")}),(0,x.jsx)("span",{className:"hidden md:block",children:s("profile.mapping.displayName")}),(0,x.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[s("profile.mapping.actualModel"),l]}),(0,x.jsx)("span",{className:"hidden md:block",children:s("profile.mapping.oneM")})]}),(0,x.jsxs)("div",{className:"space-y-3",children:[kO.map(function(e){var t,n,l,u=e.role,d=e.modelKey,f=e.nameKey,p=e.oneMKey,h=c.get(d),m=c.get(f);if(!h||!m)return null;var g=o["extra:".concat(d)],v=o["extra:".concat(f)];return(0,x.jsxs)("div",{className:k_,children:[(0,x.jsxs)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/45 px-3 text-sm font-medium",children:[u,h.required?(0,x.jsx)("span",{className:"ml-1 text-destructive",children:"*"}):null]}),(0,x.jsx)(kI,{field:m,value:null!=(t=r[f])?t:"",placeholder:(null==(l=r[d])?void 0:l.trim())?s("profile.mapping.defaultTo",{model:r[d].trim()}):void 0,error:v,onChange:function(e){return i(f,e)}}),(0,x.jsx)(kI,{field:h,value:null!=(n=r[d])?n:"",error:g,modelOptions:a,onChange:function(e){return i(d,e)}}),(0,x.jsx)(kT,{role:u,field:p?c.get(p):void 0,value:p?r[p]:void 0,error:p?o["extra:".concat(p)]:void 0,onChange:i})]},u)}),u?(0,x.jsxs)("div",{className:k_,children:[(0,x.jsx)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/45 px-3 text-sm font-medium",children:"Subagent"}),(0,x.jsx)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/30 px-3 text-sm text-muted-foreground",children:s("profile.mapping.notInMenu")}),(0,x.jsx)(kI,{field:u,value:null!=(t=r.subagentModel)?t:"",error:o["extra:subagentModel"],modelOptions:a,onChange:function(e){return i("subagentModel",e)}}),(0,x.jsx)(kT,{role:"Subagent",field:c.get(kN),value:r[kN],error:o["extra:".concat(kN)],onChange:i})]}):null]})]})}function kI(e){var t=e.field,n=e.value,r=e.placeholder,o=e.error,a=e.modelOptions,i=void 0===a?[]:a,l=e.onChange,s=(0,S.Bd)().t,c=n&&!i.includes(n)?[n].concat(kS(i)):i,u=oA(s,t.labelCode,t.params);return(0,x.jsx)(fS,{id:"extra-".concat(t.key),label:u,labelClassName:"text-xs md:sr-only",error:o?oE(s,o):void 0,className:"space-y-1.5",children:function(e){return i.length>0?(0,x.jsxs)(sx,{value:n,onValueChange:l,children:[(0,x.jsx)(cs,kj(kk({},e),{"aria-label":u,children:(0,x.jsx)(sk,{placeholder:null!=r?r:oI(s,t)})})),(0,x.jsx)(cd,{children:c.map(function(e){return(0,x.jsx)(cf,{value:e,children:e},e)})})]}):(0,x.jsx)(cv,kj(kk({},e),{value:n,placeholder:null!=r?r:oI(s,t),onChange:function(e){return l(e.target.value)}}))}})}function kT(e){var t=e.role,n=e.field,r=e.value,o=e.error,a=e.onChange,i=(0,S.Bd)().t;if(!n)return(0,x.jsx)("div",{"data-slot":"one-m-unsupported",className:"flex h-10 items-center rounded-lg border border-dashed bg-muted/20 px-3 text-sm text-muted-foreground",children:i("profile.mapping.oneMUnsupported",{role:t})});var l="extra-".concat(n.key),s=oA(i,n.labelCode,n.params);return(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsx)("div",{className:"flex h-10 items-center",children:(0,x.jsxs)("label",{htmlFor:l,className:"flex cursor-pointer items-center gap-2 text-sm text-muted-foreground",children:[(0,x.jsx)(ik,kj(kk({},fO(l,o)),{checked:"true"===r,"aria-label":s,onCheckedChange:function(e){return a(n.key,!0===e?"true":"false")}})),(0,x.jsx)("span",{className:"md:hidden",children:s}),(0,x.jsx)("span",{className:"hidden md:inline",children:i("profile.mapping.enable")})]})}),(0,x.jsx)(fC,{id:l,children:o?oE(i,o):void 0})]})}function kR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function kM(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function kz(e){var t=e.field,n=e.value,r=e.error,o=e.onChange,a=(0,S.Bd)().t,i=oA(a,t.labelCode,t.params),l=oI(a,t);return(0,x.jsx)(fS,{id:"extra-".concat(t.key),label:i,error:r?oE(a,r):void 0,hint:t.helpCode?oA(a,t.helpCode,t.params):void 0,className:"textarea"===t.kind||t.fullWidth?"sm:col-span-2":void 0,children:function(e){var r;return"select"===t.kind?(0,x.jsxs)(sx,{value:n,onValueChange:o,children:[(0,x.jsx)(cs,kM(kR({},e),{"aria-label":i,children:(0,x.jsx)(sk,{placeholder:null!=l?l:a("profile.selectPlaceholder")})})),(0,x.jsx)(cd,{children:null==(r=t.options)?void 0:r.map(function(e){return(0,x.jsx)(cf,{value:e.value,children:e.labelCode?a(e.labelCode):e.value},e.value)})})]}):"textarea"===t.kind?(0,x.jsx)(xd,kM(kR({},e),{rows:3,value:n,placeholder:l,className:"font-mono text-xs",onChange:function(e){return o(e.target.value)}})):(0,x.jsx)(cv,kM(kR({},e),{type:"password"===t.kind?"password":"text",value:n,placeholder:l,onChange:function(e){return o(e.target.value)}}))}})}function kD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function kF(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function k$(e){return function(e){if(Array.isArray(e))return kD(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return kD(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kD(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var kU=[{id:"openrouter",baseUrl:"https://openrouter.ai/api/v1"},{id:"zai",baseUrl:"https://api.z.ai/api/paas/v4",model:"glm-4.6"},{id:"moonshot",baseUrl:"https://api.moonshot.cn/v1"},{id:"deepseek",baseUrl:"https://api.deepseek.com/v1"}],kH={id:"cliproxyResponses",baseUrl:"https://api.seavey.ai/cliproxy/v1",model:"gpt-5.6-sol"},kB={claude:[{id:"zaiAnthropic",baseUrl:"https://api.z.ai/api/anthropic",model:"glm-4.6"},{id:"moonshotAnthropic",baseUrl:"https://api.moonshot.cn/anthropic"},{id:"deepseekAnthropic",baseUrl:"https://api.deepseek.com/anthropic"}],codex:kU,kimi:kU,pi:[kF(kL({},kH),{extras:{api:"openai-responses",reasoning:"true"}})].concat(k$(kU)),dsh:[kF(kL({},kH),{extras:{api:"openai-responses",reasoningEfforts:"low,medium,high,xhigh,max"}})].concat(k$(kU))};function kV(e){var t,n=e.harnessId,r=e.onPick,o=(0,S.Bd)().t,a=null!=(t=kB[n])?t:[];return 0===a.length?null:(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)("span",{className:"text-xs text-muted-foreground",children:o("profile.quickFill")}),a.map(function(e){return(0,x.jsx)(tE,{type:"button",size:"sm",variant:"outline",onClick:function(){return r(e)},children:o("preset.".concat(e.id))},e.id)})]})}let kK=_("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);function kq(e){var t=e.targets,n=e.overrides,r=e.onEdit,o=e.onReset,a=(0,S.Bd)().t;return null===t?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:a("profile.rawLoading")}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:a("profile.rawIntro")}),t.map(function(e){var t,i=void 0!==n[e.key];return(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,x.jsx)(iO,{htmlFor:"raw-".concat(e.key),className:"font-mono text-xs",children:e.path}),i?(0,x.jsxs)(tE,{type:"button",size:"sm",variant:"ghost",onClick:function(){return o(e.key)},children:[(0,x.jsx)(kK,{}),a("profile.resetToGenerated")]}):null]}),(0,x.jsx)(xd,{id:"raw-".concat(e.key),rows:10,spellCheck:!1,className:"font-mono text-xs",value:null!=(t=n[e.key])?t:e.content,onChange:function(t){return r(e.key,t.target.value)}})]},e.key)})]})}function kW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kG(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function kZ(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){kG(a,r,o,i,l,"next",e)}function l(e){kG(a,r,o,i,l,"throw",e)}i(void 0)})}}function kY(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){kY(e,t,n[t])})}return e}function kJ(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function kQ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||k0(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k0(e,t){if(e){if("string"==typeof e)return kW(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kW(e,t)}}function k1(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function k2(e){var t,n,r,o,a,i,l,s,c,u=e.harness,d=e.profile,f=e.copySource,p=void 0===f?null:f,h=e.onOpenChange,m=(0,S.Bd)().t,g=aA(function(e){return e.createProfile}),v=aA(function(e){return e.updateProfile}),y=aA(function(e){return e.previewProfile}),b=aA(function(e){return e.providers}),k=aA(function(e){return e.loadProviders}),j=aA(function(e){return e.probeDraft}),C=aA(function(e){return e.probeProfile}),N=null!==d,P=null!==p,E=null!=d?d:p,_=kQ((0,w.useState)(null!=(t=null==d?void 0:d.name)?t:p?function(e,t){var n=new Set(t.map(function(e){return e.name})),r="".concat(e,"-copy");if(!n.has(r))return r;for(var o=2;n.has("".concat(r,"-").concat(o));)o++;return"".concat(r,"-").concat(o)}(p.name,u.profiles):""),2),A=_[0],I=_[1],T=kQ((0,w.useState)(null!=(n=null==E?void 0:E.baseUrl)?n:""),2),R=T[0],M=T[1],z=kQ((0,w.useState)(""),2),F=z[0],$=z[1],U=kQ((0,w.useState)(null!=(r=null==E?void 0:E.model)?r:""),2),H=U[0],B=U[1],V=kQ((0,w.useState)(null!=(o=null==E?void 0:E.notes)?o:""),2),K=V[0],q=V[1],W=kQ((0,w.useState)(function(){return function(e,t){var n={},r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var s,c,u=i.value;n[u.key]=null!=(s=null!=(c=null==t?void 0:t.extras[u.key])?c:u.defaultValue)?s:""}}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(u.fields,E)}),2),G=W[0],Z=W[1],Y=kQ((0,w.useState)({}),2),X=Y[0],J=Y[1],Q=kQ((0,w.useState)(null!=(a=null==E?void 0:E.providerId)?a:""),2),ee=Q[0],et=Q[1],en=kQ((0,w.useState)(null!=(i=null==E?void 0:E.providerEndpoint)?i:""),2),er=en[0],eo=en[1],ea=kQ((0,w.useState)(!1),2),ei=ea[0],el=ea[1],es=kQ((0,w.useState)(null),2),ec=es[0],eu=es[1],ed=kQ((0,w.useState)(null),2),ef=ed[0],ep=ed[1],eh=kQ((0,w.useState)(!1),2),em=eh[0],eg=eh[1],ev=kQ((0,w.useState)({}),2),ey=ev[0],eb=ev[1],ex=kQ((0,w.useState)(null),2),ew=ex[0],ek=ex[1],ej=null!=b?b:[],eS=null!=(l=ej.find(function(e){return e.id===ee}))?l:null,eO=null==eS?void 0:eS.endpoints.find(function(e){return e.key===er}),eC=JSON.stringify([R,F,ee,er]),eN=kb(eC),eP=kQ((0,w.useState)(null),2),eE=eP[0],e_=eP[1],eA=(null==eE?void 0:eE.signature)===eC?eE.models:[],eI=H&&!eA.includes(H)?[H].concat(function(e){if(Array.isArray(e))return kW(e)}(eA)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(eA)||k0(eA)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):eA,eT=null!==b&&""!==ee&&null===eS,eR=null!==eS&&""!==er&&void 0===eO,eM="dsh"===u.id?u.fields.find(function(e){return"providerType"===e.key}):void 0,ez="dsh"===u.id&&"official"===G.providerType,eD="claude"===u.id?u.fields.filter(function(e){return!kP.has(e.key)}):"dsh"===u.id?u.fields.filter(function(e){return"providerType"!==e.key&&(!ez||["models","contextWindow","maxTokens"].includes(e.key))}):u.fields,eL=ez?[]:"claude"===u.id?eD.filter(function(e){return"authVar"===e.key}):eD,eF="claude"===u.id?eD.filter(function(e){return"authVar"!==e.key}):[];function e$(){return kZ(function(){var e;return k1(this,function(t){switch(t.label){case 0:if(!d)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,y(u.id,d.name)];case 2:return eu(e=t.sent()),J(Object.fromEntries(e.filter(function(e){return e.overridden}).map(function(e){return[e.key,e.content]}))),[3,4];case 3:return ep(oC(t.sent())),[3,4];case 4:return[2]}})})()}function eU(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];eb(function(e){if(!t.some(function(t){return e[t]}))return e;var n=kX({},e),r=!0,o=!1,a=void 0;try{for(var i,l=t[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var s=i.value;delete n[s]}}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n})}function eH(){var e;return eS&&er&&null!=(e=null==eO?void 0:eO.baseUrl)?e:R}function eB(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return kZ(function(){var t,n;return k1(this,function(r){switch(r.label){case 0:if(!(t=eH().trim()))return eb(function(e){return kJ(kX({},e),{baseUrl:{key:"profile.error.baseUrlRequired"}})}),[2];if(n=H.trim(),!eS&&!F.trim()&&!(N&&d))return eb(function(e){return kJ(kX({},e),{apiKey:{key:"profile.error.apiKeyRequired"}})}),[2];ep(null),ek(e?"completion":"models"),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,eN.run(function(){return kZ(function(){var r,o,a;return k1(this,function(i){switch(i.label){case 0:return[4,eS||F.trim()?j(kX({baseUrl:t},eS?{providerId:ee}:{apiKey:F},e?{completion:!0}:{},e&&n?{model:n}:{})):C(u.id,null!=(r=null==d?void 0:d.name)?r:"",e?kX({completion:!0,refresh:!0},n?{model:n}:{}):void 0)];case 1:return o=i.sent(),e||e_({signature:eC,models:o.ok&&null!=(a=o.models)?a:[]}),[2,o]}})})()})];case 2:return r.sent(),[3,5];case 3:return ep(oC(r.sent())),[3,5];case 4:return ek(null),[7];case 5:return[2]}})})()}kx(b,k);var eV=(0,x.jsxs)(tE,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:function(){eB()},disabled:eN.pending,children:[eN.pending&&"models"===ew?(0,x.jsx)(cA,{className:"animate-spin"}):null,eN.pending&&"models"===ew?m("probe.fetchingModels"):m("probe.fetchModels")]});return(0,x.jsx)(rA,{open:!0,onOpenChange:h,children:(0,x.jsx)(r0,{className:"max-h-[92vh] w-[calc(100vw-2rem)] overflow-hidden p-0 sm:max-w-[1120px]",children:(0,x.jsxs)("form",{onSubmit:function(e){return kZ(function(){var t,n;return k1(this,function(r){switch(r.label){case 0:if(e.preventDefault(),!function(){var e={},t=A.trim();t?t.includes("/")||t.includes("\\")?e.name={key:"profile.error.nameSlash"}:t.length>O.b1.name?e.name={key:"profile.error.nameTooLong",params:{max:O.b1.name}}:u.profiles.some(function(e){return e.name===t&&e.name!==(null==d?void 0:d.name)})&&(e.name={key:"profile.error.nameDuplicate"}):e.name={key:"profile.error.nameRequired"},eH().trim()||(e.baseUrl={key:"profile.error.baseUrlRequired"}),N||P||null!==eS||F.trim()||(e.apiKey={key:"profile.error.apiKeyRequired"}),u.modelRequired&&!H.trim()&&(e.model={key:"profile.error.modelRequired"}),eT&&(e.providerId={key:"profile.error.providerGone"}),eR&&(e.providerEndpoint={key:"profile.error.endpointGone"});var n=!0,r=!1,o=void 0;try{for(var a,i=u.fields[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var l,s=a.value;!s.required||(null==(l=G[s.key])?void 0:l.trim())||(e["extra:".concat(s.key)]={key:"profile.error.fieldRequired",params:{label:oA(m,s.labelCode,s.params)}})}}catch(e){r=!0,o=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw o}}return eb(e),!(Object.keys(e).length>0)||(ep({key:"profile.error.checkFields"}),!1)}())return[2];eg(!0),ep(null),r.label=1;case 1:if(r.trys.push([1,6,7,8]),n=kX({name:ez?"deepseek-official":A,baseUrl:ez?R||"https://api.deepseek.com":eS&&er&&null!=(t=null==eO?void 0:eO.baseUrl)?t:R,model:ez?H||"deepseek-v4-flash":H,notes:K,extras:G},P?{copySourceName:p.name}:{},ee?kX({providerId:ee},er?{providerEndpoint:er}:{}):N||P?{providerId:""}:{},eS?{}:{apiKey:F||void 0}),!N)return[3,3];return[4,v(u.id,d.name,kJ(kX({},n),{overrides:X}))];case 2:return r.sent(),[3,5];case 3:return[4,g(u.id,n)];case 4:r.sent(),r.label=5;case 5:return h(!1),[3,8];case 6:return ep(oC(r.sent())),[3,8];case 7:return eg(!1),[7];case 8:return[2]}})})()},noValidate:!0,className:"flex max-h-[92vh] min-h-0 flex-col",children:[(0,x.jsxs)(r1,{className:"shrink-0 border-b bg-card px-6 py-5 pr-12",children:[(0,x.jsx)(r4,{children:N?m("profile.editTitle",{harness:u.label,profile:d.name}):P?m("profile.copyTitle",{harness:u.label,profile:p.name}):m("profile.createTitle",{harness:u.label})}),(0,x.jsxs)(r3,{children:[m("profile.intro",{targets:u.targets.map(function(e){return o_(m,e.labelCode,e.label)}).join(m("common.listSeparator"))}),"additive"===u.mode?m("profile.additiveNote"):""]})]}),(0,x.jsxs)("div",{"data-slot":"profile-dialog-scroll",className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 py-5",children:[eM&&!(N&&ez)?(0,x.jsx)(kz,{field:eM,value:null!=(s=G.providerType)?s:"custom",onChange:function(e){Z(function(t){return kX(kJ(kX({},t),{providerType:e}),"official"===e?{models:t.models||"deepseek-v4-flash\ndeepseek-v4-pro\ndeepseek-v4-flash-vision-exp"}:{})}),"official"===e&&(I("deepseek-official"),M("https://api.deepseek.com"),B("deepseek-v4-flash"),et(""),eo(""))}}):null,ez?null:(0,x.jsxs)("div",{"data-slot":"provider-reference-fields",className:"space-y-3 rounded-xl border p-3",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,x.jsx)(iO,{htmlFor:"provider-select",className:"font-medium",children:m("profile.useSharedProvider")}),eS?(0,x.jsx)(e5,{variant:"secondary",children:m("profile.keyFromVault")}):null]}),(0,x.jsxs)(sx,{value:ee,onValueChange:function(e){et(e);var t,n,r=ej.find(function(t){return t.id===e});eo(null!=(t=null==r||null==(n=r.endpoints[0])?void 0:n.key)?t:""),eU("providerId","providerEndpoint","baseUrl","apiKey")},children:[(0,x.jsx)(cs,kJ(kX({},fO("provider-select",ey.providerId)),{"aria-label":m("profile.useSharedProviderLabel"),children:(0,x.jsx)(sk,{placeholder:m("profile.providerNone")})})),(0,x.jsxs)(cd,{children:[(0,x.jsx)(cf,{value:"",children:m("profile.providerNone")}),ej.map(function(e){return(0,x.jsx)(cf,{value:e.id,children:e.name},e.id)})]})]}),(0,x.jsx)(fC,{id:"provider-select",children:ey.providerId?oE(m,ey.providerId):void 0}),0===ej.length?(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:m("profile.vaultEmpty")}):null,eS?(0,x.jsx)(fS,{id:"provider-endpoint",label:m("profile.namedEndpoint"),error:ey.providerEndpoint?oE(m,ey.providerEndpoint):void 0,hint:0===eS.endpoints.length?m("profile.noEndpoints"):null,children:function(e){return(0,x.jsxs)(sx,{value:er,onValueChange:function(e){eo(e),eU("providerEndpoint","baseUrl")},children:[(0,x.jsx)(cs,kJ(kX({},e),{"aria-label":m("profile.namedEndpointLabel"),children:(0,x.jsx)(sk,{placeholder:m("profile.endpointNone")})})),(0,x.jsxs)(cd,{children:[(0,x.jsx)(cf,{value:"",children:m("profile.endpointNone")}),eS.endpoints.map(function(e){return(0,x.jsx)(cf,{value:e.key,children:e.label?m("profile.endpointOption",{label:e.label,key:e.key}):e.key},e.key)})]})]})}}):null]}),ez?null:(0,x.jsx)(kV,{harnessId:u.id,onPick:function(e){M(e.baseUrl),eU("baseUrl"),e.model&&(B(e.model),eU("model")),e.extras&&Z(function(t){return kX({},t,e.extras)})}}),(0,x.jsxs)("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[ez?null:(0,x.jsx)(fS,{id:"name",className:"sm:col-span-2",label:m("profile.name"),error:ey.name?oE(m,ey.name):void 0,hint:N?m("profile.renameHint"):null,children:function(e){return(0,x.jsx)(cv,kJ(kX({},e),{value:A,onChange:function(e){I(e.target.value),eU("name")},placeholder:m("profile.namePlaceholder")}))}}),ez?null:(0,x.jsx)(fS,{id:"baseUrl",className:"sm:col-span-2",label:m("profile.baseUrl"),error:ey.baseUrl?oE(m,ey.baseUrl):void 0,hint:eS&&er?m("profile.baseUrlFromVault",{endpoint:er}):null,children:function(e){return(0,x.jsx)(cv,kJ(kX({},e),{value:eH(),onChange:function(e){M(e.target.value),eU("baseUrl")},placeholder:m("profile.baseUrlPlaceholder"),disabled:null!==eS&&""!==er}))}}),(0,x.jsx)(fS,{id:"apiKey",label:m("profile.apiKey"),error:ey.apiKey?oE(m,ey.apiKey):void 0,hint:eS?m("profile.apiKeySharedHint"):ez?m("profile.dshOfficialApiKeyHint"):null,children:function(e){return(0,x.jsx)(cv,kJ(kX({},e),{type:"password",value:F,onChange:function(e){$(e.target.value),eU("apiKey")},placeholder:eS?m("profile.keyFromVault"):N?m("profile.apiKeyKeep"):m("profile.apiKeyRequiredPlaceholder"),disabled:null!==eS}))}}),ez?null:(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(fS,{id:"model",label:"claude"===u.id?m("profile.fallbackModel"):m("profile.model"),error:ey.model?oE(m,ey.model):void 0,hint:"claude"===u.id?m("profile.claudeModelHint"):null,children:function(e){return eA.length>0?(0,x.jsxs)(sx,{value:H,onValueChange:function(e){B(e),eU("model")},children:[(0,x.jsx)(cs,kJ(kX({},e),{"aria-label":m("profile.model"),children:(0,x.jsx)(sk,{placeholder:"claude"===u.id?m("profile.fallbackModelPlaceholder"):m("profile.modelPlaceholder")})})),(0,x.jsx)(cd,{children:eI.map(function(e){return(0,x.jsx)(cf,{value:e,children:e},e)})})]}):(0,x.jsx)(cv,kJ(kX({},e),{value:H,onChange:function(e){B(e.target.value),eU("model")},placeholder:"claude"===u.id?m("profile.fallbackModelPlaceholder"):m("profile.modelPlaceholder")}))}}),"claude"!==u.id?eV:null]}),ez?null:(0,x.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,x.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:eN.result?(0,x.jsx)(kf,{result:eN.result}):null}),(null==(c=eN.result)?void 0:c.ok)&&eA.length>0?(0,x.jsx)(dm,{variant:"muted",size:"sm",children:m("probe.catalogHint")}):null]}),eL.map(function(e){var t;return(0,x.jsx)(kz,{field:e,value:null!=(t=G[e.key])?t:"",error:ey["extra:".concat(e.key)],onChange:function(t){Z(function(n){return kJ(kX({},n),kY({},e.key,t))}),eU("extra:".concat(e.key))}},e.key)}),"claude"===u.id?(0,x.jsx)(kA,{fields:u.fields,values:G,errors:ey,modelOptions:eA,fetchAction:eV,onChange:function(e,t){Z(function(n){return kJ(kX({},n),kY({},e,t))}),eU("extra:".concat(e))}}):null,eF.map(function(e){var t;return(0,x.jsx)(kz,{field:e,value:null!=(t=G[e.key])?t:"",error:ey["extra:".concat(e.key)],onChange:function(t){Z(function(n){return kJ(kX({},n),kY({},e.key,t))}),eU("extra:".concat(e.key))}},e.key)}),(0,x.jsx)(fS,{id:"notes",className:"sm:col-span-2",label:m("profile.notes"),children:function(e){return(0,x.jsx)(xd,kJ(kX({},e),{rows:2,value:K,onChange:function(e){return q(e.target.value)}}))}})]}),(0,x.jsxs)("div",{className:"rounded-xl border",children:[(0,x.jsxs)("button",{type:"button",onClick:function(){var e=!ei;el(e),e&&null===ec&&e$()},className:"flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground active:bg-accent/80 ".concat(ei?"rounded-t-xl":"rounded-xl"),children:[ei?(0,x.jsx)(L,{className:"size-4"}):(0,x.jsx)(D,{className:"size-4"}),m("profile.advanced"),d&&d.overriddenTargets.length>0?(0,x.jsx)(e5,{variant:"secondary",children:m("profile.overridden")}):null]}),ei?(0,x.jsx)("div",{className:"space-y-4 border-t px-3 py-3",children:N?(0,x.jsx)(kq,{targets:ec,overrides:X,onEdit:function(e,t){return J(function(n){return kJ(kX({},n),kY({},e,t))})},onReset:function(e){J(function(t){var n=kX({},t);return delete n[e],n}),e$()}}):(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:m("profile.saveFirst")})}):null]}),ef?(0,x.jsx)(dm,{children:oE(m,ef)}):null]}),(0,x.jsxs)(r2,{className:"shrink-0 border-t bg-card px-6 py-4",children:[(0,x.jsx)(tE,{type:"button",variant:"outline",onClick:function(){return h(!1)},children:m("common.cancel")}),ez?null:(0,x.jsxs)(tE,{type:"button",variant:"outline",title:m("probe.completionHint"),onClick:function(){eB(!0)},disabled:eN.pending,children:[eN.pending&&"completion"===ew?(0,x.jsx)(cA,{className:"animate-spin"}):null,eN.pending&&"completion"===ew?m("probe.testingCompletion"):m("probe.completionAction")]}),(0,x.jsx)(tE,{type:"submit",disabled:em,children:em?m("profile.saving"):m("profile.save")})]})]})})})}let k4=_("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),k3=_("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),k5=_("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);function k6(e){var t,n,r=e.options,o=e.targetIndex,a=e.onTargetChange,i=e.hasStoredKey,l=e.hasTypedKey,s=e.onMissingKey,c=e.probing,u=e.probeAction,d=e.result,f=e.probeError,p=e.onProbe,h=(0,S.Bd)().t;if(0===r.length&&!i)return null;var m=null!=(t=r.find(function(e){return e.index===o}))?t:r[0];function g(e){l||i?p(e):s()}return(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t pt-3",children:[(0,x.jsxs)(tE,{type:"button",variant:"outline",size:"sm",disabled:c||0===r.length&&!l,onClick:function(){return g(!1)},children:[c&&"models"===u?(0,x.jsx)(cA,{className:"animate-spin"}):null,h(c&&"models"===u?"probe.probing":"probe.action")]}),(0,x.jsxs)(tE,{type:"button",variant:"outline",size:"sm",disabled:c||0===r.length&&!l,onClick:function(){return g(!0)},children:[c&&"completion"===u?(0,x.jsx)(cA,{className:"animate-spin"}):null,h(c&&"completion"===u?"probe.testingCompletion":"probe.completionAction")]}),r.length>1?(0,x.jsxs)(sx,{value:String(null!=(n=null==m?void 0:m.index)?n:""),onValueChange:function(e){return a(Number(e))},children:[(0,x.jsx)(cs,{className:"h-9 w-56","aria-label":h("vault.probeEndpointLabel"),children:(0,x.jsx)(sk,{})}),(0,x.jsx)(cd,{children:r.map(function(e){return(0,x.jsx)(cf,{value:String(e.index),children:e.key||e.baseUrl},e.index)})})]}):null,f?(0,x.jsxs)("span",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[(0,x.jsx)(kd,{className:"size-4 shrink-0","aria-hidden":!0}),oE(h,f)]}):d?(0,x.jsx)(kf,{result:d}):null]})}function k8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k9(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function k7(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){k9(a,r,o,i,l,"next",e)}function l(e){k9(a,r,o,i,l,"throw",e)}i(void 0)})}}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function jt(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function jn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||jo(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jr(e){return function(e){if(Array.isArray(e))return k8(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||jo(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jo(e,t){if(e){if("string"==typeof e)return k8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k8(e,t)}}function ja(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function ji(e){var t,n,r=e.entry,o=e.onCancel,a=e.onSaved,i=(0,S.Bd)().t,l=aA(function(e){return e.createProvider}),s=aA(function(e){return e.updateProvider}),c=aA(function(e){return e.probeDraft}),u=null!==r,d=jn((0,w.useState)(null!=(t=null==r?void 0:r.name)?t:""),2),f=d[0],p=d[1],h=jn((0,w.useState)(""),2),m=h[0],g=h[1],v=jn((0,w.useState)(null!=(n=null==r?void 0:r.notes)?n:""),2),y=v[0],b=v[1],k=jn((0,w.useState)(function(){var e;return(null!=(e=null==r?void 0:r.endpoints)?e:[]).map(function(e){return{key:e.key,baseUrl:e.baseUrl,label:e.label}})}),2),j=k[0],C=k[1],N=jn((0,w.useState)(!1),2),P=N[0],E=N[1],_=jn((0,w.useState)(null),2),A=_[0],I=_[1],T=jn((0,w.useState)({}),2),R=T[0],M=T[1],z=jn((0,w.useState)({}),2),D=z[0],L=z[1],F=jn((0,w.useState)(null),2),$=F[0],U=F[1],H=jn((0,w.useState)(0),2),B=H[0],V=H[1],K=jn((0,w.useState)(null),2),q=K[0],W=K[1],G=JSON.stringify(j),Z=kb(JSON.stringify([m,G]));function Y(e,t){C(function(n){return n.map(function(n,r){return r===e?je({},n,t):n})}),L(function(n){if(!n[e])return n;var r=je({},n),o=je({},r[e]);return void 0!==t.key&&delete o.key,void 0!==t.baseUrl&&delete o.baseUrl,0===Object.keys(o).length?delete r[e]:r[e]=o,r})}return(0,w.useEffect)(function(){return U(null)},[m,G]),(0,x.jsxs)("form",{onSubmit:function(e){return k7(function(){var t,n,o,i,c,d,p,h,g,v,b,x;return ja(this,function(w){switch(w.label){case 0:e.preventDefault(),t=j.map(function(e){return{key:e.key.trim(),label:e.label.trim(),baseUrl:e.baseUrl.trim()}}),n=je({},f.trim()?{}:{name:{key:"vault.error.nameRequired"}},u||m.trim()?{}:{apiKey:{key:"vault.error.apiKeyRequired"}}),o=new Map,i=!0,c=!1,d=void 0;try{for(p=t[Symbol.iterator]();!(i=(h=p.next()).done);i=!0)(g=h.value).key&&o.set(g.key,(null!=(v=o.get(g.key))?v:0)+1)}catch(e){c=!0,d=e}finally{try{i||null==p.return||p.return()}finally{if(c)throw d}}if(b=Object.fromEntries(t.flatMap(function(e,t){var n,r={};return e.key?e.key.includes("/")||e.key.includes("\\")||e.key.length>O.b1.endpointKey?r.key={key:"vault.error.endpointKeyInvalid",params:{max:O.b1.endpointKey}}:(null!=(n=o.get(e.key))?n:0)>1&&(r.key={key:"vault.error.endpointKeyDuplicate"}):r.key={key:"vault.error.endpointKeyRequired"},e.baseUrl||(r.baseUrl={key:"vault.error.endpointUrlRequired"}),Object.keys(r).length>0?[[t,r]]:[]})),M(n),L(b),Object.keys(n).length>0||Object.keys(b).length>0)return I({key:"vault.error.checkFields"}),[2];x={name:f.trim(),notes:y.trim()||void 0,endpoints:t},E(!0),I(null),w.label=1;case 1:if(w.trys.push([1,6,7,8]),!(u&&r))return[3,3];return[4,s(r.id,je({},x,m.trim()?{apiKey:m.trim()}:{}))];case 2:return a([{key:"vault.updated"}].concat(jr(w.sent().warnings.map(oO)))),[3,5];case 3:return[4,l(jt(je({},x),{apiKey:m.trim()}))];case 4:w.sent(),a([{key:"vault.created"}]),w.label=5;case 5:return[3,8];case 6:return I(oN(w.sent(),"vault.saveFailed")),[3,8];case 7:return E(!1),[7];case 8:return[2]}})})()},noValidate:!0,className:"space-y-4",children:[(0,x.jsxs)("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[(0,x.jsx)(fS,{id:"provider-name",className:"sm:col-span-2",label:i("vault.name"),error:R.name?oE(i,R.name):void 0,children:function(e){return(0,x.jsx)(cv,jt(je({},e),{value:f,onChange:function(e){p(e.target.value),M(function(e){return jt(je({},e),{name:void 0})})},placeholder:i("vault.namePlaceholder")}))}}),(0,x.jsx)(fS,{id:"provider-api-key",className:"sm:col-span-2",label:i("vault.apiKey"),error:R.apiKey?oE(i,R.apiKey):void 0,children:function(e){return(0,x.jsx)(cv,jt(je({},e),{type:"password",value:m,onChange:function(e){g(e.target.value),M(function(e){return jt(je({},e),{apiKey:void 0})})},placeholder:u?i("vault.apiKeyKeep"):i("vault.apiKeyRequiredPlaceholder")}))}}),(0,x.jsx)(fS,{id:"provider-notes",className:"sm:col-span-2",label:i("vault.notes"),children:function(e){return(0,x.jsx)(xd,jt(je({},e),{rows:2,value:y,onChange:function(e){return b(e.target.value)}}))}})]}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iO,{children:i("vault.endpoints")}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:i("vault.endpointsHint")}),0===j.length?(0,x.jsx)("p",{className:"rounded-xl border border-dashed px-3 py-3 text-center text-xs text-muted-foreground",children:i("vault.noEndpointDrafts")}):(0,x.jsx)("div",{className:"space-y-2",children:j.map(function(e,t){var n,r;return(0,x.jsxs)("div",{className:"grid items-start gap-2 sm:grid-cols-[10rem_minmax(0,1fr)_minmax(0,1fr)_auto]",children:[(0,x.jsx)(jl,{id:"endpoint-".concat(t,"-key"),label:i("vault.endpointKeyLabel",{index:t+1}),value:e.key,placeholder:i("vault.endpointKeyPlaceholder"),error:null==(n=D[t])?void 0:n.key,onChange:function(e){return Y(t,{key:e})}}),(0,x.jsx)(jl,{id:"endpoint-".concat(t,"-url"),label:i("vault.endpointUrlLabel",{index:t+1}),value:e.baseUrl,placeholder:i("vault.endpointUrlPlaceholder"),error:null==(r=D[t])?void 0:r.baseUrl,onChange:function(e){return Y(t,{baseUrl:e})}}),(0,x.jsx)(cv,{"aria-label":i("vault.endpointLabelLabel",{index:t+1}),value:e.label,onChange:function(e){return Y(t,{label:e.target.value})},placeholder:i("vault.endpointLabelPlaceholder")}),(0,x.jsx)(tE,{type:"button",size:"icon",variant:"ghost","aria-label":i("vault.removeEndpoint",{index:t+1}),onClick:function(){C(function(e){return e.filter(function(e,n){return n!==t})}),L({})},children:(0,x.jsx)(xf,{})})]},t)})}),(0,x.jsxs)(tE,{type:"button",size:"sm",variant:"outline",onClick:function(){return C(function(e){return jr(e).concat([{key:"",baseUrl:"",label:""}])})},children:[(0,x.jsx)(dd,{}),i("vault.addEndpoint")]}),(0,x.jsx)(k6,{options:j.map(function(e,t){return{index:t,key:e.key,baseUrl:e.baseUrl}}).filter(function(e){return e.baseUrl.trim()}),targetIndex:B,onTargetChange:V,hasStoredKey:u,hasTypedKey:m.trim().length>0,onMissingKey:function(){return M(function(e){return jt(je({},e),{apiKey:{key:"vault.error.apiKeyRequired"}})})},probing:Z.pending,probeAction:q,result:Z.result,probeError:$,onProbe:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k7(function(){var t,n,o;return ja(this,function(a){switch(a.label){case 0:if(!(o=null!=(t=(n=j.map(function(e,t){return{endpoint:e,index:t}}).filter(function(e){return""!==e.endpoint.baseUrl.trim()})).find(function(e){return e.index===B}))?t:n[0]))return U({key:"probe.missingBaseUrl"}),[2];if(!u&&!m.trim())return U(null),M(function(e){return jt(je({},e),{apiKey:{key:"vault.error.apiKeyRequired"}})}),[2];U(null),W(e?"completion":"models"),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,Z.run(function(){var t;return c(je({baseUrl:o.endpoint.baseUrl},m.trim()?{apiKey:m}:{providerId:null!=(t=null==r?void 0:r.id)?t:""},e?{completion:!0}:{}))})];case 2:return a.sent(),[3,5];case 3:return U(oN(a.sent(),"vault.probeFailed")),[3,5];case 4:return W(null),[7];case 5:return[2]}})})()}})]}),A?(0,x.jsx)(dm,{children:oE(i,A)}):null,(0,x.jsxs)(r2,{className:"flex-row justify-end gap-2 space-x-0",children:[(0,x.jsx)(tE,{type:"button",variant:"outline",className:"min-w-24",onClick:o,children:i("common.cancel")}),(0,x.jsx)(tE,{type:"submit",className:"min-w-24",disabled:P,children:P?i("vault.saving"):u?i("vault.saveChanges"):i("vault.add")})]})]})}function jl(e){var t=e.id,n=e.label,r=e.value,o=e.placeholder,a=e.error,i=e.onChange,l=(0,S.Bd)().t;return(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsx)(cv,jt(je({},fO(t,a)),{"aria-label":n,value:r,placeholder:o,onChange:function(e){return i(e.target.value)}})),(0,x.jsx)(fC,{id:t,children:a?oE(l,a):void 0})]})}function js(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jc(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ju(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){jc(a,r,o,i,l,"next",e)}function l(e){jc(a,r,o,i,l,"throw",e)}i(void 0)})}}function jd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){jd(e,t,n[t])})}return e}function jp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return js(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return js(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jh(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function jm(e){var t,n=e.open,r=e.onOpenChange,o=(0,S.s9)().locale,a=(0,S.Bd)().t,i=aA(function(e){return e.providers}),l=aA(function(e){return e.providersLoading}),s=aA(function(e){return e.providersError}),c=aA(function(e){return e.loadProviders}),u=aA(function(e){return e.deleteProvider}),d=jp((0,w.useState)({kind:"list"}),2),f=d[0],p=d[1],h=jp((0,w.useState)(null),2),m=h[0],g=h[1],v=jp((0,w.useState)(null),2),y=v[0],b=v[1],k=jp((0,w.useState)(null),2),j=k[0],O=k[1],C=jp((0,w.useState)(null),2),N=C[0],P=C[1],E=jp((0,w.useState)({}),2),_=E[0],A=E[1],I=aA(function(e){return e.revealProvider});(0,w.useEffect)(function(){n&&(p({kind:"list"}),g(null),b(null),P(null))},[n]),kx(i,c,n);var T=null!=i?i:[];return(0,x.jsxs)(rA,{open:n,onOpenChange:r,children:[(0,x.jsxs)(r0,{className:"max-h-[88vh] overflow-y-auto sm:max-w-2xl",children:[(0,x.jsxs)(r1,{children:[(0,x.jsx)(r4,{children:"create"===f.kind?a("vault.createTitle"):"edit"===f.kind?a("vault.editTitle",{name:f.entry.name}):a("vault.title")}),(0,x.jsx)(r3,{children:"list"===f.kind?a("vault.intro"):a("vault.formIntro")})]}),l&&0===T.length?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a("vault.loading")}):null,s?(0,x.jsx)(dm,{children:oE(a,s)}):null,"create"===f.kind||"edit"===f.kind?(0,x.jsx)(ji,{entry:"edit"===f.kind?f.entry:null,onCancel:function(){p({kind:"list"}),b(null)},onSaved:function(e){p({kind:"list"}),g(e),b(null)}}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:a("vault.entryCount",{count:T.length})}),(0,x.jsxs)(tE,{size:"sm",onClick:function(){return p({kind:"create"})},children:[(0,x.jsx)(dd,{}),a("vault.add")]})]}),m?(0,x.jsx)("div",{className:"rounded-xl bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400",children:m.map(function(e){return(0,x.jsx)("p",{children:oE(a,e)},e.key+e.scope)})}):null,y?(0,x.jsx)(dm,{children:oE(a,y)}):null,0===T.length?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a("vault.empty")}):(0,x.jsx)("ul",{className:"max-h-80 divide-y overflow-y-auto rounded-xl border",children:T.map(function(e){var t,n,r;return(0,x.jsxs)("li",{className:"px-4 py-3",children:[(0,x.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,x.jsxs)("div",{className:"min-w-0",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)("p",{className:"font-medium",children:e.name}),e.apiKeyConfigured?(0,x.jsx)(e5,{variant:"secondary",children:a("vault.keyConfigured")}):(0,x.jsx)(e5,{variant:"outline",children:a("vault.keyMissing")}),(0,x.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:(t=e.updatedAt,n=o,Number.isNaN((r=new Date(t)).getTime())?t:r.toLocaleString(n))})]}),e.notes?(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.notes}):null,e.endpoints.length>0?(0,x.jsx)("ul",{className:"mt-2 space-y-1",children:e.endpoints.map(function(e){return(0,x.jsxs)("li",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,x.jsx)("code",{className:"font-mono text-xs",children:e.key}),(0,x.jsx)("span",{className:"break-all font-mono text-[11px] text-muted-foreground",children:e.baseUrl})]},e.key)})}):(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("vault.noEndpoints")})]}),(0,x.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,x.jsx)(tE,{size:"icon",variant:"ghost","aria-label":void 0!==_[e.id]?a("vault.hide",{name:e.name}):a("vault.reveal",{name:e.name}),onClick:function(){ju(function(){var t;return jh(this,function(n){switch(n.label){case 0:if(void 0!==_[e.id])return A(function(t){var n=jf({},t);return delete n[e.id],n}),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,I(e.id)];case 2:return t=n.sent().apiKey,A(function(n){var r,o;return r=jf({},n),o=null!=(o=jd({},e.id,t))?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r}),[3,4];case 3:return b(oN(n.sent(),"vault.revealFailed")),[3,4];case 4:return[2]}})})()},children:void 0!==_[e.id]?(0,x.jsx)(k4,{}):(0,x.jsx)(k3,{})}),(0,x.jsx)(tE,{size:"icon",variant:"ghost","aria-label":a("vault.edit",{name:e.name}),onClick:function(){p({kind:"edit",entry:e}),b(null)},children:(0,x.jsx)(k5,{})}),(0,x.jsx)(tE,{size:"icon",variant:"ghost","aria-label":a("vault.delete",{name:e.name}),onClick:function(){P(null),O(e)},children:(0,x.jsx)(xf,{className:"text-destructive"})})]})]}),void 0!==_[e.id]?(0,x.jsx)("p",{className:"mt-2 break-all rounded-lg bg-muted/60 px-3 py-2 font-mono text-xs",children:_[e.id]}):null]},e.id)})})]}),"list"===f.kind?(0,x.jsx)(r2,{children:(0,x.jsx)(tE,{variant:"outline",onClick:function(){return r(!1)},children:a("vault.close")})}):null]}),(0,x.jsx)(aW,{open:null!==j,onOpenChange:function(e){return!e&&O(null)},children:(0,x.jsxs)(a6,{children:[(0,x.jsxs)(a8,{children:[(0,x.jsx)(a7,{children:a("vault.deleteTitle")}),(0,x.jsx)(ie,{children:a("vault.deleteBody",{name:null!=(t=null==j?void 0:j.name)?t:""})})]}),N?(0,x.jsx)(dm,{children:oE(a,N)}):null,(0,x.jsxs)(a9,{children:[(0,x.jsx)(ir,{children:a("common.cancel")}),(0,x.jsx)(it,{onClick:function(e){e.preventDefault(),j&&ju(function(){return jh(this,function(e){switch(e.label){case 0:P(null),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,u(j.id)];case 2:return e.sent(),O(null),g([{key:"vault.deleted"}]),[3,4];case 3:return P(oN(e.sent(),"vault.deleteFailed")),[3,4];case 4:return[2]}})})()},children:a("common.delete")})]})]})})]})}let jg=_("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),jv=_("archive-restore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);function jy(e){var t=e.preview,n=(0,S.Bd)().t,r=t.files.filter(function(e){return"unchanged"!==e.action}),o=t.files.filter(function(e){return"unchanged"===e.action}),a=function(e){return e.startsWith("store/")?n("favorites.restoreArea.".concat(e.slice(6))):e};return(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsx)("p",{className:"font-medium",children:n("favorites.restoreImpact",{count:r.length})}),r.length?(0,x.jsx)("ul",{className:"divide-y rounded-lg border px-3",children:r.map(function(e){return(0,x.jsxs)("li",{className:"space-y-1 py-3",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,x.jsx)("span",{className:"text-sm font-medium",children:a(e.key)}),(0,x.jsx)(e5,{variant:"delete"===e.action?"destructive":"secondary",children:n("favorites.restoreAction.".concat(e.action))})]}),(0,x.jsx)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:e.path})]},e.key)})}):(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("favorites.restoreNoChanges")}),o.length?(0,x.jsx)(fg,{title:n("favorites.restoreUnchanged",{count:o.length}),children:(0,x.jsx)("ul",{className:"space-y-2 text-xs text-muted-foreground",children:o.map(function(e){return(0,x.jsxs)("li",{children:[a(e.key),(0,x.jsx)("span",{className:"block break-all font-mono",children:e.path})]},e.key)})})}):null]})}function jb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jx(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function jw(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){jx(a,r,o,i,l,"next",e)}function l(e){jx(a,r,o,i,l,"throw",e)}i(void 0)})}}function jk(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return jb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jb(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jj(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function jS(){var e,t,n,r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,k,j,O,C,N,P,E,_,A,I,R=(0,S.Bd)().t,M=(0,S.s9)().locale,D=(e=(0,S.Bd)().t,t=aA(function(e){return e.favoriteBackups}),n=aA(function(e){return e.loadFavoriteBackups}),r=aA(function(e){return e.createFavoriteBackup}),o=aA(function(e){return e.restoreFavoriteBackup}),a=aA(function(e){return e.favoriteBackupPreview}),i=aA(function(e){return e.previewFavoriteBackup}),s=(l=jk((0,w.useState)(null),2))[0],c=l[1],d=(u=jk((0,w.useState)(!0),2))[0],f=u[1],h=(p=jk((0,w.useState)(!1),2))[0],m=p[1],v=(g=jk((0,w.useState)(!1),2))[0],y=g[1],k=(b=jk((0,w.useState)(""),2))[0],j=b[1],C=(O=jk((0,w.useState)(""),2))[0],N=O[1],P=(0,w.useRef)(0),(0,w.useEffect)(function(){var t=!0;return n().catch(function(n){t&&j(oE(e,oC(n)))}).finally(function(){t&&f(!1)}),function(){t=!1,P.current++}},[n,e]),E=function(t,n){return jw(function(){return jj(this,function(r){switch(r.label){case 0:if(v)return[2];P.current++,y(!0),m(!1),j(""),N(""),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,t()];case 2:return r.sent(),c(null),N(e(n)),[3,5];case 3:return j(oE(e,oC(r.sent()))),[3,5];case 4:return y(!1),[7];case 5:return[2]}})})()},_=t.find(function(e){return e.id===s}),A=h||k||(null==a?void 0:a.id)!==s?null:a,{backups:t,selected:_,loading:d,checking:h,writing:v,error:k,notice:C,impact:A,select:function(t){return jw(function(){var n,r;return jj(this,function(o){switch(o.label){case 0:if(v||(n=++P.current,c(t),j(""),N(""),m(!!t),!t))return[2];o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,i(t)];case 2:return o.sent(),[3,5];case 3:return r=o.sent(),n===P.current&&j(oE(e,oC(r))),[3,5];case 4:return n===P.current&&m(!1),[7];case 5:return[2]}})})()},create:function(){return E(r,"favorites.backupCreated")},restore:function(){return _&&A?E(function(){return o(_.id,A.fingerprint)},"favorites.backupRestored"):Promise.resolve()}}),L=aA(function(e){return e.harnesses}),F=function(e){var t,n,r;return e.context?R("favorites.backupAction.".concat(e.context.action),{name:null!=(t=e.context.name)?t:"",tools:null!=(n=null==(r=e.context.tools)?void 0:r.map(function(e){return R("favorites.toolNames.".concat(e))}).join(" / "))?n:""}):R("favorites.backupReason.".concat(e.reason))},$=function(e){return new Date(e.createdAt).toLocaleString(M)},U=D.backups.findIndex(function(e){var t;return e.id===(null==(t=D.selected)?void 0:t.id)}),H=[D.backups[U+2],D.backups[U+1]].filter(function(e){return void 0!==e});return(0,x.jsxs)("main",{className:"workspace-page space-y-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"workspace-eyebrow",children:R("timeline.eyebrow")}),(0,x.jsx)("h2",{className:"mt-2 text-2xl font-semibold sm:text-3xl",children:R("timeline.title")}),(0,x.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:R("timeline.subtitle")})]}),(0,x.jsxs)(tE,{variant:"outline",disabled:D.writing,onClick:function(){D.create()},children:[D.writing?(0,x.jsx)(cA,{className:"animate-spin"}):(0,x.jsx)(dd,{}),R("favorites.backupNow")]})]}),D.error?(0,x.jsx)(dm,{children:D.error}):null,D.notice?(0,x.jsxs)("p",{role:"status",className:"flex items-center gap-2 rounded-xl border border-primary/20 bg-primary/5 p-4 text-sm",children:[(0,x.jsx)(cT,{className:"size-4 text-primary"}),D.notice]}):null,(0,x.jsxs)("div",{className:"grid items-start gap-8 lg:grid-cols-[18rem_minmax(0,1fr)]",children:[(0,x.jsxs)("nav",{"aria-label":R("timeline.points"),className:"timeline-rail space-y-2",children:[(0,x.jsxs)("button",{type:"button","aria-current":D.selected?void 0:"true",disabled:D.writing,onClick:function(){D.select(null)},className:e4("timeline-point",!D.selected&&"timeline-point-selected"),children:[(0,x.jsx)(cT,{className:"size-5 shrink-0"}),(0,x.jsxs)("span",{children:[(0,x.jsx)("strong",{className:"block text-sm",children:R("timeline.current")}),(0,x.jsx)("span",{className:"mt-1 block text-xs text-muted-foreground",children:R("timeline.currentHint")})]})]}),D.loading?(0,x.jsx)("p",{role:"status",className:"p-4 text-sm",children:R("favorites.loading")}):null,D.backups.map(function(e){var t,n;return(0,x.jsxs)("button",{type:"button",disabled:D.writing,"aria-current":(null==(t=D.selected)?void 0:t.id)===e.id?"true":void 0,className:e4("timeline-point",(null==(n=D.selected)?void 0:n.id)===e.id&&"timeline-point-selected"),onClick:function(){D.select(e.id)},children:[(0,x.jsx)(jg,{className:"size-4 shrink-0"}),(0,x.jsxs)("span",{className:"min-w-0",children:[(0,x.jsx)("time",{dateTime:e.createdAt,className:"block text-xs tabular-nums",children:$(e)}),(0,x.jsx)("strong",{className:"mt-2 block break-words text-sm font-medium",children:F(e)})]})]},e.id)}),D.loading||D.backups.length?null:(0,x.jsx)("p",{className:"p-4 text-sm leading-6 text-muted-foreground",children:R("favorites.backupEmpty")}),(0,x.jsx)("p",{className:"p-4 text-xs leading-6 text-muted-foreground",children:R("favorites.backupHint")})]}),(0,x.jsx)("div",{className:"min-w-0",children:D.selected?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"mb-5 flex flex-wrap items-center justify-between gap-3",children:[(0,x.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,x.jsx)(T,{className:"size-4"}),R("timeline.snapshot")]}),(0,x.jsxs)("div",{className:"flex gap-2",children:[(0,x.jsxs)(tE,{variant:"outline",size:"sm",disabled:D.writing||U===D.backups.length-1,onClick:function(){D.select(D.backups[U+1].id)},children:[(0,x.jsx)(z,{}),R("timeline.older")]}),(0,x.jsxs)(tE,{variant:"outline",size:"sm",disabled:D.writing||U<=0,onClick:function(){D.select(D.backups[U-1].id)},children:[R("timeline.newer"),(0,x.jsx)(dp,{})]})]})]}),(0,x.jsxs)("div",{className:"snapshot-stack",style:{paddingTop:22*H.length},children:[H.map(function(e,t){return(0,x.jsx)("div",{"aria-hidden":!0,className:"snapshot-behind",style:{top:22*t,left:(H.length-t)*18,right:(H.length-t)*18},children:(0,x.jsxs)("span",{children:[$(e)," \xb7 ",F(e)]})},e.id)}),(0,x.jsxs)("section",{className:"workspace-surface snapshot-front relative flex flex-col gap-4 p-5 sm:p-6","aria-label":R("favorites.restoreReview"),children:[(0,x.jsxs)("div",{className:"flex items-start gap-4",children:[(0,x.jsx)(jv,{className:"mt-1 size-6 shrink-0 text-primary"}),(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"text-xl font-semibold tabular-nums",children:$(D.selected)}),(0,x.jsx)("p",{className:"mt-2 break-words text-sm text-muted-foreground",children:F(D.selected)})]})]}),(0,x.jsx)("p",{className:"text-sm leading-6 text-muted-foreground",children:R("timeline.snapshotHint")}),(0,x.jsx)("div",{className:"snapshot-impact min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1",children:D.checking?(0,x.jsxs)("p",{role:"status",className:"flex items-center gap-2 py-8 text-sm text-muted-foreground",children:[(0,x.jsx)(cA,{className:"size-4 animate-spin"}),R("favorites.restoreChecking")]}):D.impact?(0,x.jsx)(jy,{preview:D.impact}):null}),(0,x.jsx)(dm,{variant:"warning",children:R("favorites.restoreScope")}),(0,x.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-t pt-4",children:[(0,x.jsx)(tE,{variant:"outline",disabled:D.writing||D.checking,onClick:function(){D.select(D.selected.id)},children:R("favorites.restoreRecheck")}),(0,x.jsxs)(tE,{size:"lg",disabled:D.writing||!(null==(I=D.impact)?void 0:I.files.some(function(e){return"unchanged"!==e.action})),onClick:function(){D.restore()},children:[D.writing?(0,x.jsx)(cA,{className:"animate-spin"}):(0,x.jsx)(jv,{}),R("timeline.restore")]})]})]},D.selected.id)]}),(0,x.jsxs)("p",{className:"mt-6 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[(0,x.jsx)(cT,{className:"size-4"}),R("timeline.protection")]})]}):(0,x.jsxs)("section",{className:"workspace-surface space-y-6 p-6 sm:p-8",children:[(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[(0,x.jsx)(cT,{className:"size-7 text-primary"}),(0,x.jsx)("h3",{className:"text-xl font-semibold",children:R("timeline.current")})]}),(0,x.jsx)("p",{className:"text-sm leading-7 text-muted-foreground",children:R("timeline.currentDescription")}),(0,x.jsx)("div",{className:"divide-y",children:L.map(function(e){var t,n;return(0,x.jsxs)("div",{className:"flex items-center gap-3 py-4",children:[(0,x.jsx)(di,{id:e.id}),(0,x.jsx)("span",{className:"text-sm font-medium",children:e.label}),(0,x.jsx)("span",{className:"ml-auto min-w-0 max-w-[55%] break-all text-right font-mono text-xs text-muted-foreground",children:(null==(t=e.active)?void 0:t.model)||R((null==(n=e.active)?void 0:n.official)?"harness.official":"harness.currentInactive")})]},e.id)})}),(0,x.jsx)("p",{className:"text-sm text-primary",children:R("timeline.selectHint")})]})})]})]})}let jO=_("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),jC=_("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);function jN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jP(){var e,t=(0,S.Bd)().t,n=function(e){if(Array.isArray(e))return e}(e=(0,w.useState)("light"))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return jN(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jN(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,w.useEffect)(function(){var e=(0,kt.PY)();o(e),(0,kt.AZ)(e)},[]),(0,x.jsx)(tE,{type:"button",size:"icon",variant:"outline","aria-label":t("dark"===r?"theme.toLight":"theme.toDark"),onClick:function(){return o(function(e){return(0,kt.OD)(e)})},children:"dark"===r?(0,x.jsx)(jO,{}):(0,x.jsx)(jC,{})})}function jE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function jA(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}function jI(e){var t,n=e.label,r=e.className,o=e.trigger,a=e.children,i=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return jE(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jE(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=i[0],s=i[1],c=(0,w.useRef)(null);return(0,w.useEffect)(function(){var e=function(e){var t;(null==(t=c.current)?void 0:t.contains(e.target))||s(!1)};if(l)return window.addEventListener("pointerdown",e),function(){return window.removeEventListener("pointerdown",e)}},[l]),(0,x.jsxs)("div",{ref:c,className:e4("relative",r),children:[w.cloneElement(o,{"aria-expanded":l,"aria-haspopup":"menu",onClick:function(){return s(function(e){return!e})}}),l?(0,x.jsx)("div",{role:"menu","aria-label":n,className:"absolute right-0 top-full z-30 mt-2 w-52 rounded-xl border bg-popover p-1 text-popover-foreground shadow-lg",children:a(function(){return s(!1)})}):null]})}function jT(e){var t=e.className,n=e.disabled,r=e.destructive,o=jA(e,["className","disabled","destructive"]);return(0,x.jsx)("button",j_({type:"button",disabled:n,className:e4("flex w-full items-center rounded-lg px-3 py-2 text-left text-sm transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/35",r&&"text-destructive",n?"cursor-default opacity-60":r?"cursor-pointer hover:bg-destructive/10":"cursor-pointer hover:bg-accent hover:text-accent-foreground",t)},o))}function jR(e){var t=e.className,n=jA(e,["className"]);return(0,x.jsx)("div",j_({className:e4("px-3 py-2 text-xs text-muted-foreground",t)},n))}function jM(e){var t=e.className;return(0,x.jsx)("div",{className:e4("my-1 border-t",t)})}function jz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jD(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function jL(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return jz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jz(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jF(){var e=(0,S.Bd)().t,t=jL((0,w.useState)(null),2),n=t[0],r=t[1],o=jL((0,w.useState)(null),2),a=o[0],i=o[1],l=jL((0,w.useState)("idle"),2),s=l[0],c=l[1];return((0,w.useEffect)(function(){var e=!1;return om("/api/update/check").then(function(t){!e&&(r(t.current),t.updateAvailable&&t.latest&&i(t.latest))}).catch(function(){}),function(){e=!0}},[]),"updating"===s)?(0,x.jsxs)("span",{className:"flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-muted/70 px-2 font-mono text-[11px] text-muted-foreground",children:[(0,x.jsx)(cA,{className:"size-3 shrink-0 animate-spin"}),e("update.updating")]}):"failed"===s?(0,x.jsx)("span",{title:e("update.failedHint"),className:"flex h-6 shrink-0 items-center whitespace-nowrap rounded-md bg-destructive/10 px-2 font-mono text-[11px] text-destructive",children:e("update.failed")}):a?(0,x.jsxs)(tE,{variant:"outline",size:"sm","aria-label":e("update.toVersion",{version:a}),className:"h-6 shrink-0 gap-1 whitespace-nowrap px-2 font-mono text-[11px]",onClick:function(){var e;(e=function(){var e;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:c("updating"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,om("/api/update",{method:"POST"})];case 2:case 3:return t.sent(),[3,4];case 4:e=Date.now()+18e4,t.label=5;case 5:if(!(Date.now()<e))return[3,11];return[4,new Promise(function(e){return setTimeout(e,2500)})];case 6:t.sent(),t.label=7;case 7:return t.trys.push([7,9,,10]),[4,om(oh)];case 8:if(t.sent().version!==n)return window.location.reload(),[2];return[3,10];case 9:return t.sent(),[3,10];case 10:return[3,5];case 11:return c("failed"),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){jD(a,r,o,i,l,"next",e)}function l(e){jD(a,r,o,i,l,"throw",e)}i(void 0)})})()},children:[(0,x.jsx)(uN,{className:"size-3 shrink-0"}),(0,x.jsx)("span",{className:"sm:hidden",children:e("update.short")}),(0,x.jsx)("span",{className:"hidden sm:inline",children:e("update.toVersion",{version:a})})]}):null}function j$(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jU(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,w.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return j$(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j$(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],r=t[1];return((0,w.useEffect)(function(){var e=!1;return om(oh).then(function(t){e||r(t.version)}).catch(function(){}),function(){e=!0}},[]),n)?(0,x.jsxs)("span",{className:"shrink-0 whitespace-nowrap rounded-md bg-muted/70 px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:["v",n]}):null}function jH(){return(0,S.Bd)().t,null}let jB=_("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);function jV(e){var t,n=e.selectedHarnessId,r=e.onSelectHarness,o=e.onConfigure,a=e.onHistory,i=(0,S.Bd)().t,l=(0,S.s9)().locale,s=aA(function(e){return e.harnesses}),c=aA(function(e){return e.loadFavoriteBackups}),u=aA(function(e){return e.favoriteBackups});(0,w.useEffect)(function(){c().catch(function(){})},[c]);var d=null!=(t=s.find(function(e){return e.id===n}))?t:s[0];return(0,x.jsxs)("main",{className:"grid xl:grid-cols-[17rem_minmax(0,1fr)]",children:[(0,x.jsx)(dl,{harnesses:s,value:null==d?void 0:d.id,onChange:r}),(0,x.jsxs)("div",{className:"min-w-0 space-y-6 p-4 sm:p-6 xl:p-8",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"workspace-eyebrow",children:i("workspace.eyebrow")}),(0,x.jsx)("h2",{className:"mt-2 text-2xl font-semibold tracking-tight sm:text-3xl",children:i("workspace.title")}),(0,x.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:i("workspace.homeSubtitle")})]}),d?(0,x.jsxs)(cB,{idPrefix:"harness",value:d.id,className:"workspace-surface min-w-0 space-y-7 p-5 sm:p-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"text-xl font-semibold",children:i("workspace.currentForTool",{name:d.label})}),(0,x.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:i("workspace.currentForToolHint")})]}),(0,x.jsxs)(tE,{onClick:function(){return o(d.id)},children:[(0,x.jsx)(jB,{}),i("workspace.configureSwitch")]})]}),(0,x.jsx)(bQ,{harness:d})]}):(0,x.jsx)("p",{children:i("workspace.noTools")}),(0,x.jsxs)("button",{type:"button",onClick:a,className:"workspace-history-link group flex w-full flex-wrap items-center justify-between gap-4 rounded-2xl border bg-card/60 p-5 text-left focus-visible:outline-2 focus-visible:outline-ring",children:[(0,x.jsxs)("span",{className:"flex items-center gap-4",children:[(0,x.jsx)(T,{className:"size-6 shrink-0 text-primary"}),(0,x.jsxs)("span",{children:[(0,x.jsx)("span",{className:"block text-sm font-semibold",children:i("timeline.title")}),(0,x.jsx)("span",{className:"mt-1 block text-xs text-muted-foreground",children:u[0]?i("workspace.lastBackup",{time:new Date(u[0].createdAt).toLocaleString(l)}):i("workspace.historyHint")})]})]}),(0,x.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[i("workspace.openHistory"),(0,x.jsx)(dp,{className:"size-4 transition-transform group-hover:translate-x-1 motion-reduce:transform-none"})]})]})]})]})}let jK=_("circle-user-round",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),jq=_("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);function jW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jG(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function jZ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return jW(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jW(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jY(e){var t,n,r=e.harness,o=e.profile,a=e.official,i=void 0!==a&&a,l=e.open,s=e.onOpenChange,c=(0,S.Bd)().t,u=aA(function(e){return e.previewProfile}),d=aA(function(e){return e.previewOfficial}),f=aA(function(e){return e.activateProfile}),p=aA(function(e){return e.activateOfficial}),h=aA(function(e){return e.currentUser}),m=i?c("harness.official"):null==o?void 0:o.name,g=jZ((0,w.useState)(null),2),v=g[0],y=g[1],b=jZ((0,w.useState)(null),2),k=b[0],j=b[1],O=jZ((0,w.useState)(null),2),C=O[0],N=O[1],P=jZ((0,w.useState)(!1),2),E=P[0],_=P[1],A=jZ((0,w.useState)(0),2),I=A[0],T=A[1],R=jZ((0,w.useState)("route"),2),M=R[0],z=R[1];(0,w.useEffect)(function(){if(l){var e=!1;return y(null),j(null),N(null),_(!1),(i?d(r.id):u(r.id,null!=m?m:"")).then(function(t){e||y(t)}).catch(function(t){e||j(oC(t))}),function(){e=!0}}},[l,r.id,i,I,d,u,m]);var D=null!=(t=null==v?void 0:v.map(function(e){return{path:e.path,existed:null!==e.currentContent,content:e.content,currentContent:e.currentContent}}))?t:[],L=D.filter(function(e){return"same"!==tn(e)}).length;return(0,x.jsx)(aW,{open:l,onOpenChange:s,children:(0,x.jsxs)(a6,{style:{height:o&&"route"===M?"min(520px, 90dvh)":"min(820px, 90dvh)"},className:"flex flex-col overflow-hidden sm:max-w-4xl data-[state=open]:animate-none data-[state=closed]:animate-none",children:[(0,x.jsxs)(a8,{children:[(0,x.jsx)(a7,{children:c(i?"activate.officialTitle":"activate.title")}),(0,x.jsx)(ie,{children:c(i?"activate.officialBody":"activate.body",{harness:r.label,profile:null!=m?m:"",changed:L>0?c("activate.changedFiles",{count:L}):"",user:h||c("notice.currentUser")})})]}),o?(0,x.jsx)(cU,{idPrefix:"profile-preview",label:c("favorites.reviewChanges"),items:[{id:"route",label:c("workspace.switchMap")},{id:"diff",label:c("workspace.fileDiffTab")}],value:M,onChange:z,className:"flex gap-2",tabClassName:"px-4 py-2 text-sm",children:function(e){return e.label}}):null,(0,x.jsx)(cB,{idPrefix:"profile-preview",value:M,className:"min-h-0 flex-1 overflow-auto",children:o&&"route"===M?(0,x.jsx)(bJ,{current:b1(r,c),candidate:{provider:o.name,model:bX(o,c),sourceLabel:c((null==(n=o.modelFavorite)?void 0:n.favoriteId)?"templates.tag":"workspace.configuration")},harness:r}):k?(0,x.jsx)("p",{className:"text-sm text-destructive",children:c("activate.loadFailed",{reason:oE(c,k)})}):null===v?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:c("activate.loading")}):(0,x.jsx)("div",{className:"max-h-[52dvh] overflow-y-auto rounded-xl border p-3",children:(0,x.jsx)(tr,{files:D})})}),o&&"route"===M&&k?(0,x.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:oE(c,k)}):null,C?(0,x.jsx)("p",{className:"text-sm text-destructive",children:c("activate.failed",{reason:oE(c,C)})}):null,(0,x.jsxs)(a9,{children:[(0,x.jsx)(ir,{disabled:E,children:c("common.cancel")}),k?(0,x.jsx)(it,{onClick:function(e){e.preventDefault(),T(function(e){return e+1})},children:c("activate.retryPreview")}):(0,x.jsx)(it,{disabled:null===v||E,onClick:function(e){var t;return(t=function(){return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:if(e.preventDefault(),!v||E)return[2];_(!0),N(null),t.label=1;case 1:if(t.trys.push([1,6,7,8]),!i)return[3,3];return[4,p(r.id)];case 2:return t.sent(),[3,5];case 3:return[4,f(r.id,null!=m?m:"")];case 4:t.sent(),t.label=5;case 5:return s(!1),[3,8];case 6:return N(oC(t.sent())),[3,8];case 7:return _(!1),[7];case 8:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function i(e){jG(a,r,o,i,l,"next",e)}function l(e){jG(a,r,o,i,l,"throw",e)}i(void 0)})})()},children:c(E?"activate.executing":C?"activate.retry":"activate.confirm")})]})]})})}function jX(e){var t,n,r=e.profile,o=e.onOpenTemplate,a=(0,S.Bd)().t,i=aA(function(e){return e.favorites}),l=aA(function(e){return e.loadFavorites});(0,w.useEffect)(function(){null===i&&l()},[i,l]);var s=null==i?void 0:i.find(function(e){var t;return e.id===(null==(t=r.modelFavorite)?void 0:t.favoriteId)}),c=null==s?void 0:s.references.find(function(e){return e.harness===r.harness&&e.name===r.name});return(0,x.jsxs)("div",{className:"mt-2 space-y-1 text-xs text-muted-foreground",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[" ",s&&o?(0,x.jsx)(tE,{size:"sm",variant:"outline",className:"h-6 rounded-full px-2 text-xs",onClick:function(){return o(s.id)},children:a("templates.tag")}):null,(0,x.jsxs)("span",{children:[a("favorites.linked"),":"," ",null!=(t=null==s?void 0:s.name)?t:i?a("favorites.sourceMissing"):null==(n=r.modelFavorite)?void 0:n.favoriteId]})]}),(null==c?void 0:c.connectionMissing)?(0,x.jsx)("p",{children:a("favorites.connectionMissing")}):null,(null==c?void 0:c.needsUpdate)?(0,x.jsx)("p",{children:a("favorites.needsUpdate")}):null,(null==c?void 0:c.diverged)?(0,x.jsx)("p",{children:a("favorites.diverged")}):null]})}var jJ={collection:"harness.profiles",applied:"harness.activeConfig",appliedBadge:"harness.active",apply:"harness.activate",add:"harness.newProfile"},jQ={collection:"harness.providers",applied:"harness.defaultModel",appliedBadge:"harness.default",apply:"harness.setDefault",add:"harness.addCustomProvider"},j0=new Set(["dsh","kimi"]);function j1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j2(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j1(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j4(e){var t,n,r,o,a,i,l=e.harness,s=e.onAdd,c=e.onEdit,u=e.onCopy,d=e.extraActions,f=e.onOpenTemplate,p=e.switching,h=(0,S.Bd)().t,m=aA(function(e){return e.deleteProfile}),g=j2((0,w.useState)(null),2),v=g[0],y=g[1],b=j2((0,w.useState)(null),2),k=b[0],j=b[1],O=j2((0,w.useState)(!1),2),C=O[0],N=O[1],P=l.official,E=(null==P?void 0:P.linkedProfileName)?l.profiles.find(function(e){return e.name===P.linkedProfileName}):void 0,_=l.profiles.filter(function(e){return e.name!==(null==P?void 0:P.linkedProfileName)}),A=l.profiles.find(function(e){return e.name===v}),I="dsh"===l.id&&(null==A?void 0:A.extras.providerType)==="official"&&1===l.profiles.filter(function(e){return"official"===e.extras.providerType}).length,T=(t=l.id,j0.has(t)?jQ:jJ),R=(null==(o=l.active)?void 0:o.official)?h("harness.official"):null!=(n=null==(a=l.active)?void 0:a.name)?n:null;return(0,x.jsxs)("div",{className:"space-y-6",children:[(0,x.jsx)(xm,{className:"overflow-hidden border-primary/10",children:(0,x.jsxs)(xy,{className:"p-5 sm:p-6",children:[(0,x.jsxs)("div",{className:"grid gap-5 sm:grid-cols-[minmax(0,1fr)_minmax(15rem,0.85fr)] sm:divide-x",children:[(0,x.jsxs)("div",{className:"min-w-0 sm:pr-5",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,x.jsx)("span",{className:"size-2 rounded-full bg-primary shadow-[0_0_0_4px_rgb(99_91_255/0.1)]"}),h(T.applied)]}),(0,x.jsx)(xg,{className:"mt-3 truncate text-xl",children:null===R?h("harness.inactive"):h("harness.activeNamed",{name:R})}),(0,x.jsx)(xv,{className:"mt-1",children:null===R?h("harness.currentInactive"):h("harness.current",{name:R})})]}),(0,x.jsxs)("div",{className:"min-w-0 sm:pl-5",children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:h("harness.writeTargets")}),(0,x.jsx)("p",{className:"mt-3 truncate font-mono text-sm",children:null!=(r=null==(i=l.targets[0])?void 0:i.path)?r:h("harness.noTargetFile")}),l.targets.length>1?(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:h("harness.moreFiles",{count:l.targets.length-1})}):null]})]}),(0,x.jsxs)("div",{className:"mt-5 flex items-start gap-3 border-t pt-4 text-sm text-muted-foreground",children:[(0,x.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/[0.08] text-primary",children:(0,x.jsx)(cT,{className:"size-4"})}),(0,x.jsx)("p",{className:"pt-1 leading-relaxed",children:h("harness.overwriteWarning")})]})]})}),(0,x.jsxs)("section",{children:[(0,x.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,x.jsxs)("div",{children:[p?null:(0,x.jsx)("h3",{className:"text-sm font-semibold",children:h(T.collection)}),(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:h("harness.profileCount",{count:_.length})})]}),d]}),(0,x.jsxs)("div",{className:"space-y-3",children:[(null==P?void 0:P.available)?(0,x.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-xl border bg-card px-4 py-4 shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)]",children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,x.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:(0,x.jsx)(jK,{className:"size-4"})}),(0,x.jsxs)("div",{className:"min-w-0",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("p",{className:"font-medium",children:h(P.titleCode)}),P.active?(0,x.jsx)(e5,{variant:"secondary",children:h("harness.active")}):null]}),(0,x.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:h(P.hintCode)})]})]}),(0,x.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,x.jsx)(tE,{size:"sm",variant:P.active?"secondary":"outline",disabled:P.active,onClick:function(){return N(!0)},children:P.active?h("harness.officialActive"):h("harness.officialSwitch")}),E?(0,x.jsx)(tE,{size:"icon",variant:"ghost","aria-label":h("harness.edit",{name:E.name}),onClick:function(){return c(E)},children:(0,x.jsx)(k5,{})}):null]})]}):null,0!==_.length||E?_.length>0?_.map(function(e){var t,n,r=(null==(t=l.active)?void 0:t.official)!==!0&&(null==(n=l.active)?void 0:n.name)===e.name;return(0,x.jsxs)("div",{className:e4("flex flex-col gap-4 rounded-xl border bg-card px-4 py-4 shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)] transition-[border-color,background-color,box-shadow] sm:flex-row sm:items-center sm:justify-between",r?"border-primary/20 bg-primary/[0.035] shadow-[0_12px_30px_-24px_rgb(99_91_255/0.35)]":"hover:border-primary/15 hover:bg-card/85"),children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,x.jsx)("span",{className:e4("mt-2 size-2 shrink-0 rounded-full",r?"bg-primary":"bg-muted-foreground/30")}),(0,x.jsxs)("div",{className:"min-w-0",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("p",{className:"font-medium",children:e.name}),r?(0,x.jsx)(e5,{children:h(T.appliedBadge)}):null,e.overriddenTargets.length>0?(0,x.jsx)(e5,{variant:"outline",children:h("harness.manualOverride")}):null]}),(0,x.jsx)("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:e.baseUrl}),(0,x.jsx)("p",{title:bX(e,h),className:"mt-0.5 truncate font-mono text-xs text-muted-foreground",children:bX(e,h)}),e.modelFavorite?(0,x.jsx)(jX,{profile:e,onOpenTemplate:f}):null]})]}),(0,x.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 self-end sm:self-auto",children:[(0,x.jsxs)(tE,{size:"sm",variant:r?"secondary":"outline",onClick:function(){return j(e)},disabled:r,children:[r?null:(0,x.jsx)(jq,{}),h(p?r?"workspace.activeNow":"workspace.useConfiguration":r?T.appliedBadge:T.apply)]}),(0,x.jsx)(tE,{size:"icon",variant:"ghost","aria-label":h("harness.edit",{name:e.name}),onClick:function(){return c(e)},children:(0,x.jsx)(k5,{})}),(0,x.jsx)(tE,{size:"icon",variant:"ghost","aria-label":h("harness.copy",{name:e.name}),onClick:function(){return null==u?void 0:u(e)},children:(0,x.jsx)(cL,{})}),(0,x.jsx)(tE,{size:"icon",variant:"ghost","aria-label":h("harness.delete",{name:e.name}),disabled:r,title:r?h("harness.deleteBlocked"):void 0,onClick:function(){return y(e.name)},children:(0,x.jsx)(xf,{className:r?void 0:"text-destructive"})})]})]},e.name)}):null:(0,x.jsxs)("div",{className:"rounded-xl border border-dashed bg-card/60 px-5 py-8 text-center",children:[(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:h("harness.noProfiles")}),(0,x.jsxs)(tE,{className:"mt-4",size:"sm",onClick:s,children:[(0,x.jsx)(dd,{}),h("harness.newProfile")]})]})]})]}),k?(0,x.jsx)(jY,{harness:l,profile:k,open:!0,onOpenChange:function(e){return!e&&j(null)}}):null,C?(0,x.jsx)(jY,{harness:l,official:!0,open:!0,onOpenChange:function(e){return!e&&N(!1)}}):null,(0,x.jsx)(aW,{open:null!==v,onOpenChange:function(e){return!e&&y(null)},children:(0,x.jsxs)(a6,{children:[(0,x.jsxs)(a8,{children:[(0,x.jsx)(a7,{children:h("harness.deleteTitle")}),(0,x.jsx)(ie,{children:h("harness.deleteBody",{harness:l.label,profile:null!=v?v:"",extra:I?h("harness.deleteDshOfficialExtra"):"additive"===l.mode?h("harness.deleteAdditiveExtra"):""})})]}),(0,x.jsxs)(a9,{children:[(0,x.jsx)(ir,{children:h("common.cancel")}),(0,x.jsx)(it,{onClick:function(){v&&m(l.id,v)},children:h("common.delete")})]})]})})]})}function j3(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j5(e){var t,n=e.harness,r=e.onNewProfile,o=e.onOpenTemplate,a=e.onEditProfile,i=e.onCopyProfile,l=(0,S.Bd)().t,s=aA(function(e){return e.favorites}),c=aA(function(e){return e.favoritesLoading}),u=aA(function(e){return e.favoritesError}),d=aA(function(e){return e.loadFavorites}),f=aA(function(e){return e.loadProviders}),p=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(""))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return j3(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j3(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=p[0],m=p[1];(0,w.useEffect)(function(){d(),f()},[d,f]);var g=null==s?void 0:s.find(function(e){return e.id===h});return(0,x.jsxs)("section",{className:"workspace-surface space-y-6 p-5 sm:p-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsx)("p",{className:"workspace-eyebrow",children:l("workspace.switcherEyebrow")}),(0,x.jsx)("h3",{className:"mt-2 text-xl font-semibold",children:l("workspace.switcherTitle",{name:n.label})}),(0,x.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:l("workspace.switcherHint")})]}),(0,x.jsxs)("div",{className:"ml-auto flex flex-wrap justify-end gap-2",children:[(0,x.jsxs)(tE,{variant:"outline",size:"sm",onClick:r,children:[(0,x.jsx)(dd,{}),l("workspace.newConfiguration")]}),(0,x.jsx)(wp,{id:"switcher-template","aria-invalid":void 0,"aria-describedby":void 0,value:"",options:(null!=s?s:[]).map(function(e){return e.id}),getLabel:function(e){var t,n;return null!=(t=null==s||null==(n=s.find(function(t){return t.id===e}))?void 0:n.name)?t:e},onChange:m,placeholder:l("workspace.chooseTemplate"),searchLabel:l("favorites.search"),emptyHint:l(c?"favorites.loading":"workspace.noTemplates"),trigger:(0,x.jsxs)(tE,{variant:"outline",size:"sm",children:[(0,x.jsx)(uN,{}),l("workspace.newFromTemplate")]})})]})]}),u?(0,x.jsx)(dm,{children:oE(l,u)}):null,(0,x.jsx)(j4,{harness:n,onAdd:r,onEdit:a,onCopy:i,onOpenTemplate:o,switching:!0}),g?(0,x.jsx)(xo,{favorite:g,quickHarness:n,initialMode:"activate",initialPreview:!0,onClose:function(){return m("")}},g.id):null]})}function j6(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j6(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j9(){var e,t,n,r,o,a=aA(function(e){return e.currentUser}),i=j8((0,w.useState)("workspace"),2),l=i[0],s=i[1],c=(0,S.s9)().locale,u=(0,S.Bd)().t,d=aA(function(e){return e.harnesses}),f=aA(function(e){return e.envFile}),p=aA(function(e){return e.backups}),h=j8((0,w.useState)(null),2),m=h[0],g=h[1],v=j8((0,w.useState)(!1),2),y=v[0],b=v[1],k=j8((0,w.useState)(!1),2),j=k[0],O=k[1],C=j8((0,w.useState)("claude"),2),N=C[0],P=C[1],E=j8((0,w.useState)(""),2),_=E[0],F=E[1],$=d.find(function(e){return e.id===(null==m?void 0:m.harnessId)}),U=null!=(e=d.find(function(e){return e.id===N}))?e:d[0];return(0,x.jsxs)("div",{className:"min-h-[100dvh] bg-background",children:[(0,x.jsx)("header",{className:"sticky top-0 z-20 border-b bg-card/90 backdrop-blur-xl",children:(0,x.jsxs)("div",{className:"flex min-h-20 flex-wrap items-center justify-between gap-x-4 gap-y-2 px-4 py-2 sm:px-6",children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,x.jsx)(aM,{className:"size-10 shrink-0 ring-1 ring-black/5 dark:ring-white/10"}),(0,x.jsxs)("div",{className:"min-w-0",children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,x.jsx)("h1",{className:"min-w-0 flex-1 truncate text-base font-semibold tracking-tight",children:"harness-switch"}),(0,x.jsx)(jU,{}),(0,x.jsx)(jH,{}),(0,x.jsx)(jF,{})]}),(0,x.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:u("app.tagline")})]})]}),(0,x.jsx)(cU,{label:u("workspace.navigation"),idPrefix:"dashboard",items:[{id:"workspace",icon:A},{id:"favorites",icon:I},{id:"history",icon:T}],value:"tools"===l?"workspace":l,onChange:s,className:"order-3 flex w-full gap-2 overflow-x-auto border-t pt-2 lg:order-none lg:w-auto lg:border-0 lg:pt-0",tabClassName:"gap-2 px-4 py-3 text-sm font-medium",children:function(e){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(e.icon,{className:"size-4"}),u("workspace.nav."+e.id)]})}}),(0,x.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,x.jsxs)(tE,{variant:"outline",size:"sm",onClick:function(){return b(!0)},children:[(0,x.jsx)(R,{}),(0,x.jsx)("span",{className:"hidden sm:inline",children:u("nav.transfer")})]}),(0,x.jsxs)(tE,{variant:"outline",size:"sm",onClick:function(){return O(!0)},children:[(0,x.jsx)(M,{}),(0,x.jsx)("span",{className:"hidden sm:inline",children:u("nav.vault")})]}),(0,x.jsx)(dc,{}),(0,x.jsx)(jP,{}),(0,x.jsx)(j7,{})]})]})}),(0,x.jsx)(cB,{idPrefix:"dashboard",value:"tools"===l?"workspace":l,children:"workspace"===l?(0,x.jsx)(jV,{selectedHarnessId:N,onSelectHarness:P,onConfigure:function(e){P(e),s("tools")},onHistory:function(){return s("history")}},a):"favorites"===l?(0,x.jsx)(wW,{initialSelectedId:_},"".concat(a,"/").concat(_)):"history"===l?(0,x.jsx)(jS,{},a):(0,x.jsxs)("div",{className:"grid xl:grid-cols-[17rem_minmax(0,1fr)_18rem]",children:[(0,x.jsx)("div",{className:"xl:row-span-2",children:(0,x.jsx)(dl,{harnesses:d,value:null==U?void 0:U.id,onChange:P})}),U?(0,x.jsxs)("nav",{"aria-label":u("workspace.breadcrumb"),className:"flex min-w-0 items-center gap-1 border-b bg-card/30 px-4 py-3 text-sm text-muted-foreground sm:px-6 xl:col-span-2",children:[(0,x.jsxs)(tE,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:function(){return s("workspace")},children:[(0,x.jsx)(z,{}),u("workspace.back")]}),(0,x.jsx)(D,{className:"size-4 shrink-0","aria-hidden":!0}),(0,x.jsx)("span",{className:"truncate font-medium text-foreground",children:U.label})]}):null,U?(0,x.jsxs)(cB,{as:"main",idPrefix:"harness",value:U.id,className:"min-w-0 space-y-6 p-4 sm:p-6 xl:p-8",children:[(0,x.jsx)(j5,{harness:U,onNewProfile:function(){return g({harnessId:U.id,profile:null})},onEditProfile:function(e){return g({harnessId:U.id,profile:e})},onCopyProfile:function(e){return g({harnessId:U.id,profile:null,copySource:e})},onOpenTemplate:function(e){F(e),s("favorites")}}),(0,x.jsxs)("details",{className:"group rounded-2xl border bg-card px-5 py-4 text-sm shadow-[0_12px_34px_-28px_rgb(36_39_70/0.35)]",children:[(0,x.jsxs)("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 font-medium",children:[(0,x.jsx)("span",{className:"font-mono text-[13px]",children:u("env.title")}),(0,x.jsx)(L,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-180"})]}),(0,x.jsx)("p",{className:"mt-4 leading-relaxed text-muted-foreground",children:u("env.intro")}),(0,x.jsxs)("code",{className:"mt-3 block rounded-xl bg-muted/70 px-4 py-3 font-mono text-[13px]",children:["source ",f||"~/.harness-switch/env.sh"]}),(0,x.jsx)("p",{className:"mt-3 leading-relaxed text-muted-foreground",children:u("env.note")})]})]}):null,U?(0,x.jsx)(Se,{harness:U,latestBackup:p.find(function(e){return e.harness===U.id}),locale:c}):null]})}),m&&$?(0,x.jsx)(k2,{harness:$,profile:m.profile,copySource:m.copySource,onOpenChange:function(e){return!e&&g(null)}},"".concat(m.harnessId,"-").concat(null!=(t=null!=(n=null==(r=m.profile)?void 0:r.name)?n:null==(o=m.copySource)?void 0:o.name)?t:"new")):null,(0,x.jsx)(uS,{open:y,onOpenChange:b}),(0,x.jsx)(jm,{open:j,onOpenChange:O}),(0,x.jsx)(kr,{})]})}function j7(){var e=(0,S.Bd)().t,t=aA(function(e){return e.logout}),n=aA(function(e){return e.users}),r=aA(function(e){return e.currentUser}),o=aA(function(e){return e.usersLoading}),a=aA(function(e){return e.switchUser});return(0,x.jsx)(jI,{label:e("nav.currentLocalUser"),trigger:(0,x.jsxs)(tE,{variant:"outline",size:"sm",className:"group","aria-label":e("nav.currentLocalUser"),disabled:o,children:[(0,x.jsx)(F,{}),(0,x.jsx)("span",{className:"max-w-28 truncate",children:r||e("nav.localUser")}),(0,x.jsx)(L,{className:"transition-transform group-aria-expanded:rotate-180"})]}),children:function(i){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(jR,{children:e("nav.currentLocalUser")}),n.map(function(t){var n,l,s,c=!1===t.manageable,u=c?oE(e,{key:t.blockCode?(0,O.Vz)(t.blockCode):"error.user.notSwitchable",params:t.blockData}):"",d=null!=(n=null==(l=t.blockData)?void 0:l.path)?n:null==(s=t.blockData)?void 0:s.home;return(0,x.jsxs)(jT,{role:"menuitemradio","aria-checked":t.username===r,disabled:o||t.username===r||c,title:c?[u,d].filter(Boolean).join(" — "):void 0,className:"flex-col items-start",onClick:function(){a(t.username).then(i,function(){})},children:[(0,x.jsxs)("span",{className:"flex w-full items-center gap-1.5",children:[c?(0,x.jsx)($,{className:"size-3 shrink-0","aria-hidden":!0}):null,(0,x.jsx)("span",{className:"truncate",children:t.username})]}),c?(0,x.jsx)("span",{className:"mt-0.5 text-xs leading-snug text-muted-foreground",children:u}):null]},t.username)}),(0,x.jsx)(jM,{}),(0,x.jsxs)(jT,{role:"menuitem",destructive:!0,disabled:o,className:"gap-2",onClick:function(){t().then(i,function(){})},children:[(0,x.jsx)(U,{className:"size-4"}),e("nav.signOut")]})]})}})}function Se(e){var t=e.harness,n=e.latestBackup,r=e.locale,o=(0,S.Bd)().t;return(0,x.jsx)("aside",{className:"border-t bg-card/35 p-4 sm:p-6 xl:min-h-[calc(100dvh-80px)] xl:border-l xl:border-t-0 xl:p-5",children:(0,x.jsxs)("div",{className:"space-y-4 xl:sticky xl:top-[100px]",children:[(0,x.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(H,{className:"size-4 text-primary"}),(0,x.jsx)("h3",{className:"font-semibold",children:o("harness.writeTargets")})]}),(0,x.jsxs)("div",{className:"mt-5 space-y-4",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:o("harness.application")}),(0,x.jsx)("p",{className:"mt-1 text-sm font-medium",children:t.label})]}),t.targets.map(function(e){return(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:o_(o,e.labelCode,e.label)}),(0,x.jsx)("p",{className:"mt-1 break-all font-mono text-xs leading-relaxed",children:e.path})]},e.key)}),(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:o("harness.writeMode")}),(0,x.jsx)("p",{className:"mt-1 text-sm",children:"replace"===t.mode?o("harness.modeReplace"):o("harness.modeAdditive")})]})]})]}),(0,x.jsx)(uL,{harness:t}),(0,x.jsx)(ku,{harness:t}),(0,x.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,x.jsx)("h3",{className:"font-semibold",children:o("backup.latest")}),n?(0,x.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:o("backup.profile")}),(0,x.jsx)("p",{className:"mt-1 truncate text-sm font-medium",children:n.profile})]}),(0,x.jsxs)("p",{className:"font-mono text-[11px] leading-relaxed text-muted-foreground",children:[new Date(n.createdAt).toLocaleString(r)," \xb7"," ",o("backup.fileCount",{count:n.files.length})]})]}):(0,x.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:o("backup.empty")}),(0,x.jsx)("div",{className:"mt-4 border-t pt-4",children:(0,x.jsx)(aR,{harnessId:t.id})})]})]})})}function St(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Sn(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function Sr(){var e,t=(0,S.Bd)().t,n=aA(function(e){return e.login}),r=aA(function(e){return e.loading}),o=function(e){if(Array.isArray(e))return e}(e=(0,w.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return St(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return St(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o[1];return(0,x.jsxs)("main",{className:"grid min-h-[100dvh] lg:grid-cols-2",children:[(0,x.jsxs)("section",{className:"hidden flex-col justify-between border-r bg-card p-10 lg:flex",children:[(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[(0,x.jsx)(aM,{className:"size-9 ring-1 ring-black/5 dark:ring-white/10"}),(0,x.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:t("app.brandMark")})]}),(0,x.jsxs)("div",{className:"max-w-sm space-y-3",children:[(0,x.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:t("login.title")}),(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:t("login.intro")})]}),(0,x.jsxs)("div",{className:"flex gap-2",children:[(0,x.jsx)(dc,{}),(0,x.jsx)(jP,{})]})]}),(0,x.jsx)("section",{className:"flex items-center justify-center px-4 py-10",children:(0,x.jsxs)("form",{className:"w-full max-w-sm space-y-5",onSubmit:function(e){var t;return(t=function(){var t,r;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:e.preventDefault(),t=new FormData(e.currentTarget),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n(String(null!=(r=t.get("password"))?r:""))];case 2:return o.sent(),[3,4];case 3:return i(oC(o.sent())),[3,4];case 4:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function i(e){Sn(a,r,o,i,l,"next",e)}function l(e){Sn(a,r,o,i,l,"throw",e)}i(void 0)})})()},children:[(0,x.jsxs)("div",{className:"flex items-start justify-between gap-3 lg:hidden",children:[(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(aM,{className:"size-7 ring-1 ring-black/5 dark:ring-white/10"}),(0,x.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:t("app.brandMark")})]}),(0,x.jsx)("h1",{className:"mt-2 text-2xl font-semibold tracking-tight",children:t("login.title")})]}),(0,x.jsxs)("div",{className:"flex gap-2",children:[(0,x.jsx)(dc,{}),(0,x.jsx)(jP,{})]})]}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:t("login.hint")}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iO,{htmlFor:"password",children:t("login.password")}),(0,x.jsx)(cv,{id:"password",name:"password",type:"password",autoFocus:!0,required:!0})]}),a?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oE(t,a)}):null,(0,x.jsx)(tE,{className:"w-full",type:"submit",disabled:r,children:t(r?"login.submitting":"login.submit")})]})})]})}(0,j.createRoot)(document.getElementById("root")).render((0,x.jsx)(w.StrictMode,{children:(0,x.jsx)(S.CY,{children:(0,x.jsx)(function(){var e=(0,S.Bd)().t,t=aA(function(e){return e.sessionChecked}),n=aA(function(e){return e.authenticated}),r=aA(function(e){return e.loadSession});return((0,w.useEffect)(function(){r()},[r]),t)?n?(0,x.jsx)(j9,{}):(0,x.jsx)(Sr,{}):(0,x.jsx)("div",{className:"flex min-h-[100dvh] items-center justify-center text-sm text-muted-foreground",children:e("app.checkingSession")})},{})})}))})()})();
|