@nextclaw/ui 0.5.3 → 0.5.5

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.
@@ -1,332 +0,0 @@
1
- var km=t=>{throw TypeError(t)};var Zu=(t,r,o)=>r.has(t)||km("Cannot "+o);var I=(t,r,o)=>(Zu(t,r,"read from private field"),o?o.call(t):r.get(t)),xe=(t,r,o)=>r.has(t)?km("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,o),ue=(t,r,o,a)=>(Zu(t,r,"write to private field"),a?a.call(t,o):r.set(t,o),o),je=(t,r,o)=>(Zu(t,r,"access private method"),o);var gl=(t,r,o,a)=>({set _(l){ue(t,r,l,o)},get _(){return I(t,r,a)}});function Gw(t,r){for(var o=0;o<r.length;o++){const a=r[o];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in t)){const c=Object.getOwnPropertyDescriptor(a,l);c&&Object.defineProperty(t,l,c.get?c:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function o(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=o(l);fetch(l.href,c)}})();function ey(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ed={exports:{}},Ia={},td={exports:{}},Me={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Em;function Yw(){if(Em)return Me;Em=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.iterator;function C(M){return M===null||typeof M!="object"?null:(M=b&&M[b]||M["@@iterator"],typeof M=="function"?M:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,x={};function k(M,L,ee){this.props=M,this.context=L,this.refs=x,this.updater=ee||w}k.prototype.isReactComponent={},k.prototype.setState=function(M,L){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,L,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function P(){}P.prototype=k.prototype;function j(M,L,ee){this.props=M,this.context=L,this.refs=x,this.updater=ee||w}var N=j.prototype=new P;N.constructor=j,E(N,k.prototype),N.isPureReactComponent=!0;var T=Array.isArray,B=Object.prototype.hasOwnProperty,H={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function Y(M,L,ee){var ie,he={},we=null,ne=null;if(L!=null)for(ie in L.ref!==void 0&&(ne=L.ref),L.key!==void 0&&(we=""+L.key),L)B.call(L,ie)&&!$.hasOwnProperty(ie)&&(he[ie]=L[ie]);var pe=arguments.length-2;if(pe===1)he.children=ee;else if(1<pe){for(var Ce=Array(pe),Ne=0;Ne<pe;Ne++)Ce[Ne]=arguments[Ne+2];he.children=Ce}if(M&&M.defaultProps)for(ie in pe=M.defaultProps,pe)he[ie]===void 0&&(he[ie]=pe[ie]);return{$$typeof:t,type:M,key:we,ref:ne,props:he,_owner:H.current}}function U(M,L){return{$$typeof:t,type:M.type,key:L,ref:M.ref,props:M.props,_owner:M._owner}}function G(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function z(M){var L={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ee){return L[ee]})}var _=/\/+/g;function Q(M,L){return typeof M=="object"&&M!==null&&M.key!=null?z(""+M.key):L.toString(36)}function J(M,L,ee,ie,he){var we=typeof M;(we==="undefined"||we==="boolean")&&(M=null);var ne=!1;if(M===null)ne=!0;else switch(we){case"string":case"number":ne=!0;break;case"object":switch(M.$$typeof){case t:case r:ne=!0}}if(ne)return ne=M,he=he(ne),M=ie===""?"."+Q(ne,0):ie,T(he)?(ee="",M!=null&&(ee=M.replace(_,"$&/")+"/"),J(he,L,ee,"",function(Ne){return Ne})):he!=null&&(G(he)&&(he=U(he,ee+(!he.key||ne&&ne.key===he.key?"":(""+he.key).replace(_,"$&/")+"/")+M)),L.push(he)),1;if(ne=0,ie=ie===""?".":ie+":",T(M))for(var pe=0;pe<M.length;pe++){we=M[pe];var Ce=ie+Q(we,pe);ne+=J(we,L,ee,Ce,he)}else if(Ce=C(M),typeof Ce=="function")for(M=Ce.call(M),pe=0;!(we=M.next()).done;)we=we.value,Ce=ie+Q(we,pe++),ne+=J(we,L,ee,Ce,he);else if(we==="object")throw L=String(M),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return ne}function oe(M,L,ee){if(M==null)return M;var ie=[],he=0;return J(M,ie,"","",function(we){return L.call(ee,we,he++)}),ie}function le(M){if(M._status===-1){var L=M._result;L=L(),L.then(function(ee){(M._status===0||M._status===-1)&&(M._status=1,M._result=ee)},function(ee){(M._status===0||M._status===-1)&&(M._status=2,M._result=ee)}),M._status===-1&&(M._status=0,M._result=L)}if(M._status===1)return M._result.default;throw M._result}var ce={current:null},V={transition:null},q={ReactCurrentDispatcher:ce,ReactCurrentBatchConfig:V,ReactCurrentOwner:H};function K(){throw Error("act(...) is not supported in production builds of React.")}return Me.Children={map:oe,forEach:function(M,L,ee){oe(M,function(){L.apply(this,arguments)},ee)},count:function(M){var L=0;return oe(M,function(){L++}),L},toArray:function(M){return oe(M,function(L){return L})||[]},only:function(M){if(!G(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Me.Component=k,Me.Fragment=o,Me.Profiler=l,Me.PureComponent=j,Me.StrictMode=a,Me.Suspense=g,Me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Me.act=K,Me.cloneElement=function(M,L,ee){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ie=E({},M.props),he=M.key,we=M.ref,ne=M._owner;if(L!=null){if(L.ref!==void 0&&(we=L.ref,ne=H.current),L.key!==void 0&&(he=""+L.key),M.type&&M.type.defaultProps)var pe=M.type.defaultProps;for(Ce in L)B.call(L,Ce)&&!$.hasOwnProperty(Ce)&&(ie[Ce]=L[Ce]===void 0&&pe!==void 0?pe[Ce]:L[Ce])}var Ce=arguments.length-2;if(Ce===1)ie.children=ee;else if(1<Ce){pe=Array(Ce);for(var Ne=0;Ne<Ce;Ne++)pe[Ne]=arguments[Ne+2];ie.children=pe}return{$$typeof:t,type:M.type,key:he,ref:we,props:ie,_owner:ne}},Me.createContext=function(M){return M={$$typeof:f,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:c,_context:M},M.Consumer=M},Me.createElement=Y,Me.createFactory=function(M){var L=Y.bind(null,M);return L.type=M,L},Me.createRef=function(){return{current:null}},Me.forwardRef=function(M){return{$$typeof:h,render:M}},Me.isValidElement=G,Me.lazy=function(M){return{$$typeof:v,_payload:{_status:-1,_result:M},_init:le}},Me.memo=function(M,L){return{$$typeof:y,type:M,compare:L===void 0?null:L}},Me.startTransition=function(M){var L=V.transition;V.transition={};try{M()}finally{V.transition=L}},Me.unstable_act=K,Me.useCallback=function(M,L){return ce.current.useCallback(M,L)},Me.useContext=function(M){return ce.current.useContext(M)},Me.useDebugValue=function(){},Me.useDeferredValue=function(M){return ce.current.useDeferredValue(M)},Me.useEffect=function(M,L){return ce.current.useEffect(M,L)},Me.useId=function(){return ce.current.useId()},Me.useImperativeHandle=function(M,L,ee){return ce.current.useImperativeHandle(M,L,ee)},Me.useInsertionEffect=function(M,L){return ce.current.useInsertionEffect(M,L)},Me.useLayoutEffect=function(M,L){return ce.current.useLayoutEffect(M,L)},Me.useMemo=function(M,L){return ce.current.useMemo(M,L)},Me.useReducer=function(M,L,ee){return ce.current.useReducer(M,L,ee)},Me.useRef=function(M){return ce.current.useRef(M)},Me.useState=function(M){return ce.current.useState(M)},Me.useSyncExternalStore=function(M,L,ee){return ce.current.useSyncExternalStore(M,L,ee)},Me.useTransition=function(){return ce.current.useTransition()},Me.version="18.3.1",Me}var Nm;function rf(){return Nm||(Nm=1,td.exports=Yw()),td.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Pm;function Xw(){if(Pm)return Ia;Pm=1;var t=rf(),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function f(h,g,y){var v,b={},C=null,w=null;y!==void 0&&(C=""+y),g.key!==void 0&&(C=""+g.key),g.ref!==void 0&&(w=g.ref);for(v in g)a.call(g,v)&&!c.hasOwnProperty(v)&&(b[v]=g[v]);if(h&&h.defaultProps)for(v in g=h.defaultProps,g)b[v]===void 0&&(b[v]=g[v]);return{$$typeof:r,type:h,key:C,ref:w,props:b,_owner:l.current}}return Ia.Fragment=o,Ia.jsx=f,Ia.jsxs=f,Ia}var Rm;function Jw(){return Rm||(Rm=1,ed.exports=Xw()),ed.exports}var d=Jw(),m=rf();const ae=ey(m),ty=Gw({__proto__:null,default:ae},[m]);var yl={},nd={exports:{}},zt={},rd={exports:{}},od={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var jm;function Zw(){return jm||(jm=1,(function(t){function r(V,q){var K=V.length;V.push(q);e:for(;0<K;){var M=K-1>>>1,L=V[M];if(0<l(L,q))V[M]=q,V[K]=L,K=M;else break e}}function o(V){return V.length===0?null:V[0]}function a(V){if(V.length===0)return null;var q=V[0],K=V.pop();if(K!==q){V[0]=K;e:for(var M=0,L=V.length,ee=L>>>1;M<ee;){var ie=2*(M+1)-1,he=V[ie],we=ie+1,ne=V[we];if(0>l(he,K))we<L&&0>l(ne,he)?(V[M]=ne,V[we]=K,M=we):(V[M]=he,V[ie]=K,M=ie);else if(we<L&&0>l(ne,K))V[M]=ne,V[we]=K,M=we;else break e}}return q}function l(V,q){var K=V.sortIndex-q.sortIndex;return K!==0?K:V.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var f=Date,h=f.now();t.unstable_now=function(){return f.now()-h}}var g=[],y=[],v=1,b=null,C=3,w=!1,E=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(V){for(var q=o(y);q!==null;){if(q.callback===null)a(y);else if(q.startTime<=V)a(y),q.sortIndex=q.expirationTime,r(g,q);else break;q=o(y)}}function T(V){if(x=!1,N(V),!E)if(o(g)!==null)E=!0,le(B);else{var q=o(y);q!==null&&ce(T,q.startTime-V)}}function B(V,q){E=!1,x&&(x=!1,P(Y),Y=-1),w=!0;var K=C;try{for(N(q),b=o(g);b!==null&&(!(b.expirationTime>q)||V&&!z());){var M=b.callback;if(typeof M=="function"){b.callback=null,C=b.priorityLevel;var L=M(b.expirationTime<=q);q=t.unstable_now(),typeof L=="function"?b.callback=L:b===o(g)&&a(g),N(q)}else a(g);b=o(g)}if(b!==null)var ee=!0;else{var ie=o(y);ie!==null&&ce(T,ie.startTime-q),ee=!1}return ee}finally{b=null,C=K,w=!1}}var H=!1,$=null,Y=-1,U=5,G=-1;function z(){return!(t.unstable_now()-G<U)}function _(){if($!==null){var V=t.unstable_now();G=V;var q=!0;try{q=$(!0,V)}finally{q?Q():(H=!1,$=null)}}else H=!1}var Q;if(typeof j=="function")Q=function(){j(_)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,oe=J.port2;J.port1.onmessage=_,Q=function(){oe.postMessage(null)}}else Q=function(){k(_,0)};function le(V){$=V,H||(H=!0,Q())}function ce(V,q){Y=k(function(){V(t.unstable_now())},q)}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(V){V.callback=null},t.unstable_continueExecution=function(){E||w||(E=!0,le(B))},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return C},t.unstable_getFirstCallbackNode=function(){return o(g)},t.unstable_next=function(V){switch(C){case 1:case 2:case 3:var q=3;break;default:q=C}var K=C;C=q;try{return V()}finally{C=K}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,q){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var K=C;C=V;try{return q()}finally{C=K}},t.unstable_scheduleCallback=function(V,q,K){var M=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?M+K:M):K=M,V){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=K+L,V={id:v++,callback:q,priorityLevel:V,startTime:K,expirationTime:L,sortIndex:-1},K>M?(V.sortIndex=K,r(y,V),o(g)===null&&V===o(y)&&(x?(P(Y),Y=-1):x=!0,ce(T,K-M))):(V.sortIndex=L,r(g,V),E||w||(E=!0,le(B))),V},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(V){var q=C;return function(){var K=C;C=q;try{return V.apply(this,arguments)}finally{C=K}}}})(od)),od}var Tm;function e1(){return Tm||(Tm=1,rd.exports=Zw()),rd.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Mm;function t1(){if(Mm)return zt;Mm=1;var t=rf(),r=e1();function o(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,l={};function c(e,n){f(e,n),f(e+"Capture",n)}function f(e,n){for(l[e]=n,e=0;e<n.length;e++)a.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,y=/^[: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]*$/,v={},b={};function C(e){return g.call(b,e)?!0:g.call(v,e)?!1:y.test(e)?b[e]=!0:(v[e]=!0,!1)}function w(e,n,s,i){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return i?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,n,s,i){if(n===null||typeof n>"u"||w(e,n,s,i))return!0;if(i)return!1;if(s!==null)switch(s.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function x(e,n,s,i,u,p,S){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=s,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=S}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){k[e]=new x(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];k[n]=new x(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){k[e]=new x(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){k[e]=new x(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){k[e]=new x(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){k[e]=new x(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){k[e]=new x(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){k[e]=new x(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){k[e]=new x(e,5,!1,e.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function j(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(P,j);k[n]=new x(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(P,j);k[n]=new x(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(P,j);k[n]=new x(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){k[e]=new x(e,1,!1,e.toLowerCase(),null,!1,!1)}),k.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){k[e]=new x(e,1,!1,e.toLowerCase(),null,!0,!0)});function N(e,n,s,i){var u=k.hasOwnProperty(n)?k[n]:null;(u!==null?u.type!==0:i||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(E(n,s,u,i)&&(s=null),i||u===null?C(n)&&(s===null?e.removeAttribute(n):e.setAttribute(n,""+s)):u.mustUseProperty?e[u.propertyName]=s===null?u.type===3?!1:"":s:(n=u.attributeName,i=u.attributeNamespace,s===null?e.removeAttribute(n):(u=u.type,s=u===3||u===4&&s===!0?"":""+s,i?e.setAttributeNS(i,n,s):e.setAttribute(n,s))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),H=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),G=Symbol.for("react.provider"),z=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),ce=Symbol.for("react.offscreen"),V=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var K=Object.assign,M;function L(e){if(M===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);M=n&&n[1]||""}return`
34
- `+M+e}var ee=!1;function ie(e,n){if(!e||ee)return"";ee=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(W){var i=W}Reflect.construct(e,[],n)}else{try{n.call()}catch(W){i=W}e.call(n.prototype)}else{try{throw Error()}catch(W){i=W}e()}}catch(W){if(W&&i&&typeof W.stack=="string"){for(var u=W.stack.split(`
35
- `),p=i.stack.split(`
36
- `),S=u.length-1,R=p.length-1;1<=S&&0<=R&&u[S]!==p[R];)R--;for(;1<=S&&0<=R;S--,R--)if(u[S]!==p[R]){if(S!==1||R!==1)do if(S--,R--,0>R||u[S]!==p[R]){var O=`
37
- `+u[S].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),O}while(1<=S&&0<=R);break}}}finally{ee=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?L(e):""}function he(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return""}}function we(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $:return"Fragment";case H:return"Portal";case U:return"Profiler";case Y:return"StrictMode";case Q:return"Suspense";case J:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case z:return(e.displayName||"Context")+".Consumer";case G:return(e._context.displayName||"Context")+".Provider";case _:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oe:return n=e.displayName||null,n!==null?n:we(e.type)||"Memo";case le:n=e._payload,e=e._init;try{return we(e(n))}catch{}}return null}function ne(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return we(n);case 8:return n===Y?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function pe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ce(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ne(e){var n=Ce(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),i=""+e[n];if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,p=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(S){i=""+S,p.call(this,S)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Te(e){e._valueTracker||(e._valueTracker=Ne(e))}function Ie(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),i="";return e&&(i=Ce(e)?e.checked?"true":"false":e.value),e=i,e!==s?(n.setValue(e),!0):!1}function tt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yt(e,n){var s=n.checked;return K({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Nn(e,n){var s=n.defaultValue==null?"":n.defaultValue,i=n.checked!=null?n.checked:n.defaultChecked;s=pe(n.value!=null?n.value:s),e._wrapperState={initialChecked:i,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function sn(e,n){n=n.checked,n!=null&&N(e,"checked",n,!1)}function an(e,n){sn(e,n);var s=pe(n.value),i=n.type;if(s!=null)i==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Pn(e,n.type,s):n.hasOwnProperty("defaultValue")&&Pn(e,n.type,pe(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function xr(e,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var i=n.type;if(!(i!=="submit"&&i!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,s||n===e.value||(e.value=n),e.defaultValue=n}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Pn(e,n,s){(n!=="number"||tt(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var wr=Array.isArray;function Gt(e,n,s,i){if(e=e.options,n){n={};for(var u=0;u<s.length;u++)n["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=n.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+pe(s),n=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function Bo(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(o(91));return K({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Rn(e,n){var s=n.value;if(s==null){if(s=n.children,n=n.defaultValue,s!=null){if(n!=null)throw Error(o(92));if(wr(s)){if(1<s.length)throw Error(o(93));s=s[0]}n=s}n==null&&(n=""),s=n}e._wrapperState={initialValue:pe(s)}}function ri(e,n){var s=pe(n.value),i=pe(n.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),n.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),i!=null&&(e.defaultValue=""+i)}function oi(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Et(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jn(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Et(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var $o,si=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,s,i,u){MSApp.execUnsafeLocalFunction(function(){return e(n,s,i,u)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for($o=$o||document.createElement("div"),$o.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=$o.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Tn(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var so={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ai=["Webkit","ms","Moz","O"];Object.keys(so).forEach(function(e){ai.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),so[n]=so[e]})});function Wo(e,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||so.hasOwnProperty(e)&&so[e]?(""+n).trim():n+"px"}function Gn(e,n){e=e.style;for(var s in n)if(n.hasOwnProperty(s)){var i=s.indexOf("--")===0,u=Wo(s,n[s],i);s==="float"&&(s="cssFloat"),i?e.setProperty(s,u):e[s]=u}}var ii=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mn(e,n){if(n){if(ii[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(o(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(o(61))}if(n.style!=null&&typeof n.style!="object")throw Error(o(62))}}function Ys(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";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 Xs=null;function Ho(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vo=null,br=null,In=null;function ln(e){if(e=ya(e)){if(typeof Vo!="function")throw Error(o(280));var n=e.stateNode;n&&(n=Mi(n),Vo(e.stateNode,e.type,n))}}function li(e){br?In?In.push(e):In=[e]:br=e}function Ee(){if(br){var e=br,n=In;if(In=br=null,ln(e),n)for(e=0;e<n.length;e++)ln(n[e])}}function _e(e,n){return e(n)}function Ue(){}var Nt=!1;function Mt(e,n,s){if(Nt)return e(n,s);Nt=!0;try{return _e(e,n,s)}finally{Nt=!1,(br!==null||In!==null)&&(Ue(),Ee())}}function It(e,n){var s=e.stateNode;if(s===null)return null;var i=Mi(s);if(i===null)return null;s=i[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,n,typeof s));return s}var cn=!1;if(h)try{var ht={};Object.defineProperty(ht,"passive",{get:function(){cn=!0}}),window.addEventListener("test",ht,ht),window.removeEventListener("test",ht,ht)}catch{cn=!1}function On(e,n,s,i,u,p,S,R,O){var W=Array.prototype.slice.call(arguments,3);try{n.apply(s,W)}catch(te){this.onError(te)}}var Js=!1,ci=null,ui=!1,vc=null,nx={onError:function(e){Js=!0,ci=e}};function rx(e,n,s,i,u,p,S,R,O){Js=!1,ci=null,On.apply(nx,arguments)}function ox(e,n,s,i,u,p,S,R,O){if(rx.apply(this,arguments),Js){if(Js){var W=ci;Js=!1,ci=null}else throw Error(o(198));ui||(ui=!0,vc=W)}}function ao(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function Qf(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function qf(e){if(ao(e)!==e)throw Error(o(188))}function sx(e){var n=e.alternate;if(!n){if(n=ao(e),n===null)throw Error(o(188));return n!==e?null:e}for(var s=e,i=n;;){var u=s.return;if(u===null)break;var p=u.alternate;if(p===null){if(i=u.return,i!==null){s=i;continue}break}if(u.child===p.child){for(p=u.child;p;){if(p===s)return qf(u),e;if(p===i)return qf(u),n;p=p.sibling}throw Error(o(188))}if(s.return!==i.return)s=u,i=p;else{for(var S=!1,R=u.child;R;){if(R===s){S=!0,s=u,i=p;break}if(R===i){S=!0,i=u,s=p;break}R=R.sibling}if(!S){for(R=p.child;R;){if(R===s){S=!0,s=p,i=u;break}if(R===i){S=!0,i=p,s=u;break}R=R.sibling}if(!S)throw Error(o(189))}}if(s.alternate!==i)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:n}function Gf(e){return e=sx(e),e!==null?Yf(e):null}function Yf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=Yf(e);if(n!==null)return n;e=e.sibling}return null}var Xf=r.unstable_scheduleCallback,Jf=r.unstable_cancelCallback,ax=r.unstable_shouldYield,ix=r.unstable_requestPaint,nt=r.unstable_now,lx=r.unstable_getCurrentPriorityLevel,xc=r.unstable_ImmediatePriority,Zf=r.unstable_UserBlockingPriority,di=r.unstable_NormalPriority,cx=r.unstable_LowPriority,eh=r.unstable_IdlePriority,fi=null,An=null;function ux(e){if(An&&typeof An.onCommitFiberRoot=="function")try{An.onCommitFiberRoot(fi,e,void 0,(e.current.flags&128)===128)}catch{}}var un=Math.clz32?Math.clz32:hx,dx=Math.log,fx=Math.LN2;function hx(e){return e>>>=0,e===0?32:31-(dx(e)/fx|0)|0}var hi=64,pi=4194304;function Zs(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function mi(e,n){var s=e.pendingLanes;if(s===0)return 0;var i=0,u=e.suspendedLanes,p=e.pingedLanes,S=s&268435455;if(S!==0){var R=S&~u;R!==0?i=Zs(R):(p&=S,p!==0&&(i=Zs(p)))}else S=s&~u,S!==0?i=Zs(S):p!==0&&(i=Zs(p));if(i===0)return 0;if(n!==0&&n!==i&&(n&u)===0&&(u=i&-i,p=n&-n,u>=p||u===16&&(p&4194240)!==0))return n;if((i&4)!==0&&(i|=s&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=i;0<n;)s=31-un(n),u=1<<s,i|=e[s],n&=~u;return i}function px(e,n){switch(e){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mx(e,n){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,p=e.pendingLanes;0<p;){var S=31-un(p),R=1<<S,O=u[S];O===-1?((R&s)===0||(R&i)!==0)&&(u[S]=px(R,n)):O<=n&&(e.expiredLanes|=R),p&=~R}}function wc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function th(){var e=hi;return hi<<=1,(hi&4194240)===0&&(hi=64),e}function bc(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function ea(e,n,s){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-un(n),e[n]=s}function gx(e,n){var s=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<s;){var u=31-un(s),p=1<<u;n[u]=0,i[u]=-1,e[u]=-1,s&=~p}}function Sc(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var i=31-un(s),u=1<<i;u&n|e[i]&n&&(e[i]|=n),s&=~u}}var Fe=0;function nh(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var rh,Cc,oh,sh,ah,kc=!1,gi=[],Sr=null,Cr=null,kr=null,ta=new Map,na=new Map,Er=[],yx="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 submit".split(" ");function ih(e,n){switch(e){case"focusin":case"focusout":Sr=null;break;case"dragenter":case"dragleave":Cr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":ta.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":na.delete(n.pointerId)}}function ra(e,n,s,i,u,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:s,eventSystemFlags:i,nativeEvent:p,targetContainers:[u]},n!==null&&(n=ya(n),n!==null&&Cc(n)),e):(e.eventSystemFlags|=i,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function vx(e,n,s,i,u){switch(n){case"focusin":return Sr=ra(Sr,e,n,s,i,u),!0;case"dragenter":return Cr=ra(Cr,e,n,s,i,u),!0;case"mouseover":return kr=ra(kr,e,n,s,i,u),!0;case"pointerover":var p=u.pointerId;return ta.set(p,ra(ta.get(p)||null,e,n,s,i,u)),!0;case"gotpointercapture":return p=u.pointerId,na.set(p,ra(na.get(p)||null,e,n,s,i,u)),!0}return!1}function lh(e){var n=io(e.target);if(n!==null){var s=ao(n);if(s!==null){if(n=s.tag,n===13){if(n=Qf(s),n!==null){e.blockedOn=n,ah(e.priority,function(){oh(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function yi(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=Nc(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);Xs=i,s.target.dispatchEvent(i),Xs=null}else return n=ya(s),n!==null&&Cc(n),e.blockedOn=s,!1;n.shift()}return!0}function ch(e,n,s){yi(e)&&s.delete(n)}function xx(){kc=!1,Sr!==null&&yi(Sr)&&(Sr=null),Cr!==null&&yi(Cr)&&(Cr=null),kr!==null&&yi(kr)&&(kr=null),ta.forEach(ch),na.forEach(ch)}function oa(e,n){e.blockedOn===n&&(e.blockedOn=null,kc||(kc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,xx)))}function sa(e){function n(u){return oa(u,e)}if(0<gi.length){oa(gi[0],e);for(var s=1;s<gi.length;s++){var i=gi[s];i.blockedOn===e&&(i.blockedOn=null)}}for(Sr!==null&&oa(Sr,e),Cr!==null&&oa(Cr,e),kr!==null&&oa(kr,e),ta.forEach(n),na.forEach(n),s=0;s<Er.length;s++)i=Er[s],i.blockedOn===e&&(i.blockedOn=null);for(;0<Er.length&&(s=Er[0],s.blockedOn===null);)lh(s),s.blockedOn===null&&Er.shift()}var Ko=T.ReactCurrentBatchConfig,vi=!0;function wx(e,n,s,i){var u=Fe,p=Ko.transition;Ko.transition=null;try{Fe=1,Ec(e,n,s,i)}finally{Fe=u,Ko.transition=p}}function bx(e,n,s,i){var u=Fe,p=Ko.transition;Ko.transition=null;try{Fe=4,Ec(e,n,s,i)}finally{Fe=u,Ko.transition=p}}function Ec(e,n,s,i){if(vi){var u=Nc(e,n,s,i);if(u===null)Wc(e,n,i,xi,s),ih(e,i);else if(vx(u,e,n,s,i))i.stopPropagation();else if(ih(e,i),n&4&&-1<yx.indexOf(e)){for(;u!==null;){var p=ya(u);if(p!==null&&rh(p),p=Nc(e,n,s,i),p===null&&Wc(e,n,i,xi,s),p===u)break;u=p}u!==null&&i.stopPropagation()}else Wc(e,n,i,null,s)}}var xi=null;function Nc(e,n,s,i){if(xi=null,e=Ho(i),e=io(e),e!==null)if(n=ao(e),n===null)e=null;else if(s=n.tag,s===13){if(e=Qf(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return xi=e,null}function uh(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(lx()){case xc:return 1;case Zf:return 4;case di:case cx:return 16;case eh:return 536870912;default:return 16}default:return 16}}var Nr=null,Pc=null,wi=null;function dh(){if(wi)return wi;var e,n=Pc,s=n.length,i,u="value"in Nr?Nr.value:Nr.textContent,p=u.length;for(e=0;e<s&&n[e]===u[e];e++);var S=s-e;for(i=1;i<=S&&n[s-i]===u[p-i];i++);return wi=u.slice(e,1<i?1-i:void 0)}function bi(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Si(){return!0}function fh(){return!1}function $t(e){function n(s,i,u,p,S){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=p,this.target=S,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(s=e[R],this[R]=s?s(p):p[R]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Si:fh,this.isPropagationStopped=fh,this}return K(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Si)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Si)},persist:function(){},isPersistent:Si}),n}var Qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rc=$t(Qo),aa=K({},Qo,{view:0,detail:0}),Sx=$t(aa),jc,Tc,ia,Ci=K({},aa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ic,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ia&&(ia&&e.type==="mousemove"?(jc=e.screenX-ia.screenX,Tc=e.screenY-ia.screenY):Tc=jc=0,ia=e),jc)},movementY:function(e){return"movementY"in e?e.movementY:Tc}}),hh=$t(Ci),Cx=K({},Ci,{dataTransfer:0}),kx=$t(Cx),Ex=K({},aa,{relatedTarget:0}),Mc=$t(Ex),Nx=K({},Qo,{animationName:0,elapsedTime:0,pseudoElement:0}),Px=$t(Nx),Rx=K({},Qo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jx=$t(Rx),Tx=K({},Qo,{data:0}),ph=$t(Tx),Mx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ix={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"},Ox={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ax(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Ox[e])?!!n[e]:!1}function Ic(){return Ax}var Lx=K({},aa,{key:function(e){if(e.key){var n=Mx[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=bi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ix[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ic,charCode:function(e){return e.type==="keypress"?bi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_x=$t(Lx),Dx=K({},Ci,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mh=$t(Dx),zx=K({},aa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ic}),Fx=$t(zx),Ux=K({},Qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bx=$t(Ux),$x=K({},Ci,{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}),Wx=$t($x),Hx=[9,13,27,32],Oc=h&&"CompositionEvent"in window,la=null;h&&"documentMode"in document&&(la=document.documentMode);var Vx=h&&"TextEvent"in window&&!la,gh=h&&(!Oc||la&&8<la&&11>=la),yh=" ",vh=!1;function xh(e,n){switch(e){case"keyup":return Hx.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qo=!1;function Kx(e,n){switch(e){case"compositionend":return wh(n);case"keypress":return n.which!==32?null:(vh=!0,yh);case"textInput":return e=n.data,e===yh&&vh?null:e;default:return null}}function Qx(e,n){if(qo)return e==="compositionend"||!Oc&&xh(e,n)?(e=dh(),wi=Pc=Nr=null,qo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return gh&&n.locale!=="ko"?null:n.data;default:return null}}var qx={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 bh(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!qx[e.type]:n==="textarea"}function Sh(e,n,s,i){li(i),n=Ri(n,"onChange"),0<n.length&&(s=new Rc("onChange","change",null,s,i),e.push({event:s,listeners:n}))}var ca=null,ua=null;function Gx(e){Uh(e,0)}function ki(e){var n=Zo(e);if(Ie(n))return e}function Yx(e,n){if(e==="change")return n}var Ch=!1;if(h){var Ac;if(h){var Lc="oninput"in document;if(!Lc){var kh=document.createElement("div");kh.setAttribute("oninput","return;"),Lc=typeof kh.oninput=="function"}Ac=Lc}else Ac=!1;Ch=Ac&&(!document.documentMode||9<document.documentMode)}function Eh(){ca&&(ca.detachEvent("onpropertychange",Nh),ua=ca=null)}function Nh(e){if(e.propertyName==="value"&&ki(ua)){var n=[];Sh(n,ua,e,Ho(e)),Mt(Gx,n)}}function Xx(e,n,s){e==="focusin"?(Eh(),ca=n,ua=s,ca.attachEvent("onpropertychange",Nh)):e==="focusout"&&Eh()}function Jx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ki(ua)}function Zx(e,n){if(e==="click")return ki(n)}function ew(e,n){if(e==="input"||e==="change")return ki(n)}function tw(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var dn=typeof Object.is=="function"?Object.is:tw;function da(e,n){if(dn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),i=Object.keys(n);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!g.call(n,u)||!dn(e[u],n[u]))return!1}return!0}function Ph(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rh(e,n){var s=Ph(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=n&&i>=n)return{node:s,offset:n-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ph(s)}}function jh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?jh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Th(){for(var e=window,n=tt();n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=tt(e.document)}return n}function _c(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function nw(e){var n=Th(),s=e.focusedElem,i=e.selectionRange;if(n!==s&&s&&s.ownerDocument&&jh(s.ownerDocument.documentElement,s)){if(i!==null&&_c(s)){if(n=i.start,e=i.end,e===void 0&&(e=n),"selectionStart"in s)s.selectionStart=n,s.selectionEnd=Math.min(e,s.value.length);else if(e=(n=s.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var u=s.textContent.length,p=Math.min(i.start,u);i=i.end===void 0?p:Math.min(i.end,u),!e.extend&&p>i&&(u=i,i=p,p=u),u=Rh(s,p);var S=Rh(s,i);u&&S&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==S.node||e.focusOffset!==S.offset)&&(n=n.createRange(),n.setStart(u.node,u.offset),e.removeAllRanges(),p>i?(e.addRange(n),e.extend(S.node,S.offset)):(n.setEnd(S.node,S.offset),e.addRange(n)))}}for(n=[],e=s;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<n.length;s++)e=n[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var rw=h&&"documentMode"in document&&11>=document.documentMode,Go=null,Dc=null,fa=null,zc=!1;function Mh(e,n,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;zc||Go==null||Go!==tt(i)||(i=Go,"selectionStart"in i&&_c(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),fa&&da(fa,i)||(fa=i,i=Ri(Dc,"onSelect"),0<i.length&&(n=new Rc("onSelect","select",null,n,s),e.push({event:n,listeners:i}),n.target=Go)))}function Ei(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var Yo={animationend:Ei("Animation","AnimationEnd"),animationiteration:Ei("Animation","AnimationIteration"),animationstart:Ei("Animation","AnimationStart"),transitionend:Ei("Transition","TransitionEnd")},Fc={},Ih={};h&&(Ih=document.createElement("div").style,"AnimationEvent"in window||(delete Yo.animationend.animation,delete Yo.animationiteration.animation,delete Yo.animationstart.animation),"TransitionEvent"in window||delete Yo.transitionend.transition);function Ni(e){if(Fc[e])return Fc[e];if(!Yo[e])return e;var n=Yo[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in Ih)return Fc[e]=n[s];return e}var Oh=Ni("animationend"),Ah=Ni("animationiteration"),Lh=Ni("animationstart"),_h=Ni("transitionend"),Dh=new Map,zh="abort auxClick 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 Pr(e,n){Dh.set(e,n),c(n,[e])}for(var Uc=0;Uc<zh.length;Uc++){var Bc=zh[Uc],ow=Bc.toLowerCase(),sw=Bc[0].toUpperCase()+Bc.slice(1);Pr(ow,"on"+sw)}Pr(Oh,"onAnimationEnd"),Pr(Ah,"onAnimationIteration"),Pr(Lh,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(_h,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ha="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(" "),aw=new Set("cancel close invalid load scroll toggle".split(" ").concat(ha));function Fh(e,n,s){var i=e.type||"unknown-event";e.currentTarget=s,ox(i,n,void 0,e),e.currentTarget=null}function Uh(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var p=void 0;if(n)for(var S=i.length-1;0<=S;S--){var R=i[S],O=R.instance,W=R.currentTarget;if(R=R.listener,O!==p&&u.isPropagationStopped())break e;Fh(u,R,W),p=O}else for(S=0;S<i.length;S++){if(R=i[S],O=R.instance,W=R.currentTarget,R=R.listener,O!==p&&u.isPropagationStopped())break e;Fh(u,R,W),p=O}}}if(ui)throw e=vc,ui=!1,vc=null,e}function We(e,n){var s=n[Gc];s===void 0&&(s=n[Gc]=new Set);var i=e+"__bubble";s.has(i)||(Bh(n,e,2,!1),s.add(i))}function $c(e,n,s){var i=0;n&&(i|=4),Bh(s,e,i,n)}var Pi="_reactListening"+Math.random().toString(36).slice(2);function pa(e){if(!e[Pi]){e[Pi]=!0,a.forEach(function(s){s!=="selectionchange"&&(aw.has(s)||$c(s,!1,e),$c(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Pi]||(n[Pi]=!0,$c("selectionchange",!1,n))}}function Bh(e,n,s,i){switch(uh(n)){case 1:var u=wx;break;case 4:u=bx;break;default:u=Ec}s=u.bind(null,n,s,e),u=void 0,!cn||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(n,s,{capture:!0,passive:u}):e.addEventListener(n,s,!0):u!==void 0?e.addEventListener(n,s,{passive:u}):e.addEventListener(n,s,!1)}function Wc(e,n,s,i,u){var p=i;if((n&1)===0&&(n&2)===0&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var R=i.stateNode.containerInfo;if(R===u||R.nodeType===8&&R.parentNode===u)break;if(S===4)for(S=i.return;S!==null;){var O=S.tag;if((O===3||O===4)&&(O=S.stateNode.containerInfo,O===u||O.nodeType===8&&O.parentNode===u))return;S=S.return}for(;R!==null;){if(S=io(R),S===null)return;if(O=S.tag,O===5||O===6){i=p=S;continue e}R=R.parentNode}}i=i.return}Mt(function(){var W=p,te=Ho(s),re=[];e:{var Z=Dh.get(e);if(Z!==void 0){var de=Rc,me=e;switch(e){case"keypress":if(bi(s)===0)break e;case"keydown":case"keyup":de=_x;break;case"focusin":me="focus",de=Mc;break;case"focusout":me="blur",de=Mc;break;case"beforeblur":case"afterblur":de=Mc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=hh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=kx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=Fx;break;case Oh:case Ah:case Lh:de=Px;break;case _h:de=Bx;break;case"scroll":de=Sx;break;case"wheel":de=Wx;break;case"copy":case"cut":case"paste":de=jx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=mh}var ge=(n&4)!==0,rt=!ge&&e==="scroll",D=ge?Z!==null?Z+"Capture":null:Z;ge=[];for(var A=W,F;A!==null;){F=A;var se=F.stateNode;if(F.tag===5&&se!==null&&(F=se,D!==null&&(se=It(A,D),se!=null&&ge.push(ma(A,se,F)))),rt)break;A=A.return}0<ge.length&&(Z=new de(Z,me,null,s,te),re.push({event:Z,listeners:ge}))}}if((n&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",de=e==="mouseout"||e==="pointerout",Z&&s!==Xs&&(me=s.relatedTarget||s.fromElement)&&(io(me)||me[Yn]))break e;if((de||Z)&&(Z=te.window===te?te:(Z=te.ownerDocument)?Z.defaultView||Z.parentWindow:window,de?(me=s.relatedTarget||s.toElement,de=W,me=me?io(me):null,me!==null&&(rt=ao(me),me!==rt||me.tag!==5&&me.tag!==6)&&(me=null)):(de=null,me=W),de!==me)){if(ge=hh,se="onMouseLeave",D="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(ge=mh,se="onPointerLeave",D="onPointerEnter",A="pointer"),rt=de==null?Z:Zo(de),F=me==null?Z:Zo(me),Z=new ge(se,A+"leave",de,s,te),Z.target=rt,Z.relatedTarget=F,se=null,io(te)===W&&(ge=new ge(D,A+"enter",me,s,te),ge.target=F,ge.relatedTarget=rt,se=ge),rt=se,de&&me)t:{for(ge=de,D=me,A=0,F=ge;F;F=Xo(F))A++;for(F=0,se=D;se;se=Xo(se))F++;for(;0<A-F;)ge=Xo(ge),A--;for(;0<F-A;)D=Xo(D),F--;for(;A--;){if(ge===D||D!==null&&ge===D.alternate)break t;ge=Xo(ge),D=Xo(D)}ge=null}else ge=null;de!==null&&$h(re,Z,de,ge,!1),me!==null&&rt!==null&&$h(re,rt,me,ge,!0)}}e:{if(Z=W?Zo(W):window,de=Z.nodeName&&Z.nodeName.toLowerCase(),de==="select"||de==="input"&&Z.type==="file")var ye=Yx;else if(bh(Z))if(Ch)ye=ew;else{ye=Jx;var be=Xx}else(de=Z.nodeName)&&de.toLowerCase()==="input"&&(Z.type==="checkbox"||Z.type==="radio")&&(ye=Zx);if(ye&&(ye=ye(e,W))){Sh(re,ye,s,te);break e}be&&be(e,Z,W),e==="focusout"&&(be=Z._wrapperState)&&be.controlled&&Z.type==="number"&&Pn(Z,"number",Z.value)}switch(be=W?Zo(W):window,e){case"focusin":(bh(be)||be.contentEditable==="true")&&(Go=be,Dc=W,fa=null);break;case"focusout":fa=Dc=Go=null;break;case"mousedown":zc=!0;break;case"contextmenu":case"mouseup":case"dragend":zc=!1,Mh(re,s,te);break;case"selectionchange":if(rw)break;case"keydown":case"keyup":Mh(re,s,te)}var Se;if(Oc)e:{switch(e){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else qo?xh(e,s)&&(ke="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ke="onCompositionStart");ke&&(gh&&s.locale!=="ko"&&(qo||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&qo&&(Se=dh()):(Nr=te,Pc="value"in Nr?Nr.value:Nr.textContent,qo=!0)),be=Ri(W,ke),0<be.length&&(ke=new ph(ke,e,null,s,te),re.push({event:ke,listeners:be}),Se?ke.data=Se:(Se=wh(s),Se!==null&&(ke.data=Se)))),(Se=Vx?Kx(e,s):Qx(e,s))&&(W=Ri(W,"onBeforeInput"),0<W.length&&(te=new ph("onBeforeInput","beforeinput",null,s,te),re.push({event:te,listeners:W}),te.data=Se))}Uh(re,n)})}function ma(e,n,s){return{instance:e,listener:n,currentTarget:s}}function Ri(e,n){for(var s=n+"Capture",i=[];e!==null;){var u=e,p=u.stateNode;u.tag===5&&p!==null&&(u=p,p=It(e,s),p!=null&&i.unshift(ma(e,p,u)),p=It(e,n),p!=null&&i.push(ma(e,p,u))),e=e.return}return i}function Xo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $h(e,n,s,i,u){for(var p=n._reactName,S=[];s!==null&&s!==i;){var R=s,O=R.alternate,W=R.stateNode;if(O!==null&&O===i)break;R.tag===5&&W!==null&&(R=W,u?(O=It(s,p),O!=null&&S.unshift(ma(s,O,R))):u||(O=It(s,p),O!=null&&S.push(ma(s,O,R)))),s=s.return}S.length!==0&&e.push({event:n,listeners:S})}var iw=/\r\n?/g,lw=/\u0000|\uFFFD/g;function Wh(e){return(typeof e=="string"?e:""+e).replace(iw,`
38
- `).replace(lw,"")}function ji(e,n,s){if(n=Wh(n),Wh(e)!==n&&s)throw Error(o(425))}function Ti(){}var Hc=null,Vc=null;function Kc(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Qc=typeof setTimeout=="function"?setTimeout:void 0,cw=typeof clearTimeout=="function"?clearTimeout:void 0,Hh=typeof Promise=="function"?Promise:void 0,uw=typeof queueMicrotask=="function"?queueMicrotask:typeof Hh<"u"?function(e){return Hh.resolve(null).then(e).catch(dw)}:Qc;function dw(e){setTimeout(function(){throw e})}function qc(e,n){var s=n,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"){if(i===0){e.removeChild(u),sa(n);return}i--}else s!=="$"&&s!=="$?"&&s!=="$!"||i++;s=u}while(s);sa(n)}function Rr(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Vh(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return e;n--}else s==="/$"&&n++}e=e.previousSibling}return null}var Jo=Math.random().toString(36).slice(2),Ln="__reactFiber$"+Jo,ga="__reactProps$"+Jo,Yn="__reactContainer$"+Jo,Gc="__reactEvents$"+Jo,fw="__reactListeners$"+Jo,hw="__reactHandles$"+Jo;function io(e){var n=e[Ln];if(n)return n;for(var s=e.parentNode;s;){if(n=s[Yn]||s[Ln]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Vh(e);e!==null;){if(s=e[Ln])return s;e=Vh(e)}return n}e=s,s=e.parentNode}return null}function ya(e){return e=e[Ln]||e[Yn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Zo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function Mi(e){return e[ga]||null}var Yc=[],es=-1;function jr(e){return{current:e}}function He(e){0>es||(e.current=Yc[es],Yc[es]=null,es--)}function $e(e,n){es++,Yc[es]=e.current,e.current=n}var Tr={},vt=jr(Tr),Ot=jr(!1),lo=Tr;function ts(e,n){var s=e.type.contextTypes;if(!s)return Tr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===n)return i.__reactInternalMemoizedMaskedChildContext;var u={},p;for(p in s)u[p]=n[p];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=u),u}function At(e){return e=e.childContextTypes,e!=null}function Ii(){He(Ot),He(vt)}function Kh(e,n,s){if(vt.current!==Tr)throw Error(o(168));$e(vt,n),$e(Ot,s)}function Qh(e,n,s){var i=e.stateNode;if(n=n.childContextTypes,typeof i.getChildContext!="function")return s;i=i.getChildContext();for(var u in i)if(!(u in n))throw Error(o(108,ne(e)||"Unknown",u));return K({},s,i)}function Oi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Tr,lo=vt.current,$e(vt,e),$e(Ot,Ot.current),!0}function qh(e,n,s){var i=e.stateNode;if(!i)throw Error(o(169));s?(e=Qh(e,n,lo),i.__reactInternalMemoizedMergedChildContext=e,He(Ot),He(vt),$e(vt,e)):He(Ot),$e(Ot,s)}var Xn=null,Ai=!1,Xc=!1;function Gh(e){Xn===null?Xn=[e]:Xn.push(e)}function pw(e){Ai=!0,Gh(e)}function Mr(){if(!Xc&&Xn!==null){Xc=!0;var e=0,n=Fe;try{var s=Xn;for(Fe=1;e<s.length;e++){var i=s[e];do i=i(!0);while(i!==null)}Xn=null,Ai=!1}catch(u){throw Xn!==null&&(Xn=Xn.slice(e+1)),Xf(xc,Mr),u}finally{Fe=n,Xc=!1}}return null}var ns=[],rs=0,Li=null,_i=0,Yt=[],Xt=0,co=null,Jn=1,Zn="";function uo(e,n){ns[rs++]=_i,ns[rs++]=Li,Li=e,_i=n}function Yh(e,n,s){Yt[Xt++]=Jn,Yt[Xt++]=Zn,Yt[Xt++]=co,co=e;var i=Jn;e=Zn;var u=32-un(i)-1;i&=~(1<<u),s+=1;var p=32-un(n)+u;if(30<p){var S=u-u%5;p=(i&(1<<S)-1).toString(32),i>>=S,u-=S,Jn=1<<32-un(n)+u|s<<u|i,Zn=p+e}else Jn=1<<p|s<<u|i,Zn=e}function Jc(e){e.return!==null&&(uo(e,1),Yh(e,1,0))}function Zc(e){for(;e===Li;)Li=ns[--rs],ns[rs]=null,_i=ns[--rs],ns[rs]=null;for(;e===co;)co=Yt[--Xt],Yt[Xt]=null,Zn=Yt[--Xt],Yt[Xt]=null,Jn=Yt[--Xt],Yt[Xt]=null}var Wt=null,Ht=null,Qe=!1,fn=null;function Xh(e,n){var s=tn(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=e,n=e.deletions,n===null?(e.deletions=[s],e.flags|=16):n.push(s)}function Jh(e,n){switch(e.tag){case 5:var s=e.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Wt=e,Ht=Rr(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Wt=e,Ht=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=co!==null?{id:Jn,overflow:Zn}:null,e.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=tn(18,null,null,0),s.stateNode=n,s.return=e,e.child=s,Wt=e,Ht=null,!0):!1;default:return!1}}function eu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function tu(e){if(Qe){var n=Ht;if(n){var s=n;if(!Jh(e,n)){if(eu(e))throw Error(o(418));n=Rr(s.nextSibling);var i=Wt;n&&Jh(e,n)?Xh(i,s):(e.flags=e.flags&-4097|2,Qe=!1,Wt=e)}}else{if(eu(e))throw Error(o(418));e.flags=e.flags&-4097|2,Qe=!1,Wt=e}}}function Zh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wt=e}function Di(e){if(e!==Wt)return!1;if(!Qe)return Zh(e),Qe=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Kc(e.type,e.memoizedProps)),n&&(n=Ht)){if(eu(e))throw ep(),Error(o(418));for(;n;)Xh(e,n),n=Rr(n.nextSibling)}if(Zh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(n===0){Ht=Rr(e.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++}e=e.nextSibling}Ht=null}}else Ht=Wt?Rr(e.stateNode.nextSibling):null;return!0}function ep(){for(var e=Ht;e;)e=Rr(e.nextSibling)}function os(){Ht=Wt=null,Qe=!1}function nu(e){fn===null?fn=[e]:fn.push(e)}var mw=T.ReactCurrentBatchConfig;function va(e,n,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(o(309));var i=s.stateNode}if(!i)throw Error(o(147,e));var u=i,p=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===p?n.ref:(n=function(S){var R=u.refs;S===null?delete R[p]:R[p]=S},n._stringRef=p,n)}if(typeof e!="string")throw Error(o(284));if(!s._owner)throw Error(o(290,e))}return e}function zi(e,n){throw e=Object.prototype.toString.call(n),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function tp(e){var n=e._init;return n(e._payload)}function np(e){function n(D,A){if(e){var F=D.deletions;F===null?(D.deletions=[A],D.flags|=16):F.push(A)}}function s(D,A){if(!e)return null;for(;A!==null;)n(D,A),A=A.sibling;return null}function i(D,A){for(D=new Map;A!==null;)A.key!==null?D.set(A.key,A):D.set(A.index,A),A=A.sibling;return D}function u(D,A){return D=Fr(D,A),D.index=0,D.sibling=null,D}function p(D,A,F){return D.index=F,e?(F=D.alternate,F!==null?(F=F.index,F<A?(D.flags|=2,A):F):(D.flags|=2,A)):(D.flags|=1048576,A)}function S(D){return e&&D.alternate===null&&(D.flags|=2),D}function R(D,A,F,se){return A===null||A.tag!==6?(A=Qu(F,D.mode,se),A.return=D,A):(A=u(A,F),A.return=D,A)}function O(D,A,F,se){var ye=F.type;return ye===$?te(D,A,F.props.children,se,F.key):A!==null&&(A.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===le&&tp(ye)===A.type)?(se=u(A,F.props),se.ref=va(D,A,F),se.return=D,se):(se=ll(F.type,F.key,F.props,null,D.mode,se),se.ref=va(D,A,F),se.return=D,se)}function W(D,A,F,se){return A===null||A.tag!==4||A.stateNode.containerInfo!==F.containerInfo||A.stateNode.implementation!==F.implementation?(A=qu(F,D.mode,se),A.return=D,A):(A=u(A,F.children||[]),A.return=D,A)}function te(D,A,F,se,ye){return A===null||A.tag!==7?(A=xo(F,D.mode,se,ye),A.return=D,A):(A=u(A,F),A.return=D,A)}function re(D,A,F){if(typeof A=="string"&&A!==""||typeof A=="number")return A=Qu(""+A,D.mode,F),A.return=D,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case B:return F=ll(A.type,A.key,A.props,null,D.mode,F),F.ref=va(D,null,A),F.return=D,F;case H:return A=qu(A,D.mode,F),A.return=D,A;case le:var se=A._init;return re(D,se(A._payload),F)}if(wr(A)||q(A))return A=xo(A,D.mode,F,null),A.return=D,A;zi(D,A)}return null}function Z(D,A,F,se){var ye=A!==null?A.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return ye!==null?null:R(D,A,""+F,se);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case B:return F.key===ye?O(D,A,F,se):null;case H:return F.key===ye?W(D,A,F,se):null;case le:return ye=F._init,Z(D,A,ye(F._payload),se)}if(wr(F)||q(F))return ye!==null?null:te(D,A,F,se,null);zi(D,F)}return null}function de(D,A,F,se,ye){if(typeof se=="string"&&se!==""||typeof se=="number")return D=D.get(F)||null,R(A,D,""+se,ye);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case B:return D=D.get(se.key===null?F:se.key)||null,O(A,D,se,ye);case H:return D=D.get(se.key===null?F:se.key)||null,W(A,D,se,ye);case le:var be=se._init;return de(D,A,F,be(se._payload),ye)}if(wr(se)||q(se))return D=D.get(F)||null,te(A,D,se,ye,null);zi(A,se)}return null}function me(D,A,F,se){for(var ye=null,be=null,Se=A,ke=A=0,dt=null;Se!==null&&ke<F.length;ke++){Se.index>ke?(dt=Se,Se=null):dt=Se.sibling;var Le=Z(D,Se,F[ke],se);if(Le===null){Se===null&&(Se=dt);break}e&&Se&&Le.alternate===null&&n(D,Se),A=p(Le,A,ke),be===null?ye=Le:be.sibling=Le,be=Le,Se=dt}if(ke===F.length)return s(D,Se),Qe&&uo(D,ke),ye;if(Se===null){for(;ke<F.length;ke++)Se=re(D,F[ke],se),Se!==null&&(A=p(Se,A,ke),be===null?ye=Se:be.sibling=Se,be=Se);return Qe&&uo(D,ke),ye}for(Se=i(D,Se);ke<F.length;ke++)dt=de(Se,D,ke,F[ke],se),dt!==null&&(e&&dt.alternate!==null&&Se.delete(dt.key===null?ke:dt.key),A=p(dt,A,ke),be===null?ye=dt:be.sibling=dt,be=dt);return e&&Se.forEach(function(Ur){return n(D,Ur)}),Qe&&uo(D,ke),ye}function ge(D,A,F,se){var ye=q(F);if(typeof ye!="function")throw Error(o(150));if(F=ye.call(F),F==null)throw Error(o(151));for(var be=ye=null,Se=A,ke=A=0,dt=null,Le=F.next();Se!==null&&!Le.done;ke++,Le=F.next()){Se.index>ke?(dt=Se,Se=null):dt=Se.sibling;var Ur=Z(D,Se,Le.value,se);if(Ur===null){Se===null&&(Se=dt);break}e&&Se&&Ur.alternate===null&&n(D,Se),A=p(Ur,A,ke),be===null?ye=Ur:be.sibling=Ur,be=Ur,Se=dt}if(Le.done)return s(D,Se),Qe&&uo(D,ke),ye;if(Se===null){for(;!Le.done;ke++,Le=F.next())Le=re(D,Le.value,se),Le!==null&&(A=p(Le,A,ke),be===null?ye=Le:be.sibling=Le,be=Le);return Qe&&uo(D,ke),ye}for(Se=i(D,Se);!Le.done;ke++,Le=F.next())Le=de(Se,D,ke,Le.value,se),Le!==null&&(e&&Le.alternate!==null&&Se.delete(Le.key===null?ke:Le.key),A=p(Le,A,ke),be===null?ye=Le:be.sibling=Le,be=Le);return e&&Se.forEach(function(qw){return n(D,qw)}),Qe&&uo(D,ke),ye}function rt(D,A,F,se){if(typeof F=="object"&&F!==null&&F.type===$&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case B:e:{for(var ye=F.key,be=A;be!==null;){if(be.key===ye){if(ye=F.type,ye===$){if(be.tag===7){s(D,be.sibling),A=u(be,F.props.children),A.return=D,D=A;break e}}else if(be.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===le&&tp(ye)===be.type){s(D,be.sibling),A=u(be,F.props),A.ref=va(D,be,F),A.return=D,D=A;break e}s(D,be);break}else n(D,be);be=be.sibling}F.type===$?(A=xo(F.props.children,D.mode,se,F.key),A.return=D,D=A):(se=ll(F.type,F.key,F.props,null,D.mode,se),se.ref=va(D,A,F),se.return=D,D=se)}return S(D);case H:e:{for(be=F.key;A!==null;){if(A.key===be)if(A.tag===4&&A.stateNode.containerInfo===F.containerInfo&&A.stateNode.implementation===F.implementation){s(D,A.sibling),A=u(A,F.children||[]),A.return=D,D=A;break e}else{s(D,A);break}else n(D,A);A=A.sibling}A=qu(F,D.mode,se),A.return=D,D=A}return S(D);case le:return be=F._init,rt(D,A,be(F._payload),se)}if(wr(F))return me(D,A,F,se);if(q(F))return ge(D,A,F,se);zi(D,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,A!==null&&A.tag===6?(s(D,A.sibling),A=u(A,F),A.return=D,D=A):(s(D,A),A=Qu(F,D.mode,se),A.return=D,D=A),S(D)):s(D,A)}return rt}var ss=np(!0),rp=np(!1),Fi=jr(null),Ui=null,as=null,ru=null;function ou(){ru=as=Ui=null}function su(e){var n=Fi.current;He(Fi),e._currentValue=n}function au(e,n,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),e===s)break;e=e.return}}function is(e,n){Ui=e,ru=as=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Lt=!0),e.firstContext=null)}function Jt(e){var n=e._currentValue;if(ru!==e)if(e={context:e,memoizedValue:n,next:null},as===null){if(Ui===null)throw Error(o(308));as=e,Ui.dependencies={lanes:0,firstContext:e}}else as=as.next=e;return n}var fo=null;function iu(e){fo===null?fo=[e]:fo.push(e)}function op(e,n,s,i){var u=n.interleaved;return u===null?(s.next=s,iu(n)):(s.next=u.next,u.next=s),n.interleaved=s,er(e,i)}function er(e,n){e.lanes|=n;var s=e.alternate;for(s!==null&&(s.lanes|=n),s=e,e=e.return;e!==null;)e.childLanes|=n,s=e.alternate,s!==null&&(s.childLanes|=n),s=e,e=e.return;return s.tag===3?s.stateNode:null}var Ir=!1;function lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sp(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function tr(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Or(e,n,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ae&2)!==0){var u=i.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),i.pending=n,er(e,s)}return u=i.interleaved,u===null?(n.next=n,iu(i)):(n.next=u.next,u.next=n),i.interleaved=n,er(e,s)}function Bi(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194240)!==0)){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,Sc(e,s)}}function ap(e,n){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var S={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};p===null?u=p=S:p=p.next=S,s=s.next}while(s!==null);p===null?u=p=n:p=p.next=n}else u=p=n;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:p,shared:i.shared,effects:i.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}function $i(e,n,s,i){var u=e.updateQueue;Ir=!1;var p=u.firstBaseUpdate,S=u.lastBaseUpdate,R=u.shared.pending;if(R!==null){u.shared.pending=null;var O=R,W=O.next;O.next=null,S===null?p=W:S.next=W,S=O;var te=e.alternate;te!==null&&(te=te.updateQueue,R=te.lastBaseUpdate,R!==S&&(R===null?te.firstBaseUpdate=W:R.next=W,te.lastBaseUpdate=O))}if(p!==null){var re=u.baseState;S=0,te=W=O=null,R=p;do{var Z=R.lane,de=R.eventTime;if((i&Z)===Z){te!==null&&(te=te.next={eventTime:de,lane:0,tag:R.tag,payload:R.payload,callback:R.callback,next:null});e:{var me=e,ge=R;switch(Z=n,de=s,ge.tag){case 1:if(me=ge.payload,typeof me=="function"){re=me.call(de,re,Z);break e}re=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ge.payload,Z=typeof me=="function"?me.call(de,re,Z):me,Z==null)break e;re=K({},re,Z);break e;case 2:Ir=!0}}R.callback!==null&&R.lane!==0&&(e.flags|=64,Z=u.effects,Z===null?u.effects=[R]:Z.push(R))}else de={eventTime:de,lane:Z,tag:R.tag,payload:R.payload,callback:R.callback,next:null},te===null?(W=te=de,O=re):te=te.next=de,S|=Z;if(R=R.next,R===null){if(R=u.shared.pending,R===null)break;Z=R,R=Z.next,Z.next=null,u.lastBaseUpdate=Z,u.shared.pending=null}}while(!0);if(te===null&&(O=re),u.baseState=O,u.firstBaseUpdate=W,u.lastBaseUpdate=te,n=u.shared.interleaved,n!==null){u=n;do S|=u.lane,u=u.next;while(u!==n)}else p===null&&(u.shared.lanes=0);mo|=S,e.lanes=S,e.memoizedState=re}}function ip(e,n,s){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var i=e[n],u=i.callback;if(u!==null){if(i.callback=null,i=s,typeof u!="function")throw Error(o(191,u));u.call(i)}}}var xa={},_n=jr(xa),wa=jr(xa),ba=jr(xa);function ho(e){if(e===xa)throw Error(o(174));return e}function cu(e,n){switch($e(ba,n),$e(wa,e),$e(_n,xa),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:jn(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=jn(n,e)}He(_n),$e(_n,n)}function ls(){He(_n),He(wa),He(ba)}function lp(e){ho(ba.current);var n=ho(_n.current),s=jn(n,e.type);n!==s&&($e(wa,e),$e(_n,s))}function uu(e){wa.current===e&&(He(_n),He(wa))}var Ge=jr(0);function Wi(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var du=[];function fu(){for(var e=0;e<du.length;e++)du[e]._workInProgressVersionPrimary=null;du.length=0}var Hi=T.ReactCurrentDispatcher,hu=T.ReactCurrentBatchConfig,po=0,Ye=null,at=null,ct=null,Vi=!1,Sa=!1,Ca=0,gw=0;function xt(){throw Error(o(321))}function pu(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!dn(e[s],n[s]))return!1;return!0}function mu(e,n,s,i,u,p){if(po=p,Ye=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Hi.current=e===null||e.memoizedState===null?ww:bw,e=s(i,u),Sa){p=0;do{if(Sa=!1,Ca=0,25<=p)throw Error(o(301));p+=1,ct=at=null,n.updateQueue=null,Hi.current=Sw,e=s(i,u)}while(Sa)}if(Hi.current=qi,n=at!==null&&at.next!==null,po=0,ct=at=Ye=null,Vi=!1,n)throw Error(o(300));return e}function gu(){var e=Ca!==0;return Ca=0,e}function Dn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?Ye.memoizedState=ct=e:ct=ct.next=e,ct}function Zt(){if(at===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var n=ct===null?Ye.memoizedState:ct.next;if(n!==null)ct=n,at=e;else{if(e===null)throw Error(o(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},ct===null?Ye.memoizedState=ct=e:ct=ct.next=e}return ct}function ka(e,n){return typeof n=="function"?n(e):n}function yu(e){var n=Zt(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=at,u=i.baseQueue,p=s.pending;if(p!==null){if(u!==null){var S=u.next;u.next=p.next,p.next=S}i.baseQueue=u=p,s.pending=null}if(u!==null){p=u.next,i=i.baseState;var R=S=null,O=null,W=p;do{var te=W.lane;if((po&te)===te)O!==null&&(O=O.next={lane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),i=W.hasEagerState?W.eagerState:e(i,W.action);else{var re={lane:te,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null};O===null?(R=O=re,S=i):O=O.next=re,Ye.lanes|=te,mo|=te}W=W.next}while(W!==null&&W!==p);O===null?S=i:O.next=R,dn(i,n.memoizedState)||(Lt=!0),n.memoizedState=i,n.baseState=S,n.baseQueue=O,s.lastRenderedState=i}if(e=s.interleaved,e!==null){u=e;do p=u.lane,Ye.lanes|=p,mo|=p,u=u.next;while(u!==e)}else u===null&&(s.lanes=0);return[n.memoizedState,s.dispatch]}function vu(e){var n=Zt(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,p=n.memoizedState;if(u!==null){s.pending=null;var S=u=u.next;do p=e(p,S.action),S=S.next;while(S!==u);dn(p,n.memoizedState)||(Lt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),s.lastRenderedState=p}return[p,i]}function cp(){}function up(e,n){var s=Ye,i=Zt(),u=n(),p=!dn(i.memoizedState,u);if(p&&(i.memoizedState=u,Lt=!0),i=i.queue,xu(hp.bind(null,s,i,e),[e]),i.getSnapshot!==n||p||ct!==null&&ct.memoizedState.tag&1){if(s.flags|=2048,Ea(9,fp.bind(null,s,i,u,n),void 0,null),ut===null)throw Error(o(349));(po&30)!==0||dp(s,n,u)}return u}function dp(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function fp(e,n,s,i){n.value=s,n.getSnapshot=i,pp(n)&&mp(e)}function hp(e,n,s){return s(function(){pp(n)&&mp(e)})}function pp(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!dn(e,s)}catch{return!0}}function mp(e){var n=er(e,1);n!==null&&gn(n,e,1,-1)}function gp(e){var n=Dn();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:e},n.queue=e,e=e.dispatch=xw.bind(null,Ye,e),[n.memoizedState,e]}function Ea(e,n,s,i){return e={tag:e,create:n,destroy:s,deps:i,next:null},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.updateQueue=n,n.lastEffect=e.next=e):(s=n.lastEffect,s===null?n.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,n.lastEffect=e)),e}function yp(){return Zt().memoizedState}function Ki(e,n,s,i){var u=Dn();Ye.flags|=e,u.memoizedState=Ea(1|n,s,void 0,i===void 0?null:i)}function Qi(e,n,s,i){var u=Zt();i=i===void 0?null:i;var p=void 0;if(at!==null){var S=at.memoizedState;if(p=S.destroy,i!==null&&pu(i,S.deps)){u.memoizedState=Ea(n,s,p,i);return}}Ye.flags|=e,u.memoizedState=Ea(1|n,s,p,i)}function vp(e,n){return Ki(8390656,8,e,n)}function xu(e,n){return Qi(2048,8,e,n)}function xp(e,n){return Qi(4,2,e,n)}function wp(e,n){return Qi(4,4,e,n)}function bp(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Sp(e,n,s){return s=s!=null?s.concat([e]):null,Qi(4,4,bp.bind(null,n,e),s)}function wu(){}function Cp(e,n){var s=Zt();n=n===void 0?null:n;var i=s.memoizedState;return i!==null&&n!==null&&pu(n,i[1])?i[0]:(s.memoizedState=[e,n],e)}function kp(e,n){var s=Zt();n=n===void 0?null:n;var i=s.memoizedState;return i!==null&&n!==null&&pu(n,i[1])?i[0]:(e=e(),s.memoizedState=[e,n],e)}function Ep(e,n,s){return(po&21)===0?(e.baseState&&(e.baseState=!1,Lt=!0),e.memoizedState=s):(dn(s,n)||(s=th(),Ye.lanes|=s,mo|=s,e.baseState=!0),n)}function yw(e,n){var s=Fe;Fe=s!==0&&4>s?s:4,e(!0);var i=hu.transition;hu.transition={};try{e(!1),n()}finally{Fe=s,hu.transition=i}}function Np(){return Zt().memoizedState}function vw(e,n,s){var i=Dr(e);if(s={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null},Pp(e))Rp(n,s);else if(s=op(e,n,s,i),s!==null){var u=Rt();gn(s,e,i,u),jp(s,n,i)}}function xw(e,n,s){var i=Dr(e),u={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null};if(Pp(e))Rp(n,u);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var S=n.lastRenderedState,R=p(S,s);if(u.hasEagerState=!0,u.eagerState=R,dn(R,S)){var O=n.interleaved;O===null?(u.next=u,iu(n)):(u.next=O.next,O.next=u),n.interleaved=u;return}}catch{}finally{}s=op(e,n,u,i),s!==null&&(u=Rt(),gn(s,e,i,u),jp(s,n,i))}}function Pp(e){var n=e.alternate;return e===Ye||n!==null&&n===Ye}function Rp(e,n){Sa=Vi=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function jp(e,n,s){if((s&4194240)!==0){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,Sc(e,s)}}var qi={readContext:Jt,useCallback:xt,useContext:xt,useEffect:xt,useImperativeHandle:xt,useInsertionEffect:xt,useLayoutEffect:xt,useMemo:xt,useReducer:xt,useRef:xt,useState:xt,useDebugValue:xt,useDeferredValue:xt,useTransition:xt,useMutableSource:xt,useSyncExternalStore:xt,useId:xt,unstable_isNewReconciler:!1},ww={readContext:Jt,useCallback:function(e,n){return Dn().memoizedState=[e,n===void 0?null:n],e},useContext:Jt,useEffect:vp,useImperativeHandle:function(e,n,s){return s=s!=null?s.concat([e]):null,Ki(4194308,4,bp.bind(null,n,e),s)},useLayoutEffect:function(e,n){return Ki(4194308,4,e,n)},useInsertionEffect:function(e,n){return Ki(4,2,e,n)},useMemo:function(e,n){var s=Dn();return n=n===void 0?null:n,e=e(),s.memoizedState=[e,n],e},useReducer:function(e,n,s){var i=Dn();return n=s!==void 0?s(n):n,i.memoizedState=i.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},i.queue=e,e=e.dispatch=vw.bind(null,Ye,e),[i.memoizedState,e]},useRef:function(e){var n=Dn();return e={current:e},n.memoizedState=e},useState:gp,useDebugValue:wu,useDeferredValue:function(e){return Dn().memoizedState=e},useTransition:function(){var e=gp(!1),n=e[0];return e=yw.bind(null,e[1]),Dn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,s){var i=Ye,u=Dn();if(Qe){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),ut===null)throw Error(o(349));(po&30)!==0||dp(i,n,s)}u.memoizedState=s;var p={value:s,getSnapshot:n};return u.queue=p,vp(hp.bind(null,i,p,e),[e]),i.flags|=2048,Ea(9,fp.bind(null,i,p,s,n),void 0,null),s},useId:function(){var e=Dn(),n=ut.identifierPrefix;if(Qe){var s=Zn,i=Jn;s=(i&~(1<<32-un(i)-1)).toString(32)+s,n=":"+n+"R"+s,s=Ca++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=gw++,n=":"+n+"r"+s.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},bw={readContext:Jt,useCallback:Cp,useContext:Jt,useEffect:xu,useImperativeHandle:Sp,useInsertionEffect:xp,useLayoutEffect:wp,useMemo:kp,useReducer:yu,useRef:yp,useState:function(){return yu(ka)},useDebugValue:wu,useDeferredValue:function(e){var n=Zt();return Ep(n,at.memoizedState,e)},useTransition:function(){var e=yu(ka)[0],n=Zt().memoizedState;return[e,n]},useMutableSource:cp,useSyncExternalStore:up,useId:Np,unstable_isNewReconciler:!1},Sw={readContext:Jt,useCallback:Cp,useContext:Jt,useEffect:xu,useImperativeHandle:Sp,useInsertionEffect:xp,useLayoutEffect:wp,useMemo:kp,useReducer:vu,useRef:yp,useState:function(){return vu(ka)},useDebugValue:wu,useDeferredValue:function(e){var n=Zt();return at===null?n.memoizedState=e:Ep(n,at.memoizedState,e)},useTransition:function(){var e=vu(ka)[0],n=Zt().memoizedState;return[e,n]},useMutableSource:cp,useSyncExternalStore:up,useId:Np,unstable_isNewReconciler:!1};function hn(e,n){if(e&&e.defaultProps){n=K({},n),e=e.defaultProps;for(var s in e)n[s]===void 0&&(n[s]=e[s]);return n}return n}function bu(e,n,s,i){n=e.memoizedState,s=s(i,n),s=s==null?n:K({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Gi={isMounted:function(e){return(e=e._reactInternals)?ao(e)===e:!1},enqueueSetState:function(e,n,s){e=e._reactInternals;var i=Rt(),u=Dr(e),p=tr(i,u);p.payload=n,s!=null&&(p.callback=s),n=Or(e,p,u),n!==null&&(gn(n,e,u,i),Bi(n,e,u))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var i=Rt(),u=Dr(e),p=tr(i,u);p.tag=1,p.payload=n,s!=null&&(p.callback=s),n=Or(e,p,u),n!==null&&(gn(n,e,u,i),Bi(n,e,u))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=Rt(),i=Dr(e),u=tr(s,i);u.tag=2,n!=null&&(u.callback=n),n=Or(e,u,i),n!==null&&(gn(n,e,i,s),Bi(n,e,i))}};function Tp(e,n,s,i,u,p,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,p,S):n.prototype&&n.prototype.isPureReactComponent?!da(s,i)||!da(u,p):!0}function Mp(e,n,s){var i=!1,u=Tr,p=n.contextType;return typeof p=="object"&&p!==null?p=Jt(p):(u=At(n)?lo:vt.current,i=n.contextTypes,p=(i=i!=null)?ts(e,u):Tr),n=new n(s,p),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Gi,e.stateNode=n,n._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=u,e.__reactInternalMemoizedMaskedChildContext=p),n}function Ip(e,n,s,i){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,i),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,i),n.state!==e&&Gi.enqueueReplaceState(n,n.state,null)}function Su(e,n,s,i){var u=e.stateNode;u.props=s,u.state=e.memoizedState,u.refs={},lu(e);var p=n.contextType;typeof p=="object"&&p!==null?u.context=Jt(p):(p=At(n)?lo:vt.current,u.context=ts(e,p)),u.state=e.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(bu(e,n,p,s),u.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(n=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),n!==u.state&&Gi.enqueueReplaceState(u,u.state,null),$i(e,s,u,i),u.state=e.memoizedState),typeof u.componentDidMount=="function"&&(e.flags|=4194308)}function cs(e,n){try{var s="",i=n;do s+=he(i),i=i.return;while(i);var u=s}catch(p){u=`
39
- Error generating stack: `+p.message+`
40
- `+p.stack}return{value:e,source:n,stack:u,digest:null}}function Cu(e,n,s){return{value:e,source:null,stack:s??null,digest:n??null}}function ku(e,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var Cw=typeof WeakMap=="function"?WeakMap:Map;function Op(e,n,s){s=tr(-1,s),s.tag=3,s.payload={element:null};var i=n.value;return s.callback=function(){nl||(nl=!0,Fu=i),ku(e,n)},s}function Ap(e,n,s){s=tr(-1,s),s.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var u=n.value;s.payload=function(){return i(u)},s.callback=function(){ku(e,n)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(s.callback=function(){ku(e,n),typeof i!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var S=n.stack;this.componentDidCatch(n.value,{componentStack:S!==null?S:""})}),s}function Lp(e,n,s){var i=e.pingCache;if(i===null){i=e.pingCache=new Cw;var u=new Set;i.set(n,u)}else u=i.get(n),u===void 0&&(u=new Set,i.set(n,u));u.has(s)||(u.add(s),e=Dw.bind(null,e,n,s),n.then(e,e))}function _p(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Dp(e,n,s,i,u){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=tr(-1,1),n.tag=2,Or(s,n,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=u,e)}var kw=T.ReactCurrentOwner,Lt=!1;function Pt(e,n,s,i){n.child=e===null?rp(n,null,s,i):ss(n,e.child,s,i)}function zp(e,n,s,i,u){s=s.render;var p=n.ref;return is(n,u),i=mu(e,n,s,i,p,u),s=gu(),e!==null&&!Lt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~u,nr(e,n,u)):(Qe&&s&&Jc(n),n.flags|=1,Pt(e,n,i,u),n.child)}function Fp(e,n,s,i,u){if(e===null){var p=s.type;return typeof p=="function"&&!Ku(p)&&p.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=p,Up(e,n,p,i,u)):(e=ll(s.type,null,i,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,(e.lanes&u)===0){var S=p.memoizedProps;if(s=s.compare,s=s!==null?s:da,s(S,i)&&e.ref===n.ref)return nr(e,n,u)}return n.flags|=1,e=Fr(p,i),e.ref=n.ref,e.return=n,n.child=e}function Up(e,n,s,i,u){if(e!==null){var p=e.memoizedProps;if(da(p,i)&&e.ref===n.ref)if(Lt=!1,n.pendingProps=i=p,(e.lanes&u)!==0)(e.flags&131072)!==0&&(Lt=!0);else return n.lanes=e.lanes,nr(e,n,u)}return Eu(e,n,s,i,u)}function Bp(e,n,s){var i=n.pendingProps,u=i.children,p=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},$e(ds,Vt),Vt|=s;else{if((s&1073741824)===0)return e=p!==null?p.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,$e(ds,Vt),Vt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=p!==null?p.baseLanes:s,$e(ds,Vt),Vt|=i}else p!==null?(i=p.baseLanes|s,n.memoizedState=null):i=s,$e(ds,Vt),Vt|=i;return Pt(e,n,u,s),n.child}function $p(e,n){var s=n.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function Eu(e,n,s,i,u){var p=At(s)?lo:vt.current;return p=ts(n,p),is(n,u),s=mu(e,n,s,i,p,u),i=gu(),e!==null&&!Lt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~u,nr(e,n,u)):(Qe&&i&&Jc(n),n.flags|=1,Pt(e,n,s,u),n.child)}function Wp(e,n,s,i,u){if(At(s)){var p=!0;Oi(n)}else p=!1;if(is(n,u),n.stateNode===null)Xi(e,n),Mp(n,s,i),Su(n,s,i,u),i=!0;else if(e===null){var S=n.stateNode,R=n.memoizedProps;S.props=R;var O=S.context,W=s.contextType;typeof W=="object"&&W!==null?W=Jt(W):(W=At(s)?lo:vt.current,W=ts(n,W));var te=s.getDerivedStateFromProps,re=typeof te=="function"||typeof S.getSnapshotBeforeUpdate=="function";re||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(R!==i||O!==W)&&Ip(n,S,i,W),Ir=!1;var Z=n.memoizedState;S.state=Z,$i(n,i,S,u),O=n.memoizedState,R!==i||Z!==O||Ot.current||Ir?(typeof te=="function"&&(bu(n,s,te,i),O=n.memoizedState),(R=Ir||Tp(n,s,R,i,Z,O,W))?(re||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(n.flags|=4194308)):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=i,n.memoizedState=O),S.props=i,S.state=O,S.context=W,i=R):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),i=!1)}else{S=n.stateNode,sp(e,n),R=n.memoizedProps,W=n.type===n.elementType?R:hn(n.type,R),S.props=W,re=n.pendingProps,Z=S.context,O=s.contextType,typeof O=="object"&&O!==null?O=Jt(O):(O=At(s)?lo:vt.current,O=ts(n,O));var de=s.getDerivedStateFromProps;(te=typeof de=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(R!==re||Z!==O)&&Ip(n,S,i,O),Ir=!1,Z=n.memoizedState,S.state=Z,$i(n,i,S,u);var me=n.memoizedState;R!==re||Z!==me||Ot.current||Ir?(typeof de=="function"&&(bu(n,s,de,i),me=n.memoizedState),(W=Ir||Tp(n,s,W,i,Z,me,O)||!1)?(te||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(i,me,O),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(i,me,O)),typeof S.componentDidUpdate=="function"&&(n.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof S.componentDidUpdate!="function"||R===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||R===e.memoizedProps&&Z===e.memoizedState||(n.flags|=1024),n.memoizedProps=i,n.memoizedState=me),S.props=i,S.state=me,S.context=O,i=W):(typeof S.componentDidUpdate!="function"||R===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||R===e.memoizedProps&&Z===e.memoizedState||(n.flags|=1024),i=!1)}return Nu(e,n,s,i,p,u)}function Nu(e,n,s,i,u,p){$p(e,n);var S=(n.flags&128)!==0;if(!i&&!S)return u&&qh(n,s,!1),nr(e,n,p);i=n.stateNode,kw.current=n;var R=S&&typeof s.getDerivedStateFromError!="function"?null:i.render();return n.flags|=1,e!==null&&S?(n.child=ss(n,e.child,null,p),n.child=ss(n,null,R,p)):Pt(e,n,R,p),n.memoizedState=i.state,u&&qh(n,s,!0),n.child}function Hp(e){var n=e.stateNode;n.pendingContext?Kh(e,n.pendingContext,n.pendingContext!==n.context):n.context&&Kh(e,n.context,!1),cu(e,n.containerInfo)}function Vp(e,n,s,i,u){return os(),nu(u),n.flags|=256,Pt(e,n,s,i),n.child}var Pu={dehydrated:null,treeContext:null,retryLane:0};function Ru(e){return{baseLanes:e,cachePool:null,transitions:null}}function Kp(e,n,s){var i=n.pendingProps,u=Ge.current,p=!1,S=(n.flags&128)!==0,R;if((R=S)||(R=e!==null&&e.memoizedState===null?!1:(u&2)!==0),R?(p=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(u|=1),$e(Ge,u&1),e===null)return tu(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(S=i.children,e=i.fallback,p?(i=n.mode,p=n.child,S={mode:"hidden",children:S},(i&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=S):p=cl(S,i,0,null),e=xo(e,i,s,null),p.return=n,e.return=n,p.sibling=e,n.child=p,n.child.memoizedState=Ru(s),n.memoizedState=Pu,e):ju(n,S));if(u=e.memoizedState,u!==null&&(R=u.dehydrated,R!==null))return Ew(e,n,S,i,R,u,s);if(p){p=i.fallback,S=n.mode,u=e.child,R=u.sibling;var O={mode:"hidden",children:i.children};return(S&1)===0&&n.child!==u?(i=n.child,i.childLanes=0,i.pendingProps=O,n.deletions=null):(i=Fr(u,O),i.subtreeFlags=u.subtreeFlags&14680064),R!==null?p=Fr(R,p):(p=xo(p,S,s,null),p.flags|=2),p.return=n,i.return=n,i.sibling=p,n.child=i,i=p,p=n.child,S=e.child.memoizedState,S=S===null?Ru(s):{baseLanes:S.baseLanes|s,cachePool:null,transitions:S.transitions},p.memoizedState=S,p.childLanes=e.childLanes&~s,n.memoizedState=Pu,i}return p=e.child,e=p.sibling,i=Fr(p,{mode:"visible",children:i.children}),(n.mode&1)===0&&(i.lanes=s),i.return=n,i.sibling=null,e!==null&&(s=n.deletions,s===null?(n.deletions=[e],n.flags|=16):s.push(e)),n.child=i,n.memoizedState=null,i}function ju(e,n){return n=cl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Yi(e,n,s,i){return i!==null&&nu(i),ss(n,e.child,null,s),e=ju(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ew(e,n,s,i,u,p,S){if(s)return n.flags&256?(n.flags&=-257,i=Cu(Error(o(422))),Yi(e,n,S,i)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(p=i.fallback,u=n.mode,i=cl({mode:"visible",children:i.children},u,0,null),p=xo(p,u,S,null),p.flags|=2,i.return=n,p.return=n,i.sibling=p,n.child=i,(n.mode&1)!==0&&ss(n,e.child,null,S),n.child.memoizedState=Ru(S),n.memoizedState=Pu,p);if((n.mode&1)===0)return Yi(e,n,S,null);if(u.data==="$!"){if(i=u.nextSibling&&u.nextSibling.dataset,i)var R=i.dgst;return i=R,p=Error(o(419)),i=Cu(p,i,void 0),Yi(e,n,S,i)}if(R=(S&e.childLanes)!==0,Lt||R){if(i=ut,i!==null){switch(S&-S){case 4:u=2;break;case 16:u=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:u=32;break;case 536870912:u=268435456;break;default:u=0}u=(u&(i.suspendedLanes|S))!==0?0:u,u!==0&&u!==p.retryLane&&(p.retryLane=u,er(e,u),gn(i,e,u,-1))}return Vu(),i=Cu(Error(o(421))),Yi(e,n,S,i)}return u.data==="$?"?(n.flags|=128,n.child=e.child,n=zw.bind(null,e),u._reactRetry=n,null):(e=p.treeContext,Ht=Rr(u.nextSibling),Wt=n,Qe=!0,fn=null,e!==null&&(Yt[Xt++]=Jn,Yt[Xt++]=Zn,Yt[Xt++]=co,Jn=e.id,Zn=e.overflow,co=n),n=ju(n,i.children),n.flags|=4096,n)}function Qp(e,n,s){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n),au(e.return,n,s)}function Tu(e,n,s,i,u){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u}:(p.isBackwards=n,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=s,p.tailMode=u)}function qp(e,n,s){var i=n.pendingProps,u=i.revealOrder,p=i.tail;if(Pt(e,n,i.children,s),i=Ge.current,(i&2)!==0)i=i&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qp(e,s,n);else if(e.tag===19)Qp(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if($e(Ge,i),(n.mode&1)===0)n.memoizedState=null;else switch(u){case"forwards":for(s=n.child,u=null;s!==null;)e=s.alternate,e!==null&&Wi(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=n.child,n.child=null):(u=s.sibling,s.sibling=null),Tu(n,!1,u,s,p);break;case"backwards":for(s=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&Wi(e)===null){n.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Tu(n,!0,s,null,p);break;case"together":Tu(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Xi(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function nr(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),mo|=n.lanes,(s&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(o(153));if(n.child!==null){for(e=n.child,s=Fr(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=Fr(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function Nw(e,n,s){switch(n.tag){case 3:Hp(n),os();break;case 5:lp(n);break;case 1:At(n.type)&&Oi(n);break;case 4:cu(n,n.stateNode.containerInfo);break;case 10:var i=n.type._context,u=n.memoizedProps.value;$e(Fi,i._currentValue),i._currentValue=u;break;case 13:if(i=n.memoizedState,i!==null)return i.dehydrated!==null?($e(Ge,Ge.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?Kp(e,n,s):($e(Ge,Ge.current&1),e=nr(e,n,s),e!==null?e.sibling:null);$e(Ge,Ge.current&1);break;case 19:if(i=(s&n.childLanes)!==0,(e.flags&128)!==0){if(i)return qp(e,n,s);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),$e(Ge,Ge.current),i)break;return null;case 22:case 23:return n.lanes=0,Bp(e,n,s)}return nr(e,n,s)}var Gp,Mu,Yp,Xp;Gp=function(e,n){for(var s=n.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},Mu=function(){},Yp=function(e,n,s,i){var u=e.memoizedProps;if(u!==i){e=n.stateNode,ho(_n.current);var p=null;switch(s){case"input":u=yt(e,u),i=yt(e,i),p=[];break;case"select":u=K({},u,{value:void 0}),i=K({},i,{value:void 0}),p=[];break;case"textarea":u=Bo(e,u),i=Bo(e,i),p=[];break;default:typeof u.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Ti)}Mn(s,i);var S;s=null;for(W in u)if(!i.hasOwnProperty(W)&&u.hasOwnProperty(W)&&u[W]!=null)if(W==="style"){var R=u[W];for(S in R)R.hasOwnProperty(S)&&(s||(s={}),s[S]="")}else W!=="dangerouslySetInnerHTML"&&W!=="children"&&W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&W!=="autoFocus"&&(l.hasOwnProperty(W)?p||(p=[]):(p=p||[]).push(W,null));for(W in i){var O=i[W];if(R=u!=null?u[W]:void 0,i.hasOwnProperty(W)&&O!==R&&(O!=null||R!=null))if(W==="style")if(R){for(S in R)!R.hasOwnProperty(S)||O&&O.hasOwnProperty(S)||(s||(s={}),s[S]="");for(S in O)O.hasOwnProperty(S)&&R[S]!==O[S]&&(s||(s={}),s[S]=O[S])}else s||(p||(p=[]),p.push(W,s)),s=O;else W==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,R=R?R.__html:void 0,O!=null&&R!==O&&(p=p||[]).push(W,O)):W==="children"?typeof O!="string"&&typeof O!="number"||(p=p||[]).push(W,""+O):W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&(l.hasOwnProperty(W)?(O!=null&&W==="onScroll"&&We("scroll",e),p||R===O||(p=[])):(p=p||[]).push(W,O))}s&&(p=p||[]).push("style",s);var W=p;(n.updateQueue=W)&&(n.flags|=4)}},Xp=function(e,n,s,i){s!==i&&(n.flags|=4)};function Na(e,n){if(!Qe)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function wt(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(n)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&14680064,i|=u.flags&14680064,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,n}function Pw(e,n,s){var i=n.pendingProps;switch(Zc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(n),null;case 1:return At(n.type)&&Ii(),wt(n),null;case 3:return i=n.stateNode,ls(),He(Ot),He(vt),fu(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Di(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,fn!==null&&($u(fn),fn=null))),Mu(e,n),wt(n),null;case 5:uu(n);var u=ho(ba.current);if(s=n.type,e!==null&&n.stateNode!=null)Yp(e,n,s,i,u),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!i){if(n.stateNode===null)throw Error(o(166));return wt(n),null}if(e=ho(_n.current),Di(n)){i=n.stateNode,s=n.type;var p=n.memoizedProps;switch(i[Ln]=n,i[ga]=p,e=(n.mode&1)!==0,s){case"dialog":We("cancel",i),We("close",i);break;case"iframe":case"object":case"embed":We("load",i);break;case"video":case"audio":for(u=0;u<ha.length;u++)We(ha[u],i);break;case"source":We("error",i);break;case"img":case"image":case"link":We("error",i),We("load",i);break;case"details":We("toggle",i);break;case"input":Nn(i,p),We("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!p.multiple},We("invalid",i);break;case"textarea":Rn(i,p),We("invalid",i)}Mn(s,p),u=null;for(var S in p)if(p.hasOwnProperty(S)){var R=p[S];S==="children"?typeof R=="string"?i.textContent!==R&&(p.suppressHydrationWarning!==!0&&ji(i.textContent,R,e),u=["children",R]):typeof R=="number"&&i.textContent!==""+R&&(p.suppressHydrationWarning!==!0&&ji(i.textContent,R,e),u=["children",""+R]):l.hasOwnProperty(S)&&R!=null&&S==="onScroll"&&We("scroll",i)}switch(s){case"input":Te(i),xr(i,p,!0);break;case"textarea":Te(i),oi(i);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(i.onclick=Ti)}i=u,n.updateQueue=i,i!==null&&(n.flags|=4)}else{S=u.nodeType===9?u:u.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Et(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=S.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=S.createElement(s,{is:i.is}):(e=S.createElement(s),s==="select"&&(S=e,i.multiple?S.multiple=!0:i.size&&(S.size=i.size))):e=S.createElementNS(e,s),e[Ln]=n,e[ga]=i,Gp(e,n,!1,!1),n.stateNode=e;e:{switch(S=Ys(s,i),s){case"dialog":We("cancel",e),We("close",e),u=i;break;case"iframe":case"object":case"embed":We("load",e),u=i;break;case"video":case"audio":for(u=0;u<ha.length;u++)We(ha[u],e);u=i;break;case"source":We("error",e),u=i;break;case"img":case"image":case"link":We("error",e),We("load",e),u=i;break;case"details":We("toggle",e),u=i;break;case"input":Nn(e,i),u=yt(e,i),We("invalid",e);break;case"option":u=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},u=K({},i,{value:void 0}),We("invalid",e);break;case"textarea":Rn(e,i),u=Bo(e,i),We("invalid",e);break;default:u=i}Mn(s,u),R=u;for(p in R)if(R.hasOwnProperty(p)){var O=R[p];p==="style"?Gn(e,O):p==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,O!=null&&si(e,O)):p==="children"?typeof O=="string"?(s!=="textarea"||O!=="")&&Tn(e,O):typeof O=="number"&&Tn(e,""+O):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(l.hasOwnProperty(p)?O!=null&&p==="onScroll"&&We("scroll",e):O!=null&&N(e,p,O,S))}switch(s){case"input":Te(e),xr(e,i,!1);break;case"textarea":Te(e),oi(e);break;case"option":i.value!=null&&e.setAttribute("value",""+pe(i.value));break;case"select":e.multiple=!!i.multiple,p=i.value,p!=null?Gt(e,!!i.multiple,p,!1):i.defaultValue!=null&&Gt(e,!!i.multiple,i.defaultValue,!0);break;default:typeof u.onClick=="function"&&(e.onclick=Ti)}switch(s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return wt(n),null;case 6:if(e&&n.stateNode!=null)Xp(e,n,e.memoizedProps,i);else{if(typeof i!="string"&&n.stateNode===null)throw Error(o(166));if(s=ho(ba.current),ho(_n.current),Di(n)){if(i=n.stateNode,s=n.memoizedProps,i[Ln]=n,(p=i.nodeValue!==s)&&(e=Wt,e!==null))switch(e.tag){case 3:ji(i.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ji(i.nodeValue,s,(e.mode&1)!==0)}p&&(n.flags|=4)}else i=(s.nodeType===9?s:s.ownerDocument).createTextNode(i),i[Ln]=n,n.stateNode=i}return wt(n),null;case 13:if(He(Ge),i=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&Ht!==null&&(n.mode&1)!==0&&(n.flags&128)===0)ep(),os(),n.flags|=98560,p=!1;else if(p=Di(n),i!==null&&i.dehydrated!==null){if(e===null){if(!p)throw Error(o(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[Ln]=n}else os(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wt(n),p=!1}else fn!==null&&($u(fn),fn=null),p=!0;if(!p)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=s,n):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Ge.current&1)!==0?it===0&&(it=3):Vu())),n.updateQueue!==null&&(n.flags|=4),wt(n),null);case 4:return ls(),Mu(e,n),e===null&&pa(n.stateNode.containerInfo),wt(n),null;case 10:return su(n.type._context),wt(n),null;case 17:return At(n.type)&&Ii(),wt(n),null;case 19:if(He(Ge),p=n.memoizedState,p===null)return wt(n),null;if(i=(n.flags&128)!==0,S=p.rendering,S===null)if(i)Na(p,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(S=Wi(e),S!==null){for(n.flags|=128,Na(p,!1),i=S.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),n.subtreeFlags=0,i=s,s=n.child;s!==null;)p=s,e=i,p.flags&=14680066,S=p.alternate,S===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=S.childLanes,p.lanes=S.lanes,p.child=S.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=S.memoizedProps,p.memoizedState=S.memoizedState,p.updateQueue=S.updateQueue,p.type=S.type,e=S.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return $e(Ge,Ge.current&1|2),n.child}e=e.sibling}p.tail!==null&&nt()>fs&&(n.flags|=128,i=!0,Na(p,!1),n.lanes=4194304)}else{if(!i)if(e=Wi(S),e!==null){if(n.flags|=128,i=!0,s=e.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),Na(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!Qe)return wt(n),null}else 2*nt()-p.renderingStartTime>fs&&s!==1073741824&&(n.flags|=128,i=!0,Na(p,!1),n.lanes=4194304);p.isBackwards?(S.sibling=n.child,n.child=S):(s=p.last,s!==null?s.sibling=S:n.child=S,p.last=S)}return p.tail!==null?(n=p.tail,p.rendering=n,p.tail=n.sibling,p.renderingStartTime=nt(),n.sibling=null,s=Ge.current,$e(Ge,i?s&1|2:s&1),n):(wt(n),null);case 22:case 23:return Hu(),i=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(n.flags|=8192),i&&(n.mode&1)!==0?(Vt&1073741824)!==0&&(wt(n),n.subtreeFlags&6&&(n.flags|=8192)):wt(n),null;case 24:return null;case 25:return null}throw Error(o(156,n.tag))}function Rw(e,n){switch(Zc(n),n.tag){case 1:return At(n.type)&&Ii(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ls(),He(Ot),He(vt),fu(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return uu(n),null;case 13:if(He(Ge),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));os()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return He(Ge),null;case 4:return ls(),null;case 10:return su(n.type._context),null;case 22:case 23:return Hu(),null;case 24:return null;default:return null}}var Ji=!1,bt=!1,jw=typeof WeakSet=="function"?WeakSet:Set,fe=null;function us(e,n){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(i){Ze(e,n,i)}else s.current=null}function Iu(e,n,s){try{s()}catch(i){Ze(e,n,i)}}var Jp=!1;function Tw(e,n){if(Hc=vi,e=Th(),_c(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var u=i.anchorOffset,p=i.focusNode;i=i.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var S=0,R=-1,O=-1,W=0,te=0,re=e,Z=null;t:for(;;){for(var de;re!==s||u!==0&&re.nodeType!==3||(R=S+u),re!==p||i!==0&&re.nodeType!==3||(O=S+i),re.nodeType===3&&(S+=re.nodeValue.length),(de=re.firstChild)!==null;)Z=re,re=de;for(;;){if(re===e)break t;if(Z===s&&++W===u&&(R=S),Z===p&&++te===i&&(O=S),(de=re.nextSibling)!==null)break;re=Z,Z=re.parentNode}re=de}s=R===-1||O===-1?null:{start:R,end:O}}else s=null}s=s||{start:0,end:0}}else s=null;for(Vc={focusedElem:e,selectionRange:s},vi=!1,fe=n;fe!==null;)if(n=fe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,fe=e;else for(;fe!==null;){n=fe;try{var me=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(me!==null){var ge=me.memoizedProps,rt=me.memoizedState,D=n.stateNode,A=D.getSnapshotBeforeUpdate(n.elementType===n.type?ge:hn(n.type,ge),rt);D.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var F=n.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(se){Ze(n,n.return,se)}if(e=n.sibling,e!==null){e.return=n.return,fe=e;break}fe=n.return}return me=Jp,Jp=!1,me}function Pa(e,n,s){var i=n.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&e)===e){var p=u.destroy;u.destroy=void 0,p!==void 0&&Iu(n,s,p)}u=u.next}while(u!==i)}}function Zi(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.create;s.destroy=i()}s=s.next}while(s!==n)}}function Ou(e){var n=e.ref;if(n!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof n=="function"?n(e):n.current=e}}function Zp(e){var n=e.alternate;n!==null&&(e.alternate=null,Zp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Ln],delete n[ga],delete n[Gc],delete n[fw],delete n[hw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function em(e){return e.tag===5||e.tag===3||e.tag===4}function tm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||em(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Au(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.nodeType===8?s.parentNode.insertBefore(e,n):s.insertBefore(e,n):(s.nodeType===8?(n=s.parentNode,n.insertBefore(e,s)):(n=s,n.appendChild(e)),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Ti));else if(i!==4&&(e=e.child,e!==null))for(Au(e,n,s),e=e.sibling;e!==null;)Au(e,n,s),e=e.sibling}function Lu(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Lu(e,n,s),e=e.sibling;e!==null;)Lu(e,n,s),e=e.sibling}var pt=null,pn=!1;function Ar(e,n,s){for(s=s.child;s!==null;)nm(e,n,s),s=s.sibling}function nm(e,n,s){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount(fi,s)}catch{}switch(s.tag){case 5:bt||us(s,n);case 6:var i=pt,u=pn;pt=null,Ar(e,n,s),pt=i,pn=u,pt!==null&&(pn?(e=pt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):pt.removeChild(s.stateNode));break;case 18:pt!==null&&(pn?(e=pt,s=s.stateNode,e.nodeType===8?qc(e.parentNode,s):e.nodeType===1&&qc(e,s),sa(e)):qc(pt,s.stateNode));break;case 4:i=pt,u=pn,pt=s.stateNode.containerInfo,pn=!0,Ar(e,n,s),pt=i,pn=u;break;case 0:case 11:case 14:case 15:if(!bt&&(i=s.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){u=i=i.next;do{var p=u,S=p.destroy;p=p.tag,S!==void 0&&((p&2)!==0||(p&4)!==0)&&Iu(s,n,S),u=u.next}while(u!==i)}Ar(e,n,s);break;case 1:if(!bt&&(us(s,n),i=s.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=s.memoizedProps,i.state=s.memoizedState,i.componentWillUnmount()}catch(R){Ze(s,n,R)}Ar(e,n,s);break;case 21:Ar(e,n,s);break;case 22:s.mode&1?(bt=(i=bt)||s.memoizedState!==null,Ar(e,n,s),bt=i):Ar(e,n,s);break;default:Ar(e,n,s)}}function rm(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new jw),n.forEach(function(i){var u=Fw.bind(null,e,i);s.has(i)||(s.add(i),i.then(u,u))})}}function mn(e,n){var s=n.deletions;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i];try{var p=e,S=n,R=S;e:for(;R!==null;){switch(R.tag){case 5:pt=R.stateNode,pn=!1;break e;case 3:pt=R.stateNode.containerInfo,pn=!0;break e;case 4:pt=R.stateNode.containerInfo,pn=!0;break e}R=R.return}if(pt===null)throw Error(o(160));nm(p,S,u),pt=null,pn=!1;var O=u.alternate;O!==null&&(O.return=null),u.return=null}catch(W){Ze(u,n,W)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)om(n,e),n=n.sibling}function om(e,n){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mn(n,e),zn(e),i&4){try{Pa(3,e,e.return),Zi(3,e)}catch(ge){Ze(e,e.return,ge)}try{Pa(5,e,e.return)}catch(ge){Ze(e,e.return,ge)}}break;case 1:mn(n,e),zn(e),i&512&&s!==null&&us(s,s.return);break;case 5:if(mn(n,e),zn(e),i&512&&s!==null&&us(s,s.return),e.flags&32){var u=e.stateNode;try{Tn(u,"")}catch(ge){Ze(e,e.return,ge)}}if(i&4&&(u=e.stateNode,u!=null)){var p=e.memoizedProps,S=s!==null?s.memoizedProps:p,R=e.type,O=e.updateQueue;if(e.updateQueue=null,O!==null)try{R==="input"&&p.type==="radio"&&p.name!=null&&sn(u,p),Ys(R,S);var W=Ys(R,p);for(S=0;S<O.length;S+=2){var te=O[S],re=O[S+1];te==="style"?Gn(u,re):te==="dangerouslySetInnerHTML"?si(u,re):te==="children"?Tn(u,re):N(u,te,re,W)}switch(R){case"input":an(u,p);break;case"textarea":ri(u,p);break;case"select":var Z=u._wrapperState.wasMultiple;u._wrapperState.wasMultiple=!!p.multiple;var de=p.value;de!=null?Gt(u,!!p.multiple,de,!1):Z!==!!p.multiple&&(p.defaultValue!=null?Gt(u,!!p.multiple,p.defaultValue,!0):Gt(u,!!p.multiple,p.multiple?[]:"",!1))}u[ga]=p}catch(ge){Ze(e,e.return,ge)}}break;case 6:if(mn(n,e),zn(e),i&4){if(e.stateNode===null)throw Error(o(162));u=e.stateNode,p=e.memoizedProps;try{u.nodeValue=p}catch(ge){Ze(e,e.return,ge)}}break;case 3:if(mn(n,e),zn(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{sa(n.containerInfo)}catch(ge){Ze(e,e.return,ge)}break;case 4:mn(n,e),zn(e);break;case 13:mn(n,e),zn(e),u=e.child,u.flags&8192&&(p=u.memoizedState!==null,u.stateNode.isHidden=p,!p||u.alternate!==null&&u.alternate.memoizedState!==null||(zu=nt())),i&4&&rm(e);break;case 22:if(te=s!==null&&s.memoizedState!==null,e.mode&1?(bt=(W=bt)||te,mn(n,e),bt=W):mn(n,e),zn(e),i&8192){if(W=e.memoizedState!==null,(e.stateNode.isHidden=W)&&!te&&(e.mode&1)!==0)for(fe=e,te=e.child;te!==null;){for(re=fe=te;fe!==null;){switch(Z=fe,de=Z.child,Z.tag){case 0:case 11:case 14:case 15:Pa(4,Z,Z.return);break;case 1:us(Z,Z.return);var me=Z.stateNode;if(typeof me.componentWillUnmount=="function"){i=Z,s=Z.return;try{n=i,me.props=n.memoizedProps,me.state=n.memoizedState,me.componentWillUnmount()}catch(ge){Ze(i,s,ge)}}break;case 5:us(Z,Z.return);break;case 22:if(Z.memoizedState!==null){im(re);continue}}de!==null?(de.return=Z,fe=de):im(re)}te=te.sibling}e:for(te=null,re=e;;){if(re.tag===5){if(te===null){te=re;try{u=re.stateNode,W?(p=u.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(R=re.stateNode,O=re.memoizedProps.style,S=O!=null&&O.hasOwnProperty("display")?O.display:null,R.style.display=Wo("display",S))}catch(ge){Ze(e,e.return,ge)}}}else if(re.tag===6){if(te===null)try{re.stateNode.nodeValue=W?"":re.memoizedProps}catch(ge){Ze(e,e.return,ge)}}else if((re.tag!==22&&re.tag!==23||re.memoizedState===null||re===e)&&re.child!==null){re.child.return=re,re=re.child;continue}if(re===e)break e;for(;re.sibling===null;){if(re.return===null||re.return===e)break e;te===re&&(te=null),re=re.return}te===re&&(te=null),re.sibling.return=re.return,re=re.sibling}}break;case 19:mn(n,e),zn(e),i&4&&rm(e);break;case 21:break;default:mn(n,e),zn(e)}}function zn(e){var n=e.flags;if(n&2){try{e:{for(var s=e.return;s!==null;){if(em(s)){var i=s;break e}s=s.return}throw Error(o(160))}switch(i.tag){case 5:var u=i.stateNode;i.flags&32&&(Tn(u,""),i.flags&=-33);var p=tm(e);Lu(e,p,u);break;case 3:case 4:var S=i.stateNode.containerInfo,R=tm(e);Au(e,R,S);break;default:throw Error(o(161))}}catch(O){Ze(e,e.return,O)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Mw(e,n,s){fe=e,sm(e)}function sm(e,n,s){for(var i=(e.mode&1)!==0;fe!==null;){var u=fe,p=u.child;if(u.tag===22&&i){var S=u.memoizedState!==null||Ji;if(!S){var R=u.alternate,O=R!==null&&R.memoizedState!==null||bt;R=Ji;var W=bt;if(Ji=S,(bt=O)&&!W)for(fe=u;fe!==null;)S=fe,O=S.child,S.tag===22&&S.memoizedState!==null?lm(u):O!==null?(O.return=S,fe=O):lm(u);for(;p!==null;)fe=p,sm(p),p=p.sibling;fe=u,Ji=R,bt=W}am(e)}else(u.subtreeFlags&8772)!==0&&p!==null?(p.return=u,fe=p):am(e)}}function am(e){for(;fe!==null;){var n=fe;if((n.flags&8772)!==0){var s=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:bt||Zi(5,n);break;case 1:var i=n.stateNode;if(n.flags&4&&!bt)if(s===null)i.componentDidMount();else{var u=n.elementType===n.type?s.memoizedProps:hn(n.type,s.memoizedProps);i.componentDidUpdate(u,s.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var p=n.updateQueue;p!==null&&ip(n,p,i);break;case 3:var S=n.updateQueue;if(S!==null){if(s=null,n.child!==null)switch(n.child.tag){case 5:s=n.child.stateNode;break;case 1:s=n.child.stateNode}ip(n,S,s)}break;case 5:var R=n.stateNode;if(s===null&&n.flags&4){s=R;var O=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":O.autoFocus&&s.focus();break;case"img":O.src&&(s.src=O.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var W=n.alternate;if(W!==null){var te=W.memoizedState;if(te!==null){var re=te.dehydrated;re!==null&&sa(re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}bt||n.flags&512&&Ou(n)}catch(Z){Ze(n,n.return,Z)}}if(n===e){fe=null;break}if(s=n.sibling,s!==null){s.return=n.return,fe=s;break}fe=n.return}}function im(e){for(;fe!==null;){var n=fe;if(n===e){fe=null;break}var s=n.sibling;if(s!==null){s.return=n.return,fe=s;break}fe=n.return}}function lm(e){for(;fe!==null;){var n=fe;try{switch(n.tag){case 0:case 11:case 15:var s=n.return;try{Zi(4,n)}catch(O){Ze(n,s,O)}break;case 1:var i=n.stateNode;if(typeof i.componentDidMount=="function"){var u=n.return;try{i.componentDidMount()}catch(O){Ze(n,u,O)}}var p=n.return;try{Ou(n)}catch(O){Ze(n,p,O)}break;case 5:var S=n.return;try{Ou(n)}catch(O){Ze(n,S,O)}}}catch(O){Ze(n,n.return,O)}if(n===e){fe=null;break}var R=n.sibling;if(R!==null){R.return=n.return,fe=R;break}fe=n.return}}var Iw=Math.ceil,el=T.ReactCurrentDispatcher,_u=T.ReactCurrentOwner,en=T.ReactCurrentBatchConfig,Ae=0,ut=null,ot=null,mt=0,Vt=0,ds=jr(0),it=0,Ra=null,mo=0,tl=0,Du=0,ja=null,_t=null,zu=0,fs=1/0,rr=null,nl=!1,Fu=null,Lr=null,rl=!1,_r=null,ol=0,Ta=0,Uu=null,sl=-1,al=0;function Rt(){return(Ae&6)!==0?nt():sl!==-1?sl:sl=nt()}function Dr(e){return(e.mode&1)===0?1:(Ae&2)!==0&&mt!==0?mt&-mt:mw.transition!==null?(al===0&&(al=th()),al):(e=Fe,e!==0||(e=window.event,e=e===void 0?16:uh(e.type)),e)}function gn(e,n,s,i){if(50<Ta)throw Ta=0,Uu=null,Error(o(185));ea(e,s,i),((Ae&2)===0||e!==ut)&&(e===ut&&((Ae&2)===0&&(tl|=s),it===4&&zr(e,mt)),Dt(e,i),s===1&&Ae===0&&(n.mode&1)===0&&(fs=nt()+500,Ai&&Mr()))}function Dt(e,n){var s=e.callbackNode;mx(e,n);var i=mi(e,e===ut?mt:0);if(i===0)s!==null&&Jf(s),e.callbackNode=null,e.callbackPriority=0;else if(n=i&-i,e.callbackPriority!==n){if(s!=null&&Jf(s),n===1)e.tag===0?pw(um.bind(null,e)):Gh(um.bind(null,e)),uw(function(){(Ae&6)===0&&Mr()}),s=null;else{switch(nh(i)){case 1:s=xc;break;case 4:s=Zf;break;case 16:s=di;break;case 536870912:s=eh;break;default:s=di}s=vm(s,cm.bind(null,e))}e.callbackPriority=n,e.callbackNode=s}}function cm(e,n){if(sl=-1,al=0,(Ae&6)!==0)throw Error(o(327));var s=e.callbackNode;if(hs()&&e.callbackNode!==s)return null;var i=mi(e,e===ut?mt:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||n)n=il(e,i);else{n=i;var u=Ae;Ae|=2;var p=fm();(ut!==e||mt!==n)&&(rr=null,fs=nt()+500,yo(e,n));do try{Lw();break}catch(R){dm(e,R)}while(!0);ou(),el.current=p,Ae=u,ot!==null?n=0:(ut=null,mt=0,n=it)}if(n!==0){if(n===2&&(u=wc(e),u!==0&&(i=u,n=Bu(e,u))),n===1)throw s=Ra,yo(e,0),zr(e,i),Dt(e,nt()),s;if(n===6)zr(e,i);else{if(u=e.current.alternate,(i&30)===0&&!Ow(u)&&(n=il(e,i),n===2&&(p=wc(e),p!==0&&(i=p,n=Bu(e,p))),n===1))throw s=Ra,yo(e,0),zr(e,i),Dt(e,nt()),s;switch(e.finishedWork=u,e.finishedLanes=i,n){case 0:case 1:throw Error(o(345));case 2:vo(e,_t,rr);break;case 3:if(zr(e,i),(i&130023424)===i&&(n=zu+500-nt(),10<n)){if(mi(e,0)!==0)break;if(u=e.suspendedLanes,(u&i)!==i){Rt(),e.pingedLanes|=e.suspendedLanes&u;break}e.timeoutHandle=Qc(vo.bind(null,e,_t,rr),n);break}vo(e,_t,rr);break;case 4:if(zr(e,i),(i&4194240)===i)break;for(n=e.eventTimes,u=-1;0<i;){var S=31-un(i);p=1<<S,S=n[S],S>u&&(u=S),i&=~p}if(i=u,i=nt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Iw(i/1960))-i,10<i){e.timeoutHandle=Qc(vo.bind(null,e,_t,rr),i);break}vo(e,_t,rr);break;case 5:vo(e,_t,rr);break;default:throw Error(o(329))}}}return Dt(e,nt()),e.callbackNode===s?cm.bind(null,e):null}function Bu(e,n){var s=ja;return e.current.memoizedState.isDehydrated&&(yo(e,n).flags|=256),e=il(e,n),e!==2&&(n=_t,_t=s,n!==null&&$u(n)),e}function $u(e){_t===null?_t=e:_t.push.apply(_t,e)}function Ow(e){for(var n=e;;){if(n.flags&16384){var s=n.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var i=0;i<s.length;i++){var u=s[i],p=u.getSnapshot;u=u.value;try{if(!dn(p(),u))return!1}catch{return!1}}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function zr(e,n){for(n&=~Du,n&=~tl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var s=31-un(n),i=1<<s;e[s]=-1,n&=~i}}function um(e){if((Ae&6)!==0)throw Error(o(327));hs();var n=mi(e,0);if((n&1)===0)return Dt(e,nt()),null;var s=il(e,n);if(e.tag!==0&&s===2){var i=wc(e);i!==0&&(n=i,s=Bu(e,i))}if(s===1)throw s=Ra,yo(e,0),zr(e,n),Dt(e,nt()),s;if(s===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,vo(e,_t,rr),Dt(e,nt()),null}function Wu(e,n){var s=Ae;Ae|=1;try{return e(n)}finally{Ae=s,Ae===0&&(fs=nt()+500,Ai&&Mr())}}function go(e){_r!==null&&_r.tag===0&&(Ae&6)===0&&hs();var n=Ae;Ae|=1;var s=en.transition,i=Fe;try{if(en.transition=null,Fe=1,e)return e()}finally{Fe=i,en.transition=s,Ae=n,(Ae&6)===0&&Mr()}}function Hu(){Vt=ds.current,He(ds)}function yo(e,n){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,cw(s)),ot!==null)for(s=ot.return;s!==null;){var i=s;switch(Zc(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Ii();break;case 3:ls(),He(Ot),He(vt),fu();break;case 5:uu(i);break;case 4:ls();break;case 13:He(Ge);break;case 19:He(Ge);break;case 10:su(i.type._context);break;case 22:case 23:Hu()}s=s.return}if(ut=e,ot=e=Fr(e.current,null),mt=Vt=n,it=0,Ra=null,Du=tl=mo=0,_t=ja=null,fo!==null){for(n=0;n<fo.length;n++)if(s=fo[n],i=s.interleaved,i!==null){s.interleaved=null;var u=i.next,p=s.pending;if(p!==null){var S=p.next;p.next=u,i.next=S}s.pending=i}fo=null}return e}function dm(e,n){do{var s=ot;try{if(ou(),Hi.current=qi,Vi){for(var i=Ye.memoizedState;i!==null;){var u=i.queue;u!==null&&(u.pending=null),i=i.next}Vi=!1}if(po=0,ct=at=Ye=null,Sa=!1,Ca=0,_u.current=null,s===null||s.return===null){it=1,Ra=n,ot=null;break}e:{var p=e,S=s.return,R=s,O=n;if(n=mt,R.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){var W=O,te=R,re=te.tag;if((te.mode&1)===0&&(re===0||re===11||re===15)){var Z=te.alternate;Z?(te.updateQueue=Z.updateQueue,te.memoizedState=Z.memoizedState,te.lanes=Z.lanes):(te.updateQueue=null,te.memoizedState=null)}var de=_p(S);if(de!==null){de.flags&=-257,Dp(de,S,R,p,n),de.mode&1&&Lp(p,W,n),n=de,O=W;var me=n.updateQueue;if(me===null){var ge=new Set;ge.add(O),n.updateQueue=ge}else me.add(O);break e}else{if((n&1)===0){Lp(p,W,n),Vu();break e}O=Error(o(426))}}else if(Qe&&R.mode&1){var rt=_p(S);if(rt!==null){(rt.flags&65536)===0&&(rt.flags|=256),Dp(rt,S,R,p,n),nu(cs(O,R));break e}}p=O=cs(O,R),it!==4&&(it=2),ja===null?ja=[p]:ja.push(p),p=S;do{switch(p.tag){case 3:p.flags|=65536,n&=-n,p.lanes|=n;var D=Op(p,O,n);ap(p,D);break e;case 1:R=O;var A=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Lr===null||!Lr.has(F)))){p.flags|=65536,n&=-n,p.lanes|=n;var se=Ap(p,R,n);ap(p,se);break e}}p=p.return}while(p!==null)}pm(s)}catch(ye){n=ye,ot===s&&s!==null&&(ot=s=s.return);continue}break}while(!0)}function fm(){var e=el.current;return el.current=qi,e===null?qi:e}function Vu(){(it===0||it===3||it===2)&&(it=4),ut===null||(mo&268435455)===0&&(tl&268435455)===0||zr(ut,mt)}function il(e,n){var s=Ae;Ae|=2;var i=fm();(ut!==e||mt!==n)&&(rr=null,yo(e,n));do try{Aw();break}catch(u){dm(e,u)}while(!0);if(ou(),Ae=s,el.current=i,ot!==null)throw Error(o(261));return ut=null,mt=0,it}function Aw(){for(;ot!==null;)hm(ot)}function Lw(){for(;ot!==null&&!ax();)hm(ot)}function hm(e){var n=ym(e.alternate,e,Vt);e.memoizedProps=e.pendingProps,n===null?pm(e):ot=n,_u.current=null}function pm(e){var n=e;do{var s=n.alternate;if(e=n.return,(n.flags&32768)===0){if(s=Pw(s,n,Vt),s!==null){ot=s;return}}else{if(s=Rw(s,n),s!==null){s.flags&=32767,ot=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{it=6,ot=null;return}}if(n=n.sibling,n!==null){ot=n;return}ot=n=e}while(n!==null);it===0&&(it=5)}function vo(e,n,s){var i=Fe,u=en.transition;try{en.transition=null,Fe=1,_w(e,n,s,i)}finally{en.transition=u,Fe=i}return null}function _w(e,n,s,i){do hs();while(_r!==null);if((Ae&6)!==0)throw Error(o(327));s=e.finishedWork;var u=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var p=s.lanes|s.childLanes;if(gx(e,p),e===ut&&(ot=ut=null,mt=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||rl||(rl=!0,vm(di,function(){return hs(),null})),p=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||p){p=en.transition,en.transition=null;var S=Fe;Fe=1;var R=Ae;Ae|=4,_u.current=null,Tw(e,s),om(s,e),nw(Vc),vi=!!Hc,Vc=Hc=null,e.current=s,Mw(s),ix(),Ae=R,Fe=S,en.transition=p}else e.current=s;if(rl&&(rl=!1,_r=e,ol=u),p=e.pendingLanes,p===0&&(Lr=null),ux(s.stateNode),Dt(e,nt()),n!==null)for(i=e.onRecoverableError,s=0;s<n.length;s++)u=n[s],i(u.value,{componentStack:u.stack,digest:u.digest});if(nl)throw nl=!1,e=Fu,Fu=null,e;return(ol&1)!==0&&e.tag!==0&&hs(),p=e.pendingLanes,(p&1)!==0?e===Uu?Ta++:(Ta=0,Uu=e):Ta=0,Mr(),null}function hs(){if(_r!==null){var e=nh(ol),n=en.transition,s=Fe;try{if(en.transition=null,Fe=16>e?16:e,_r===null)var i=!1;else{if(e=_r,_r=null,ol=0,(Ae&6)!==0)throw Error(o(331));var u=Ae;for(Ae|=4,fe=e.current;fe!==null;){var p=fe,S=p.child;if((fe.flags&16)!==0){var R=p.deletions;if(R!==null){for(var O=0;O<R.length;O++){var W=R[O];for(fe=W;fe!==null;){var te=fe;switch(te.tag){case 0:case 11:case 15:Pa(8,te,p)}var re=te.child;if(re!==null)re.return=te,fe=re;else for(;fe!==null;){te=fe;var Z=te.sibling,de=te.return;if(Zp(te),te===W){fe=null;break}if(Z!==null){Z.return=de,fe=Z;break}fe=de}}}var me=p.alternate;if(me!==null){var ge=me.child;if(ge!==null){me.child=null;do{var rt=ge.sibling;ge.sibling=null,ge=rt}while(ge!==null)}}fe=p}}if((p.subtreeFlags&2064)!==0&&S!==null)S.return=p,fe=S;else e:for(;fe!==null;){if(p=fe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Pa(9,p,p.return)}var D=p.sibling;if(D!==null){D.return=p.return,fe=D;break e}fe=p.return}}var A=e.current;for(fe=A;fe!==null;){S=fe;var F=S.child;if((S.subtreeFlags&2064)!==0&&F!==null)F.return=S,fe=F;else e:for(S=A;fe!==null;){if(R=fe,(R.flags&2048)!==0)try{switch(R.tag){case 0:case 11:case 15:Zi(9,R)}}catch(ye){Ze(R,R.return,ye)}if(R===S){fe=null;break e}var se=R.sibling;if(se!==null){se.return=R.return,fe=se;break e}fe=R.return}}if(Ae=u,Mr(),An&&typeof An.onPostCommitFiberRoot=="function")try{An.onPostCommitFiberRoot(fi,e)}catch{}i=!0}return i}finally{Fe=s,en.transition=n}}return!1}function mm(e,n,s){n=cs(s,n),n=Op(e,n,1),e=Or(e,n,1),n=Rt(),e!==null&&(ea(e,1,n),Dt(e,n))}function Ze(e,n,s){if(e.tag===3)mm(e,e,s);else for(;n!==null;){if(n.tag===3){mm(n,e,s);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Lr===null||!Lr.has(i))){e=cs(s,e),e=Ap(n,e,1),n=Or(n,e,1),e=Rt(),n!==null&&(ea(n,1,e),Dt(n,e));break}}n=n.return}}function Dw(e,n,s){var i=e.pingCache;i!==null&&i.delete(n),n=Rt(),e.pingedLanes|=e.suspendedLanes&s,ut===e&&(mt&s)===s&&(it===4||it===3&&(mt&130023424)===mt&&500>nt()-zu?yo(e,0):Du|=s),Dt(e,n)}function gm(e,n){n===0&&((e.mode&1)===0?n=1:(n=pi,pi<<=1,(pi&130023424)===0&&(pi=4194304)));var s=Rt();e=er(e,n),e!==null&&(ea(e,n,s),Dt(e,s))}function zw(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),gm(e,s)}function Fw(e,n){var s=0;switch(e.tag){case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(o(314))}i!==null&&i.delete(n),gm(e,s)}var ym;ym=function(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps||Ot.current)Lt=!0;else{if((e.lanes&s)===0&&(n.flags&128)===0)return Lt=!1,Nw(e,n,s);Lt=(e.flags&131072)!==0}else Lt=!1,Qe&&(n.flags&1048576)!==0&&Yh(n,_i,n.index);switch(n.lanes=0,n.tag){case 2:var i=n.type;Xi(e,n),e=n.pendingProps;var u=ts(n,vt.current);is(n,s),u=mu(null,n,i,e,u,s);var p=gu();return n.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,At(i)?(p=!0,Oi(n)):p=!1,n.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,lu(n),u.updater=Gi,n.stateNode=u,u._reactInternals=n,Su(n,i,e,s),n=Nu(null,n,i,!0,p,s)):(n.tag=0,Qe&&p&&Jc(n),Pt(null,n,u,s),n=n.child),n;case 16:i=n.elementType;e:{switch(Xi(e,n),e=n.pendingProps,u=i._init,i=u(i._payload),n.type=i,u=n.tag=Bw(i),e=hn(i,e),u){case 0:n=Eu(null,n,i,e,s);break e;case 1:n=Wp(null,n,i,e,s);break e;case 11:n=zp(null,n,i,e,s);break e;case 14:n=Fp(null,n,i,hn(i.type,e),s);break e}throw Error(o(306,i,""))}return n;case 0:return i=n.type,u=n.pendingProps,u=n.elementType===i?u:hn(i,u),Eu(e,n,i,u,s);case 1:return i=n.type,u=n.pendingProps,u=n.elementType===i?u:hn(i,u),Wp(e,n,i,u,s);case 3:e:{if(Hp(n),e===null)throw Error(o(387));i=n.pendingProps,p=n.memoizedState,u=p.element,sp(e,n),$i(n,i,null,s);var S=n.memoizedState;if(i=S.element,p.isDehydrated)if(p={element:i,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){u=cs(Error(o(423)),n),n=Vp(e,n,i,s,u);break e}else if(i!==u){u=cs(Error(o(424)),n),n=Vp(e,n,i,s,u);break e}else for(Ht=Rr(n.stateNode.containerInfo.firstChild),Wt=n,Qe=!0,fn=null,s=rp(n,null,i,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(os(),i===u){n=nr(e,n,s);break e}Pt(e,n,i,s)}n=n.child}return n;case 5:return lp(n),e===null&&tu(n),i=n.type,u=n.pendingProps,p=e!==null?e.memoizedProps:null,S=u.children,Kc(i,u)?S=null:p!==null&&Kc(i,p)&&(n.flags|=32),$p(e,n),Pt(e,n,S,s),n.child;case 6:return e===null&&tu(n),null;case 13:return Kp(e,n,s);case 4:return cu(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=ss(n,null,i,s):Pt(e,n,i,s),n.child;case 11:return i=n.type,u=n.pendingProps,u=n.elementType===i?u:hn(i,u),zp(e,n,i,u,s);case 7:return Pt(e,n,n.pendingProps,s),n.child;case 8:return Pt(e,n,n.pendingProps.children,s),n.child;case 12:return Pt(e,n,n.pendingProps.children,s),n.child;case 10:e:{if(i=n.type._context,u=n.pendingProps,p=n.memoizedProps,S=u.value,$e(Fi,i._currentValue),i._currentValue=S,p!==null)if(dn(p.value,S)){if(p.children===u.children&&!Ot.current){n=nr(e,n,s);break e}}else for(p=n.child,p!==null&&(p.return=n);p!==null;){var R=p.dependencies;if(R!==null){S=p.child;for(var O=R.firstContext;O!==null;){if(O.context===i){if(p.tag===1){O=tr(-1,s&-s),O.tag=2;var W=p.updateQueue;if(W!==null){W=W.shared;var te=W.pending;te===null?O.next=O:(O.next=te.next,te.next=O),W.pending=O}}p.lanes|=s,O=p.alternate,O!==null&&(O.lanes|=s),au(p.return,s,n),R.lanes|=s;break}O=O.next}}else if(p.tag===10)S=p.type===n.type?null:p.child;else if(p.tag===18){if(S=p.return,S===null)throw Error(o(341));S.lanes|=s,R=S.alternate,R!==null&&(R.lanes|=s),au(S,s,n),S=p.sibling}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===n){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}Pt(e,n,u.children,s),n=n.child}return n;case 9:return u=n.type,i=n.pendingProps.children,is(n,s),u=Jt(u),i=i(u),n.flags|=1,Pt(e,n,i,s),n.child;case 14:return i=n.type,u=hn(i,n.pendingProps),u=hn(i.type,u),Fp(e,n,i,u,s);case 15:return Up(e,n,n.type,n.pendingProps,s);case 17:return i=n.type,u=n.pendingProps,u=n.elementType===i?u:hn(i,u),Xi(e,n),n.tag=1,At(i)?(e=!0,Oi(n)):e=!1,is(n,s),Mp(n,i,u),Su(n,i,u,s),Nu(null,n,i,!0,e,s);case 19:return qp(e,n,s);case 22:return Bp(e,n,s)}throw Error(o(156,n.tag))};function vm(e,n){return Xf(e,n)}function Uw(e,n,s,i){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,n,s,i){return new Uw(e,n,s,i)}function Ku(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bw(e){if(typeof e=="function")return Ku(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_)return 11;if(e===oe)return 14}return 2}function Fr(e,n){var s=e.alternate;return s===null?(s=tn(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function ll(e,n,s,i,u,p){var S=2;if(i=e,typeof e=="function")Ku(e)&&(S=1);else if(typeof e=="string")S=5;else e:switch(e){case $:return xo(s.children,u,p,n);case Y:S=8,u|=8;break;case U:return e=tn(12,s,n,u|2),e.elementType=U,e.lanes=p,e;case Q:return e=tn(13,s,n,u),e.elementType=Q,e.lanes=p,e;case J:return e=tn(19,s,n,u),e.elementType=J,e.lanes=p,e;case ce:return cl(s,u,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:S=10;break e;case z:S=9;break e;case _:S=11;break e;case oe:S=14;break e;case le:S=16,i=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return n=tn(S,s,n,u),n.elementType=e,n.type=i,n.lanes=p,n}function xo(e,n,s,i){return e=tn(7,e,i,n),e.lanes=s,e}function cl(e,n,s,i){return e=tn(22,e,i,n),e.elementType=ce,e.lanes=s,e.stateNode={isHidden:!1},e}function Qu(e,n,s){return e=tn(6,e,null,n),e.lanes=s,e}function qu(e,n,s){return n=tn(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function $w(e,n,s,i,u){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bc(0),this.expirationTimes=bc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bc(0),this.identifierPrefix=i,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function Gu(e,n,s,i,u,p,S,R,O){return e=new $w(e,n,s,R,O),n===1?(n=1,p===!0&&(n|=8)):n=0,p=tn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:i,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},lu(p),e}function Ww(e,n,s){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H,key:i==null?null:""+i,children:e,containerInfo:n,implementation:s}}function xm(e){if(!e)return Tr;e=e._reactInternals;e:{if(ao(e)!==e||e.tag!==1)throw Error(o(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(At(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(o(171))}if(e.tag===1){var s=e.type;if(At(s))return Qh(e,s,n)}return n}function wm(e,n,s,i,u,p,S,R,O){return e=Gu(s,i,!0,e,u,p,S,R,O),e.context=xm(null),s=e.current,i=Rt(),u=Dr(s),p=tr(i,u),p.callback=n??null,Or(s,p,u),e.current.lanes=u,ea(e,u,i),Dt(e,i),e}function ul(e,n,s,i){var u=n.current,p=Rt(),S=Dr(u);return s=xm(s),n.context===null?n.context=s:n.pendingContext=s,n=tr(p,S),n.payload={element:e},i=i===void 0?null:i,i!==null&&(n.callback=i),e=Or(u,n,S),e!==null&&(gn(e,u,S,p),Bi(e,u,S)),S}function dl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function bm(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function Yu(e,n){bm(e,n),(e=e.alternate)&&bm(e,n)}function Hw(){return null}var Sm=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xu(e){this._internalRoot=e}fl.prototype.render=Xu.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));ul(e,n,null,null)},fl.prototype.unmount=Xu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;go(function(){ul(null,e,null,null)}),n[Yn]=null}};function fl(e){this._internalRoot=e}fl.prototype.unstable_scheduleHydration=function(e){if(e){var n=sh();e={blockedOn:null,target:e,priority:n};for(var s=0;s<Er.length&&n!==0&&n<Er[s].priority;s++);Er.splice(s,0,e),s===0&&lh(e)}};function Ju(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cm(){}function Vw(e,n,s,i,u){if(u){if(typeof i=="function"){var p=i;i=function(){var W=dl(S);p.call(W)}}var S=wm(n,i,e,0,null,!1,!1,"",Cm);return e._reactRootContainer=S,e[Yn]=S.current,pa(e.nodeType===8?e.parentNode:e),go(),S}for(;u=e.lastChild;)e.removeChild(u);if(typeof i=="function"){var R=i;i=function(){var W=dl(O);R.call(W)}}var O=Gu(e,0,!1,null,null,!1,!1,"",Cm);return e._reactRootContainer=O,e[Yn]=O.current,pa(e.nodeType===8?e.parentNode:e),go(function(){ul(n,O,s,i)}),O}function pl(e,n,s,i,u){var p=s._reactRootContainer;if(p){var S=p;if(typeof u=="function"){var R=u;u=function(){var O=dl(S);R.call(O)}}ul(n,S,e,u)}else S=Vw(s,n,e,u,i);return dl(S)}rh=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var s=Zs(n.pendingLanes);s!==0&&(Sc(n,s|1),Dt(n,nt()),(Ae&6)===0&&(fs=nt()+500,Mr()))}break;case 13:go(function(){var i=er(e,1);if(i!==null){var u=Rt();gn(i,e,1,u)}}),Yu(e,1)}},Cc=function(e){if(e.tag===13){var n=er(e,134217728);if(n!==null){var s=Rt();gn(n,e,134217728,s)}Yu(e,134217728)}},oh=function(e){if(e.tag===13){var n=Dr(e),s=er(e,n);if(s!==null){var i=Rt();gn(s,e,n,i)}Yu(e,n)}},sh=function(){return Fe},ah=function(e,n){var s=Fe;try{return Fe=e,n()}finally{Fe=s}},Vo=function(e,n,s){switch(n){case"input":if(an(e,s),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<s.length;n++){var i=s[n];if(i!==e&&i.form===e.form){var u=Mi(i);if(!u)throw Error(o(90));Ie(i),an(i,u)}}}break;case"textarea":ri(e,s);break;case"select":n=s.value,n!=null&&Gt(e,!!s.multiple,n,!1)}},_e=Wu,Ue=go;var Kw={usingClientEntryPoint:!1,Events:[ya,Zo,Mi,li,Ee,Wu]},Ma={findFiberByHostInstance:io,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Qw={bundleType:Ma.bundleType,version:Ma.version,rendererPackageName:Ma.rendererPackageName,rendererConfig:Ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Gf(e),e===null?null:e.stateNode},findFiberByHostInstance:Ma.findFiberByHostInstance||Hw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ml=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ml.isDisabled&&ml.supportsFiber)try{fi=ml.inject(Qw),An=ml}catch{}}return zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kw,zt.createPortal=function(e,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ju(n))throw Error(o(200));return Ww(e,n,null,s)},zt.createRoot=function(e,n){if(!Ju(e))throw Error(o(299));var s=!1,i="",u=Sm;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(u=n.onRecoverableError)),n=Gu(e,1,!1,null,null,s,!1,i,u),e[Yn]=n.current,pa(e.nodeType===8?e.parentNode:e),new Xu(n)},zt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=Gf(n),e=e===null?null:e.stateNode,e},zt.flushSync=function(e){return go(e)},zt.hydrate=function(e,n,s){if(!hl(n))throw Error(o(200));return pl(null,e,n,!0,s)},zt.hydrateRoot=function(e,n,s){if(!Ju(e))throw Error(o(405));var i=s!=null&&s.hydratedSources||null,u=!1,p="",S=Sm;if(s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onRecoverableError!==void 0&&(S=s.onRecoverableError)),n=wm(n,null,e,1,s??null,u,!1,p,S),e[Yn]=n.current,pa(e),i)for(e=0;e<i.length;e++)s=i[e],u=s._getVersion,u=u(s._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[s,u]:n.mutableSourceEagerHydrationData.push(s,u);return new fl(n)},zt.render=function(e,n,s){if(!hl(n))throw Error(o(200));return pl(null,e,n,!1,s)},zt.unmountComponentAtNode=function(e){if(!hl(e))throw Error(o(40));return e._reactRootContainer?(go(function(){pl(null,null,e,!1,function(){e._reactRootContainer=null,e[Yn]=null})}),!0):!1},zt.unstable_batchedUpdates=Wu,zt.unstable_renderSubtreeIntoContainer=function(e,n,s,i){if(!hl(s))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return pl(e,n,s,!1,i)},zt.version="18.3.1-next-f1338f8080-20240426",zt}var Im;function ny(){if(Im)return nd.exports;Im=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),nd.exports=t1(),nd.exports}var Om;function n1(){if(Om)return yl;Om=1;var t=ny();return yl.createRoot=t.createRoot,yl.hydrateRoot=t.hydrateRoot,yl}var r1=n1();/**
41
- * react-router v7.13.0
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */var Am="popstate";function o1(t={}){function r(a,l){let{pathname:c,search:f,hash:h}=a.location;return bd("",{pathname:c,search:f,hash:h},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function o(a,l){return typeof l=="string"?l:Fa(l)}return a1(r,o,null,t)}function qe(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function Sn(t,r){if(!t){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function s1(){return Math.random().toString(36).substring(2,10)}function Lm(t,r){return{usr:t.state,key:t.key,idx:r}}function bd(t,r,o=null,a){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof r=="string"?Fs(r):r,state:o,key:r&&r.key||a||s1()}}function Fa({pathname:t="/",search:r="",hash:o=""}){return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),o&&o!=="#"&&(t+=o.charAt(0)==="#"?o:"#"+o),t}function Fs(t){let r={};if(t){let o=t.indexOf("#");o>=0&&(r.hash=t.substring(o),t=t.substring(0,o));let a=t.indexOf("?");a>=0&&(r.search=t.substring(a),t=t.substring(0,a)),t&&(r.pathname=t)}return r}function a1(t,r,o,a={}){let{window:l=document.defaultView,v5Compat:c=!1}=a,f=l.history,h="POP",g=null,y=v();y==null&&(y=0,f.replaceState({...f.state,idx:y},""));function v(){return(f.state||{idx:null}).idx}function b(){h="POP";let k=v(),P=k==null?null:k-y;y=k,g&&g({action:h,location:x.location,delta:P})}function C(k,P){h="PUSH";let j=bd(x.location,k,P);y=v()+1;let N=Lm(j,y),T=x.createHref(j);try{f.pushState(N,"",T)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;l.location.assign(T)}c&&g&&g({action:h,location:x.location,delta:1})}function w(k,P){h="REPLACE";let j=bd(x.location,k,P);y=v();let N=Lm(j,y),T=x.createHref(j);f.replaceState(N,"",T),c&&g&&g({action:h,location:x.location,delta:0})}function E(k){return i1(k)}let x={get action(){return h},get location(){return t(l,f)},listen(k){if(g)throw new Error("A history only accepts one active listener");return l.addEventListener(Am,b),g=k,()=>{l.removeEventListener(Am,b),g=null}},createHref(k){return r(l,k)},createURL:E,encodeLocation(k){let P=E(k);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:C,replace:w,go(k){return f.go(k)}};return x}function i1(t,r=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),qe(o,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:Fa(t);return a=a.replace(/ $/,"%20"),!r&&a.startsWith("//")&&(a=o+a),new URL(a,o)}function ry(t,r,o="/"){return l1(t,r,o,!1)}function l1(t,r,o,a){let l=typeof r=="string"?Fs(r):r,c=pr(l.pathname||"/",o);if(c==null)return null;let f=oy(t);c1(f);let h=null;for(let g=0;h==null&&g<f.length;++g){let y=w1(c);h=v1(f[g],y,a)}return h}function oy(t,r=[],o=[],a="",l=!1){let c=(f,h,g=l,y)=>{let v={relativePath:y===void 0?f.path||"":y,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(a)&&g)return;qe(v.relativePath.startsWith(a),`Absolute route path "${v.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(a.length)}let b=fr([a,v.relativePath]),C=o.concat(v);f.children&&f.children.length>0&&(qe(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),oy(f.children,r,C,b,g)),!(f.path==null&&!f.index)&&r.push({path:b,score:g1(b,f.index),routesMeta:C})};return t.forEach((f,h)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))c(f,h);else for(let y of sy(f.path))c(f,h,!0,y)}),r}function sy(t){let r=t.split("/");if(r.length===0)return[];let[o,...a]=r,l=o.endsWith("?"),c=o.replace(/\?$/,"");if(a.length===0)return l?[c,""]:[c];let f=sy(a.join("/")),h=[];return h.push(...f.map(g=>g===""?c:[c,g].join("/"))),l&&h.push(...f),h.map(g=>t.startsWith("/")&&g===""?"/":g)}function c1(t){t.sort((r,o)=>r.score!==o.score?o.score-r.score:y1(r.routesMeta.map(a=>a.childrenIndex),o.routesMeta.map(a=>a.childrenIndex)))}var u1=/^:[\w-]+$/,d1=3,f1=2,h1=1,p1=10,m1=-2,_m=t=>t==="*";function g1(t,r){let o=t.split("/"),a=o.length;return o.some(_m)&&(a+=m1),r&&(a+=f1),o.filter(l=>!_m(l)).reduce((l,c)=>l+(u1.test(c)?d1:c===""?h1:p1),a)}function y1(t,r){return t.length===r.length&&t.slice(0,-1).every((a,l)=>a===r[l])?t[t.length-1]-r[r.length-1]:0}function v1(t,r,o=!1){let{routesMeta:a}=t,l={},c="/",f=[];for(let h=0;h<a.length;++h){let g=a[h],y=h===a.length-1,v=c==="/"?r:r.slice(c.length)||"/",b=$l({path:g.relativePath,caseSensitive:g.caseSensitive,end:y},v),C=g.route;if(!b&&y&&o&&!a[a.length-1].route.index&&(b=$l({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!b)return null;Object.assign(l,b.params),f.push({params:l,pathname:fr([c,b.pathname]),pathnameBase:k1(fr([c,b.pathnameBase])),route:C}),b.pathnameBase!=="/"&&(c=fr([c,b.pathnameBase]))}return f}function $l(t,r){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[o,a]=x1(t.path,t.caseSensitive,t.end),l=r.match(o);if(!l)return null;let c=l[0],f=c.replace(/(.)\/+$/,"$1"),h=l.slice(1);return{params:a.reduce((y,{paramName:v,isOptional:b},C)=>{if(v==="*"){let E=h[C]||"";f=c.slice(0,c.length-E.length).replace(/(.)\/+$/,"$1")}const w=h[C];return b&&!w?y[v]=void 0:y[v]=(w||"").replace(/%2F/g,"/"),y},{}),pathname:c,pathnameBase:f,pattern:t}}function x1(t,r=!1,o=!0){Sn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let a=[],l="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,g)=>(a.push({paramName:h,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(a.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,r?void 0:"i"),a]}function w1(t){try{return t.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Sn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),t}}function pr(t,r){if(r==="/")return t;if(!t.toLowerCase().startsWith(r.toLowerCase()))return null;let o=r.endsWith("/")?r.length-1:r.length,a=t.charAt(o);return a&&a!=="/"?null:t.slice(o)||"/"}var b1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function S1(t,r="/"){let{pathname:o,search:a="",hash:l=""}=typeof t=="string"?Fs(t):t,c;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?c=Dm(o.substring(1),"/"):c=Dm(o,r)):c=r,{pathname:c,search:E1(a),hash:N1(l)}}function Dm(t,r){let o=r.replace(/\/+$/,"").split("/");return t.split("/").forEach(l=>{l===".."?o.length>1&&o.pop():l!=="."&&o.push(l)}),o.length>1?o.join("/"):"/"}function sd(t,r,o,a){return`Cannot include a '${t}' character in a manually specified \`to.${r}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function C1(t){return t.filter((r,o)=>o===0||r.route.path&&r.route.path.length>0)}function of(t){let r=C1(t);return r.map((o,a)=>a===r.length-1?o.pathname:o.pathnameBase)}function sf(t,r,o,a=!1){let l;typeof t=="string"?l=Fs(t):(l={...t},qe(!l.pathname||!l.pathname.includes("?"),sd("?","pathname","search",l)),qe(!l.pathname||!l.pathname.includes("#"),sd("#","pathname","hash",l)),qe(!l.search||!l.search.includes("#"),sd("#","search","hash",l)));let c=t===""||l.pathname==="",f=c?"/":l.pathname,h;if(f==null)h=o;else{let b=r.length-1;if(!a&&f.startsWith("..")){let C=f.split("/");for(;C[0]==="..";)C.shift(),b-=1;l.pathname=C.join("/")}h=b>=0?r[b]:"/"}let g=S1(l,h),y=f&&f!=="/"&&f.endsWith("/"),v=(c||f===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(y||v)&&(g.pathname+="/"),g}var fr=t=>t.join("/").replace(/\/\/+/g,"/"),k1=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),E1=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,N1=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,P1=class{constructor(t,r,o,a=!1){this.status=t,this.statusText=r||"",this.internal=a,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function R1(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function j1(t){return t.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ay=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function iy(t,r){let o=t;if(typeof o!="string"||!b1.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let a=o,l=!1;if(ay)try{let c=new URL(window.location.href),f=o.startsWith("//")?new URL(c.protocol+o):new URL(o),h=pr(f.pathname,r);f.origin===c.origin&&h!=null?o=h+f.search+f.hash:l=!0}catch{Sn(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ly=["POST","PUT","PATCH","DELETE"];new Set(ly);var T1=["GET",...ly];new Set(T1);var Us=m.createContext(null);Us.displayName="DataRouter";var tc=m.createContext(null);tc.displayName="DataRouterState";var M1=m.createContext(!1),cy=m.createContext({isTransitioning:!1});cy.displayName="ViewTransition";var I1=m.createContext(new Map);I1.displayName="Fetchers";var O1=m.createContext(null);O1.displayName="Await";var qt=m.createContext(null);qt.displayName="Navigation";var Ya=m.createContext(null);Ya.displayName="Location";var Kn=m.createContext({outlet:null,matches:[],isDataRoute:!1});Kn.displayName="Route";var af=m.createContext(null);af.displayName="RouteError";var uy="REACT_ROUTER_ERROR",A1="REDIRECT",L1="ROUTE_ERROR_RESPONSE";function _1(t){if(t.startsWith(`${uy}:${A1}:{`))try{let r=JSON.parse(t.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function D1(t){if(t.startsWith(`${uy}:${L1}:{`))try{let r=JSON.parse(t.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new P1(r.status,r.statusText,r.data)}catch{}}function z1(t,{relative:r}={}){qe(Bs(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:a}=m.useContext(qt),{hash:l,pathname:c,search:f}=Xa(t,{relative:r}),h=c;return o!=="/"&&(h=c==="/"?o:fr([o,c])),a.createHref({pathname:h,search:f,hash:l})}function Bs(){return m.useContext(Ya)!=null}function yr(){return qe(Bs(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Ya).location}var dy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fy(t){m.useContext(qt).static||m.useLayoutEffect(t)}function hy(){let{isDataRoute:t}=m.useContext(Kn);return t?X1():F1()}function F1(){qe(Bs(),"useNavigate() may be used only in the context of a <Router> component.");let t=m.useContext(Us),{basename:r,navigator:o}=m.useContext(qt),{matches:a}=m.useContext(Kn),{pathname:l}=yr(),c=JSON.stringify(of(a)),f=m.useRef(!1);return fy(()=>{f.current=!0}),m.useCallback((g,y={})=>{if(Sn(f.current,dy),!f.current)return;if(typeof g=="number"){o.go(g);return}let v=sf(g,JSON.parse(c),l,y.relative==="path");t==null&&r!=="/"&&(v.pathname=v.pathname==="/"?r:fr([r,v.pathname])),(y.replace?o.replace:o.push)(v,y.state,y)},[r,o,c,l,t])}m.createContext(null);function Xa(t,{relative:r}={}){let{matches:o}=m.useContext(Kn),{pathname:a}=yr(),l=JSON.stringify(of(o));return m.useMemo(()=>sf(t,JSON.parse(l),a,r==="path"),[t,l,a,r])}function U1(t,r){return py(t,r)}function py(t,r,o,a,l){var j;qe(Bs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=m.useContext(qt),{matches:f}=m.useContext(Kn),h=f[f.length-1],g=h?h.params:{},y=h?h.pathname:"/",v=h?h.pathnameBase:"/",b=h&&h.route;{let N=b&&b.path||"";gy(y,!b||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${y}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
-
51
- Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let C=yr(),w;if(r){let N=typeof r=="string"?Fs(r):r;qe(v==="/"||((j=N.pathname)==null?void 0:j.startsWith(v)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${N.pathname}" was given in the \`location\` prop.`),w=N}else w=C;let E=w.pathname||"/",x=E;if(v!=="/"){let N=v.replace(/^\//,"").split("/");x="/"+E.replace(/^\//,"").split("/").slice(N.length).join("/")}let k=ry(t,{pathname:x});Sn(b||k!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),Sn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let P=V1(k&&k.map(N=>Object.assign({},N,{params:Object.assign({},g,N.params),pathname:fr([v,c.encodeLocation?c.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?v:fr([v,c.encodeLocation?c.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),f,o,a,l);return r&&P?m.createElement(Ya.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},P):P}function B1(){let t=Y1(),r=R1(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),o=t instanceof Error?t.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},c={padding:"2px 4px",backgroundColor:a},f=null;return console.error("Error handled by React Router default ErrorBoundary:",t),f=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:c},"ErrorBoundary")," or"," ",m.createElement("code",{style:c},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},r),o?m.createElement("pre",{style:l},o):null,f)}var $1=m.createElement(B1,null),my=class extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){this.props.onError?this.props.onError(t,r):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const o=D1(t.digest);o&&(t=o)}let r=t!==void 0?m.createElement(Kn.Provider,{value:this.props.routeContext},m.createElement(af.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?m.createElement(W1,{error:t},r):r}};my.contextType=M1;var ad=new WeakMap;function W1({children:t,error:r}){let{basename:o}=m.useContext(qt);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let a=_1(r.digest);if(a){let l=ad.get(r);if(l)throw l;let c=iy(a.location,o);if(ay&&!ad.get(r))if(c.isExternal||a.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:a.replace}));throw ad.set(r,f),f}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return t}function H1({routeContext:t,match:r,children:o}){let a=m.useContext(Us);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),m.createElement(Kn.Provider,{value:t},o)}function V1(t,r=[],o=null,a=null,l=null){if(t==null){if(!o)return null;if(o.errors)t=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let c=t,f=o==null?void 0:o.errors;if(f!=null){let v=c.findIndex(b=>b.route.id&&(f==null?void 0:f[b.route.id])!==void 0);qe(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),c=c.slice(0,Math.min(c.length,v+1))}let h=!1,g=-1;if(o)for(let v=0;v<c.length;v++){let b=c[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(g=v),b.route.id){let{loaderData:C,errors:w}=o,E=b.route.loader&&!C.hasOwnProperty(b.route.id)&&(!w||w[b.route.id]===void 0);if(b.route.lazy||E){h=!0,g>=0?c=c.slice(0,g+1):c=[c[0]];break}}}let y=o&&a?(v,b)=>{var C,w;a(v,{location:o.location,params:((w=(C=o.matches)==null?void 0:C[0])==null?void 0:w.params)??{},unstable_pattern:j1(o.matches),errorInfo:b})}:void 0;return c.reduceRight((v,b,C)=>{let w,E=!1,x=null,k=null;o&&(w=f&&b.route.id?f[b.route.id]:void 0,x=b.route.errorElement||$1,h&&(g<0&&C===0?(gy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,k=null):g===C&&(E=!0,k=b.route.hydrateFallbackElement||null)));let P=r.concat(c.slice(0,C+1)),j=()=>{let N;return w?N=x:E?N=k:b.route.Component?N=m.createElement(b.route.Component,null):b.route.element?N=b.route.element:N=v,m.createElement(H1,{match:b,routeContext:{outlet:v,matches:P,isDataRoute:o!=null},children:N})};return o&&(b.route.ErrorBoundary||b.route.errorElement||C===0)?m.createElement(my,{location:o.location,revalidation:o.revalidation,component:x,error:w,children:j(),routeContext:{outlet:null,matches:P,isDataRoute:!0},onError:y}):j()},null)}function lf(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function K1(t){let r=m.useContext(Us);return qe(r,lf(t)),r}function Q1(t){let r=m.useContext(tc);return qe(r,lf(t)),r}function q1(t){let r=m.useContext(Kn);return qe(r,lf(t)),r}function cf(t){let r=q1(t),o=r.matches[r.matches.length-1];return qe(o.route.id,`${t} can only be used on routes that contain a unique "id"`),o.route.id}function G1(){return cf("useRouteId")}function Y1(){var a;let t=m.useContext(af),r=Q1("useRouteError"),o=cf("useRouteError");return t!==void 0?t:(a=r.errors)==null?void 0:a[o]}function X1(){let{router:t}=K1("useNavigate"),r=cf("useNavigate"),o=m.useRef(!1);return fy(()=>{o.current=!0}),m.useCallback(async(l,c={})=>{Sn(o.current,dy),o.current&&(typeof l=="number"?await t.navigate(l):await t.navigate(l,{fromRouteId:r,...c}))},[t,r])}var zm={};function gy(t,r,o){!r&&!zm[t]&&(zm[t]=!0,Sn(!1,o))}m.memo(J1);function J1({routes:t,future:r,state:o,onError:a}){return py(t,void 0,o,a,r)}function Fm({to:t,replace:r,state:o,relative:a}){qe(Bs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=m.useContext(qt);Sn(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:c}=m.useContext(Kn),{pathname:f}=yr(),h=hy(),g=sf(t,of(c),f,a==="path"),y=JSON.stringify(g);return m.useEffect(()=>{h(JSON.parse(y),{replace:r,state:o,relative:a})},[h,y,a,r,o]),null}function sr(t){qe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Z1({basename:t="/",children:r=null,location:o,navigationType:a="POP",navigator:l,static:c=!1,unstable_useTransitions:f}){qe(!Bs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=t.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:h,navigator:l,static:c,unstable_useTransitions:f,future:{}}),[h,l,c,f]);typeof o=="string"&&(o=Fs(o));let{pathname:y="/",search:v="",hash:b="",state:C=null,key:w="default"}=o,E=m.useMemo(()=>{let x=pr(y,h);return x==null?null:{location:{pathname:x,search:v,hash:b,state:C,key:w},navigationType:a}},[h,y,v,b,C,w,a]);return Sn(E!=null,`<Router basename="${h}"> is not able to match the URL "${y}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:m.createElement(qt.Provider,{value:g},m.createElement(Ya.Provider,{children:r,value:E}))}function eb({children:t,location:r}){return U1(Sd(t),r)}function Sd(t,r=[]){let o=[];return m.Children.forEach(t,(a,l)=>{if(!m.isValidElement(a))return;let c=[...r,l];if(a.type===m.Fragment){o.push.apply(o,Sd(a.props.children,c));return}qe(a.type===sr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qe(!a.props.index||!a.props.children,"An index route cannot have child routes.");let f={id:a.props.id||c.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(f.children=Sd(a.props.children,c)),o.push(f)}),o}var Tl="get",Ml="application/x-www-form-urlencoded";function nc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function tb(t){return nc(t)&&t.tagName.toLowerCase()==="button"}function nb(t){return nc(t)&&t.tagName.toLowerCase()==="form"}function rb(t){return nc(t)&&t.tagName.toLowerCase()==="input"}function ob(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function sb(t,r){return t.button===0&&(!r||r==="_self")&&!ob(t)}var vl=null;function ab(){if(vl===null)try{new FormData(document.createElement("form"),0),vl=!1}catch{vl=!0}return vl}var ib=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function id(t){return t!=null&&!ib.has(t)?(Sn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ml}"`),null):t}function lb(t,r){let o,a,l,c,f;if(nb(t)){let h=t.getAttribute("action");a=h?pr(h,r):null,o=t.getAttribute("method")||Tl,l=id(t.getAttribute("enctype"))||Ml,c=new FormData(t)}else if(tb(t)||rb(t)&&(t.type==="submit"||t.type==="image")){let h=t.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=t.getAttribute("formaction")||h.getAttribute("action");if(a=g?pr(g,r):null,o=t.getAttribute("formmethod")||h.getAttribute("method")||Tl,l=id(t.getAttribute("formenctype"))||id(h.getAttribute("enctype"))||Ml,c=new FormData(h,t),!ab()){let{name:y,type:v,value:b}=t;if(v==="image"){let C=y?`${y}.`:"";c.append(`${C}x`,"0"),c.append(`${C}y`,"0")}else y&&c.append(y,b)}}else{if(nc(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Tl,a=null,l=Ml,f=t}return c&&l==="text/plain"&&(f=c,c=void 0),{action:a,method:o.toLowerCase(),encType:l,formData:c,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function uf(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function cb(t,r,o,a){let l=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return o?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:r&&pr(l.pathname,r)==="/"?l.pathname=`${r.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function ub(t,r){if(t.id in r)return r[t.id];try{let o=await import(t.module);return r[t.id]=o,o}catch(o){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function db(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function fb(t,r,o){let a=await Promise.all(t.map(async l=>{let c=r.routes[l.route.id];if(c){let f=await ub(c,o);return f.links?f.links():[]}return[]}));return gb(a.flat(1).filter(db).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function Um(t,r,o,a,l,c){let f=(g,y)=>o[y]?g.route.id!==o[y].route.id:!0,h=(g,y)=>{var v;return o[y].pathname!==g.pathname||((v=o[y].route.path)==null?void 0:v.endsWith("*"))&&o[y].params["*"]!==g.params["*"]};return c==="assets"?r.filter((g,y)=>f(g,y)||h(g,y)):c==="data"?r.filter((g,y)=>{var b;let v=a.routes[g.route.id];if(!v||!v.hasLoader)return!1;if(f(g,y)||h(g,y))return!0;if(g.route.shouldRevalidate){let C=g.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((b=o[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function hb(t,r,{includeHydrateFallback:o}={}){return pb(t.map(a=>{let l=r.routes[a.route.id];if(!l)return[];let c=[l.module];return l.clientActionModule&&(c=c.concat(l.clientActionModule)),l.clientLoaderModule&&(c=c.concat(l.clientLoaderModule)),o&&l.hydrateFallbackModule&&(c=c.concat(l.hydrateFallbackModule)),l.imports&&(c=c.concat(l.imports)),c}).flat(1))}function pb(t){return[...new Set(t)]}function mb(t){let r={},o=Object.keys(t).sort();for(let a of o)r[a]=t[a];return r}function gb(t,r){let o=new Set;return new Set(r),t.reduce((a,l)=>{let c=JSON.stringify(mb(l));return o.has(c)||(o.add(c),a.push({key:c,link:l})),a},[])}function yy(){let t=m.useContext(Us);return uf(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function yb(){let t=m.useContext(tc);return uf(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var df=m.createContext(void 0);df.displayName="FrameworkContext";function vy(){let t=m.useContext(df);return uf(t,"You must render this element inside a <HydratedRouter> element"),t}function vb(t,r){let o=m.useContext(df),[a,l]=m.useState(!1),[c,f]=m.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:y,onMouseLeave:v,onTouchStart:b}=r,C=m.useRef(null);m.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let x=P=>{P.forEach(j=>{f(j.isIntersecting)})},k=new IntersectionObserver(x,{threshold:.5});return C.current&&k.observe(C.current),()=>{k.disconnect()}}},[t]),m.useEffect(()=>{if(a){let x=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(x)}}},[a]);let w=()=>{l(!0)},E=()=>{l(!1),f(!1)};return o?t!=="intent"?[c,C,{}]:[c,C,{onFocus:Oa(h,w),onBlur:Oa(g,E),onMouseEnter:Oa(y,w),onMouseLeave:Oa(v,E),onTouchStart:Oa(b,w)}]:[!1,C,{}]}function Oa(t,r){return o=>{t&&t(o),o.defaultPrevented||r(o)}}function xb({page:t,...r}){let{router:o}=yy(),a=m.useMemo(()=>ry(o.routes,t,o.basename),[o.routes,t,o.basename]);return a?m.createElement(bb,{page:t,matches:a,...r}):null}function wb(t){let{manifest:r,routeModules:o}=vy(),[a,l]=m.useState([]);return m.useEffect(()=>{let c=!1;return fb(t,r,o).then(f=>{c||l(f)}),()=>{c=!0}},[t,r,o]),a}function bb({page:t,matches:r,...o}){let a=yr(),{future:l,manifest:c,routeModules:f}=vy(),{basename:h}=yy(),{loaderData:g,matches:y}=yb(),v=m.useMemo(()=>Um(t,r,y,c,a,"data"),[t,r,y,c,a]),b=m.useMemo(()=>Um(t,r,y,c,a,"assets"),[t,r,y,c,a]),C=m.useMemo(()=>{if(t===a.pathname+a.search+a.hash)return[];let x=new Set,k=!1;if(r.forEach(j=>{var T;let N=c.routes[j.route.id];!N||!N.hasLoader||(!v.some(B=>B.route.id===j.route.id)&&j.route.id in g&&((T=f[j.route.id])!=null&&T.shouldRevalidate)||N.hasClientLoader?k=!0:x.add(j.route.id))}),x.size===0)return[];let P=cb(t,h,l.unstable_trailingSlashAwareDataRequests,"data");return k&&x.size>0&&P.searchParams.set("_routes",r.filter(j=>x.has(j.route.id)).map(j=>j.route.id).join(",")),[P.pathname+P.search]},[h,l.unstable_trailingSlashAwareDataRequests,g,a,c,v,r,t,f]),w=m.useMemo(()=>hb(b,c),[b,c]),E=wb(b);return m.createElement(m.Fragment,null,C.map(x=>m.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...o})),w.map(x=>m.createElement("link",{key:x,rel:"modulepreload",href:x,...o})),E.map(({key:x,link:k})=>m.createElement("link",{key:x,nonce:o.nonce,...k,crossOrigin:k.crossOrigin??o.crossOrigin})))}function Sb(...t){return r=>{t.forEach(o=>{typeof o=="function"?o(r):o!=null&&(o.current=r)})}}var Cb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Cb&&(window.__reactRouterVersion="7.13.0")}catch{}function kb({basename:t,children:r,unstable_useTransitions:o,window:a}){let l=m.useRef();l.current==null&&(l.current=o1({window:a,v5Compat:!0}));let c=l.current,[f,h]=m.useState({action:c.action,location:c.location}),g=m.useCallback(y=>{o===!1?h(y):m.startTransition(()=>h(y))},[o]);return m.useLayoutEffect(()=>c.listen(g),[c,g]),m.createElement(Z1,{basename:t,children:r,location:f.location,navigationType:f.action,navigator:c,unstable_useTransitions:o})}var xy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wy=m.forwardRef(function({onClick:r,discover:o="render",prefetch:a="none",relative:l,reloadDocument:c,replace:f,state:h,target:g,to:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:C,...w},E){let{basename:x,unstable_useTransitions:k}=m.useContext(qt),P=typeof y=="string"&&xy.test(y),j=iy(y,x);y=j.to;let N=z1(y,{relative:l}),[T,B,H]=vb(a,w),$=Pb(y,{replace:f,state:h,target:g,preventScrollReset:v,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:C,unstable_useTransitions:k});function Y(G){r&&r(G),G.defaultPrevented||$(G)}let U=m.createElement("a",{...w,...H,href:j.absoluteURL||N,onClick:j.isExternal||c?r:Y,ref:Sb(E,B),target:g,"data-discover":!P&&o==="render"?"true":void 0});return T&&!P?m.createElement(m.Fragment,null,U,m.createElement(xb,{page:N})):U});wy.displayName="Link";var by=m.forwardRef(function({"aria-current":r="page",caseSensitive:o=!1,className:a="",end:l=!1,style:c,to:f,viewTransition:h,children:g,...y},v){let b=Xa(f,{relative:y.relative}),C=yr(),w=m.useContext(tc),{navigator:E,basename:x}=m.useContext(qt),k=w!=null&&Ib(b)&&h===!0,P=E.encodeLocation?E.encodeLocation(b).pathname:b.pathname,j=C.pathname,N=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;o||(j=j.toLowerCase(),N=N?N.toLowerCase():null,P=P.toLowerCase()),N&&x&&(N=pr(N,x)||N);const T=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let B=j===P||!l&&j.startsWith(P)&&j.charAt(T)==="/",H=N!=null&&(N===P||!l&&N.startsWith(P)&&N.charAt(P.length)==="/"),$={isActive:B,isPending:H,isTransitioning:k},Y=B?r:void 0,U;typeof a=="function"?U=a($):U=[a,B?"active":null,H?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let G=typeof c=="function"?c($):c;return m.createElement(wy,{...y,"aria-current":Y,className:U,ref:v,style:G,to:f,viewTransition:h},typeof g=="function"?g($):g)});by.displayName="NavLink";var Eb=m.forwardRef(({discover:t="render",fetcherKey:r,navigate:o,reloadDocument:a,replace:l,state:c,method:f=Tl,action:h,onSubmit:g,relative:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:C,...w},E)=>{let{unstable_useTransitions:x}=m.useContext(qt),k=Tb(),P=Mb(h,{relative:y}),j=f.toLowerCase()==="get"?"get":"post",N=typeof h=="string"&&xy.test(h),T=B=>{if(g&&g(B),B.defaultPrevented)return;B.preventDefault();let H=B.nativeEvent.submitter,$=(H==null?void 0:H.getAttribute("formmethod"))||f,Y=()=>k(H||B.currentTarget,{fetcherKey:r,method:$,navigate:o,replace:l,state:c,relative:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:C});x&&o!==!1?m.startTransition(()=>Y()):Y()};return m.createElement("form",{ref:E,method:j,action:P,onSubmit:a?g:T,...w,"data-discover":!N&&t==="render"?"true":void 0})});Eb.displayName="Form";function Nb(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sy(t){let r=m.useContext(Us);return qe(r,Nb(t)),r}function Pb(t,{target:r,replace:o,state:a,preventScrollReset:l,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:g}={}){let y=hy(),v=yr(),b=Xa(t,{relative:c});return m.useCallback(C=>{if(sb(C,r)){C.preventDefault();let w=o!==void 0?o:Fa(v)===Fa(b),E=()=>y(t,{replace:w,state:a,preventScrollReset:l,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:h});g?m.startTransition(()=>E()):E()}},[v,y,b,o,a,r,t,l,c,f,h,g])}var Rb=0,jb=()=>`__${String(++Rb)}__`;function Tb(){let{router:t}=Sy("useSubmit"),{basename:r}=m.useContext(qt),o=G1(),a=t.fetch,l=t.navigate;return m.useCallback(async(c,f={})=>{let{action:h,method:g,encType:y,formData:v,body:b}=lb(c,r);if(f.navigate===!1){let C=f.fetcherKey||jb();await a(C,o,f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:v,body:b,formMethod:f.method||g,formEncType:f.encType||y,flushSync:f.flushSync})}else await l(f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:v,body:b,formMethod:f.method||g,formEncType:f.encType||y,replace:f.replace,state:f.state,fromRouteId:o,flushSync:f.flushSync,viewTransition:f.viewTransition})},[a,l,r,o])}function Mb(t,{relative:r}={}){let{basename:o}=m.useContext(qt),a=m.useContext(Kn);qe(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),c={...Xa(t||".",{relative:r})},f=yr();if(t==null){c.search=f.search;let h=new URLSearchParams(c.search),g=h.getAll("index");if(g.some(v=>v==="")){h.delete("index"),g.filter(b=>b).forEach(b=>h.append("index",b));let v=h.toString();c.search=v?`?${v}`:""}}return(!t||t===".")&&l.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(c.pathname=c.pathname==="/"?o:fr([o,c.pathname])),Fa(c)}function Ib(t,{relative:r}={}){let o=m.useContext(cy);qe(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Sy("useViewTransitionState"),l=Xa(t,{relative:r});if(!o.isTransitioning)return!1;let c=pr(o.currentLocation.pathname,a)||o.currentLocation.pathname,f=pr(o.nextLocation.pathname,a)||o.nextLocation.pathname;return $l(l.pathname,f)!=null||$l(l.pathname,c)!=null}var Ja=ny();const Cy=ey(Ja);var $s=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ob={setTimeout:(t,r)=>setTimeout(t,r),clearTimeout:t=>clearTimeout(t),setInterval:(t,r)=>setInterval(t,r),clearInterval:t=>clearInterval(t)},Vr,nf,Wg,Ab=(Wg=class{constructor(){xe(this,Vr,Ob);xe(this,nf,!1)}setTimeoutProvider(t){ue(this,Vr,t)}setTimeout(t,r){return I(this,Vr).setTimeout(t,r)}clearTimeout(t){I(this,Vr).clearTimeout(t)}setInterval(t,r){return I(this,Vr).setInterval(t,r)}clearInterval(t){I(this,Vr).clearInterval(t)}},Vr=new WeakMap,nf=new WeakMap,Wg),wo=new Ab;function Lb(t){setTimeout(t,0)}var Mo=typeof window>"u"||"Deno"in globalThis;function Tt(){}function _b(t,r){return typeof t=="function"?t(r):t}function Cd(t){return typeof t=="number"&&t>=0&&t!==1/0}function ky(t,r){return Math.max(t+(r||0)-Date.now(),0)}function eo(t,r){return typeof t=="function"?t(r):t}function rn(t,r){return typeof t=="function"?t(r):t}function Bm(t,r){const{type:o="all",exact:a,fetchStatus:l,predicate:c,queryKey:f,stale:h}=t;if(f){if(a){if(r.queryHash!==ff(f,r.options))return!1}else if(!Ua(r.queryKey,f))return!1}if(o!=="all"){const g=r.isActive();if(o==="active"&&!g||o==="inactive"&&g)return!1}return!(typeof h=="boolean"&&r.isStale()!==h||l&&l!==r.state.fetchStatus||c&&!c(r))}function $m(t,r){const{exact:o,status:a,predicate:l,mutationKey:c}=t;if(c){if(!r.options.mutationKey)return!1;if(o){if(Io(r.options.mutationKey)!==Io(c))return!1}else if(!Ua(r.options.mutationKey,c))return!1}return!(a&&r.state.status!==a||l&&!l(r))}function ff(t,r){return((r==null?void 0:r.queryKeyHashFn)||Io)(t)}function Io(t){return JSON.stringify(t,(r,o)=>kd(o)?Object.keys(o).sort().reduce((a,l)=>(a[l]=o[l],a),{}):o)}function Ua(t,r){return t===r?!0:typeof t!=typeof r?!1:t&&r&&typeof t=="object"&&typeof r=="object"?Object.keys(r).every(o=>Ua(t[o],r[o])):!1}var Db=Object.prototype.hasOwnProperty;function Ey(t,r,o=0){if(t===r)return t;if(o>500)return r;const a=Wm(t)&&Wm(r);if(!a&&!(kd(t)&&kd(r)))return r;const c=(a?t:Object.keys(t)).length,f=a?r:Object.keys(r),h=f.length,g=a?new Array(h):{};let y=0;for(let v=0;v<h;v++){const b=a?v:f[v],C=t[b],w=r[b];if(C===w){g[b]=C,(a?v<c:Db.call(t,b))&&y++;continue}if(C===null||w===null||typeof C!="object"||typeof w!="object"){g[b]=w;continue}const E=Ey(C,w,o+1);g[b]=E,E===C&&y++}return c===h&&y===c?t:g}function Wl(t,r){if(!r||Object.keys(t).length!==Object.keys(r).length)return!1;for(const o in t)if(t[o]!==r[o])return!1;return!0}function Wm(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function kd(t){if(!Hm(t))return!1;const r=t.constructor;if(r===void 0)return!0;const o=r.prototype;return!(!Hm(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Hm(t){return Object.prototype.toString.call(t)==="[object Object]"}function zb(t){return new Promise(r=>{wo.setTimeout(r,t)})}function Ed(t,r,o){return typeof o.structuralSharing=="function"?o.structuralSharing(t,r):o.structuralSharing!==!1?Ey(t,r):r}function Fb(t,r,o=0){const a=[...t,r];return o&&a.length>o?a.slice(1):a}function Ub(t,r,o=0){const a=[r,...t];return o&&a.length>o?a.slice(0,-1):a}var hf=Symbol();function Ny(t,r){return!t.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!t.queryFn||t.queryFn===hf?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function pf(t,r){return typeof t=="function"?t(...r):!!t}function Bb(t,r,o){let a=!1,l;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(l??(l=r()),a||(a=!0,l.aborted?o():l.addEventListener("abort",o,{once:!0})),l)}),t}var bo,Kr,Cs,Hg,$b=(Hg=class extends $s{constructor(){super();xe(this,bo);xe(this,Kr);xe(this,Cs);ue(this,Cs,r=>{if(!Mo&&window.addEventListener){const o=()=>r();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}})}onSubscribe(){I(this,Kr)||this.setEventListener(I(this,Cs))}onUnsubscribe(){var r;this.hasListeners()||((r=I(this,Kr))==null||r.call(this),ue(this,Kr,void 0))}setEventListener(r){var o;ue(this,Cs,r),(o=I(this,Kr))==null||o.call(this),ue(this,Kr,r(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(r){I(this,bo)!==r&&(ue(this,bo,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(o=>{o(r)})}isFocused(){var r;return typeof I(this,bo)=="boolean"?I(this,bo):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},bo=new WeakMap,Kr=new WeakMap,Cs=new WeakMap,Hg),mf=new $b;function Nd(){let t,r;const o=new Promise((l,c)=>{t=l,r=c});o.status="pending",o.catch(()=>{});function a(l){Object.assign(o,l),delete o.resolve,delete o.reject}return o.resolve=l=>{a({status:"fulfilled",value:l}),t(l)},o.reject=l=>{a({status:"rejected",reason:l}),r(l)},o}var Wb=Lb;function Hb(){let t=[],r=0,o=h=>{h()},a=h=>{h()},l=Wb;const c=h=>{r?t.push(h):l(()=>{o(h)})},f=()=>{const h=t;t=[],h.length&&l(()=>{a(()=>{h.forEach(g=>{o(g)})})})};return{batch:h=>{let g;r++;try{g=h()}finally{r--,r||f()}return g},batchCalls:h=>(...g)=>{c(()=>{h(...g)})},schedule:c,setNotifyFunction:h=>{o=h},setBatchNotifyFunction:h=>{a=h},setScheduler:h=>{l=h}}}var lt=Hb(),ks,Qr,Es,Vg,Vb=(Vg=class extends $s{constructor(){super();xe(this,ks,!0);xe(this,Qr);xe(this,Es);ue(this,Es,r=>{if(!Mo&&window.addEventListener){const o=()=>r(!0),a=()=>r(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",a)}}})}onSubscribe(){I(this,Qr)||this.setEventListener(I(this,Es))}onUnsubscribe(){var r;this.hasListeners()||((r=I(this,Qr))==null||r.call(this),ue(this,Qr,void 0))}setEventListener(r){var o;ue(this,Es,r),(o=I(this,Qr))==null||o.call(this),ue(this,Qr,r(this.setOnline.bind(this)))}setOnline(r){I(this,ks)!==r&&(ue(this,ks,r),this.listeners.forEach(a=>{a(r)}))}isOnline(){return I(this,ks)}},ks=new WeakMap,Qr=new WeakMap,Es=new WeakMap,Vg),Hl=new Vb;function Kb(t){return Math.min(1e3*2**t,3e4)}function Py(t){return(t??"online")==="online"?Hl.isOnline():!0}var Pd=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Ry(t){let r=!1,o=0,a;const l=Nd(),c=()=>l.status!=="pending",f=x=>{var k;if(!c()){const P=new Pd(x);C(P),(k=t.onCancel)==null||k.call(t,P)}},h=()=>{r=!0},g=()=>{r=!1},y=()=>mf.isFocused()&&(t.networkMode==="always"||Hl.isOnline())&&t.canRun(),v=()=>Py(t.networkMode)&&t.canRun(),b=x=>{c()||(a==null||a(),l.resolve(x))},C=x=>{c()||(a==null||a(),l.reject(x))},w=()=>new Promise(x=>{var k;a=P=>{(c()||y())&&x(P)},(k=t.onPause)==null||k.call(t)}).then(()=>{var x;a=void 0,c()||(x=t.onContinue)==null||x.call(t)}),E=()=>{if(c())return;let x;const k=o===0?t.initialPromise:void 0;try{x=k??t.fn()}catch(P){x=Promise.reject(P)}Promise.resolve(x).then(b).catch(P=>{var H;if(c())return;const j=t.retry??(Mo?0:3),N=t.retryDelay??Kb,T=typeof N=="function"?N(o,P):N,B=j===!0||typeof j=="number"&&o<j||typeof j=="function"&&j(o,P);if(r||!B){C(P);return}o++,(H=t.onFail)==null||H.call(t,o,P),zb(T).then(()=>y()?void 0:w()).then(()=>{r?C(P):E()})})};return{promise:l,status:()=>l.status,cancel:f,continue:()=>(a==null||a(),l),cancelRetry:h,continueRetry:g,canStart:v,start:()=>(v()?E():w().then(E),l)}}var So,Kg,jy=(Kg=class{constructor(){xe(this,So)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cd(this.gcTime)&&ue(this,So,wo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Mo?1/0:300*1e3))}clearGcTimeout(){I(this,So)&&(wo.clearTimeout(I(this,So)),ue(this,So,void 0))}},So=new WeakMap,Kg),Co,Ns,nn,ko,ft,Va,Eo,wn,ar,Qg,Qb=(Qg=class extends jy{constructor(r){super();xe(this,wn);xe(this,Co);xe(this,Ns);xe(this,nn);xe(this,ko);xe(this,ft);xe(this,Va);xe(this,Eo);ue(this,Eo,!1),ue(this,Va,r.defaultOptions),this.setOptions(r.options),this.observers=[],ue(this,ko,r.client),ue(this,nn,I(this,ko).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,ue(this,Co,Km(this.options)),this.state=r.state??I(this,Co),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=I(this,ft))==null?void 0:r.promise}setOptions(r){if(this.options={...I(this,Va),...r},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const o=Km(this.options);o.data!==void 0&&(this.setState(Vm(o.data,o.dataUpdatedAt)),ue(this,Co,o))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,nn).remove(this)}setData(r,o){const a=Ed(this.state.data,r,this.options);return je(this,wn,ar).call(this,{data:a,type:"success",dataUpdatedAt:o==null?void 0:o.updatedAt,manual:o==null?void 0:o.manual}),a}setState(r,o){je(this,wn,ar).call(this,{type:"setState",state:r,setStateOptions:o})}cancel(r){var a,l;const o=(a=I(this,ft))==null?void 0:a.promise;return(l=I(this,ft))==null||l.cancel(r),o?o.then(Tt).catch(Tt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(I(this,Co))}isActive(){return this.observers.some(r=>rn(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>eo(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!ky(this.state.dataUpdatedAt,r)}onFocus(){var o;const r=this.observers.find(a=>a.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(o=I(this,ft))==null||o.continue()}onOnline(){var o;const r=this.observers.find(a=>a.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(o=I(this,ft))==null||o.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),I(this,nn).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(o=>o!==r),this.observers.length||(I(this,ft)&&(I(this,Eo)?I(this,ft).cancel({revert:!0}):I(this,ft).cancelRetry()),this.scheduleGc()),I(this,nn).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||je(this,wn,ar).call(this,{type:"invalidate"})}async fetch(r,o){var g,y,v,b,C,w,E,x,k,P,j,N;if(this.state.fetchStatus!=="idle"&&((g=I(this,ft))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(o!=null&&o.cancelRefetch))this.cancel({silent:!0});else if(I(this,ft))return I(this,ft).continueRetry(),I(this,ft).promise}if(r&&this.setOptions(r),!this.options.queryFn){const T=this.observers.find(B=>B.options.queryFn);T&&this.setOptions(T.options)}const a=new AbortController,l=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ue(this,Eo,!0),a.signal)})},c=()=>{const T=Ny(this.options,o),H=(()=>{const $={client:I(this,ko),queryKey:this.queryKey,meta:this.meta};return l($),$})();return ue(this,Eo,!1),this.options.persister?this.options.persister(T,H,this):T(H)},h=(()=>{const T={fetchOptions:o,options:this.options,queryKey:this.queryKey,client:I(this,ko),state:this.state,fetchFn:c};return l(T),T})();(y=this.options.behavior)==null||y.onFetch(h,this),ue(this,Ns,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=h.fetchOptions)==null?void 0:v.meta))&&je(this,wn,ar).call(this,{type:"fetch",meta:(b=h.fetchOptions)==null?void 0:b.meta}),ue(this,ft,Ry({initialPromise:o==null?void 0:o.initialPromise,fn:h.fetchFn,onCancel:T=>{T instanceof Pd&&T.revert&&this.setState({...I(this,Ns),fetchStatus:"idle"}),a.abort()},onFail:(T,B)=>{je(this,wn,ar).call(this,{type:"failed",failureCount:T,error:B})},onPause:()=>{je(this,wn,ar).call(this,{type:"pause"})},onContinue:()=>{je(this,wn,ar).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const T=await I(this,ft).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(w=(C=I(this,nn).config).onSuccess)==null||w.call(C,T,this),(x=(E=I(this,nn).config).onSettled)==null||x.call(E,T,this.state.error,this),T}catch(T){if(T instanceof Pd){if(T.silent)return I(this,ft).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw je(this,wn,ar).call(this,{type:"error",error:T}),(P=(k=I(this,nn).config).onError)==null||P.call(k,T,this),(N=(j=I(this,nn).config).onSettled)==null||N.call(j,this.state.data,T,this),T}finally{this.scheduleGc()}}},Co=new WeakMap,Ns=new WeakMap,nn=new WeakMap,ko=new WeakMap,ft=new WeakMap,Va=new WeakMap,Eo=new WeakMap,wn=new WeakSet,ar=function(r){const o=a=>{switch(r.type){case"failed":return{...a,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...Ty(a.data,this.options),fetchMeta:r.meta??null};case"success":const l={...a,...Vm(r.data,r.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,Ns,r.manual?l:void 0),l;case"error":const c=r.error;return{...a,error:c,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...r.state}}};this.state=o(this.state),lt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),I(this,nn).notify({query:this,type:"updated",action:r})})},Qg);function Ty(t,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Py(r.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Vm(t,r){return{data:t,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Km(t){const r=typeof t.initialData=="function"?t.initialData():t.initialData,o=r!==void 0,a=o?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:o?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var Ft,Oe,Ka,jt,No,Ps,ir,qr,Qa,Rs,js,Po,Ro,Gr,Ts,ze,_a,Rd,jd,Td,Md,Id,Od,Ad,My,qg,qb=(qg=class extends $s{constructor(r,o){super();xe(this,ze);xe(this,Ft);xe(this,Oe);xe(this,Ka);xe(this,jt);xe(this,No);xe(this,Ps);xe(this,ir);xe(this,qr);xe(this,Qa);xe(this,Rs);xe(this,js);xe(this,Po);xe(this,Ro);xe(this,Gr);xe(this,Ts,new Set);this.options=o,ue(this,Ft,r),ue(this,qr,null),ue(this,ir,Nd()),this.bindMethods(),this.setOptions(o)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,Oe).addObserver(this),Qm(I(this,Oe),this.options)?je(this,ze,_a).call(this):this.updateResult(),je(this,ze,Md).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ld(I(this,Oe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ld(I(this,Oe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,je(this,ze,Id).call(this),je(this,ze,Od).call(this),I(this,Oe).removeObserver(this)}setOptions(r){const o=this.options,a=I(this,Oe);if(this.options=I(this,Ft).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rn(this.options.enabled,I(this,Oe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");je(this,ze,Ad).call(this),I(this,Oe).setOptions(this.options),o._defaulted&&!Wl(this.options,o)&&I(this,Ft).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,Oe),observer:this});const l=this.hasListeners();l&&qm(I(this,Oe),a,this.options,o)&&je(this,ze,_a).call(this),this.updateResult(),l&&(I(this,Oe)!==a||rn(this.options.enabled,I(this,Oe))!==rn(o.enabled,I(this,Oe))||eo(this.options.staleTime,I(this,Oe))!==eo(o.staleTime,I(this,Oe)))&&je(this,ze,Rd).call(this);const c=je(this,ze,jd).call(this);l&&(I(this,Oe)!==a||rn(this.options.enabled,I(this,Oe))!==rn(o.enabled,I(this,Oe))||c!==I(this,Gr))&&je(this,ze,Td).call(this,c)}getOptimisticResult(r){const o=I(this,Ft).getQueryCache().build(I(this,Ft),r),a=this.createResult(o,r);return Yb(this,a)&&(ue(this,jt,a),ue(this,Ps,this.options),ue(this,No,I(this,Oe).state)),a}getCurrentResult(){return I(this,jt)}trackResult(r,o){return new Proxy(r,{get:(a,l)=>(this.trackProp(l),o==null||o(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&I(this,ir).status==="pending"&&I(this,ir).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(r){I(this,Ts).add(r)}getCurrentQuery(){return I(this,Oe)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const o=I(this,Ft).defaultQueryOptions(r),a=I(this,Ft).getQueryCache().build(I(this,Ft),o);return a.fetch().then(()=>this.createResult(a,o))}fetch(r){return je(this,ze,_a).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,jt)))}createResult(r,o){var U;const a=I(this,Oe),l=this.options,c=I(this,jt),f=I(this,No),h=I(this,Ps),y=r!==a?r.state:I(this,Ka),{state:v}=r;let b={...v},C=!1,w;if(o._optimisticResults){const G=this.hasListeners(),z=!G&&Qm(r,o),_=G&&qm(r,a,o,l);(z||_)&&(b={...b,...Ty(v.data,r.options)}),o._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:E,errorUpdatedAt:x,status:k}=b;w=b.data;let P=!1;if(o.placeholderData!==void 0&&w===void 0&&k==="pending"){let G;c!=null&&c.isPlaceholderData&&o.placeholderData===(h==null?void 0:h.placeholderData)?(G=c.data,P=!0):G=typeof o.placeholderData=="function"?o.placeholderData((U=I(this,js))==null?void 0:U.state.data,I(this,js)):o.placeholderData,G!==void 0&&(k="success",w=Ed(c==null?void 0:c.data,G,o),C=!0)}if(o.select&&w!==void 0&&!P)if(c&&w===(f==null?void 0:f.data)&&o.select===I(this,Qa))w=I(this,Rs);else try{ue(this,Qa,o.select),w=o.select(w),w=Ed(c==null?void 0:c.data,w,o),ue(this,Rs,w),ue(this,qr,null)}catch(G){ue(this,qr,G)}I(this,qr)&&(E=I(this,qr),w=I(this,Rs),x=Date.now(),k="error");const j=b.fetchStatus==="fetching",N=k==="pending",T=k==="error",B=N&&j,H=w!==void 0,Y={status:k,fetchStatus:b.fetchStatus,isPending:N,isSuccess:k==="success",isError:T,isInitialLoading:B,isLoading:B,data:w,dataUpdatedAt:b.dataUpdatedAt,error:E,errorUpdatedAt:x,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>y.dataUpdateCount||b.errorUpdateCount>y.errorUpdateCount,isFetching:j,isRefetching:j&&!N,isLoadingError:T&&!H,isPaused:b.fetchStatus==="paused",isPlaceholderData:C,isRefetchError:T&&H,isStale:gf(r,o),refetch:this.refetch,promise:I(this,ir),isEnabled:rn(o.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){const G=Y.data!==void 0,z=Y.status==="error"&&!G,_=oe=>{z?oe.reject(Y.error):G&&oe.resolve(Y.data)},Q=()=>{const oe=ue(this,ir,Y.promise=Nd());_(oe)},J=I(this,ir);switch(J.status){case"pending":r.queryHash===a.queryHash&&_(J);break;case"fulfilled":(z||Y.data!==J.value)&&Q();break;case"rejected":(!z||Y.error!==J.reason)&&Q();break}}return Y}updateResult(){const r=I(this,jt),o=this.createResult(I(this,Oe),this.options);if(ue(this,No,I(this,Oe).state),ue(this,Ps,this.options),I(this,No).data!==void 0&&ue(this,js,I(this,Oe)),Wl(o,r))return;ue(this,jt,o);const a=()=>{if(!r)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!I(this,Ts).size)return!0;const f=new Set(c??I(this,Ts));return this.options.throwOnError&&f.add("error"),Object.keys(I(this,jt)).some(h=>{const g=h;return I(this,jt)[g]!==r[g]&&f.has(g)})};je(this,ze,My).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&je(this,ze,Md).call(this)}},Ft=new WeakMap,Oe=new WeakMap,Ka=new WeakMap,jt=new WeakMap,No=new WeakMap,Ps=new WeakMap,ir=new WeakMap,qr=new WeakMap,Qa=new WeakMap,Rs=new WeakMap,js=new WeakMap,Po=new WeakMap,Ro=new WeakMap,Gr=new WeakMap,Ts=new WeakMap,ze=new WeakSet,_a=function(r){je(this,ze,Ad).call(this);let o=I(this,Oe).fetch(this.options,r);return r!=null&&r.throwOnError||(o=o.catch(Tt)),o},Rd=function(){je(this,ze,Id).call(this);const r=eo(this.options.staleTime,I(this,Oe));if(Mo||I(this,jt).isStale||!Cd(r))return;const a=ky(I(this,jt).dataUpdatedAt,r)+1;ue(this,Po,wo.setTimeout(()=>{I(this,jt).isStale||this.updateResult()},a))},jd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,Oe)):this.options.refetchInterval)??!1},Td=function(r){je(this,ze,Od).call(this),ue(this,Gr,r),!(Mo||rn(this.options.enabled,I(this,Oe))===!1||!Cd(I(this,Gr))||I(this,Gr)===0)&&ue(this,Ro,wo.setInterval(()=>{(this.options.refetchIntervalInBackground||mf.isFocused())&&je(this,ze,_a).call(this)},I(this,Gr)))},Md=function(){je(this,ze,Rd).call(this),je(this,ze,Td).call(this,je(this,ze,jd).call(this))},Id=function(){I(this,Po)&&(wo.clearTimeout(I(this,Po)),ue(this,Po,void 0))},Od=function(){I(this,Ro)&&(wo.clearInterval(I(this,Ro)),ue(this,Ro,void 0))},Ad=function(){const r=I(this,Ft).getQueryCache().build(I(this,Ft),this.options);if(r===I(this,Oe))return;const o=I(this,Oe);ue(this,Oe,r),ue(this,Ka,r.state),this.hasListeners()&&(o==null||o.removeObserver(this),r.addObserver(this))},My=function(r){lt.batch(()=>{r.listeners&&this.listeners.forEach(o=>{o(I(this,jt))}),I(this,Ft).getQueryCache().notify({query:I(this,Oe),type:"observerResultsUpdated"})})},qg);function Gb(t,r){return rn(r.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&r.retryOnMount===!1)}function Qm(t,r){return Gb(t,r)||t.state.data!==void 0&&Ld(t,r,r.refetchOnMount)}function Ld(t,r,o){if(rn(r.enabled,t)!==!1&&eo(r.staleTime,t)!=="static"){const a=typeof o=="function"?o(t):o;return a==="always"||a!==!1&&gf(t,r)}return!1}function qm(t,r,o,a){return(t!==r||rn(a.enabled,t)===!1)&&(!o.suspense||t.state.status!=="error")&&gf(t,o)}function gf(t,r){return rn(r.enabled,t)!==!1&&t.isStaleByTime(eo(r.staleTime,t))}function Yb(t,r){return!Wl(t.getCurrentResult(),r)}function Gm(t){return{onFetch:(r,o)=>{var v,b,C,w,E;const a=r.options,l=(C=(b=(v=r.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:C.direction,c=((w=r.state.data)==null?void 0:w.pages)||[],f=((E=r.state.data)==null?void 0:E.pageParams)||[];let h={pages:[],pageParams:[]},g=0;const y=async()=>{let x=!1;const k=N=>{Bb(N,()=>r.signal,()=>x=!0)},P=Ny(r.options,r.fetchOptions),j=async(N,T,B)=>{if(x)return Promise.reject();if(T==null&&N.pages.length)return Promise.resolve(N);const $=(()=>{const z={client:r.client,queryKey:r.queryKey,pageParam:T,direction:B?"backward":"forward",meta:r.options.meta};return k(z),z})(),Y=await P($),{maxPages:U}=r.options,G=B?Ub:Fb;return{pages:G(N.pages,Y,U),pageParams:G(N.pageParams,T,U)}};if(l&&c.length){const N=l==="backward",T=N?Xb:Ym,B={pages:c,pageParams:f},H=T(a,B);h=await j(B,H,N)}else{const N=t??c.length;do{const T=g===0?f[0]??a.initialPageParam:Ym(a,h);if(g>0&&T==null)break;h=await j(h,T),g++}while(g<N)}return h};r.options.persister?r.fetchFn=()=>{var x,k;return(k=(x=r.options).persister)==null?void 0:k.call(x,y,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},o)}:r.fetchFn=y}}}function Ym(t,{pages:r,pageParams:o}){const a=r.length-1;return r.length>0?t.getNextPageParam(r[a],r,o[a],o):void 0}function Xb(t,{pages:r,pageParams:o}){var a;return r.length>0?(a=t.getPreviousPageParam)==null?void 0:a.call(t,r[0],r,o[0],o):void 0}var qa,Fn,St,jo,Un,Wr,Gg,Jb=(Gg=class extends jy{constructor(r){super();xe(this,Un);xe(this,qa);xe(this,Fn);xe(this,St);xe(this,jo);ue(this,qa,r.client),this.mutationId=r.mutationId,ue(this,St,r.mutationCache),ue(this,Fn,[]),this.state=r.state||Iy(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){I(this,Fn).includes(r)||(I(this,Fn).push(r),this.clearGcTimeout(),I(this,St).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){ue(this,Fn,I(this,Fn).filter(o=>o!==r)),this.scheduleGc(),I(this,St).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){I(this,Fn).length||(this.state.status==="pending"?this.scheduleGc():I(this,St).remove(this))}continue(){var r;return((r=I(this,jo))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var f,h,g,y,v,b,C,w,E,x,k,P,j,N,T,B,H,$;const o=()=>{je(this,Un,Wr).call(this,{type:"continue"})},a={client:I(this,qa),meta:this.options.meta,mutationKey:this.options.mutationKey};ue(this,jo,Ry({fn:()=>this.options.mutationFn?this.options.mutationFn(r,a):Promise.reject(new Error("No mutationFn found")),onFail:(Y,U)=>{je(this,Un,Wr).call(this,{type:"failed",failureCount:Y,error:U})},onPause:()=>{je(this,Un,Wr).call(this,{type:"pause"})},onContinue:o,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,St).canRun(this)}));const l=this.state.status==="pending",c=!I(this,jo).canStart();try{if(l)o();else{je(this,Un,Wr).call(this,{type:"pending",variables:r,isPaused:c}),I(this,St).config.onMutate&&await I(this,St).config.onMutate(r,this,a);const U=await((h=(f=this.options).onMutate)==null?void 0:h.call(f,r,a));U!==this.state.context&&je(this,Un,Wr).call(this,{type:"pending",context:U,variables:r,isPaused:c})}const Y=await I(this,jo).start();return await((y=(g=I(this,St).config).onSuccess)==null?void 0:y.call(g,Y,r,this.state.context,this,a)),await((b=(v=this.options).onSuccess)==null?void 0:b.call(v,Y,r,this.state.context,a)),await((w=(C=I(this,St).config).onSettled)==null?void 0:w.call(C,Y,null,this.state.variables,this.state.context,this,a)),await((x=(E=this.options).onSettled)==null?void 0:x.call(E,Y,null,r,this.state.context,a)),je(this,Un,Wr).call(this,{type:"success",data:Y}),Y}catch(Y){try{await((P=(k=I(this,St).config).onError)==null?void 0:P.call(k,Y,r,this.state.context,this,a))}catch(U){Promise.reject(U)}try{await((N=(j=this.options).onError)==null?void 0:N.call(j,Y,r,this.state.context,a))}catch(U){Promise.reject(U)}try{await((B=(T=I(this,St).config).onSettled)==null?void 0:B.call(T,void 0,Y,this.state.variables,this.state.context,this,a))}catch(U){Promise.reject(U)}try{await(($=(H=this.options).onSettled)==null?void 0:$.call(H,void 0,Y,r,this.state.context,a))}catch(U){Promise.reject(U)}throw je(this,Un,Wr).call(this,{type:"error",error:Y}),Y}finally{I(this,St).runNext(this)}}},qa=new WeakMap,Fn=new WeakMap,St=new WeakMap,jo=new WeakMap,Un=new WeakSet,Wr=function(r){const o=a=>{switch(r.type){case"failed":return{...a,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...a,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:r.error,failureCount:a.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=o(this.state),lt.batch(()=>{I(this,Fn).forEach(a=>{a.onMutationUpdate(r)}),I(this,St).notify({mutation:this,type:"updated",action:r})})},Gg);function Iy(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lr,bn,Ga,Yg,Zb=(Yg=class extends $s{constructor(r={}){super();xe(this,lr);xe(this,bn);xe(this,Ga);this.config=r,ue(this,lr,new Set),ue(this,bn,new Map),ue(this,Ga,0)}build(r,o,a){const l=new Jb({client:r,mutationCache:this,mutationId:++gl(this,Ga)._,options:r.defaultMutationOptions(o),state:a});return this.add(l),l}add(r){I(this,lr).add(r);const o=xl(r);if(typeof o=="string"){const a=I(this,bn).get(o);a?a.push(r):I(this,bn).set(o,[r])}this.notify({type:"added",mutation:r})}remove(r){if(I(this,lr).delete(r)){const o=xl(r);if(typeof o=="string"){const a=I(this,bn).get(o);if(a)if(a.length>1){const l=a.indexOf(r);l!==-1&&a.splice(l,1)}else a[0]===r&&I(this,bn).delete(o)}}this.notify({type:"removed",mutation:r})}canRun(r){const o=xl(r);if(typeof o=="string"){const a=I(this,bn).get(o),l=a==null?void 0:a.find(c=>c.state.status==="pending");return!l||l===r}else return!0}runNext(r){var a;const o=xl(r);if(typeof o=="string"){const l=(a=I(this,bn).get(o))==null?void 0:a.find(c=>c!==r&&c.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){lt.batch(()=>{I(this,lr).forEach(r=>{this.notify({type:"removed",mutation:r})}),I(this,lr).clear(),I(this,bn).clear()})}getAll(){return Array.from(I(this,lr))}find(r){const o={exact:!0,...r};return this.getAll().find(a=>$m(o,a))}findAll(r={}){return this.getAll().filter(o=>$m(r,o))}notify(r){lt.batch(()=>{this.listeners.forEach(o=>{o(r)})})}resumePausedMutations(){const r=this.getAll().filter(o=>o.state.isPaused);return lt.batch(()=>Promise.all(r.map(o=>o.continue().catch(Tt))))}},lr=new WeakMap,bn=new WeakMap,Ga=new WeakMap,Yg);function xl(t){var r;return(r=t.options.scope)==null?void 0:r.id}var cr,Yr,Ut,ur,hr,Il,_d,Xg,eS=(Xg=class extends $s{constructor(o,a){super();xe(this,hr);xe(this,cr);xe(this,Yr);xe(this,Ut);xe(this,ur);ue(this,cr,o),this.setOptions(a),this.bindMethods(),je(this,hr,Il).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(o){var l;const a=this.options;this.options=I(this,cr).defaultMutationOptions(o),Wl(this.options,a)||I(this,cr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:I(this,Ut),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&Io(a.mutationKey)!==Io(this.options.mutationKey)?this.reset():((l=I(this,Ut))==null?void 0:l.state.status)==="pending"&&I(this,Ut).setOptions(this.options)}onUnsubscribe(){var o;this.hasListeners()||(o=I(this,Ut))==null||o.removeObserver(this)}onMutationUpdate(o){je(this,hr,Il).call(this),je(this,hr,_d).call(this,o)}getCurrentResult(){return I(this,Yr)}reset(){var o;(o=I(this,Ut))==null||o.removeObserver(this),ue(this,Ut,void 0),je(this,hr,Il).call(this),je(this,hr,_d).call(this)}mutate(o,a){var l;return ue(this,ur,a),(l=I(this,Ut))==null||l.removeObserver(this),ue(this,Ut,I(this,cr).getMutationCache().build(I(this,cr),this.options)),I(this,Ut).addObserver(this),I(this,Ut).execute(o)}},cr=new WeakMap,Yr=new WeakMap,Ut=new WeakMap,ur=new WeakMap,hr=new WeakSet,Il=function(){var a;const o=((a=I(this,Ut))==null?void 0:a.state)??Iy();ue(this,Yr,{...o,isPending:o.status==="pending",isSuccess:o.status==="success",isError:o.status==="error",isIdle:o.status==="idle",mutate:this.mutate,reset:this.reset})},_d=function(o){lt.batch(()=>{var a,l,c,f,h,g,y,v;if(I(this,ur)&&this.hasListeners()){const b=I(this,Yr).variables,C=I(this,Yr).context,w={client:I(this,cr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((o==null?void 0:o.type)==="success"){try{(l=(a=I(this,ur)).onSuccess)==null||l.call(a,o.data,b,C,w)}catch(E){Promise.reject(E)}try{(f=(c=I(this,ur)).onSettled)==null||f.call(c,o.data,null,b,C,w)}catch(E){Promise.reject(E)}}else if((o==null?void 0:o.type)==="error"){try{(g=(h=I(this,ur)).onError)==null||g.call(h,o.error,b,C,w)}catch(E){Promise.reject(E)}try{(v=(y=I(this,ur)).onSettled)==null||v.call(y,void 0,o.error,b,C,w)}catch(E){Promise.reject(E)}}}this.listeners.forEach(b=>{b(I(this,Yr))})})},Xg),Bn,Jg,tS=(Jg=class extends $s{constructor(r={}){super();xe(this,Bn);this.config=r,ue(this,Bn,new Map)}build(r,o,a){const l=o.queryKey,c=o.queryHash??ff(l,o);let f=this.get(c);return f||(f=new Qb({client:r,queryKey:l,queryHash:c,options:r.defaultQueryOptions(o),state:a,defaultOptions:r.getQueryDefaults(l)}),this.add(f)),f}add(r){I(this,Bn).has(r.queryHash)||(I(this,Bn).set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){const o=I(this,Bn).get(r.queryHash);o&&(r.destroy(),o===r&&I(this,Bn).delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){lt.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return I(this,Bn).get(r)}getAll(){return[...I(this,Bn).values()]}find(r){const o={exact:!0,...r};return this.getAll().find(a=>Bm(o,a))}findAll(r={}){const o=this.getAll();return Object.keys(r).length>0?o.filter(a=>Bm(r,a)):o}notify(r){lt.batch(()=>{this.listeners.forEach(o=>{o(r)})})}onFocus(){lt.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){lt.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},Bn=new WeakMap,Jg),et,Xr,Jr,Ms,Is,Zr,Os,As,Zg,nS=(Zg=class{constructor(t={}){xe(this,et);xe(this,Xr);xe(this,Jr);xe(this,Ms);xe(this,Is);xe(this,Zr);xe(this,Os);xe(this,As);ue(this,et,t.queryCache||new tS),ue(this,Xr,t.mutationCache||new Zb),ue(this,Jr,t.defaultOptions||{}),ue(this,Ms,new Map),ue(this,Is,new Map),ue(this,Zr,0)}mount(){gl(this,Zr)._++,I(this,Zr)===1&&(ue(this,Os,mf.subscribe(async t=>{t&&(await this.resumePausedMutations(),I(this,et).onFocus())})),ue(this,As,Hl.subscribe(async t=>{t&&(await this.resumePausedMutations(),I(this,et).onOnline())})))}unmount(){var t,r;gl(this,Zr)._--,I(this,Zr)===0&&((t=I(this,Os))==null||t.call(this),ue(this,Os,void 0),(r=I(this,As))==null||r.call(this),ue(this,As,void 0))}isFetching(t){return I(this,et).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return I(this,Xr).findAll({...t,status:"pending"}).length}getQueryData(t){var o;const r=this.defaultQueryOptions({queryKey:t});return(o=I(this,et).get(r.queryHash))==null?void 0:o.state.data}ensureQueryData(t){const r=this.defaultQueryOptions(t),o=I(this,et).build(this,r),a=o.state.data;return a===void 0?this.fetchQuery(t):(t.revalidateIfStale&&o.isStaleByTime(eo(r.staleTime,o))&&this.prefetchQuery(r),Promise.resolve(a))}getQueriesData(t){return I(this,et).findAll(t).map(({queryKey:r,state:o})=>{const a=o.data;return[r,a]})}setQueryData(t,r,o){const a=this.defaultQueryOptions({queryKey:t}),l=I(this,et).get(a.queryHash),c=l==null?void 0:l.state.data,f=_b(r,c);if(f!==void 0)return I(this,et).build(this,a).setData(f,{...o,manual:!0})}setQueriesData(t,r,o){return lt.batch(()=>I(this,et).findAll(t).map(({queryKey:a})=>[a,this.setQueryData(a,r,o)]))}getQueryState(t){var o;const r=this.defaultQueryOptions({queryKey:t});return(o=I(this,et).get(r.queryHash))==null?void 0:o.state}removeQueries(t){const r=I(this,et);lt.batch(()=>{r.findAll(t).forEach(o=>{r.remove(o)})})}resetQueries(t,r){const o=I(this,et);return lt.batch(()=>(o.findAll(t).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...t},r)))}cancelQueries(t,r={}){const o={revert:!0,...r},a=lt.batch(()=>I(this,et).findAll(t).map(l=>l.cancel(o)));return Promise.all(a).then(Tt).catch(Tt)}invalidateQueries(t,r={}){return lt.batch(()=>(I(this,et).findAll(t).forEach(o=>{o.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},r)))}refetchQueries(t,r={}){const o={...r,cancelRefetch:r.cancelRefetch??!0},a=lt.batch(()=>I(this,et).findAll(t).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,o);return o.throwOnError||(c=c.catch(Tt)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(Tt)}fetchQuery(t){const r=this.defaultQueryOptions(t);r.retry===void 0&&(r.retry=!1);const o=I(this,et).build(this,r);return o.isStaleByTime(eo(r.staleTime,o))?o.fetch(r):Promise.resolve(o.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Tt).catch(Tt)}fetchInfiniteQuery(t){return t.behavior=Gm(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Tt).catch(Tt)}ensureInfiniteQueryData(t){return t.behavior=Gm(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Hl.isOnline()?I(this,Xr).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,et)}getMutationCache(){return I(this,Xr)}getDefaultOptions(){return I(this,Jr)}setDefaultOptions(t){ue(this,Jr,t)}setQueryDefaults(t,r){I(this,Ms).set(Io(t),{queryKey:t,defaultOptions:r})}getQueryDefaults(t){const r=[...I(this,Ms).values()],o={};return r.forEach(a=>{Ua(t,a.queryKey)&&Object.assign(o,a.defaultOptions)}),o}setMutationDefaults(t,r){I(this,Is).set(Io(t),{mutationKey:t,defaultOptions:r})}getMutationDefaults(t){const r=[...I(this,Is).values()],o={};return r.forEach(a=>{Ua(t,a.mutationKey)&&Object.assign(o,a.defaultOptions)}),o}defaultQueryOptions(t){if(t._defaulted)return t;const r={...I(this,Jr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return r.queryHash||(r.queryHash=ff(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===hf&&(r.enabled=!1),r}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...I(this,Jr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){I(this,et).clear(),I(this,Xr).clear()}},et=new WeakMap,Xr=new WeakMap,Jr=new WeakMap,Ms=new WeakMap,Is=new WeakMap,Zr=new WeakMap,Os=new WeakMap,As=new WeakMap,Zg),Oy=m.createContext(void 0),Qn=t=>{const r=m.useContext(Oy);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},rS=({client:t,children:r})=>(m.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),d.jsx(Oy.Provider,{value:t,children:r})),Ay=m.createContext(!1),oS=()=>m.useContext(Ay);Ay.Provider;function sS(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var aS=m.createContext(sS()),iS=()=>m.useContext(aS),lS=(t,r,o)=>{const a=o!=null&&o.state.error&&typeof t.throwOnError=="function"?pf(t.throwOnError,[o.state.error,o]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||a)&&(r.isReset()||(t.retryOnMount=!1))},cS=t=>{m.useEffect(()=>{t.clearReset()},[t])},uS=({result:t,errorResetBoundary:r,throwOnError:o,query:a,suspense:l})=>t.isError&&!r.isReset()&&!t.isFetching&&a&&(l&&t.data===void 0||pf(o,[t.error,a])),dS=t=>{if(t.suspense){const o=l=>l==="static"?l:Math.max(l??1e3,1e3),a=t.staleTime;t.staleTime=typeof a=="function"?(...l)=>o(a(...l)):o(a),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},fS=(t,r)=>t.isLoading&&t.isFetching&&!r,hS=(t,r)=>(t==null?void 0:t.suspense)&&r.isPending,Xm=(t,r,o)=>r.fetchOptimistic(t).catch(()=>{o.clearReset()});function pS(t,r,o){var C,w,E,x;const a=oS(),l=iS(),c=Qn(),f=c.defaultQueryOptions(t);(w=(C=c.getDefaultOptions().queries)==null?void 0:C._experimental_beforeQuery)==null||w.call(C,f);const h=c.getQueryCache().get(f.queryHash);f._optimisticResults=a?"isRestoring":"optimistic",dS(f),lS(f,l,h),cS(l);const g=!c.getQueryCache().get(f.queryHash),[y]=m.useState(()=>new r(c,f)),v=y.getOptimisticResult(f),b=!a&&t.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(k=>{const P=b?y.subscribe(lt.batchCalls(k)):Tt;return y.updateResult(),P},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),m.useEffect(()=>{y.setOptions(f)},[f,y]),hS(f,v))throw Xm(f,y,l);if(uS({result:v,errorResetBoundary:l,throwOnError:f.throwOnError,query:h,suspense:f.suspense}))throw v.error;if((x=(E=c.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||x.call(E,f,v),f.experimental_prefetchInRender&&!Mo&&fS(v,a)){const k=g?Xm(f,y,l):h==null?void 0:h.promise;k==null||k.catch(Tt).finally(()=>{y.updateResult()})}return f.notifyOnChangeProps?v:y.trackResult(v)}function Uo(t,r){return pS(t,qb)}function vr(t,r){const o=Qn(),[a]=m.useState(()=>new eS(o,t));m.useEffect(()=>{a.setOptions(t)},[a,t]);const l=m.useSyncExternalStore(m.useCallback(f=>a.subscribe(lt.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=m.useCallback((f,h)=>{a.mutate(f,h).catch(Tt)},[a]);if(l.error&&pf(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}function Ly(t){var r,o,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(r=0;r<l;r++)t[r]&&(o=Ly(t[r]))&&(a&&(a+=" "),a+=o)}else for(o in t)t[o]&&(a&&(a+=" "),a+=o);return a}function _y(){for(var t,r,o=0,a="",l=arguments.length;o<l;o++)(t=arguments[o])&&(r=Ly(t))&&(a&&(a+=" "),a+=r);return a}const yf="-",mS=t=>{const r=yS(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:f=>{const h=f.split(yf);return h[0]===""&&h.length!==1&&h.shift(),Dy(h,r)||gS(f)},getConflictingClassGroupIds:(f,h)=>{const g=o[f]||[];return h&&a[f]?[...g,...a[f]]:g}}},Dy=(t,r)=>{var f;if(t.length===0)return r.classGroupId;const o=t[0],a=r.nextPart.get(o),l=a?Dy(t.slice(1),a):void 0;if(l)return l;if(r.validators.length===0)return;const c=t.join(yf);return(f=r.validators.find(({validator:h})=>h(c)))==null?void 0:f.classGroupId},Jm=/^\[(.+)\]$/,gS=t=>{if(Jm.test(t)){const r=Jm.exec(t)[1],o=r==null?void 0:r.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},yS=t=>{const{theme:r,prefix:o}=t,a={nextPart:new Map,validators:[]};return xS(Object.entries(t.classGroups),o).forEach(([c,f])=>{Dd(f,a,c,r)}),a},Dd=(t,r,o,a)=>{t.forEach(l=>{if(typeof l=="string"){const c=l===""?r:Zm(r,l);c.classGroupId=o;return}if(typeof l=="function"){if(vS(l)){Dd(l(a),r,o,a);return}r.validators.push({validator:l,classGroupId:o});return}Object.entries(l).forEach(([c,f])=>{Dd(f,Zm(r,c),o,a)})})},Zm=(t,r)=>{let o=t;return r.split(yf).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},vS=t=>t.isThemeGetter,xS=(t,r)=>r?t.map(([o,a])=>{const l=a.map(c=>typeof c=="string"?r+c:typeof c=="object"?Object.fromEntries(Object.entries(c).map(([f,h])=>[r+f,h])):c);return[o,l]}):t,wS=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,o=new Map,a=new Map;const l=(c,f)=>{o.set(c,f),r++,r>t&&(r=0,a=o,o=new Map)};return{get(c){let f=o.get(c);if(f!==void 0)return f;if((f=a.get(c))!==void 0)return l(c,f),f},set(c,f){o.has(c)?o.set(c,f):l(c,f)}}},zy="!",bS=t=>{const{separator:r,experimentalParseClassName:o}=t,a=r.length===1,l=r[0],c=r.length,f=h=>{const g=[];let y=0,v=0,b;for(let k=0;k<h.length;k++){let P=h[k];if(y===0){if(P===l&&(a||h.slice(k,k+c)===r)){g.push(h.slice(v,k)),v=k+c;continue}if(P==="/"){b=k;continue}}P==="["?y++:P==="]"&&y--}const C=g.length===0?h:h.substring(v),w=C.startsWith(zy),E=w?C.substring(1):C,x=b&&b>v?b-v:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:x}};return o?h=>o({className:h,parseClassName:f}):f},SS=t=>{if(t.length<=1)return t;const r=[];let o=[];return t.forEach(a=>{a[0]==="["?(r.push(...o.sort(),a),o=[]):o.push(a)}),r.push(...o.sort()),r},CS=t=>({cache:wS(t.cacheSize),parseClassName:bS(t),...mS(t)}),kS=/\s+/,ES=(t,r)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:l}=r,c=[],f=t.trim().split(kS);let h="";for(let g=f.length-1;g>=0;g-=1){const y=f[g],{modifiers:v,hasImportantModifier:b,baseClassName:C,maybePostfixModifierPosition:w}=o(y);let E=!!w,x=a(E?C.substring(0,w):C);if(!x){if(!E){h=y+(h.length>0?" "+h:h);continue}if(x=a(C),!x){h=y+(h.length>0?" "+h:h);continue}E=!1}const k=SS(v).join(":"),P=b?k+zy:k,j=P+x;if(c.includes(j))continue;c.push(j);const N=l(x,E);for(let T=0;T<N.length;++T){const B=N[T];c.push(P+B)}h=y+(h.length>0?" "+h:h)}return h};function NS(){let t=0,r,o,a="";for(;t<arguments.length;)(r=arguments[t++])&&(o=Fy(r))&&(a&&(a+=" "),a+=o);return a}const Fy=t=>{if(typeof t=="string")return t;let r,o="";for(let a=0;a<t.length;a++)t[a]&&(r=Fy(t[a]))&&(o&&(o+=" "),o+=r);return o};function PS(t,...r){let o,a,l,c=f;function f(g){const y=r.reduce((v,b)=>b(v),t());return o=CS(y),a=o.cache.get,l=o.cache.set,c=h,h(g)}function h(g){const y=a(g);if(y)return y;const v=ES(g,o);return l(g,v),v}return function(){return c(NS.apply(null,arguments))}}const Ve=t=>{const r=o=>o[t]||[];return r.isThemeGetter=!0,r},Uy=/^\[(?:([a-z-]+):)?(.+)\]$/i,RS=/^\d+\/\d+$/,jS=new Set(["px","full","screen"]),TS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,MS=/\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$/,IS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,OS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,or=t=>ys(t)||jS.has(t)||RS.test(t),Br=t=>Ws(t,"length",$S),ys=t=>!!t&&!Number.isNaN(Number(t)),ld=t=>Ws(t,"number",ys),Aa=t=>!!t&&Number.isInteger(Number(t)),LS=t=>t.endsWith("%")&&ys(t.slice(0,-1)),Re=t=>Uy.test(t),$r=t=>TS.test(t),_S=new Set(["length","size","percentage"]),DS=t=>Ws(t,_S,By),zS=t=>Ws(t,"position",By),FS=new Set(["image","url"]),US=t=>Ws(t,FS,HS),BS=t=>Ws(t,"",WS),La=()=>!0,Ws=(t,r,o)=>{const a=Uy.exec(t);return a?a[1]?typeof r=="string"?a[1]===r:r.has(a[1]):o(a[2]):!1},$S=t=>MS.test(t)&&!IS.test(t),By=()=>!1,WS=t=>OS.test(t),HS=t=>AS.test(t),VS=()=>{const t=Ve("colors"),r=Ve("spacing"),o=Ve("blur"),a=Ve("brightness"),l=Ve("borderColor"),c=Ve("borderRadius"),f=Ve("borderSpacing"),h=Ve("borderWidth"),g=Ve("contrast"),y=Ve("grayscale"),v=Ve("hueRotate"),b=Ve("invert"),C=Ve("gap"),w=Ve("gradientColorStops"),E=Ve("gradientColorStopPositions"),x=Ve("inset"),k=Ve("margin"),P=Ve("opacity"),j=Ve("padding"),N=Ve("saturate"),T=Ve("scale"),B=Ve("sepia"),H=Ve("skew"),$=Ve("space"),Y=Ve("translate"),U=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",Re,r],_=()=>[Re,r],Q=()=>["",or,Br],J=()=>["auto",ys,Re],oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Re],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[ys,Re];return{cacheSize:500,separator:":",theme:{colors:[La],spacing:[or,Br],blur:["none","",$r,Re],brightness:M(),borderColor:[t],borderRadius:["none","","full",$r,Re],borderSpacing:_(),borderWidth:Q(),contrast:M(),grayscale:q(),hueRotate:M(),invert:q(),gap:_(),gradientColorStops:[t],gradientColorStopPositions:[LS,Br],inset:z(),margin:z(),opacity:M(),padding:_(),saturate:M(),scale:M(),sepia:q(),skew:M(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",Re]}],container:["container"],columns:[{columns:[$r]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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"],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:[...oe(),Re]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Aa,Re]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Re]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",Aa,Re]}],"grid-cols":[{"grid-cols":[La]}],"col-start-end":[{col:["auto",{span:["full",Aa,Re]},Re]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[La]}],"row-start-end":[{row:["auto",{span:[Aa,Re]},Re]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Re]}],gap:[{gap:[C]}],"gap-x":[{"gap-x":[C]}],"gap-y":[{"gap-y":[C]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Re,r]}],"min-w":[{"min-w":[Re,r,"min","max","fit"]}],"max-w":[{"max-w":[Re,r,"none","full","min","max","fit","prose",{screen:[$r]},$r]}],h:[{h:[Re,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Re,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Re,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Re,r,"auto","min","max","fit"]}],"font-size":[{text:["base",$r,Br]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ld]}],"font-family":[{font:[La]}],"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:["tighter","tight","normal","wide","wider","widest",Re]}],"line-clamp":[{"line-clamp":["none",ys,ld]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",or,Re]}],"list-image":[{"list-image":["none",Re]}],"list-style-type":[{list:["none","disc","decimal",Re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",or,Br]}],"underline-offset":[{"underline-offset":["auto",or,Re]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...oe(),zS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",DS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},US]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[c]}],"rounded-s":[{"rounded-s":[c]}],"rounded-e":[{"rounded-e":[c]}],"rounded-t":[{"rounded-t":[c]}],"rounded-r":[{"rounded-r":[c]}],"rounded-b":[{"rounded-b":[c]}],"rounded-l":[{"rounded-l":[c]}],"rounded-ss":[{"rounded-ss":[c]}],"rounded-se":[{"rounded-se":[c]}],"rounded-ee":[{"rounded-ee":[c]}],"rounded-es":[{"rounded-es":[c]}],"rounded-tl":[{"rounded-tl":[c]}],"rounded-tr":[{"rounded-tr":[c]}],"rounded-br":[{"rounded-br":[c]}],"rounded-bl":[{"rounded-bl":[c]}],"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-t":[{"border-t":[h]}],"border-w-r":[{"border-r":[h]}],"border-w-b":[{"border-b":[h]}],"border-w-l":[{"border-l":[h]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[h]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[h]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:le()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[or,Re]}],"outline-w":[{outline:[or,Br]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[or,Br]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",$r,BS]}],"shadow-color":[{shadow:[La]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...ce(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ce()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",$r,Re]}],grayscale:[{grayscale:[y]}],"hue-rotate":[{"hue-rotate":[v]}],invert:[{invert:[b]}],saturate:[{saturate:[N]}],sepia:[{sepia:[B]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[B]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Re]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",Re]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",Re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Aa,Re]}],"translate-x":[{"translate-x":[Y]}],"translate-y":[{"translate-y":[Y]}],"skew-x":[{"skew-x":[H]}],"skew-y":[{"skew-y":[H]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Re]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],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",Re]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",Re]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[or,Br,ld]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},KS=PS(VS);function ve(...t){return KS(_y(t))}const eg={model:{zh:"模型",en:"Model"},providers:{zh:"提供商",en:"Providers"},channels:{zh:"渠道",en:"Channels"},enabled:{zh:"启用",en:"Enabled"},disabled:{zh:"禁用",en:"Disabled"},save:{zh:"保存",en:"Save"},cancel:{zh:"取消",en:"Cancel"},delete:{zh:"删除",en:"Delete"},add:{zh:"添加",en:"Add"},edit:{zh:"编辑",en:"Edit"},loading:{zh:"加载中...",en:"Loading..."},success:{zh:"成功",en:"Success"},error:{zh:"错误",en:"Error"},modelName:{zh:"模型",en:"Model"},workspace:{zh:"工作空间",en:"Workspace"},maxTokens:{zh:"最大 Token 数",en:"Max Tokens"},maxToolIterations:{zh:"最大工具迭代次数",en:"Max Tool Iterations"},apiKey:{zh:"API 密钥",en:"API Key"},apiBase:{zh:"API Base",en:"API Base"},extraHeaders:{zh:"额外请求头",en:"Extra Headers"},wireApi:{zh:"请求接口",en:"Wire API"},wireApiAuto:{zh:"自动(优先 Chat,必要时 Responses)",en:"Auto (Chat with fallback)"},wireApiChat:{zh:"Chat Completions",en:"Chat Completions"},wireApiResponses:{zh:"Responses",en:"Responses"},apiKeySet:{zh:"已设置",en:"Set"},apiKeyNotSet:{zh:"未设置",en:"Not Set"},showKey:{zh:"显示密钥",en:"Show Key"},hideKey:{zh:"隐藏密钥",en:"Hide Key"},allowFrom:{zh:"允许来源",en:"Allow From"},token:{zh:"Token",en:"Token"},botToken:{zh:"Bot Token",en:"Bot Token"},appToken:{zh:"App Token",en:"App Token"},appId:{zh:"App ID",en:"App ID"},corpId:{zh:"企业 ID",en:"Corp ID"},agentId:{zh:"应用 Agent ID",en:"Agent ID"},appSecret:{zh:"App Secret",en:"App Secret"},markdownSupport:{zh:"Markdown 支持",en:"Markdown Support"},clientId:{zh:"Client ID",en:"Client ID"},clientSecret:{zh:"Client Secret",en:"Client Secret"},encryptKey:{zh:"加密密钥",en:"Encrypt Key"},verificationToken:{zh:"验证令牌",en:"Verification Token"},bridgeUrl:{zh:"桥接 URL",en:"Bridge URL"},gatewayUrl:{zh:"网关 URL",en:"Gateway URL"},proxy:{zh:"代理",en:"Proxy"},intents:{zh:"Intents",en:"Intents"},mode:{zh:"模式",en:"Mode"},webhookPath:{zh:"Webhook 路径",en:"Webhook Path"},callbackPort:{zh:"回调端口",en:"Callback Port"},callbackPath:{zh:"回调路径",en:"Callback Path"},groupPolicy:{zh:"群组策略",en:"Group Policy"},consentGranted:{zh:"同意条款",en:"Consent Granted"},imapHost:{zh:"IMAP 服务器",en:"IMAP Host"},imapPort:{zh:"IMAP 端口",en:"IMAP Port"},imapUsername:{zh:"IMAP 用户名",en:"IMAP Username"},imapPassword:{zh:"IMAP 密码",en:"IMAP Password"},imapMailbox:{zh:"IMAP 邮箱",en:"IMAP Mailbox"},imapUseSsl:{zh:"IMAP 使用 SSL",en:"IMAP Use SSL"},smtpHost:{zh:"SMTP 服务器",en:"SMTP Host"},smtpPort:{zh:"SMTP 端口",en:"SMTP Port"},smtpUsername:{zh:"SMTP 用户名",en:"SMTP Username"},smtpPassword:{zh:"SMTP 密码",en:"SMTP Password"},smtpUseTls:{zh:"SMTP 使用 TLS",en:"SMTP Use TLS"},smtpUseSsl:{zh:"SMTP 使用 SSL",en:"SMTP Use SSL"},fromAddress:{zh:"发件地址",en:"From Address"},autoReplyEnabled:{zh:"自动回复已启用",en:"Auto Reply Enabled"},pollIntervalSeconds:{zh:"轮询间隔(秒)",en:"Poll Interval (s)"},markSeen:{zh:"标记为已读",en:"Mark Seen"},maxBodyChars:{zh:"最大正文字符数",en:"Max Body Chars"},subjectPrefix:{zh:"主题前缀",en:"Subject Prefix"},baseUrl:{zh:"Base URL",en:"Base URL"},socketUrl:{zh:"Socket URL",en:"Socket URL"},socketPath:{zh:"Socket 路径",en:"Socket Path"},socketDisableMsgpack:{zh:"禁用 Msgpack",en:"Disable Msgpack"},socketReconnectDelayMs:{zh:"重连延迟(ms)",en:"Reconnect Delay (ms)"},socketMaxReconnectDelayMs:{zh:"最大重连延迟(ms)",en:"Max Reconnect Delay (ms)"},socketConnectTimeoutMs:{zh:"连接超时(ms)",en:"Connect Timeout (ms)"},refreshIntervalMs:{zh:"刷新间隔(ms)",en:"Refresh Interval (ms)"},watchTimeoutMs:{zh:"监视超时(ms)",en:"Watch Timeout (ms)"},watchLimit:{zh:"监视限制",en:"Watch Limit"},retryDelayMs:{zh:"重试延迟(ms)",en:"Retry Delay (ms)"},maxRetryAttempts:{zh:"最大重试次数",en:"Max Retry Attempts"},clawToken:{zh:"Claw Token",en:"Claw Token"},agentUserId:{zh:"代理用户ID",en:"Agent User ID"},sessions:{zh:"会话",en:"Sessions"},panels:{zh:"面板",en:"Panels"},mentionRequireInGroups:{zh:"群组中需要@",en:"Require Mention in Groups"},groups:{zh:"群组",en:"Groups"},replyDelayMode:{zh:"回复延迟模式",en:"Reply Delay Mode"},replyDelayMs:{zh:"回复延迟(ms)",en:"Reply Delay (ms)"},secret:{zh:"密钥",en:"Secret"},sessionsPageTitle:{zh:"会话管理",en:"Sessions"},sessionsPageDescription:{zh:"管理会话:筛选、按渠道分组、查看历史、改标签/偏好模型、清空和删除。",en:"Manage sessions: filter, group by channel, inspect history, edit metadata, clear, and delete."},sessionsFiltersTitle:{zh:"筛选",en:"Filters"},sessionsFiltersDescription:{zh:"按关键词、活跃窗口和分组方式筛选会话。",en:"Filter sessions by query, activity window, and grouping mode."},sessionsSearchPlaceholder:{zh:"搜索 key 或标签",en:"Search session key or label"},sessionsActiveMinutesPlaceholder:{zh:"活跃分钟(0=不限)",en:"Active minutes (0 = no limit)"},sessionsLimitPlaceholder:{zh:"展示上限",en:"Limit"},sessionsGroupModeLabel:{zh:"分组方式",en:"Grouping"},sessionsGroupModeAll:{zh:"不分组 / 全部",en:"All (No grouping)"},sessionsGroupModeByChannel:{zh:"按渠道分组",en:"Group by channel"},sessionsListTitle:{zh:"会话列表",en:"Session list"},sessionsTotalLabel:{zh:"总数",en:"Total"},sessionsCurrentLabel:{zh:"当前展示",en:"Showing"},sessionsLoading:{zh:"加载会话中...",en:"Loading sessions..."},sessionsEmpty:{zh:"暂无会话。",en:"No sessions yet."},sessionsKeyLabel:{zh:"键",en:"Key"},sessionsChannelLabel:{zh:"渠道",en:"Channel"},sessionsMessagesLabel:{zh:"消息数",en:"Messages"},sessionsUpdatedLabel:{zh:"更新时间",en:"Updated"},sessionsLastRoleLabel:{zh:"最后角色",en:"Last Role"},sessionsLabelPlaceholder:{zh:"会话标签(可选)",en:"Session label (optional)"},sessionsModelPlaceholder:{zh:"偏好模型(可选)",en:"Preferred model (optional)"},sessionsShowHistory:{zh:"查看历史",en:"View history"},sessionsHideHistory:{zh:"隐藏历史",en:"Hide history"},sessionsSaveMeta:{zh:"保存元信息",en:"Save metadata"},sessionsClearHistory:{zh:"清空历史",en:"Clear history"},sessionsDeleteConfirm:{zh:"确认删除会话",en:"Delete session"},sessionsHistoryTitle:{zh:"历史",en:"History"},sessionsHistoryDescription:{zh:"最近 200 条消息(展示窗口)。",en:"Latest 200 messages (display window)."},sessionsHistoryLoading:{zh:"加载历史中...",en:"Loading history..."},sessionsApplyingChanges:{zh:"正在应用会话变更...",en:"Applying session changes..."},sessionsUnknownChannel:{zh:"未知渠道",en:"Unknown channel"},saveVerifyConnect:{zh:"保存并验证 / 连接",en:"Save & Verify / Connect"},connected:{zh:"已连接",en:"Connected"},disconnected:{zh:"未连接",en:"Disconnected"},connecting:{zh:"连接中...",en:"Connecting..."},feishuConnecting:{zh:"验证 / 连接中...",en:"Verifying / connecting..."},configSaved:{zh:"配置已保存",en:"Configuration saved"},configSavedApplied:{zh:"配置已保存并已应用",en:"Configuration saved and applied"},configSaveFailed:{zh:"保存配置失败",en:"Failed to save configuration"},configReloaded:{zh:"配置已重载",en:"Configuration reloaded"},configReloadFailed:{zh:"重载配置失败",en:"Failed to reload configuration"},feishuVerifySuccess:{zh:"验证成功,请到飞书开放平台完成事件订阅与发布后再开始使用。",en:"Verified. Please finish Feishu event subscription and app publishing before using."},feishuVerifyFailed:{zh:"验证失败",en:"Verification failed"},enterTag:{zh:"输入后按回车...",en:"Type and press Enter..."},headerName:{zh:"Header 名称",en:"Header Name"},headerValue:{zh:"Header 值",en:"Header Value"},docBrowserTitle:{zh:"帮助文档",en:"Help Docs"},docBrowserSearchPlaceholder:{zh:"搜索,也可以输入文档地址直接打开",en:"Search, or enter a doc URL to open"},docBrowserUrlPlaceholder:{zh:"输入文档路径,如 /guide/channels",en:"Enter a doc path, e.g. /guide/channels"},docBrowserOpenExternal:{zh:"文档中心打开",en:"Open in Docs"},docBrowserFloatMode:{zh:"悬浮窗口",en:"Float Window"},docBrowserDockMode:{zh:"固定到侧栏",en:"Dock to Sidebar"},docBrowserClose:{zh:"关闭",en:"Close"},docBrowserHelp:{zh:"帮助文档",en:"Help Docs"}};function X(t,r="en"){var o,a;return((o=eg[t])==null?void 0:o[r])||((a=eg[t])==null?void 0:a.en)||t}/**
52
- * @license lucide-react v0.462.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const QS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$y=(...t)=>t.filter((r,o,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===o).join(" ").trim();/**
57
- * @license lucide-react v0.462.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */var qS={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"};/**
62
- * @license lucide-react v0.462.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const GS=m.forwardRef(({color:t="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:l="",children:c,iconNode:f,...h},g)=>m.createElement("svg",{ref:g,...qS,width:r,height:r,stroke:t,strokeWidth:a?Number(o)*24/Number(r):o,className:$y("lucide",l),...h},[...f.map(([y,v])=>m.createElement(y,v)),...Array.isArray(c)?c:[c]]));/**
67
- * @license lucide-react v0.462.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const Pe=(t,r)=>{const o=m.forwardRef(({className:a,...l},c)=>m.createElement(GS,{ref:c,iconNode:r,className:$y(`lucide-${QS(t)}`,a),...l}));return o.displayName=`${t}`,o};/**
72
- * @license lucide-react v0.462.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const YS=Pe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
77
- * @license lucide-react v0.462.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const vf=Pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
82
- * @license lucide-react v0.462.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const XS=Pe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
87
- * @license lucide-react v0.462.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const Wy=Pe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
92
- * @license lucide-react v0.462.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const JS=Pe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
97
- * @license lucide-react v0.462.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const Hy=Pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
102
- * @license lucide-react v0.462.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const Vy=Pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
107
- * @license lucide-react v0.462.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const ZS=Pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
112
- * @license lucide-react v0.462.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const eC=Pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
117
- * @license lucide-react v0.462.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const tC=Pe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
122
- * @license lucide-react v0.462.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const Ky=Pe("ExternalLink",[["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"}]]);/**
127
- * @license lucide-react v0.462.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const nC=Pe("EyeOff",[["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"}]]);/**
132
- * @license lucide-react v0.462.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const rC=Pe("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"}]]);/**
137
- * @license lucide-react v0.462.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const oC=Pe("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
142
- * @license lucide-react v0.462.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const sC=Pe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
147
- * @license lucide-react v0.462.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const Qy=Pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
152
- * @license lucide-react v0.462.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const aC=Pe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
157
- * @license lucide-react v0.462.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const Vl=Pe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
162
- * @license lucide-react v0.462.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const iC=Pe("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"}]]);/**
167
- * @license lucide-react v0.462.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const tg=Pe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
172
- * @license lucide-react v0.462.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const Kl=Pe("KeyRound",[["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"}]]);/**
177
- * @license lucide-react v0.462.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const lC=Pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
182
- * @license lucide-react v0.462.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const xf=Pe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
187
- * @license lucide-react v0.462.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const cC=Pe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
192
- * @license lucide-react v0.462.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const vs=Pe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
197
- * @license lucide-react v0.462.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const wf=Pe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
202
- * @license lucide-react v0.462.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const uC=Pe("PackageSearch",[["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]);/**
207
- * @license lucide-react v0.462.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const dC=Pe("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);/**
212
- * @license lucide-react v0.462.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const zd=Pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
217
- * @license lucide-react v0.462.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const fC=Pe("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
222
- * @license lucide-react v0.462.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const ng=Pe("RefreshCw",[["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"}]]);/**
227
- * @license lucide-react v0.462.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const hC=Pe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
232
- * @license lucide-react v0.462.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const qy=Pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
237
- * @license lucide-react v0.462.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const bf=Pe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
242
- * @license lucide-react v0.462.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const pC=Pe("Slack",[["rect",{width:"3",height:"8",x:"13",y:"2",rx:"1.5",key:"diqz80"}],["path",{d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5",key:"183iwg"}],["rect",{width:"3",height:"8",x:"8",y:"14",rx:"1.5",key:"hqg7r1"}],["path",{d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5",key:"76g71w"}],["rect",{width:"8",height:"3",x:"14",y:"13",rx:"1.5",key:"1kmz0a"}],["path",{d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5",key:"jc4sz0"}],["rect",{width:"8",height:"3",x:"2",y:"8",rx:"1.5",key:"1omvl4"}],["path",{d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5",key:"16f3cl"}]]);/**
247
- * @license lucide-react v0.462.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const mC=Pe("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
252
- * @license lucide-react v0.462.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const Gy=Pe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
257
- * @license lucide-react v0.462.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const gC=Pe("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/**
262
- * @license lucide-react v0.462.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const yC=Pe("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
267
- * @license lucide-react v0.462.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const Fd=Pe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
272
- * @license lucide-react v0.462.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const vC=Pe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
277
- * @license lucide-react v0.462.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const Sf=Pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
282
- * @license lucide-react v0.462.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const xC=Pe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Ud="docs.nextclaw.io",rg="nextclaw-docs.pages.dev",wC=new Set([Ud,`www.${Ud}`,rg,`www.${rg}`]),za=`https://${Ud}`;function wl(t){try{return new URL(t).pathname.replace(/\.html$/,"").replace(/\/$/,"")}catch{return t}}const Yy=m.createContext(null);function rc(){const t=m.useContext(Yy);if(!t)throw new Error("useDocBrowser must be used within DocBrowserProvider");return t}function bC(t){try{const r=new URL(t,window.location.origin);return wC.has(r.hostname)}catch{return!1}}function SC({children:t}){const[r,o]=m.useState({isOpen:!1,mode:"docked",currentUrl:`${za}/guide/getting-started`,history:[`${za}/guide/getting-started`],historyIndex:0,navVersion:0}),a=m.useCallback(E=>{const x=E||r.currentUrl||`${za}/guide/getting-started`;o(k=>({...k,isOpen:!0,currentUrl:x,history:[...k.history.slice(0,k.historyIndex+1),x],historyIndex:k.historyIndex+1,navVersion:k.navVersion+1}))},[r.currentUrl]),l=m.useCallback(()=>{o(E=>({...E,isOpen:!1}))},[]),c=m.useCallback(()=>{o(E=>({...E,mode:E.mode==="floating"?"docked":"floating"}))},[]),f=m.useCallback(E=>{o(x=>({...x,mode:E}))},[]),h=m.useCallback(E=>{o(x=>wl(E)===wl(x.currentUrl)?x:{...x,currentUrl:E,history:[...x.history.slice(0,x.historyIndex+1),E],historyIndex:x.historyIndex+1,navVersion:x.navVersion+1})},[]),g=m.useCallback(E=>{o(x=>wl(E)===wl(x.currentUrl)?x:{...x,currentUrl:E,history:[...x.history.slice(0,x.historyIndex+1),E],historyIndex:x.historyIndex+1})},[]),y=m.useCallback(()=>{o(E=>{if(E.historyIndex<=0)return E;const x=E.historyIndex-1;return{...E,historyIndex:x,currentUrl:E.history[x]}})},[]),v=m.useCallback(()=>{o(E=>{if(E.historyIndex>=E.history.length-1)return E;const x=E.historyIndex+1;return{...E,historyIndex:x,currentUrl:E.history[x]}})},[]),b=r.historyIndex>0,C=r.historyIndex<r.history.length-1,w=m.useMemo(()=>({...r,open:a,close:l,toggleMode:c,setMode:f,navigate:h,syncUrl:g,goBack:y,goForward:v,canGoBack:b,canGoForward:C}),[r,a,l,c,f,h,g,y,v,b,C]);return d.jsx(Yy.Provider,{value:w,children:t})}function og(){const{isOpen:t,mode:r,currentUrl:o,navVersion:a,close:l,toggleMode:c,goBack:f,goForward:h,canGoBack:g,canGoForward:y,navigate:v,syncUrl:b}=rc(),[C,w]=m.useState(""),[E,x]=m.useState(!1),[k,P]=m.useState(!1),[j,N]=m.useState(()=>({x:Math.max(40,window.innerWidth-520),y:80})),[T,B]=m.useState({w:480,h:600}),[H,$]=m.useState(420),Y=m.useRef(null),U=m.useRef(null),G=m.useRef(null),z=m.useRef(null),_=m.useRef(a);m.useEffect(()=>{try{const K=new URL(o);w(K.pathname)}catch{w(o)}},[o]),m.useEffect(()=>{var K;if(a!==_.current){_.current=a;return}if((K=z.current)!=null&&K.contentWindow)try{const M=new URL(o).pathname;z.current.contentWindow.postMessage({type:"docs-navigate",path:M},"*")}catch{}},[o,a]),m.useEffect(()=>{r==="floating"&&N(K=>({x:Math.max(40,window.innerWidth-T.w-40),y:K.y}))},[r,T.w]),m.useEffect(()=>{const K=M=>{var L;((L=M.data)==null?void 0:L.type)==="docs-route-change"&&typeof M.data.url=="string"&&b(M.data.url)};return window.addEventListener("message",K),()=>window.removeEventListener("message",K)},[b]);const Q=m.useCallback(K=>{K.preventDefault();const M=C.trim();M&&(M.startsWith("/")?v(`${za}${M}`):M.startsWith("http")?v(M):v(`${za}/${M}`))},[C,v]),J=m.useCallback(K=>{r==="floating"&&(x(!0),Y.current={startX:K.clientX,startY:K.clientY,startPosX:j.x,startPosY:j.y})},[r,j]);m.useEffect(()=>{if(!E)return;const K=L=>{Y.current&&N({x:Y.current.startPosX+(L.clientX-Y.current.startX),y:Y.current.startPosY+(L.clientY-Y.current.startY)})},M=()=>{x(!1),Y.current=null};return window.addEventListener("mousemove",K),window.addEventListener("mouseup",M),()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",M)}},[E]);const oe=m.useCallback(K=>{K.preventDefault(),K.stopPropagation(),P(!0);const M=K.currentTarget.dataset.axis;U.current={startX:K.clientX,startY:K.clientY,startW:T.w,startH:T.h};const L=ie=>{U.current&&B(he=>({w:M==="y"?he.w:Math.max(360,U.current.startW+(ie.clientX-U.current.startX)),h:M==="x"?he.h:Math.max(400,U.current.startH+(ie.clientY-U.current.startY))}))},ee=()=>{P(!1),U.current=null,window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",ee)};window.addEventListener("mousemove",L),window.addEventListener("mouseup",ee)},[T]),le=m.useCallback(K=>{K.preventDefault(),K.stopPropagation(),P(!0),G.current={startX:K.clientX,startW:H};const M=ee=>{if(!G.current)return;const ie=G.current.startX-ee.clientX;$(Math.max(320,Math.min(800,G.current.startW+ie)))},L=()=>{P(!1),G.current=null,window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",L)};window.addEventListener("mousemove",M),window.addEventListener("mouseup",L)},[H]),ce=m.useCallback(K=>{K.preventDefault(),K.stopPropagation(),P(!0);const M=K.clientX,L=T.w,ee=j.x,ie=we=>{const ne=M-we.clientX,pe=Math.max(360,L+ne);B(Ce=>({...Ce,w:pe})),N(Ce=>({...Ce,x:ee-(pe-L)}))},he=()=>{P(!1),window.removeEventListener("mousemove",ie),window.removeEventListener("mouseup",he)};window.addEventListener("mousemove",ie),window.addEventListener("mouseup",he)},[T.w,j.x]);if(!t)return null;const V=r==="docked";return d.jsxs("div",{className:ve("flex flex-col bg-white overflow-hidden relative",V?"h-full border-l border-gray-200 shrink-0":"rounded-2xl shadow-2xl border border-gray-200"),style:V?{width:H}:{position:"fixed",left:j.x,top:j.y,width:T.w,height:T.h,zIndex:9999},children:[V&&d.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:le}),d.jsxs("div",{className:ve("flex items-center justify-between px-4 py-2.5 bg-gray-50 border-b border-gray-200 shrink-0 select-none",!V&&"cursor-grab active:cursor-grabbing"),onMouseDown:V?void 0:J,children:[d.jsxs("div",{className:"flex items-center gap-2.5",children:[d.jsx(Wy,{className:"w-4 h-4 text-primary"}),d.jsx("span",{className:"text-sm font-semibold text-gray-900",children:X("docBrowserTitle")})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:c,className:"hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors",title:X(V?"docBrowserFloatMode":"docBrowserDockMode"),children:V?d.jsx(cC,{className:"w-3.5 h-3.5"}):d.jsx(dC,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:l,className:"hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors",title:X("docBrowserClose"),children:d.jsx(Sf,{className:"w-3.5 h-3.5"})})]})]}),d.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2 bg-white border-b border-gray-100 shrink-0",children:[d.jsx("button",{onClick:f,disabled:!g,className:"p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors",children:d.jsx(YS,{className:"w-4 h-4"})}),d.jsx("button",{onClick:h,disabled:!y,className:"p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors",children:d.jsx(vf,{className:"w-4 h-4"})}),d.jsxs("form",{onSubmit:Q,className:"flex-1 relative",children:[d.jsx(qy,{className:"w-3.5 h-3.5 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),d.jsx("input",{type:"text",value:C,onChange:K=>w(K.target.value),placeholder:X("docBrowserSearchPlaceholder"),className:"w-full h-8 pl-8 pr-3 rounded-lg bg-gray-50 border border-gray-200 text-xs text-gray-700 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 transition-colors placeholder:text-gray-400"})]})]}),d.jsxs("div",{className:"flex-1 relative overflow-hidden",children:[d.jsx("iframe",{ref:z,src:o,className:"absolute inset-0 w-full h-full border-0",title:"NextClaw Documentation",sandbox:"allow-same-origin allow-scripts allow-popups allow-forms",allow:"clipboard-read; clipboard-write"},a),(k||E)&&d.jsx("div",{className:"absolute inset-0 z-10"})]}),d.jsx("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 border-t border-gray-200 shrink-0",children:d.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer","data-doc-external":!0,className:"flex items-center gap-1.5 text-xs text-primary hover:text-primary-hover font-medium transition-colors",children:[X("docBrowserOpenExternal"),d.jsx(Ky,{className:"w-3 h-3"})]})}),!V&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:ce}),d.jsx("div",{className:"absolute top-0 right-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:oe,"data-axis":"x"}),d.jsx("div",{className:"absolute bottom-0 left-0 h-1.5 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:oe,"data-axis":"y"}),d.jsx("div",{className:"absolute bottom-0 right-0 w-4 h-4 cursor-se-resize z-30 flex items-center justify-center text-gray-300 hover:text-gray-500 transition-colors",onMouseDown:oe,children:d.jsx(aC,{className:"w-3 h-3 rotate-[-45deg]"})})]})]})}function CC(){const t=rc();m.useEffect(()=>{const r=o=>{const a=o.target.closest("a[href]");if(!a)return;const l=a.getAttribute("href")||"";bC(l)&&(a.hasAttribute("data-doc-external")||o.ctrlKey||o.metaKey||o.shiftKey||(o.preventDefault(),o.stopPropagation(),t.open(l)))};return document.addEventListener("click",r,!0),()=>document.removeEventListener("click",r,!0)},[t])}const kC=[{target:"/model",label:"Models",icon:tC},{target:"/providers",label:"Providers",icon:Gy},{target:"/channels",label:"Channels",icon:wf},{target:"/runtime",label:"Routing & Runtime",icon:sC},{target:"/sessions",label:X("sessions"),icon:iC},{target:"/marketplace",label:"Marketplace",icon:gC}];function EC(){const t=rc();return d.jsxs("aside",{className:"w-[240px] bg-white border-r border-gray-200 flex flex-col h-full py-6 px-4",children:[d.jsx("div",{className:"px-3 mb-8",children:d.jsxs("div",{className:"flex items-center gap-2.5 group cursor-pointer",children:[d.jsx("div",{className:"h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center transition-transform duration-fast group-hover:scale-110",children:d.jsx("img",{src:"/logo.svg",alt:"NextClaw",className:"h-full w-full object-contain"})}),d.jsx("span",{className:"text-[15px] font-bold bg-gradient-to-r from-primary to-indigo-500 bg-clip-text text-transparent tracking-[-0.02em]",children:"NextClaw"})]})}),d.jsx("nav",{className:"flex-1",children:d.jsx("ul",{className:"space-y-1",children:kC.map(r=>{const o=r.icon;return d.jsx("li",{children:d.jsx(by,{to:r.target,className:({isActive:a})=>ve("group w-full flex items-center gap-3 px-4 py-2.5 rounded-lg text-sm font-medium transition-all duration-base",a?"bg-brand-50 text-brand-700":"text-gray-600 hover:bg-gray-100/80 hover:text-gray-900"),children:({isActive:a})=>d.jsxs(d.Fragment,{children:[d.jsx(o,{className:ve("h-4 w-4 transition-transform duration-fast group-hover:scale-110",a?"text-primary":"text-gray-500")}),d.jsx("span",{className:"flex-1 text-left",children:r.label})]})})},r.target)})})}),d.jsx("div",{className:"pt-2 border-t border-gray-100 mt-2",children:d.jsxs("button",{onClick:()=>t.open(),className:ve("w-full flex items-center gap-3 px-4 py-2.5 rounded-lg text-sm font-medium transition-all duration-base",t.isOpen?"bg-brand-50 text-brand-700":"text-gray-600 hover:bg-gray-100/80 hover:text-gray-900"),children:[d.jsx(Wy,{className:ve("h-4 w-4",t.isOpen?"text-primary":"text-gray-500")}),d.jsx("span",{className:"flex-1 text-left",children:X("docBrowserHelp")})]})})]})}function NC({children:t}){const{isOpen:r,mode:o}=rc();return CC(),d.jsxs("div",{className:"h-screen flex bg-white font-sans text-foreground",children:[d.jsx(EC,{}),d.jsxs("div",{className:"flex-1 flex min-w-0 overflow-hidden relative",children:[d.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-gray-50 overflow-hidden",children:d.jsx("main",{className:"flex-1 overflow-auto custom-scrollbar p-10",children:d.jsx("div",{className:"max-w-6xl mx-auto animate-fade-in h-full",children:t})})}),r&&o==="docked"&&d.jsx(og,{})]}),r&&o==="floating"&&d.jsx(og,{})]})}function PC({children:t}){return d.jsx(SC,{children:d.jsx(NC,{children:t})})}const sg=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,ag=_y,RC=(t,r)=>o=>{var a;if((r==null?void 0:r.variants)==null)return ag(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:l,defaultVariants:c}=r,f=Object.keys(l).map(y=>{const v=o==null?void 0:o[y],b=c==null?void 0:c[y];if(v===null)return null;const C=sg(v)||sg(b);return l[y][C]}),h=o&&Object.entries(o).reduce((y,v)=>{let[b,C]=v;return C===void 0||(y[b]=C),y},{}),g=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((y,v)=>{let{class:b,className:C,...w}=v;return Object.entries(w).every(E=>{let[x,k]=E;return Array.isArray(k)?k.includes({...c,...h}[x]):{...c,...h}[x]===k})?[...y,b,C]:y},[]);return ag(t,f,g,o==null?void 0:o.class,o==null?void 0:o.className)},jC=RC("inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background transition-all duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-secondary hover:text-secondary-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-gray-200",ghost:"hover:bg-secondary hover:text-secondary-foreground",link:"text-primary underline-offset-4 hover:underline",primary:"bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm",subtle:"bg-secondary text-secondary-foreground hover:bg-gray-200","primary-outline":"border-2 border-primary text-primary hover:bg-primary hover:text-primary-foreground"},size:{default:"h-10 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-12 rounded-xl px-6 text-base",xl:"h-14 rounded-xl px-8 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),st=m.forwardRef(({className:t,variant:r,size:o,...a},l)=>d.jsx("button",{className:ve(jC({variant:r,size:o,className:t})),ref:l,...a}));st.displayName="Button";const xs=m.forwardRef(({className:t,hover:r=!0,...o},a)=>d.jsx("div",{ref:a,className:ve("rounded-xl border border-gray-200 bg-white text-card-foreground shadow-card transition-all duration-base",r&&"hover:shadow-card-hover hover:border-gray-300",t),...o}));xs.displayName="Card";const Ol=m.forwardRef(({className:t,...r},o)=>d.jsx("div",{ref:o,className:ve("flex flex-col space-y-2 p-6",t),...r}));Ol.displayName="CardHeader";const Al=m.forwardRef(({className:t,...r},o)=>d.jsx("h3",{ref:o,className:ve("text-lg font-semibold leading-tight tracking-tight text-gray-900",t),...r}));Al.displayName="CardTitle";const Ll=m.forwardRef(({className:t,...r},o)=>d.jsx("p",{ref:o,className:ve("text-sm text-gray-500 leading-relaxed",t),...r}));Ll.displayName="CardDescription";const _l=m.forwardRef(({className:t,...r},o)=>d.jsx("div",{ref:o,className:ve("p-6 pt-0",t),...r}));_l.displayName="CardContent";const TC=m.forwardRef(({className:t,...r},o)=>d.jsx("div",{ref:o,className:ve("flex items-center justify-between p-6 pt-0",t),...r}));TC.displayName="CardFooter";const Ke=m.forwardRef(({className:t,type:r,...o},a)=>d.jsx("input",{type:r,className:ve("flex h-10 w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-400 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...o}));Ke.displayName="Input";const dr=m.forwardRef(({className:t,...r},o)=>d.jsx("label",{ref:o,className:ve("text-sm font-medium leading-none text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...r}));dr.displayName="Label";function yn({className:t,...r}){return d.jsx("div",{className:ve("animate-pulse rounded-md bg-slate-200",t),...r})}const MC="http://127.0.0.1:18791",Dl=(()=>{var t;return typeof window<"u"&&((t=window.location)!=null&&t.origin)?window.location.origin:MC})();async function bl(t,r={}){const o=`${Dl}${t}`,a=await fetch(o,{headers:{"Content-Type":"application/json",...r.headers},...r}),l=await a.text();let c=null;if(l)try{c=JSON.parse(l)}catch{}if(!c){const f=l?l.slice(0,200):"";return{ok:!1,error:{code:"INVALID_RESPONSE",message:`Non-JSON response (${a.status} ${a.statusText})${f?`: ${f}`:""}`}}}return a.ok,c}const kt={get:t=>bl(t,{method:"GET"}),put:(t,r)=>bl(t,{method:"PUT",body:JSON.stringify(r)}),post:(t,r)=>bl(t,{method:"POST",body:JSON.stringify(r)}),delete:t=>bl(t,{method:"DELETE"})};async function IC(){const t=await kt.get("/api/config");if(!t.ok)throw new Error(t.error.message);return t.data}async function OC(){const t=await kt.get("/api/config/meta");if(!t.ok)throw new Error(t.error.message);return t.data}async function AC(){const t=await kt.get("/api/config/schema");if(!t.ok)throw new Error(t.error.message);return t.data}async function LC(t){const r=await kt.put("/api/config/model",t);if(!r.ok)throw new Error(r.error.message);return r.data}async function _C(t,r){const o=await kt.put(`/api/config/providers/${t}`,r);if(!o.ok)throw new Error(o.error.message);return o.data}async function DC(t,r){const o=await kt.put(`/api/config/channels/${t}`,r);if(!o.ok)throw new Error(o.error.message);return o.data}async function zC(t){const r=await kt.put("/api/config/runtime",t);if(!r.ok)throw new Error(r.error.message);return r.data}async function FC(t,r){const o=await kt.post(`/api/config/actions/${t}/execute`,r);if(!o.ok)throw new Error(o.error.message);return o.data}async function UC(t){var l;const r=new URLSearchParams;(l=t==null?void 0:t.q)!=null&&l.trim()&&r.set("q",t.q.trim()),typeof(t==null?void 0:t.limit)=="number"&&Number.isFinite(t.limit)&&r.set("limit",String(Math.max(0,Math.trunc(t.limit)))),typeof(t==null?void 0:t.activeMinutes)=="number"&&Number.isFinite(t.activeMinutes)&&r.set("activeMinutes",String(Math.max(0,Math.trunc(t.activeMinutes))));const o=r.toString(),a=await kt.get(o?"/api/sessions?"+o:"/api/sessions");if(!a.ok)throw new Error(a.error.message);return a.data}async function BC(t,r=200){const o=await kt.get(`/api/sessions/${encodeURIComponent(t)}/history?limit=${Math.max(1,Math.trunc(r))}`);if(!o.ok)throw new Error(o.error.message);return o.data}async function $C(t,r){const o=await kt.put(`/api/sessions/${encodeURIComponent(t)}`,r);if(!o.ok)throw new Error(o.error.message);return o.data}async function WC(t){const r=await kt.delete(`/api/sessions/${encodeURIComponent(t)}`);if(!r.ok)throw new Error(r.error.message);return r.data}var HC=t=>{switch(t){case"success":return QC;case"info":return GC;case"warning":return qC;case"error":return YC;default:return null}},VC=Array(12).fill(0),KC=({visible:t,className:r})=>ae.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":t},ae.createElement("div",{className:"sonner-spinner"},VC.map((o,a)=>ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),QC=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.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"})),qC=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ae.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"})),GC=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.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"})),YC=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.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"})),XC=ae.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"},ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),JC=()=>{let[t,r]=ae.useState(document.hidden);return ae.useEffect(()=>{let o=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),t},Bd=1,ZC=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;let{message:o,...a}=t,l=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Bd++,c=this.toasts.find(h=>h.id===l),f=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),c?this.toasts=this.toasts.map(h=>h.id===l?(this.publish({...h,...t,id:l,title:o}),{...h,...t,id:l,dismissible:f,title:o}):h):this.addToast({title:o,...a,dismissible:f,id:l}),l},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(r=>{this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:t,dismiss:!0})),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let o;r.loading!==void 0&&(o=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let a=t instanceof Promise?t:t(),l=o!==void 0,c,f=a.then(async g=>{if(c=["resolve",g],ae.isValidElement(g))l=!1,this.create({id:o,type:"default",message:g});else if(t2(g)&&!g.ok){l=!1;let y=typeof r.error=="function"?await r.error(`HTTP error! status: ${g.status}`):r.error,v=typeof r.description=="function"?await r.description(`HTTP error! status: ${g.status}`):r.description;this.create({id:o,type:"error",message:y,description:v})}else if(r.success!==void 0){l=!1;let y=typeof r.success=="function"?await r.success(g):r.success,v=typeof r.description=="function"?await r.description(g):r.description;this.create({id:o,type:"success",message:y,description:v})}}).catch(async g=>{if(c=["reject",g],r.error!==void 0){l=!1;let y=typeof r.error=="function"?await r.error(g):r.error,v=typeof r.description=="function"?await r.description(g):r.description;this.create({id:o,type:"error",message:y,description:v})}}).finally(()=>{var g;l&&(this.dismiss(o),o=void 0),(g=r.finally)==null||g.call(r)}),h=()=>new Promise((g,y)=>f.then(()=>c[0]==="reject"?y(c[1]):g(c[1])).catch(y));return typeof o!="string"&&typeof o!="number"?{unwrap:h}:Object.assign(o,{unwrap:h})},this.custom=(t,r)=>{let o=(r==null?void 0:r.id)||Bd++;return this.create({jsx:t(o),id:o,...r}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Bt=new ZC,e2=(t,r)=>{let o=(r==null?void 0:r.id)||Bd++;return Bt.addToast({title:t,...r,id:o}),o},t2=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",n2=e2,r2=()=>Bt.toasts,o2=()=>Bt.getActiveToasts(),Xe=Object.assign(n2,{success:Bt.success,info:Bt.info,warning:Bt.warning,error:Bt.error,custom:Bt.custom,message:Bt.message,promise:Bt.promise,dismiss:Bt.dismiss,loading:Bt.loading},{getHistory:r2,getToasts:o2});function s2(t,{insertAt:r}={}){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",r==="top"&&o.firstChild?o.insertBefore(a,o.firstChild):o.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t))}s2(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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(--gray12);border:1px solid var(--gray4);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)}
287
- `);function Sl(t){return t.label!==void 0}var a2=3,i2="32px",l2="16px",ig=4e3,c2=356,u2=14,d2=20,f2=200;function vn(...t){return t.filter(Boolean).join(" ")}function h2(t){let[r,o]=t.split("-"),a=[];return r&&a.push(r),o&&a.push(o),a}var p2=t=>{var r,o,a,l,c,f,h,g,y,v,b;let{invert:C,toast:w,unstyled:E,interacting:x,setHeights:k,visibleToasts:P,heights:j,index:N,toasts:T,expanded:B,removeToast:H,defaultRichColors:$,closeButton:Y,style:U,cancelButtonStyle:G,actionButtonStyle:z,className:_="",descriptionClassName:Q="",duration:J,position:oe,gap:le,loadingIcon:ce,expandByDefault:V,classNames:q,icons:K,closeButtonAriaLabel:M="Close toast",pauseWhenPageIsHidden:L}=t,[ee,ie]=ae.useState(null),[he,we]=ae.useState(null),[ne,pe]=ae.useState(!1),[Ce,Ne]=ae.useState(!1),[Te,Ie]=ae.useState(!1),[tt,yt]=ae.useState(!1),[Nn,sn]=ae.useState(!1),[an,xr]=ae.useState(0),[Pn,wr]=ae.useState(0),Gt=ae.useRef(w.duration||J||ig),Bo=ae.useRef(null),Rn=ae.useRef(null),ri=N===0,oi=N+1<=P,Et=w.type,jn=w.dismissible!==!1,$o=w.className||"",si=w.descriptionClassName||"",Tn=ae.useMemo(()=>j.findIndex(Ee=>Ee.toastId===w.id)||0,[j,w.id]),so=ae.useMemo(()=>{var Ee;return(Ee=w.closeButton)!=null?Ee:Y},[w.closeButton,Y]),ai=ae.useMemo(()=>w.duration||J||ig,[w.duration,J]),Wo=ae.useRef(0),Gn=ae.useRef(0),ii=ae.useRef(0),Mn=ae.useRef(null),[Ys,Xs]=oe.split("-"),Ho=ae.useMemo(()=>j.reduce((Ee,_e,Ue)=>Ue>=Tn?Ee:Ee+_e.height,0),[j,Tn]),Vo=JC(),br=w.invert||C,In=Et==="loading";Gn.current=ae.useMemo(()=>Tn*le+Ho,[Tn,Ho]),ae.useEffect(()=>{Gt.current=ai},[ai]),ae.useEffect(()=>{pe(!0)},[]),ae.useEffect(()=>{let Ee=Rn.current;if(Ee){let _e=Ee.getBoundingClientRect().height;return wr(_e),k(Ue=>[{toastId:w.id,height:_e,position:w.position},...Ue]),()=>k(Ue=>Ue.filter(Nt=>Nt.toastId!==w.id))}},[k,w.id]),ae.useLayoutEffect(()=>{if(!ne)return;let Ee=Rn.current,_e=Ee.style.height;Ee.style.height="auto";let Ue=Ee.getBoundingClientRect().height;Ee.style.height=_e,wr(Ue),k(Nt=>Nt.find(Mt=>Mt.toastId===w.id)?Nt.map(Mt=>Mt.toastId===w.id?{...Mt,height:Ue}:Mt):[{toastId:w.id,height:Ue,position:w.position},...Nt])},[ne,w.title,w.description,k,w.id]);let ln=ae.useCallback(()=>{Ne(!0),xr(Gn.current),k(Ee=>Ee.filter(_e=>_e.toastId!==w.id)),setTimeout(()=>{H(w)},f2)},[w,H,k,Gn]);ae.useEffect(()=>{if(w.promise&&Et==="loading"||w.duration===1/0||w.type==="loading")return;let Ee;return B||x||L&&Vo?(()=>{if(ii.current<Wo.current){let _e=new Date().getTime()-Wo.current;Gt.current=Gt.current-_e}ii.current=new Date().getTime()})():Gt.current!==1/0&&(Wo.current=new Date().getTime(),Ee=setTimeout(()=>{var _e;(_e=w.onAutoClose)==null||_e.call(w,w),ln()},Gt.current)),()=>clearTimeout(Ee)},[B,x,w,Et,L,Vo,ln]),ae.useEffect(()=>{w.delete&&ln()},[ln,w.delete]);function li(){var Ee,_e,Ue;return K!=null&&K.loading?ae.createElement("div",{className:vn(q==null?void 0:q.loader,(Ee=w==null?void 0:w.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":Et==="loading"},K.loading):ce?ae.createElement("div",{className:vn(q==null?void 0:q.loader,(_e=w==null?void 0:w.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":Et==="loading"},ce):ae.createElement(KC,{className:vn(q==null?void 0:q.loader,(Ue=w==null?void 0:w.classNames)==null?void 0:Ue.loader),visible:Et==="loading"})}return ae.createElement("li",{tabIndex:0,ref:Rn,className:vn(_,$o,q==null?void 0:q.toast,(r=w==null?void 0:w.classNames)==null?void 0:r.toast,q==null?void 0:q.default,q==null?void 0:q[Et],(o=w==null?void 0:w.classNames)==null?void 0:o[Et]),"data-sonner-toast":"","data-rich-colors":(a=w.richColors)!=null?a:$,"data-styled":!(w.jsx||w.unstyled||E),"data-mounted":ne,"data-promise":!!w.promise,"data-swiped":Nn,"data-removed":Ce,"data-visible":oi,"data-y-position":Ys,"data-x-position":Xs,"data-index":N,"data-front":ri,"data-swiping":Te,"data-dismissible":jn,"data-type":Et,"data-invert":br,"data-swipe-out":tt,"data-swipe-direction":he,"data-expanded":!!(B||V&&ne),style:{"--index":N,"--toasts-before":N,"--z-index":T.length-N,"--offset":`${Ce?an:Gn.current}px`,"--initial-height":V?"auto":`${Pn}px`,...U,...w.style},onDragEnd:()=>{Ie(!1),ie(null),Mn.current=null},onPointerDown:Ee=>{In||!jn||(Bo.current=new Date,xr(Gn.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(Ie(!0),Mn.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,_e,Ue,Nt;if(tt||!jn)return;Mn.current=null;let Mt=Number(((Ee=Rn.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),It=Number(((_e=Rn.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),cn=new Date().getTime()-((Ue=Bo.current)==null?void 0:Ue.getTime()),ht=ee==="x"?Mt:It,On=Math.abs(ht)/cn;if(Math.abs(ht)>=d2||On>.11){xr(Gn.current),(Nt=w.onDismiss)==null||Nt.call(w,w),we(ee==="x"?Mt>0?"right":"left":It>0?"down":"up"),ln(),yt(!0),sn(!1);return}Ie(!1),ie(null)},onPointerMove:Ee=>{var _e,Ue,Nt,Mt;if(!Mn.current||!jn||((_e=window.getSelection())==null?void 0:_e.toString().length)>0)return;let It=Ee.clientY-Mn.current.y,cn=Ee.clientX-Mn.current.x,ht=(Ue=t.swipeDirections)!=null?Ue:h2(oe);!ee&&(Math.abs(cn)>1||Math.abs(It)>1)&&ie(Math.abs(cn)>Math.abs(It)?"x":"y");let On={x:0,y:0};ee==="y"?(ht.includes("top")||ht.includes("bottom"))&&(ht.includes("top")&&It<0||ht.includes("bottom")&&It>0)&&(On.y=It):ee==="x"&&(ht.includes("left")||ht.includes("right"))&&(ht.includes("left")&&cn<0||ht.includes("right")&&cn>0)&&(On.x=cn),(Math.abs(On.x)>0||Math.abs(On.y)>0)&&sn(!0),(Nt=Rn.current)==null||Nt.style.setProperty("--swipe-amount-x",`${On.x}px`),(Mt=Rn.current)==null||Mt.style.setProperty("--swipe-amount-y",`${On.y}px`)}},so&&!w.jsx?ae.createElement("button",{"aria-label":M,"data-disabled":In,"data-close-button":!0,onClick:In||!jn?()=>{}:()=>{var Ee;ln(),(Ee=w.onDismiss)==null||Ee.call(w,w)},className:vn(q==null?void 0:q.closeButton,(l=w==null?void 0:w.classNames)==null?void 0:l.closeButton)},(c=K==null?void 0:K.close)!=null?c:XC):null,w.jsx||m.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ae.createElement(ae.Fragment,null,Et||w.icon||w.promise?ae.createElement("div",{"data-icon":"",className:vn(q==null?void 0:q.icon,(f=w==null?void 0:w.classNames)==null?void 0:f.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||li():null,w.type!=="loading"?w.icon||(K==null?void 0:K[Et])||HC(Et):null):null,ae.createElement("div",{"data-content":"",className:vn(q==null?void 0:q.content,(h=w==null?void 0:w.classNames)==null?void 0:h.content)},ae.createElement("div",{"data-title":"",className:vn(q==null?void 0:q.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?ae.createElement("div",{"data-description":"",className:vn(Q,si,q==null?void 0:q.description,(y=w==null?void 0:w.classNames)==null?void 0:y.description)},typeof w.description=="function"?w.description():w.description):null),m.isValidElement(w.cancel)?w.cancel:w.cancel&&Sl(w.cancel)?ae.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||G,onClick:Ee=>{var _e,Ue;Sl(w.cancel)&&jn&&((Ue=(_e=w.cancel).onClick)==null||Ue.call(_e,Ee),ln())},className:vn(q==null?void 0:q.cancelButton,(v=w==null?void 0:w.classNames)==null?void 0:v.cancelButton)},w.cancel.label):null,m.isValidElement(w.action)?w.action:w.action&&Sl(w.action)?ae.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||z,onClick:Ee=>{var _e,Ue;Sl(w.action)&&((Ue=(_e=w.action).onClick)==null||Ue.call(_e,Ee),!Ee.defaultPrevented&&ln())},className:vn(q==null?void 0:q.actionButton,(b=w==null?void 0:w.classNames)==null?void 0:b.actionButton)},w.action.label):null))};function lg(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function m2(t,r){let o={};return[t,r].forEach((a,l)=>{let c=l===1,f=c?"--mobile-offset":"--offset",h=c?l2:i2;function g(y){["top","right","bottom","left"].forEach(v=>{o[`${f}-${v}`]=typeof y=="number"?`${y}px`:y})}typeof a=="number"||typeof a=="string"?g(a):typeof a=="object"?["top","right","bottom","left"].forEach(y=>{a[y]===void 0?o[`${f}-${y}`]=h:o[`${f}-${y}`]=typeof a[y]=="number"?`${a[y]}px`:a[y]}):g(h)}),o}var g2=m.forwardRef(function(t,r){let{invert:o,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:h,offset:g,mobileOffset:y,theme:v="light",richColors:b,duration:C,style:w,visibleToasts:E=a2,toastOptions:x,dir:k=lg(),gap:P=u2,loadingIcon:j,icons:N,containerAriaLabel:T="Notifications",pauseWhenPageIsHidden:B}=t,[H,$]=ae.useState([]),Y=ae.useMemo(()=>Array.from(new Set([a].concat(H.filter(L=>L.position).map(L=>L.position)))),[H,a]),[U,G]=ae.useState([]),[z,_]=ae.useState(!1),[Q,J]=ae.useState(!1),[oe,le]=ae.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ce=ae.useRef(null),V=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=ae.useRef(null),K=ae.useRef(!1),M=ae.useCallback(L=>{$(ee=>{var ie;return(ie=ee.find(he=>he.id===L.id))!=null&&ie.delete||Bt.dismiss(L.id),ee.filter(({id:he})=>he!==L.id)})},[]);return ae.useEffect(()=>Bt.subscribe(L=>{if(L.dismiss){$(ee=>ee.map(ie=>ie.id===L.id?{...ie,delete:!0}:ie));return}setTimeout(()=>{Cy.flushSync(()=>{$(ee=>{let ie=ee.findIndex(he=>he.id===L.id);return ie!==-1?[...ee.slice(0,ie),{...ee[ie],...L},...ee.slice(ie+1)]:[L,...ee]})})})}),[]),ae.useEffect(()=>{if(v!=="system"){le(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?le("dark"):le("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:ee})=>{le(ee?"dark":"light")})}catch{L.addListener(({matches:ie})=>{try{le(ie?"dark":"light")}catch(he){console.error(he)}})}},[v]),ae.useEffect(()=>{H.length<=1&&_(!1)},[H]),ae.useEffect(()=>{let L=ee=>{var ie,he;l.every(we=>ee[we]||ee.code===we)&&(_(!0),(ie=ce.current)==null||ie.focus()),ee.code==="Escape"&&(document.activeElement===ce.current||(he=ce.current)!=null&&he.contains(document.activeElement))&&_(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[l]),ae.useEffect(()=>{if(ce.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,K.current=!1)}},[ce.current]),ae.createElement("section",{ref:r,"aria-label":`${T} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Y.map((L,ee)=>{var ie;let[he,we]=L.split("-");return H.length?ae.createElement("ol",{key:L,dir:k==="auto"?lg():k,tabIndex:-1,ref:ce,className:h,"data-sonner-toaster":!0,"data-theme":oe,"data-y-position":he,"data-lifted":z&&H.length>1&&!c,"data-x-position":we,style:{"--front-toast-height":`${((ie=U[0])==null?void 0:ie.height)||0}px`,"--width":`${c2}px`,"--gap":`${P}px`,...w,...m2(g,y)},onBlur:ne=>{K.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(K.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||K.current||(K.current=!0,q.current=ne.relatedTarget)},onMouseEnter:()=>_(!0),onMouseMove:()=>_(!0),onMouseLeave:()=>{Q||_(!1)},onDragEnd:()=>_(!1),onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||J(!0)},onPointerUp:()=>J(!1)},H.filter(ne=>!ne.position&&ee===0||ne.position===L).map((ne,pe)=>{var Ce,Ne;return ae.createElement(p2,{key:ne.id,icons:N,index:pe,toast:ne,defaultRichColors:b,duration:(Ce=x==null?void 0:x.duration)!=null?Ce:C,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:o,visibleToasts:E,closeButton:(Ne=x==null?void 0:x.closeButton)!=null?Ne:f,interacting:Q,position:L,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:M,toasts:H.filter(Te=>Te.position==ne.position),heights:U.filter(Te=>Te.position==ne.position),setHeights:G,expandByDefault:c,gap:P,loadingIcon:j,expanded:z,pauseWhenPageIsHidden:B,swipeDirections:t.swipeDirections})})):null}))});function Hs(){return Uo({queryKey:["config"],queryFn:IC,staleTime:3e4,refetchOnWindowFocus:!0})}function Cf(){return Uo({queryKey:["config-meta"],queryFn:OC,staleTime:1/0})}function Vs(){return Uo({queryKey:["config-schema"],queryFn:AC,staleTime:1/0})}function y2(){const t=Qn();return vr({mutationFn:LC,onSuccess:()=>{t.invalidateQueries({queryKey:["config"]}),Xe.success(X("configSaved"))},onError:r=>{Xe.error(X("configSaveFailed")+": "+r.message)}})}function v2(){const t=Qn();return vr({mutationFn:({provider:r,data:o})=>_C(r,o),onSuccess:()=>{t.invalidateQueries({queryKey:["config"]}),Xe.success(X("configSaved"))},onError:r=>{Xe.error(X("configSaveFailed")+": "+r.message)}})}function x2(){const t=Qn();return vr({mutationFn:({channel:r,data:o})=>DC(r,o),onSuccess:()=>{t.invalidateQueries({queryKey:["config"]}),Xe.success(X("configSavedApplied"))},onError:r=>{Xe.error(X("configSaveFailed")+": "+r.message)}})}function w2(){const t=Qn();return vr({mutationFn:({data:r})=>zC(r),onSuccess:()=>{t.invalidateQueries({queryKey:["config"]}),Xe.success(X("configSavedApplied"))},onError:r=>{Xe.error(X("configSaveFailed")+": "+r.message)}})}function b2(){return vr({mutationFn:({actionId:t,data:r})=>FC(t,r),onError:t=>{Xe.error(X("error")+": "+t.message)}})}function S2(t){return Uo({queryKey:["sessions",t],queryFn:()=>UC(t),staleTime:1e4})}function C2(t,r=200){return Uo({queryKey:["session-history",t,r],queryFn:()=>BC(t,r),enabled:!!t,staleTime:5e3})}function k2(){const t=Qn();return vr({mutationFn:({key:r,data:o})=>$C(r,o),onSuccess:(r,o)=>{t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["session-history",o.key]}),Xe.success(X("configSavedApplied"))},onError:r=>{Xe.error(X("configSaveFailed")+": "+r.message)}})}function E2(){const t=Qn();return vr({mutationFn:({key:r})=>WC(r),onSuccess:()=>{t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["session-history"]}),Xe.success(X("configSavedApplied"))},onError:r=>{Xe.error(X("configSaveFailed")+": "+r.message)}})}function N2(t){return Array.isArray(t)?t.filter(r=>typeof r=="string").join("."):t}function gt(t,r){if(!r)return;const o=N2(t),a=r[o];if(a)return a;const l=o.split(".");for(const[c,f]of Object.entries(r)){if(!c.includes("*"))continue;const h=c.split(".");if(h.length!==l.length)continue;let g=!0;for(let y=0;y<l.length;y+=1)if(h[y]!=="*"&&h[y]!==l[y]){g=!1;break}if(g)return f}}function P2(){const{data:t,isLoading:r}=Hs(),{data:o}=Vs(),a=y2(),[l,c]=m.useState(""),[f,h]=m.useState(""),[g,y]=m.useState(8192),v=o==null?void 0:o.uiHints,b=gt("agents.defaults.model",v),C=gt("agents.defaults.workspace",v),w=gt("agents.defaults.maxTokens",v);m.useEffect(()=>{var x;(x=t==null?void 0:t.agents)!=null&&x.defaults&&(c(t.agents.defaults.model||""),h(t.agents.defaults.workspace||""),y(t.agents.defaults.maxTokens||8192))},[t]);const E=x=>{x.preventDefault(),a.mutate({model:l,maxTokens:g})};return r?d.jsxs("div",{className:"max-w-2xl space-y-6",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(yn,{className:"h-8 w-32"}),d.jsx(yn,{className:"h-4 w-48"})]}),d.jsxs(xs,{className:"rounded-2xl border-gray-200 p-6",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[d.jsx(yn,{className:"h-12 w-12 rounded-xl"}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(yn,{className:"h-5 w-24"}),d.jsx(yn,{className:"h-3 w-32"})]})]}),d.jsx(yn,{className:"h-4 w-20 mb-2"}),d.jsx(yn,{className:"h-10 w-full rounded-xl"})]}),d.jsxs(xs,{className:"rounded-2xl border-gray-200 p-6",children:[d.jsx(yn,{className:"h-5 w-24 mb-2"}),d.jsx(yn,{className:"h-3 w-40 mb-6"}),d.jsx("div",{className:"space-y-6",children:d.jsxs("div",{children:[d.jsx(yn,{className:"h-4 w-28 mb-3"}),d.jsx(yn,{className:"h-2 w-full rounded-full"})]})})]})]}):d.jsxs("div",{className:"max-w-4xl animate-fade-in pb-20",children:[d.jsxs("div",{className:"mb-10",children:[d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Model Configuration"}),d.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Configure default AI model and runtime limits"})]}),d.jsxs("form",{onSubmit:E,className:"space-y-8",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[d.jsxs("div",{className:"p-8 rounded-2xl bg-white border border-gray-200 shadow-card",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[d.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center text-white",children:d.jsx(Gy,{className:"h-5 w-5"})}),d.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"Default Model"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(dr,{htmlFor:"model",className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:(b==null?void 0:b.label)??"Model Name"}),d.jsx(Ke,{id:"model",value:l,onChange:x=>c(x.target.value),placeholder:(b==null?void 0:b.placeholder)??"minimax/MiniMax-M2.1",className:"h-12 px-4 rounded-xl"}),d.jsx("p",{className:"text-xs text-gray-400",children:(b==null?void 0:b.help)??"Examples: minimax/MiniMax-M2.5 · minimax/MiniMax-M2.1 · openrouter/anthropic/claude-3.5-sonnet · openrouter/openai/gpt-4o-mini"})]})]}),d.jsxs("div",{className:"p-8 rounded-2xl bg-white border border-gray-200 shadow-card",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[d.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center text-white",children:d.jsx(oC,{className:"h-5 w-5"})}),d.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"Workspace"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(dr,{htmlFor:"workspace",className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:(C==null?void 0:C.label)??"Default Path"}),d.jsx(Ke,{id:"workspace",value:f,onChange:x=>h(x.target.value),placeholder:(C==null?void 0:C.placeholder)??"/path/to/workspace",className:"h-12 px-4 rounded-xl"})]})]})]}),d.jsxs("div",{className:"p-8 rounded-2xl bg-white border border-gray-200 shadow-card",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-10",children:[d.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center text-white",children:d.jsx(mC,{className:"h-5 w-5"})}),d.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"Generation Parameters"})]}),d.jsx("div",{className:"grid grid-cols-1 gap-12",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex justify-between items-center mb-2",children:[d.jsx(dr,{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:(w==null?void 0:w.label)??"Max Tokens"}),d.jsx("span",{className:"text-sm font-semibold text-gray-900",children:g.toLocaleString()})]}),d.jsx("input",{type:"range",min:"1000",max:"32000",step:"1000",value:g,onChange:x=>y(parseInt(x.target.value)),className:"w-full h-1 bg-gray-200 rounded-full appearance-none cursor-pointer accent-primary"})]})})]}),d.jsx("div",{className:"flex justify-end pt-4",children:d.jsx(st,{type:"submit",disabled:a.isPending,size:"lg",children:a.isPending?d.jsx(lC,{className:"h-5 w-5 animate-spin"}):"Save Changes"})})]})]})}const cg=t=>{let r;const o=new Set,a=(y,v)=>{const b=typeof y=="function"?y(r):y;if(!Object.is(b,r)){const C=r;r=v??(typeof b!="object"||b===null)?b:Object.assign({},r,b),o.forEach(w=>w(r,C))}},l=()=>r,h={setState:a,getState:l,getInitialState:()=>g,subscribe:y=>(o.add(y),()=>o.delete(y))},g=r=t(a,l,h);return h},R2=(t=>t?cg(t):cg),j2=t=>t;function T2(t,r=j2){const o=ae.useSyncExternalStore(t.subscribe,ae.useCallback(()=>r(t.getState()),[t,r]),ae.useCallback(()=>r(t.getInitialState()),[t,r]));return ae.useDebugValue(o),o}const ug=t=>{const r=R2(t),o=a=>T2(r,a);return Object.assign(o,r),o},M2=(t=>t?ug(t):ug),Za=M2(t=>({connectionStatus:"disconnected",setConnectionStatus:r=>t({connectionStatus:r}),providerModal:{open:!1},openProviderModal:r=>t({providerModal:{open:!0,provider:r}}),closeProviderModal:()=>t({providerModal:{open:!1}}),channelModal:{open:!1},openChannelModal:r=>t({channelModal:{open:!0,channel:r}}),closeChannelModal:()=>t({channelModal:{open:!1}})}));function De(t,r,{checkForDefaultPrevented:o=!0}={}){return function(l){if(t==null||t(l),o===!1||!l.defaultPrevented)return r==null?void 0:r(l)}}function dg(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}function Xy(...t){return r=>{let o=!1;const a=t.map(l=>{const c=dg(l,r);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let l=0;l<a.length;l++){const c=a[l];typeof c=="function"?c():dg(t[l],null)}}}}function Je(...t){return m.useCallback(Xy(...t),t)}function I2(t,r){const o=m.createContext(r),a=c=>{const{children:f,...h}=c,g=m.useMemo(()=>h,Object.values(h));return d.jsx(o.Provider,{value:g,children:f})};a.displayName=t+"Provider";function l(c){const f=m.useContext(o);if(f)return f;if(r!==void 0)return r;throw new Error(`\`${c}\` must be used within \`${t}\``)}return[a,l]}function ei(t,r=[]){let o=[];function a(c,f){const h=m.createContext(f),g=o.length;o=[...o,f];const y=b=>{var P;const{scope:C,children:w,...E}=b,x=((P=C==null?void 0:C[t])==null?void 0:P[g])||h,k=m.useMemo(()=>E,Object.values(E));return d.jsx(x.Provider,{value:k,children:w})};y.displayName=c+"Provider";function v(b,C){var x;const w=((x=C==null?void 0:C[t])==null?void 0:x[g])||h,E=m.useContext(w);if(E)return E;if(f!==void 0)return f;throw new Error(`\`${b}\` must be used within \`${c}\``)}return[y,v]}const l=()=>{const c=o.map(f=>m.createContext(f));return function(h){const g=(h==null?void 0:h[t])||c;return m.useMemo(()=>({[`__scope${t}`]:{...h,[t]:g}}),[h,g])}};return l.scopeName=t,[a,O2(l,...r)]}function O2(...t){const r=t[0];if(t.length===1)return r;const o=()=>{const a=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const f=a.reduce((h,{useScope:g,scopeName:y})=>{const b=g(c)[`__scope${y}`];return{...h,...b}},{});return m.useMemo(()=>({[`__scope${r.scopeName}`]:f}),[f])}};return o.scopeName=r.scopeName,o}var Ct=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},A2=ty[" useId ".trim().toString()]||(()=>{}),L2=0;function To(t){const[r,o]=m.useState(A2());return Ct(()=>{o(a=>a??String(L2++))},[t]),r?`radix-${r}`:""}var _2=ty[" useInsertionEffect ".trim().toString()]||Ct;function Ql({prop:t,defaultProp:r,onChange:o=()=>{},caller:a}){const[l,c,f]=D2({defaultProp:r,onChange:o}),h=t!==void 0,g=h?t:l;{const v=m.useRef(t!==void 0);m.useEffect(()=>{const b=v.current;b!==h&&console.warn(`${a} is changing from ${b?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=h},[h,a])}const y=m.useCallback(v=>{var b;if(h){const C=z2(v)?v(t):v;C!==t&&((b=f.current)==null||b.call(f,C))}else c(v)},[h,t,c,f]);return[g,y]}function D2({defaultProp:t,onChange:r}){const[o,a]=m.useState(t),l=m.useRef(o),c=m.useRef(r);return _2(()=>{c.current=r},[r]),m.useEffect(()=>{var f;l.current!==o&&((f=c.current)==null||f.call(c,o),l.current=o)},[o,l]),[o,a,c]}function z2(t){return typeof t=="function"}function Ba(t){const r=F2(t),o=m.forwardRef((a,l)=>{const{children:c,...f}=a,h=m.Children.toArray(c),g=h.find(B2);if(g){const y=g.props.children,v=h.map(b=>b===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:b);return d.jsx(r,{...f,ref:l,children:m.isValidElement(y)?m.cloneElement(y,void 0,v):null})}return d.jsx(r,{...f,ref:l,children:c})});return o.displayName=`${t}.Slot`,o}function F2(t){const r=m.forwardRef((o,a)=>{const{children:l,...c}=o;if(m.isValidElement(l)){const f=W2(l),h=$2(c,l.props);return l.type!==m.Fragment&&(h.ref=a?Xy(a,f):f),m.cloneElement(l,h)}return m.Children.count(l)>1?m.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var Jy=Symbol("radix.slottable");function U2(t){const r=({children:o})=>d.jsx(d.Fragment,{children:o});return r.displayName=`${t}.Slottable`,r.__radixId=Jy,r}function B2(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Jy}function $2(t,r){const o={...r};for(const a in r){const l=t[a],c=r[a];/^on[A-Z]/.test(a)?l&&c?o[a]=(...h)=>{const g=c(...h);return l(...h),g}:l&&(o[a]=l):a==="style"?o[a]={...l,...c}:a==="className"&&(o[a]=[l,c].filter(Boolean).join(" "))}return{...t,...o}}function W2(t){var a,l;let r=(a=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:a.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?t.ref:(r=(l=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:l.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var H2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Be=H2.reduce((t,r)=>{const o=Ba(`Primitive.${r}`),a=m.forwardRef((l,c)=>{const{asChild:f,...h}=l,g=f?o:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(g,{...h,ref:c})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{});function V2(t,r){t&&Ja.flushSync(()=>t.dispatchEvent(r))}function Oo(t){const r=m.useRef(t);return m.useEffect(()=>{r.current=t}),m.useMemo(()=>(...o)=>{var a;return(a=r.current)==null?void 0:a.call(r,...o)},[])}function K2(t,r=globalThis==null?void 0:globalThis.document){const o=Oo(t);m.useEffect(()=>{const a=l=>{l.key==="Escape"&&o(l)};return r.addEventListener("keydown",a,{capture:!0}),()=>r.removeEventListener("keydown",a,{capture:!0})},[o,r])}var Q2="DismissableLayer",$d="dismissableLayer.update",q2="dismissableLayer.pointerDownOutside",G2="dismissableLayer.focusOutside",fg,Zy=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oc=m.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:f,onDismiss:h,...g}=t,y=m.useContext(Zy),[v,b]=m.useState(null),C=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=m.useState({}),E=Je(r,$=>b($)),x=Array.from(y.layers),[k]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),P=x.indexOf(k),j=v?x.indexOf(v):-1,N=y.layersWithOutsidePointerEventsDisabled.size>0,T=j>=P,B=J2($=>{const Y=$.target,U=[...y.branches].some(G=>G.contains(Y));!T||U||(l==null||l($),f==null||f($),$.defaultPrevented||h==null||h())},C),H=Z2($=>{const Y=$.target;[...y.branches].some(G=>G.contains(Y))||(c==null||c($),f==null||f($),$.defaultPrevented||h==null||h())},C);return K2($=>{j===y.layers.size-1&&(a==null||a($),!$.defaultPrevented&&h&&($.preventDefault(),h()))},C),m.useEffect(()=>{if(v)return o&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(fg=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(v)),y.layers.add(v),hg(),()=>{o&&y.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=fg)}},[v,C,o,y]),m.useEffect(()=>()=>{v&&(y.layers.delete(v),y.layersWithOutsidePointerEventsDisabled.delete(v),hg())},[v,y]),m.useEffect(()=>{const $=()=>w({});return document.addEventListener($d,$),()=>document.removeEventListener($d,$)},[]),d.jsx(Be.div,{...g,ref:E,style:{pointerEvents:N?T?"auto":"none":void 0,...t.style},onFocusCapture:De(t.onFocusCapture,H.onFocusCapture),onBlurCapture:De(t.onBlurCapture,H.onBlurCapture),onPointerDownCapture:De(t.onPointerDownCapture,B.onPointerDownCapture)})});oc.displayName=Q2;var Y2="DismissableLayerBranch",X2=m.forwardRef((t,r)=>{const o=m.useContext(Zy),a=m.useRef(null),l=Je(r,a);return m.useEffect(()=>{const c=a.current;if(c)return o.branches.add(c),()=>{o.branches.delete(c)}},[o.branches]),d.jsx(Be.div,{...t,ref:l})});X2.displayName=Y2;function J2(t,r=globalThis==null?void 0:globalThis.document){const o=Oo(t),a=m.useRef(!1),l=m.useRef(()=>{});return m.useEffect(()=>{const c=h=>{if(h.target&&!a.current){let g=function(){ev(q2,o,y,{discrete:!0})};const y={originalEvent:h};h.pointerType==="touch"?(r.removeEventListener("click",l.current),l.current=g,r.addEventListener("click",l.current,{once:!0})):g()}else r.removeEventListener("click",l.current);a.current=!1},f=window.setTimeout(()=>{r.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(f),r.removeEventListener("pointerdown",c),r.removeEventListener("click",l.current)}},[r,o]),{onPointerDownCapture:()=>a.current=!0}}function Z2(t,r=globalThis==null?void 0:globalThis.document){const o=Oo(t),a=m.useRef(!1);return m.useEffect(()=>{const l=c=>{c.target&&!a.current&&ev(G2,o,{originalEvent:c},{discrete:!1})};return r.addEventListener("focusin",l),()=>r.removeEventListener("focusin",l)},[r,o]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function hg(){const t=new CustomEvent($d);document.dispatchEvent(t)}function ev(t,r,o,{discrete:a}){const l=o.originalEvent.target,c=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:o});r&&l.addEventListener(t,r,{once:!0}),a?V2(l,c):l.dispatchEvent(c)}var cd="focusScope.autoFocusOnMount",ud="focusScope.autoFocusOnUnmount",pg={bubbles:!1,cancelable:!0},ek="FocusScope",kf=m.forwardRef((t,r)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:c,...f}=t,[h,g]=m.useState(null),y=Oo(l),v=Oo(c),b=m.useRef(null),C=Je(r,x=>g(x)),w=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(a){let x=function(N){if(w.paused||!h)return;const T=N.target;h.contains(T)?b.current=T:Hr(b.current,{select:!0})},k=function(N){if(w.paused||!h)return;const T=N.relatedTarget;T!==null&&(h.contains(T)||Hr(b.current,{select:!0}))},P=function(N){if(document.activeElement===document.body)for(const B of N)B.removedNodes.length>0&&Hr(h)};document.addEventListener("focusin",x),document.addEventListener("focusout",k);const j=new MutationObserver(P);return h&&j.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k),j.disconnect()}}},[a,h,w.paused]),m.useEffect(()=>{if(h){gg.add(w);const x=document.activeElement;if(!h.contains(x)){const P=new CustomEvent(cd,pg);h.addEventListener(cd,y),h.dispatchEvent(P),P.defaultPrevented||(tk(ak(tv(h)),{select:!0}),document.activeElement===x&&Hr(h))}return()=>{h.removeEventListener(cd,y),setTimeout(()=>{const P=new CustomEvent(ud,pg);h.addEventListener(ud,v),h.dispatchEvent(P),P.defaultPrevented||Hr(x??document.body,{select:!0}),h.removeEventListener(ud,v),gg.remove(w)},0)}}},[h,y,v,w]);const E=m.useCallback(x=>{if(!o&&!a||w.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,P=document.activeElement;if(k&&P){const j=x.currentTarget,[N,T]=nk(j);N&&T?!x.shiftKey&&P===T?(x.preventDefault(),o&&Hr(N,{select:!0})):x.shiftKey&&P===N&&(x.preventDefault(),o&&Hr(T,{select:!0})):P===j&&x.preventDefault()}},[o,a,w.paused]);return d.jsx(Be.div,{tabIndex:-1,...f,ref:C,onKeyDown:E})});kf.displayName=ek;function tk(t,{select:r=!1}={}){const o=document.activeElement;for(const a of t)if(Hr(a,{select:r}),document.activeElement!==o)return}function nk(t){const r=tv(t),o=mg(r,t),a=mg(r.reverse(),t);return[o,a]}function tv(t){const r=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)r.push(o.currentNode);return r}function mg(t,r){for(const o of t)if(!rk(o,{upTo:r}))return o}function rk(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function ok(t){return t instanceof HTMLInputElement&&"select"in t}function Hr(t,{select:r=!1}={}){if(t&&t.focus){const o=document.activeElement;t.focus({preventScroll:!0}),t!==o&&ok(t)&&r&&t.select()}}var gg=sk();function sk(){let t=[];return{add(r){const o=t[0];r!==o&&(o==null||o.pause()),t=yg(t,r),t.unshift(r)},remove(r){var o;t=yg(t,r),(o=t[0])==null||o.resume()}}}function yg(t,r){const o=[...t],a=o.indexOf(r);return a!==-1&&o.splice(a,1),o}function ak(t){return t.filter(r=>r.tagName!=="A")}var ik="Portal",sc=m.forwardRef((t,r)=>{var h;const{container:o,...a}=t,[l,c]=m.useState(!1);Ct(()=>c(!0),[]);const f=o||l&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return f?Cy.createPortal(d.jsx(Be.div,{...a,ref:r}),f):null});sc.displayName=ik;function lk(t,r){return m.useReducer((o,a)=>r[o][a]??o,t)}var Ks=t=>{const{present:r,children:o}=t,a=ck(r),l=typeof o=="function"?o({present:a.isPresent}):m.Children.only(o),c=Je(a.ref,uk(l));return typeof o=="function"||a.isPresent?m.cloneElement(l,{ref:c}):null};Ks.displayName="Presence";function ck(t){const[r,o]=m.useState(),a=m.useRef(null),l=m.useRef(t),c=m.useRef("none"),f=t?"mounted":"unmounted",[h,g]=lk(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const y=Cl(a.current);c.current=h==="mounted"?y:"none"},[h]),Ct(()=>{const y=a.current,v=l.current;if(v!==t){const C=c.current,w=Cl(y);t?g("MOUNT"):w==="none"||(y==null?void 0:y.display)==="none"?g("UNMOUNT"):g(v&&C!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,g]),Ct(()=>{if(r){let y;const v=r.ownerDocument.defaultView??window,b=w=>{const x=Cl(a.current).includes(CSS.escape(w.animationName));if(w.target===r&&x&&(g("ANIMATION_END"),!l.current)){const k=r.style.animationFillMode;r.style.animationFillMode="forwards",y=v.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=k)})}},C=w=>{w.target===r&&(c.current=Cl(a.current))};return r.addEventListener("animationstart",C),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{v.clearTimeout(y),r.removeEventListener("animationstart",C),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else g("ANIMATION_END")},[r,g]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:m.useCallback(y=>{a.current=y?getComputedStyle(y):null,o(y)},[])}}function Cl(t){return(t==null?void 0:t.animationName)||"none"}function uk(t){var a,l;let r=(a=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:a.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?t.ref:(r=(l=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:l.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var dd=0;function nv(){m.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??vg()),document.body.insertAdjacentElement("beforeend",t[1]??vg()),dd++,()=>{dd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),dd--}},[])}function vg(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var $n=function(){return $n=Object.assign||function(r){for(var o,a=1,l=arguments.length;a<l;a++){o=arguments[a];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(r[c]=o[c])}return r},$n.apply(this,arguments)};function rv(t,r){var o={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&r.indexOf(a)<0&&(o[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(t);l<a.length;l++)r.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(t,a[l])&&(o[a[l]]=t[a[l]]);return o}function dk(t,r,o){if(o||arguments.length===2)for(var a=0,l=r.length,c;a<l;a++)(c||!(a in r))&&(c||(c=Array.prototype.slice.call(r,0,a)),c[a]=r[a]);return t.concat(c||Array.prototype.slice.call(r))}var zl="right-scroll-bar-position",Fl="width-before-scroll-bar",fk="with-scroll-bars-hidden",hk="--removed-body-scroll-bar-size";function fd(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function pk(t,r){var o=m.useState(function(){return{value:t,callback:r,facade:{get current(){return o.value},set current(a){var l=o.value;l!==a&&(o.value=a,o.callback(a,l))}}}})[0];return o.callback=r,o.facade}var mk=typeof window<"u"?m.useLayoutEffect:m.useEffect,xg=new WeakMap;function gk(t,r){var o=pk(null,function(a){return t.forEach(function(l){return fd(l,a)})});return mk(function(){var a=xg.get(o);if(a){var l=new Set(a),c=new Set(t),f=o.current;l.forEach(function(h){c.has(h)||fd(h,null)}),c.forEach(function(h){l.has(h)||fd(h,f)})}xg.set(o,t)},[t]),o}function yk(t){return t}function vk(t,r){r===void 0&&(r=yk);var o=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:t},useMedium:function(c){var f=r(c,a);return o.push(f),function(){o=o.filter(function(h){return h!==f})}},assignSyncMedium:function(c){for(a=!0;o.length;){var f=o;o=[],f.forEach(c)}o={push:function(h){return c(h)},filter:function(){return o}}},assignMedium:function(c){a=!0;var f=[];if(o.length){var h=o;o=[],h.forEach(c),f=o}var g=function(){var v=f;f=[],v.forEach(c)},y=function(){return Promise.resolve().then(g)};y(),o={push:function(v){f.push(v),y()},filter:function(v){return f=f.filter(v),o}}}};return l}function xk(t){t===void 0&&(t={});var r=vk(null);return r.options=$n({async:!0,ssr:!1},t),r}var ov=function(t){var r=t.sideCar,o=rv(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=r.read();if(!a)throw new Error("Sidecar medium not found");return m.createElement(a,$n({},o))};ov.isSideCarExport=!0;function wk(t,r){return t.useMedium(r),ov}var sv=xk(),hd=function(){},ac=m.forwardRef(function(t,r){var o=m.useRef(null),a=m.useState({onScrollCapture:hd,onWheelCapture:hd,onTouchMoveCapture:hd}),l=a[0],c=a[1],f=t.forwardProps,h=t.children,g=t.className,y=t.removeScrollBar,v=t.enabled,b=t.shards,C=t.sideCar,w=t.noRelative,E=t.noIsolation,x=t.inert,k=t.allowPinchZoom,P=t.as,j=P===void 0?"div":P,N=t.gapMode,T=rv(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=C,H=gk([o,r]),$=$n($n({},T),l);return m.createElement(m.Fragment,null,v&&m.createElement(B,{sideCar:sv,removeScrollBar:y,shards:b,noRelative:w,noIsolation:E,inert:x,setCallbacks:c,allowPinchZoom:!!k,lockRef:o,gapMode:N}),f?m.cloneElement(m.Children.only(h),$n($n({},$),{ref:H})):m.createElement(j,$n({},$,{className:g,ref:H}),h))});ac.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ac.classNames={fullWidth:Fl,zeroRight:zl};var bk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Sk(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=bk();return r&&t.setAttribute("nonce",r),t}function Ck(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function kk(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var Ek=function(){var t=0,r=null;return{add:function(o){t==0&&(r=Sk())&&(Ck(r,o),kk(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},Nk=function(){var t=Ek();return function(r,o){m.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&o])}},av=function(){var t=Nk(),r=function(o){var a=o.styles,l=o.dynamic;return t(a,l),null};return r},Pk={left:0,top:0,right:0,gap:0},pd=function(t){return parseInt(t||"",10)||0},Rk=function(t){var r=window.getComputedStyle(document.body),o=r[t==="padding"?"paddingLeft":"marginLeft"],a=r[t==="padding"?"paddingTop":"marginTop"],l=r[t==="padding"?"paddingRight":"marginRight"];return[pd(o),pd(a),pd(l)]},jk=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Pk;var r=Rk(t),o=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-o+r[2]-r[0])}},Tk=av(),ws="data-scroll-locked",Mk=function(t,r,o,a){var l=t.left,c=t.top,f=t.right,h=t.gap;return o===void 0&&(o="margin"),`
288
- .`.concat(fk,` {
289
- overflow: hidden `).concat(a,`;
290
- padding-right: `).concat(h,"px ").concat(a,`;
291
- }
292
- body[`).concat(ws,`] {
293
- overflow: hidden `).concat(a,`;
294
- overscroll-behavior: contain;
295
- `).concat([r&&"position: relative ".concat(a,";"),o==="margin"&&`
296
- padding-left: `.concat(l,`px;
297
- padding-top: `).concat(c,`px;
298
- padding-right: `).concat(f,`px;
299
- margin-left:0;
300
- margin-top:0;
301
- margin-right: `).concat(h,"px ").concat(a,`;
302
- `),o==="padding"&&"padding-right: ".concat(h,"px ").concat(a,";")].filter(Boolean).join(""),`
303
- }
304
-
305
- .`).concat(zl,` {
306
- right: `).concat(h,"px ").concat(a,`;
307
- }
308
-
309
- .`).concat(Fl,` {
310
- margin-right: `).concat(h,"px ").concat(a,`;
311
- }
312
-
313
- .`).concat(zl," .").concat(zl,` {
314
- right: 0 `).concat(a,`;
315
- }
316
-
317
- .`).concat(Fl," .").concat(Fl,` {
318
- margin-right: 0 `).concat(a,`;
319
- }
320
-
321
- body[`).concat(ws,`] {
322
- `).concat(hk,": ").concat(h,`px;
323
- }
324
- `)},wg=function(){var t=parseInt(document.body.getAttribute(ws)||"0",10);return isFinite(t)?t:0},Ik=function(){m.useEffect(function(){return document.body.setAttribute(ws,(wg()+1).toString()),function(){var t=wg()-1;t<=0?document.body.removeAttribute(ws):document.body.setAttribute(ws,t.toString())}},[])},Ok=function(t){var r=t.noRelative,o=t.noImportant,a=t.gapMode,l=a===void 0?"margin":a;Ik();var c=m.useMemo(function(){return jk(l)},[l]);return m.createElement(Tk,{styles:Mk(c,!r,l,o?"":"!important")})},Wd=!1;if(typeof window<"u")try{var kl=Object.defineProperty({},"passive",{get:function(){return Wd=!0,!0}});window.addEventListener("test",kl,kl),window.removeEventListener("test",kl,kl)}catch{Wd=!1}var ps=Wd?{passive:!1}:!1,Ak=function(t){return t.tagName==="TEXTAREA"},iv=function(t,r){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return o[r]!=="hidden"&&!(o.overflowY===o.overflowX&&!Ak(t)&&o[r]==="visible")},Lk=function(t){return iv(t,"overflowY")},_k=function(t){return iv(t,"overflowX")},bg=function(t,r){var o=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=lv(t,a);if(l){var c=cv(t,a),f=c[1],h=c[2];if(f>h)return!0}a=a.parentNode}while(a&&a!==o.body);return!1},Dk=function(t){var r=t.scrollTop,o=t.scrollHeight,a=t.clientHeight;return[r,o,a]},zk=function(t){var r=t.scrollLeft,o=t.scrollWidth,a=t.clientWidth;return[r,o,a]},lv=function(t,r){return t==="v"?Lk(r):_k(r)},cv=function(t,r){return t==="v"?Dk(r):zk(r)},Fk=function(t,r){return t==="h"&&r==="rtl"?-1:1},Uk=function(t,r,o,a,l){var c=Fk(t,window.getComputedStyle(r).direction),f=c*a,h=o.target,g=r.contains(h),y=!1,v=f>0,b=0,C=0;do{if(!h)break;var w=cv(t,h),E=w[0],x=w[1],k=w[2],P=x-k-c*E;(E||P)&&lv(t,h)&&(b+=P,C+=E);var j=h.parentNode;h=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!g&&h!==document.body||g&&(r.contains(h)||r===h));return(v&&Math.abs(b)<1||!v&&Math.abs(C)<1)&&(y=!0),y},El=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Sg=function(t){return[t.deltaX,t.deltaY]},Cg=function(t){return t&&"current"in t?t.current:t},Bk=function(t,r){return t[0]===r[0]&&t[1]===r[1]},$k=function(t){return`
325
- .block-interactivity-`.concat(t,` {pointer-events: none;}
326
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
327
- `)},Wk=0,ms=[];function Hk(t){var r=m.useRef([]),o=m.useRef([0,0]),a=m.useRef(),l=m.useState(Wk++)[0],c=m.useState(av)[0],f=m.useRef(t);m.useEffect(function(){f.current=t},[t]),m.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(l));var x=dk([t.lockRef.current],(t.shards||[]).map(Cg),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var h=m.useCallback(function(x,k){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!f.current.allowPinchZoom;var P=El(x),j=o.current,N="deltaX"in x?x.deltaX:j[0]-P[0],T="deltaY"in x?x.deltaY:j[1]-P[1],B,H=x.target,$=Math.abs(N)>Math.abs(T)?"h":"v";if("touches"in x&&$==="h"&&H.type==="range")return!1;var Y=window.getSelection(),U=Y&&Y.anchorNode,G=U?U===H||U.contains(H):!1;if(G)return!1;var z=bg($,H);if(!z)return!0;if(z?B=$:(B=$==="v"?"h":"v",z=bg($,H)),!z)return!1;if(!a.current&&"changedTouches"in x&&(N||T)&&(a.current=B),!B)return!0;var _=a.current||B;return Uk(_,k,x,_==="h"?N:T)},[]),g=m.useCallback(function(x){var k=x;if(!(!ms.length||ms[ms.length-1]!==c)){var P="deltaY"in k?Sg(k):El(k),j=r.current.filter(function(B){return B.name===k.type&&(B.target===k.target||k.target===B.shadowParent)&&Bk(B.delta,P)})[0];if(j&&j.should){k.cancelable&&k.preventDefault();return}if(!j){var N=(f.current.shards||[]).map(Cg).filter(Boolean).filter(function(B){return B.contains(k.target)}),T=N.length>0?h(k,N[0]):!f.current.noIsolation;T&&k.cancelable&&k.preventDefault()}}},[]),y=m.useCallback(function(x,k,P,j){var N={name:x,delta:k,target:P,should:j,shadowParent:Vk(P)};r.current.push(N),setTimeout(function(){r.current=r.current.filter(function(T){return T!==N})},1)},[]),v=m.useCallback(function(x){o.current=El(x),a.current=void 0},[]),b=m.useCallback(function(x){y(x.type,Sg(x),x.target,h(x,t.lockRef.current))},[]),C=m.useCallback(function(x){y(x.type,El(x),x.target,h(x,t.lockRef.current))},[]);m.useEffect(function(){return ms.push(c),t.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:C}),document.addEventListener("wheel",g,ps),document.addEventListener("touchmove",g,ps),document.addEventListener("touchstart",v,ps),function(){ms=ms.filter(function(x){return x!==c}),document.removeEventListener("wheel",g,ps),document.removeEventListener("touchmove",g,ps),document.removeEventListener("touchstart",v,ps)}},[]);var w=t.removeScrollBar,E=t.inert;return m.createElement(m.Fragment,null,E?m.createElement(c,{styles:$k(l)}):null,w?m.createElement(Ok,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Vk(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const Kk=wk(sv,Hk);var Ef=m.forwardRef(function(t,r){return m.createElement(ac,$n({},t,{ref:r,sideCar:Kk}))});Ef.classNames=ac.classNames;var Qk=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},gs=new WeakMap,Nl=new WeakMap,Pl={},md=0,uv=function(t){return t&&(t.host||uv(t.parentNode))},qk=function(t,r){return r.map(function(o){if(t.contains(o))return o;var a=uv(o);return a&&t.contains(a)?a:(console.error("aria-hidden",o,"in not contained inside",t,". Doing nothing"),null)}).filter(function(o){return!!o})},Gk=function(t,r,o,a){var l=qk(r,Array.isArray(t)?t:[t]);Pl[o]||(Pl[o]=new WeakMap);var c=Pl[o],f=[],h=new Set,g=new Set(l),y=function(b){!b||h.has(b)||(h.add(b),y(b.parentNode))};l.forEach(y);var v=function(b){!b||g.has(b)||Array.prototype.forEach.call(b.children,function(C){if(h.has(C))v(C);else try{var w=C.getAttribute(a),E=w!==null&&w!=="false",x=(gs.get(C)||0)+1,k=(c.get(C)||0)+1;gs.set(C,x),c.set(C,k),f.push(C),x===1&&E&&Nl.set(C,!0),k===1&&C.setAttribute(o,"true"),E||C.setAttribute(a,"true")}catch(P){console.error("aria-hidden: cannot operate on ",C,P)}})};return v(r),h.clear(),md++,function(){f.forEach(function(b){var C=gs.get(b)-1,w=c.get(b)-1;gs.set(b,C),c.set(b,w),C||(Nl.has(b)||b.removeAttribute(a),Nl.delete(b)),w||b.removeAttribute(o)}),md--,md||(gs=new WeakMap,gs=new WeakMap,Nl=new WeakMap,Pl={})}},dv=function(t,r,o){o===void 0&&(o="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),l=Qk(t);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),Gk(a,l,o,"aria-hidden")):function(){return null}},ic="Dialog",[fv]=ei(ic),[Yk,En]=fv(ic),hv=t=>{const{__scopeDialog:r,children:o,open:a,defaultOpen:l,onOpenChange:c,modal:f=!0}=t,h=m.useRef(null),g=m.useRef(null),[y,v]=Ql({prop:a,defaultProp:l??!1,onChange:c,caller:ic});return d.jsx(Yk,{scope:r,triggerRef:h,contentRef:g,contentId:To(),titleId:To(),descriptionId:To(),open:y,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(b=>!b),[v]),modal:f,children:o})};hv.displayName=ic;var pv="DialogTrigger",Xk=m.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=En(pv,o),c=Je(r,l.triggerRef);return d.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Rf(l.open),...a,ref:c,onClick:De(t.onClick,l.onOpenToggle)})});Xk.displayName=pv;var Nf="DialogPortal",[Jk,mv]=fv(Nf,{forceMount:void 0}),gv=t=>{const{__scopeDialog:r,forceMount:o,children:a,container:l}=t,c=En(Nf,r);return d.jsx(Jk,{scope:r,forceMount:o,children:m.Children.map(a,f=>d.jsx(Ks,{present:o||c.open,children:d.jsx(sc,{asChild:!0,container:l,children:f})}))})};gv.displayName=Nf;var ql="DialogOverlay",yv=m.forwardRef((t,r)=>{const o=mv(ql,t.__scopeDialog),{forceMount:a=o.forceMount,...l}=t,c=En(ql,t.__scopeDialog);return c.modal?d.jsx(Ks,{present:a||c.open,children:d.jsx(eE,{...l,ref:r})}):null});yv.displayName=ql;var Zk=Ba("DialogOverlay.RemoveScroll"),eE=m.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=En(ql,o);return d.jsx(Ef,{as:Zk,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(Be.div,{"data-state":Rf(l.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),Ao="DialogContent",vv=m.forwardRef((t,r)=>{const o=mv(Ao,t.__scopeDialog),{forceMount:a=o.forceMount,...l}=t,c=En(Ao,t.__scopeDialog);return d.jsx(Ks,{present:a||c.open,children:c.modal?d.jsx(tE,{...l,ref:r}):d.jsx(nE,{...l,ref:r})})});vv.displayName=Ao;var tE=m.forwardRef((t,r)=>{const o=En(Ao,t.__scopeDialog),a=m.useRef(null),l=Je(r,o.contentRef,a);return m.useEffect(()=>{const c=a.current;if(c)return dv(c)},[]),d.jsx(xv,{...t,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:De(t.onCloseAutoFocus,c=>{var f;c.preventDefault(),(f=o.triggerRef.current)==null||f.focus()}),onPointerDownOutside:De(t.onPointerDownOutside,c=>{const f=c.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0;(f.button===2||h)&&c.preventDefault()}),onFocusOutside:De(t.onFocusOutside,c=>c.preventDefault())})}),nE=m.forwardRef((t,r)=>{const o=En(Ao,t.__scopeDialog),a=m.useRef(!1),l=m.useRef(!1);return d.jsx(xv,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var f,h;(f=t.onCloseAutoFocus)==null||f.call(t,c),c.defaultPrevented||(a.current||(h=o.triggerRef.current)==null||h.focus(),c.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:c=>{var g,y;(g=t.onInteractOutside)==null||g.call(t,c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=c.target;((y=o.triggerRef.current)==null?void 0:y.contains(f))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&l.current&&c.preventDefault()}})}),xv=m.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:c,...f}=t,h=En(Ao,o),g=m.useRef(null),y=Je(r,g);return nv(),d.jsxs(d.Fragment,{children:[d.jsx(kf,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:c,children:d.jsx(oc,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":Rf(h.open),...f,ref:y,onDismiss:()=>h.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(rE,{titleId:h.titleId}),d.jsx(sE,{contentRef:g,descriptionId:h.descriptionId})]})]})}),Pf="DialogTitle",wv=m.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=En(Pf,o);return d.jsx(Be.h2,{id:l.titleId,...a,ref:r})});wv.displayName=Pf;var bv="DialogDescription",Sv=m.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=En(bv,o);return d.jsx(Be.p,{id:l.descriptionId,...a,ref:r})});Sv.displayName=bv;var Cv="DialogClose",kv=m.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=En(Cv,o);return d.jsx(Be.button,{type:"button",...a,ref:r,onClick:De(t.onClick,()=>l.onOpenChange(!1))})});kv.displayName=Cv;function Rf(t){return t?"open":"closed"}var Ev="DialogTitleWarning",[ER,Nv]=I2(Ev,{contentName:Ao,titleName:Pf,docsSlug:"dialog"}),rE=({titleId:t})=>{const r=Nv(Ev),o=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
328
-
329
- If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
330
-
331
- For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return m.useEffect(()=>{t&&(document.getElementById(t)||console.error(o))},[o,t]),null},oE="DialogDescriptionWarning",sE=({contentRef:t,descriptionId:r})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Nv(oE).contentName}}.`;return m.useEffect(()=>{var c;const l=(c=t.current)==null?void 0:c.getAttribute("aria-describedby");r&&l&&(document.getElementById(r)||console.warn(a))},[a,t,r]),null},aE=hv,iE=gv,Pv=yv,Rv=vv,jv=wv,Tv=Sv,lE=kv;const Mv=aE,cE=iE,Iv=m.forwardRef(({className:t,...r},o)=>d.jsx(Pv,{ref:o,className:ve("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r}));Iv.displayName=Pv.displayName;const jf=m.forwardRef(({className:t,children:r,...o},a)=>d.jsxs(cE,{children:[d.jsx(Iv,{}),d.jsxs(Rv,{ref:a,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-xl duration-base 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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-xl",t),...o,children:[r,d.jsxs(lE,{className:"absolute right-4 top-4 rounded-lg p-1 opacity-70 ring-offset-white transition-all duration-fast hover:opacity-100 hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none",children:[d.jsx(Sf,{className:"h-4 w-4 text-gray-500"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jf.displayName=Rv.displayName;const Tf=({className:t,...r})=>d.jsx("div",{className:ve("flex flex-col space-y-2 text-center sm:text-left",t),...r});Tf.displayName="DialogHeader";const Mf=({className:t,...r})=>d.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3",t),...r});Mf.displayName="DialogFooter";const If=m.forwardRef(({className:t,...r},o)=>d.jsx(jv,{ref:o,className:ve("text-lg font-semibold leading-tight tracking-tight text-gray-900",t),...r}));If.displayName=jv.displayName;const Of=m.forwardRef(({className:t,...r},o)=>d.jsx(Tv,{ref:o,className:ve("text-sm text-gray-500 leading-relaxed",t),...r}));Of.displayName=Tv.displayName;function kg(t,[r,o]){return Math.min(o,Math.max(r,t))}function uE(t){const r=t+"CollectionProvider",[o,a]=ei(r),[l,c]=o(r,{collectionRef:{current:null},itemMap:new Map}),f=x=>{const{scope:k,children:P}=x,j=ae.useRef(null),N=ae.useRef(new Map).current;return d.jsx(l,{scope:k,itemMap:N,collectionRef:j,children:P})};f.displayName=r;const h=t+"CollectionSlot",g=Ba(h),y=ae.forwardRef((x,k)=>{const{scope:P,children:j}=x,N=c(h,P),T=Je(k,N.collectionRef);return d.jsx(g,{ref:T,children:j})});y.displayName=h;const v=t+"CollectionItemSlot",b="data-radix-collection-item",C=Ba(v),w=ae.forwardRef((x,k)=>{const{scope:P,children:j,...N}=x,T=ae.useRef(null),B=Je(k,T),H=c(v,P);return ae.useEffect(()=>(H.itemMap.set(T,{ref:T,...N}),()=>void H.itemMap.delete(T))),d.jsx(C,{[b]:"",ref:B,children:j})});w.displayName=v;function E(x){const k=c(t+"CollectionConsumer",x);return ae.useCallback(()=>{const j=k.collectionRef.current;if(!j)return[];const N=Array.from(j.querySelectorAll(`[${b}]`));return Array.from(k.itemMap.values()).sort((H,$)=>N.indexOf(H.ref.current)-N.indexOf($.ref.current))},[k.collectionRef,k.itemMap])}return[{Provider:f,Slot:y,ItemSlot:w},E,a]}var dE=m.createContext(void 0);function fE(t){const r=m.useContext(dE);return t||r||"ltr"}const hE=["top","right","bottom","left"],to=Math.min,Kt=Math.max,Gl=Math.round,Rl=Math.floor,Hn=t=>({x:t,y:t}),pE={left:"right",right:"left",bottom:"top",top:"bottom"},mE={start:"end",end:"start"};function Hd(t,r,o){return Kt(t,to(r,o))}function mr(t,r){return typeof t=="function"?t(r):t}function gr(t){return t.split("-")[0]}function Qs(t){return t.split("-")[1]}function Af(t){return t==="x"?"y":"x"}function Lf(t){return t==="y"?"height":"width"}const gE=new Set(["top","bottom"]);function Wn(t){return gE.has(gr(t))?"y":"x"}function _f(t){return Af(Wn(t))}function yE(t,r,o){o===void 0&&(o=!1);const a=Qs(t),l=_f(t),c=Lf(l);let f=l==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[c]>r.floating[c]&&(f=Yl(f)),[f,Yl(f)]}function vE(t){const r=Yl(t);return[Vd(t),r,Vd(r)]}function Vd(t){return t.replace(/start|end/g,r=>mE[r])}const Eg=["left","right"],Ng=["right","left"],xE=["top","bottom"],wE=["bottom","top"];function bE(t,r,o){switch(t){case"top":case"bottom":return o?r?Ng:Eg:r?Eg:Ng;case"left":case"right":return r?xE:wE;default:return[]}}function SE(t,r,o,a){const l=Qs(t);let c=bE(gr(t),o==="start",a);return l&&(c=c.map(f=>f+"-"+l),r&&(c=c.concat(c.map(Vd)))),c}function Yl(t){return t.replace(/left|right|bottom|top/g,r=>pE[r])}function CE(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ov(t){return typeof t!="number"?CE(t):{top:t,right:t,bottom:t,left:t}}function Xl(t){const{x:r,y:o,width:a,height:l}=t;return{width:a,height:l,top:o,left:r,right:r+a,bottom:o+l,x:r,y:o}}function Pg(t,r,o){let{reference:a,floating:l}=t;const c=Wn(r),f=_f(r),h=Lf(f),g=gr(r),y=c==="y",v=a.x+a.width/2-l.width/2,b=a.y+a.height/2-l.height/2,C=a[h]/2-l[h]/2;let w;switch(g){case"top":w={x:v,y:a.y-l.height};break;case"bottom":w={x:v,y:a.y+a.height};break;case"right":w={x:a.x+a.width,y:b};break;case"left":w={x:a.x-l.width,y:b};break;default:w={x:a.x,y:a.y}}switch(Qs(r)){case"start":w[f]-=C*(o&&y?-1:1);break;case"end":w[f]+=C*(o&&y?-1:1);break}return w}async function kE(t,r){var o;r===void 0&&(r={});const{x:a,y:l,platform:c,rects:f,elements:h,strategy:g}=t,{boundary:y="clippingAncestors",rootBoundary:v="viewport",elementContext:b="floating",altBoundary:C=!1,padding:w=0}=mr(r,t),E=Ov(w),k=h[C?b==="floating"?"reference":"floating":b],P=Xl(await c.getClippingRect({element:(o=await(c.isElement==null?void 0:c.isElement(k)))==null||o?k:k.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(h.floating)),boundary:y,rootBoundary:v,strategy:g})),j=b==="floating"?{x:a,y:l,width:f.floating.width,height:f.floating.height}:f.reference,N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h.floating)),T=await(c.isElement==null?void 0:c.isElement(N))?await(c.getScale==null?void 0:c.getScale(N))||{x:1,y:1}:{x:1,y:1},B=Xl(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:j,offsetParent:N,strategy:g}):j);return{top:(P.top-B.top+E.top)/T.y,bottom:(B.bottom-P.bottom+E.bottom)/T.y,left:(P.left-B.left+E.left)/T.x,right:(B.right-P.right+E.right)/T.x}}const EE=async(t,r,o)=>{const{placement:a="bottom",strategy:l="absolute",middleware:c=[],platform:f}=o,h=c.filter(Boolean),g=await(f.isRTL==null?void 0:f.isRTL(r));let y=await f.getElementRects({reference:t,floating:r,strategy:l}),{x:v,y:b}=Pg(y,a,g),C=a,w={},E=0;for(let k=0;k<h.length;k++){var x;const{name:P,fn:j}=h[k],{x:N,y:T,data:B,reset:H}=await j({x:v,y:b,initialPlacement:a,placement:C,strategy:l,middlewareData:w,rects:y,platform:{...f,detectOverflow:(x=f.detectOverflow)!=null?x:kE},elements:{reference:t,floating:r}});v=N??v,b=T??b,w={...w,[P]:{...w[P],...B}},H&&E<=50&&(E++,typeof H=="object"&&(H.placement&&(C=H.placement),H.rects&&(y=H.rects===!0?await f.getElementRects({reference:t,floating:r,strategy:l}):H.rects),{x:v,y:b}=Pg(y,C,g)),k=-1)}return{x:v,y:b,placement:C,strategy:l,middlewareData:w}},NE=t=>({name:"arrow",options:t,async fn(r){const{x:o,y:a,placement:l,rects:c,platform:f,elements:h,middlewareData:g}=r,{element:y,padding:v=0}=mr(t,r)||{};if(y==null)return{};const b=Ov(v),C={x:o,y:a},w=_f(l),E=Lf(w),x=await f.getDimensions(y),k=w==="y",P=k?"top":"left",j=k?"bottom":"right",N=k?"clientHeight":"clientWidth",T=c.reference[E]+c.reference[w]-C[w]-c.floating[E],B=C[w]-c.reference[w],H=await(f.getOffsetParent==null?void 0:f.getOffsetParent(y));let $=H?H[N]:0;(!$||!await(f.isElement==null?void 0:f.isElement(H)))&&($=h.floating[N]||c.floating[E]);const Y=T/2-B/2,U=$/2-x[E]/2-1,G=to(b[P],U),z=to(b[j],U),_=G,Q=$-x[E]-z,J=$/2-x[E]/2+Y,oe=Hd(_,J,Q),le=!g.arrow&&Qs(l)!=null&&J!==oe&&c.reference[E]/2-(J<_?G:z)-x[E]/2<0,ce=le?J<_?J-_:J-Q:0;return{[w]:C[w]+ce,data:{[w]:oe,centerOffset:J-oe-ce,...le&&{alignmentOffset:ce}},reset:le}}}),PE=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var o,a;const{placement:l,middlewareData:c,rects:f,initialPlacement:h,platform:g,elements:y}=r,{mainAxis:v=!0,crossAxis:b=!0,fallbackPlacements:C,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:x=!0,...k}=mr(t,r);if((o=c.arrow)!=null&&o.alignmentOffset)return{};const P=gr(l),j=Wn(h),N=gr(h)===h,T=await(g.isRTL==null?void 0:g.isRTL(y.floating)),B=C||(N||!x?[Yl(h)]:vE(h)),H=E!=="none";!C&&H&&B.push(...SE(h,x,E,T));const $=[h,...B],Y=await g.detectOverflow(r,k),U=[];let G=((a=c.flip)==null?void 0:a.overflows)||[];if(v&&U.push(Y[P]),b){const J=yE(l,f,T);U.push(Y[J[0]],Y[J[1]])}if(G=[...G,{placement:l,overflows:U}],!U.every(J=>J<=0)){var z,_;const J=(((z=c.flip)==null?void 0:z.index)||0)+1,oe=$[J];if(oe&&(!(b==="alignment"?j!==Wn(oe):!1)||G.every(V=>Wn(V.placement)===j?V.overflows[0]>0:!0)))return{data:{index:J,overflows:G},reset:{placement:oe}};let le=(_=G.filter(ce=>ce.overflows[0]<=0).sort((ce,V)=>ce.overflows[1]-V.overflows[1])[0])==null?void 0:_.placement;if(!le)switch(w){case"bestFit":{var Q;const ce=(Q=G.filter(V=>{if(H){const q=Wn(V.placement);return q===j||q==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(q=>q>0).reduce((q,K)=>q+K,0)]).sort((V,q)=>V[1]-q[1])[0])==null?void 0:Q[0];ce&&(le=ce);break}case"initialPlacement":le=h;break}if(l!==le)return{reset:{placement:le}}}return{}}}};function Rg(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function jg(t){return hE.some(r=>t[r]>=0)}const RE=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:o,platform:a}=r,{strategy:l="referenceHidden",...c}=mr(t,r);switch(l){case"referenceHidden":{const f=await a.detectOverflow(r,{...c,elementContext:"reference"}),h=Rg(f,o.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:jg(h)}}}case"escaped":{const f=await a.detectOverflow(r,{...c,altBoundary:!0}),h=Rg(f,o.floating);return{data:{escapedOffsets:h,escaped:jg(h)}}}default:return{}}}}},Av=new Set(["left","top"]);async function jE(t,r){const{placement:o,platform:a,elements:l}=t,c=await(a.isRTL==null?void 0:a.isRTL(l.floating)),f=gr(o),h=Qs(o),g=Wn(o)==="y",y=Av.has(f)?-1:1,v=c&&g?-1:1,b=mr(r,t);let{mainAxis:C,crossAxis:w,alignmentAxis:E}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return h&&typeof E=="number"&&(w=h==="end"?E*-1:E),g?{x:w*v,y:C*y}:{x:C*y,y:w*v}}const TE=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var o,a;const{x:l,y:c,placement:f,middlewareData:h}=r,g=await jE(r,t);return f===((o=h.offset)==null?void 0:o.placement)&&(a=h.arrow)!=null&&a.alignmentOffset?{}:{x:l+g.x,y:c+g.y,data:{...g,placement:f}}}}},ME=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:o,y:a,placement:l,platform:c}=r,{mainAxis:f=!0,crossAxis:h=!1,limiter:g={fn:P=>{let{x:j,y:N}=P;return{x:j,y:N}}},...y}=mr(t,r),v={x:o,y:a},b=await c.detectOverflow(r,y),C=Wn(gr(l)),w=Af(C);let E=v[w],x=v[C];if(f){const P=w==="y"?"top":"left",j=w==="y"?"bottom":"right",N=E+b[P],T=E-b[j];E=Hd(N,E,T)}if(h){const P=C==="y"?"top":"left",j=C==="y"?"bottom":"right",N=x+b[P],T=x-b[j];x=Hd(N,x,T)}const k=g.fn({...r,[w]:E,[C]:x});return{...k,data:{x:k.x-o,y:k.y-a,enabled:{[w]:f,[C]:h}}}}}},IE=function(t){return t===void 0&&(t={}),{options:t,fn(r){const{x:o,y:a,placement:l,rects:c,middlewareData:f}=r,{offset:h=0,mainAxis:g=!0,crossAxis:y=!0}=mr(t,r),v={x:o,y:a},b=Wn(l),C=Af(b);let w=v[C],E=v[b];const x=mr(h,r),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(g){const N=C==="y"?"height":"width",T=c.reference[C]-c.floating[N]+k.mainAxis,B=c.reference[C]+c.reference[N]-k.mainAxis;w<T?w=T:w>B&&(w=B)}if(y){var P,j;const N=C==="y"?"width":"height",T=Av.has(gr(l)),B=c.reference[b]-c.floating[N]+(T&&((P=f.offset)==null?void 0:P[b])||0)+(T?0:k.crossAxis),H=c.reference[b]+c.reference[N]+(T?0:((j=f.offset)==null?void 0:j[b])||0)-(T?k.crossAxis:0);E<B?E=B:E>H&&(E=H)}return{[C]:w,[b]:E}}}},OE=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){var o,a;const{placement:l,rects:c,platform:f,elements:h}=r,{apply:g=()=>{},...y}=mr(t,r),v=await f.detectOverflow(r,y),b=gr(l),C=Qs(l),w=Wn(l)==="y",{width:E,height:x}=c.floating;let k,P;b==="top"||b==="bottom"?(k=b,P=C===(await(f.isRTL==null?void 0:f.isRTL(h.floating))?"start":"end")?"left":"right"):(P=b,k=C==="end"?"top":"bottom");const j=x-v.top-v.bottom,N=E-v.left-v.right,T=to(x-v[k],j),B=to(E-v[P],N),H=!r.middlewareData.shift;let $=T,Y=B;if((o=r.middlewareData.shift)!=null&&o.enabled.x&&(Y=N),(a=r.middlewareData.shift)!=null&&a.enabled.y&&($=j),H&&!C){const G=Kt(v.left,0),z=Kt(v.right,0),_=Kt(v.top,0),Q=Kt(v.bottom,0);w?Y=E-2*(G!==0||z!==0?G+z:Kt(v.left,v.right)):$=x-2*(_!==0||Q!==0?_+Q:Kt(v.top,v.bottom))}await g({...r,availableWidth:Y,availableHeight:$});const U=await f.getDimensions(h.floating);return E!==U.width||x!==U.height?{reset:{rects:!0}}:{}}}};function lc(){return typeof window<"u"}function qs(t){return Lv(t)?(t.nodeName||"").toLowerCase():"#document"}function Qt(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function qn(t){var r;return(r=(Lv(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function Lv(t){return lc()?t instanceof Node||t instanceof Qt(t).Node:!1}function Cn(t){return lc()?t instanceof Element||t instanceof Qt(t).Element:!1}function Vn(t){return lc()?t instanceof HTMLElement||t instanceof Qt(t).HTMLElement:!1}function Tg(t){return!lc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qt(t).ShadowRoot}const AE=new Set(["inline","contents"]);function ti(t){const{overflow:r,overflowX:o,overflowY:a,display:l}=kn(t);return/auto|scroll|overlay|hidden|clip/.test(r+a+o)&&!AE.has(l)}const LE=new Set(["table","td","th"]);function _E(t){return LE.has(qs(t))}const DE=[":popover-open",":modal"];function cc(t){return DE.some(r=>{try{return t.matches(r)}catch{return!1}})}const zE=["transform","translate","scale","rotate","perspective"],FE=["transform","translate","scale","rotate","perspective","filter"],UE=["paint","layout","strict","content"];function Df(t){const r=zf(),o=Cn(t)?kn(t):t;return zE.some(a=>o[a]?o[a]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!r&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!r&&(o.filter?o.filter!=="none":!1)||FE.some(a=>(o.willChange||"").includes(a))||UE.some(a=>(o.contain||"").includes(a))}function BE(t){let r=no(t);for(;Vn(r)&&!Ls(r);){if(Df(r))return r;if(cc(r))return null;r=no(r)}return null}function zf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $E=new Set(["html","body","#document"]);function Ls(t){return $E.has(qs(t))}function kn(t){return Qt(t).getComputedStyle(t)}function uc(t){return Cn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function no(t){if(qs(t)==="html")return t;const r=t.assignedSlot||t.parentNode||Tg(t)&&t.host||qn(t);return Tg(r)?r.host:r}function _v(t){const r=no(t);return Ls(r)?t.ownerDocument?t.ownerDocument.body:t.body:Vn(r)&&ti(r)?r:_v(r)}function $a(t,r,o){var a;r===void 0&&(r=[]),o===void 0&&(o=!0);const l=_v(t),c=l===((a=t.ownerDocument)==null?void 0:a.body),f=Qt(l);if(c){const h=Kd(f);return r.concat(f,f.visualViewport||[],ti(l)?l:[],h&&o?$a(h):[])}return r.concat(l,$a(l,[],o))}function Kd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Dv(t){const r=kn(t);let o=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const l=Vn(t),c=l?t.offsetWidth:o,f=l?t.offsetHeight:a,h=Gl(o)!==c||Gl(a)!==f;return h&&(o=c,a=f),{width:o,height:a,$:h}}function Ff(t){return Cn(t)?t:t.contextElement}function bs(t){const r=Ff(t);if(!Vn(r))return Hn(1);const o=r.getBoundingClientRect(),{width:a,height:l,$:c}=Dv(r);let f=(c?Gl(o.width):o.width)/a,h=(c?Gl(o.height):o.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!h||!Number.isFinite(h))&&(h=1),{x:f,y:h}}const WE=Hn(0);function zv(t){const r=Qt(t);return!zf()||!r.visualViewport?WE:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function HE(t,r,o){return r===void 0&&(r=!1),!o||r&&o!==Qt(t)?!1:r}function Lo(t,r,o,a){r===void 0&&(r=!1),o===void 0&&(o=!1);const l=t.getBoundingClientRect(),c=Ff(t);let f=Hn(1);r&&(a?Cn(a)&&(f=bs(a)):f=bs(t));const h=HE(c,o,a)?zv(c):Hn(0);let g=(l.left+h.x)/f.x,y=(l.top+h.y)/f.y,v=l.width/f.x,b=l.height/f.y;if(c){const C=Qt(c),w=a&&Cn(a)?Qt(a):a;let E=C,x=Kd(E);for(;x&&a&&w!==E;){const k=bs(x),P=x.getBoundingClientRect(),j=kn(x),N=P.left+(x.clientLeft+parseFloat(j.paddingLeft))*k.x,T=P.top+(x.clientTop+parseFloat(j.paddingTop))*k.y;g*=k.x,y*=k.y,v*=k.x,b*=k.y,g+=N,y+=T,E=Qt(x),x=Kd(E)}}return Xl({width:v,height:b,x:g,y})}function dc(t,r){const o=uc(t).scrollLeft;return r?r.left+o:Lo(qn(t)).left+o}function Fv(t,r){const o=t.getBoundingClientRect(),a=o.left+r.scrollLeft-dc(t,o),l=o.top+r.scrollTop;return{x:a,y:l}}function VE(t){let{elements:r,rect:o,offsetParent:a,strategy:l}=t;const c=l==="fixed",f=qn(a),h=r?cc(r.floating):!1;if(a===f||h&&c)return o;let g={scrollLeft:0,scrollTop:0},y=Hn(1);const v=Hn(0),b=Vn(a);if((b||!b&&!c)&&((qs(a)!=="body"||ti(f))&&(g=uc(a)),Vn(a))){const w=Lo(a);y=bs(a),v.x=w.x+a.clientLeft,v.y=w.y+a.clientTop}const C=f&&!b&&!c?Fv(f,g):Hn(0);return{width:o.width*y.x,height:o.height*y.y,x:o.x*y.x-g.scrollLeft*y.x+v.x+C.x,y:o.y*y.y-g.scrollTop*y.y+v.y+C.y}}function KE(t){return Array.from(t.getClientRects())}function QE(t){const r=qn(t),o=uc(t),a=t.ownerDocument.body,l=Kt(r.scrollWidth,r.clientWidth,a.scrollWidth,a.clientWidth),c=Kt(r.scrollHeight,r.clientHeight,a.scrollHeight,a.clientHeight);let f=-o.scrollLeft+dc(t);const h=-o.scrollTop;return kn(a).direction==="rtl"&&(f+=Kt(r.clientWidth,a.clientWidth)-l),{width:l,height:c,x:f,y:h}}const Mg=25;function qE(t,r){const o=Qt(t),a=qn(t),l=o.visualViewport;let c=a.clientWidth,f=a.clientHeight,h=0,g=0;if(l){c=l.width,f=l.height;const v=zf();(!v||v&&r==="fixed")&&(h=l.offsetLeft,g=l.offsetTop)}const y=dc(a);if(y<=0){const v=a.ownerDocument,b=v.body,C=getComputedStyle(b),w=v.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,E=Math.abs(a.clientWidth-b.clientWidth-w);E<=Mg&&(c-=E)}else y<=Mg&&(c+=y);return{width:c,height:f,x:h,y:g}}const GE=new Set(["absolute","fixed"]);function YE(t,r){const o=Lo(t,!0,r==="fixed"),a=o.top+t.clientTop,l=o.left+t.clientLeft,c=Vn(t)?bs(t):Hn(1),f=t.clientWidth*c.x,h=t.clientHeight*c.y,g=l*c.x,y=a*c.y;return{width:f,height:h,x:g,y}}function Ig(t,r,o){let a;if(r==="viewport")a=qE(t,o);else if(r==="document")a=QE(qn(t));else if(Cn(r))a=YE(r,o);else{const l=zv(t);a={x:r.x-l.x,y:r.y-l.y,width:r.width,height:r.height}}return Xl(a)}function Uv(t,r){const o=no(t);return o===r||!Cn(o)||Ls(o)?!1:kn(o).position==="fixed"||Uv(o,r)}function XE(t,r){const o=r.get(t);if(o)return o;let a=$a(t,[],!1).filter(h=>Cn(h)&&qs(h)!=="body"),l=null;const c=kn(t).position==="fixed";let f=c?no(t):t;for(;Cn(f)&&!Ls(f);){const h=kn(f),g=Df(f);!g&&h.position==="fixed"&&(l=null),(c?!g&&!l:!g&&h.position==="static"&&!!l&&GE.has(l.position)||ti(f)&&!g&&Uv(t,f))?a=a.filter(v=>v!==f):l=h,f=no(f)}return r.set(t,a),a}function JE(t){let{element:r,boundary:o,rootBoundary:a,strategy:l}=t;const f=[...o==="clippingAncestors"?cc(r)?[]:XE(r,this._c):[].concat(o),a],h=f[0],g=f.reduce((y,v)=>{const b=Ig(r,v,l);return y.top=Kt(b.top,y.top),y.right=to(b.right,y.right),y.bottom=to(b.bottom,y.bottom),y.left=Kt(b.left,y.left),y},Ig(r,h,l));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function ZE(t){const{width:r,height:o}=Dv(t);return{width:r,height:o}}function eN(t,r,o){const a=Vn(r),l=qn(r),c=o==="fixed",f=Lo(t,!0,c,r);let h={scrollLeft:0,scrollTop:0};const g=Hn(0);function y(){g.x=dc(l)}if(a||!a&&!c)if((qs(r)!=="body"||ti(l))&&(h=uc(r)),a){const w=Lo(r,!0,c,r);g.x=w.x+r.clientLeft,g.y=w.y+r.clientTop}else l&&y();c&&!a&&l&&y();const v=l&&!a&&!c?Fv(l,h):Hn(0),b=f.left+h.scrollLeft-g.x-v.x,C=f.top+h.scrollTop-g.y-v.y;return{x:b,y:C,width:f.width,height:f.height}}function gd(t){return kn(t).position==="static"}function Og(t,r){if(!Vn(t)||kn(t).position==="fixed")return null;if(r)return r(t);let o=t.offsetParent;return qn(t)===o&&(o=o.ownerDocument.body),o}function Bv(t,r){const o=Qt(t);if(cc(t))return o;if(!Vn(t)){let l=no(t);for(;l&&!Ls(l);){if(Cn(l)&&!gd(l))return l;l=no(l)}return o}let a=Og(t,r);for(;a&&_E(a)&&gd(a);)a=Og(a,r);return a&&Ls(a)&&gd(a)&&!Df(a)?o:a||BE(t)||o}const tN=async function(t){const r=this.getOffsetParent||Bv,o=this.getDimensions,a=await o(t.floating);return{reference:eN(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function nN(t){return kn(t).direction==="rtl"}const rN={convertOffsetParentRelativeRectToViewportRelativeRect:VE,getDocumentElement:qn,getClippingRect:JE,getOffsetParent:Bv,getElementRects:tN,getClientRects:KE,getDimensions:ZE,getScale:bs,isElement:Cn,isRTL:nN};function $v(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function oN(t,r){let o=null,a;const l=qn(t);function c(){var h;clearTimeout(a),(h=o)==null||h.disconnect(),o=null}function f(h,g){h===void 0&&(h=!1),g===void 0&&(g=1),c();const y=t.getBoundingClientRect(),{left:v,top:b,width:C,height:w}=y;if(h||r(),!C||!w)return;const E=Rl(b),x=Rl(l.clientWidth-(v+C)),k=Rl(l.clientHeight-(b+w)),P=Rl(v),N={rootMargin:-E+"px "+-x+"px "+-k+"px "+-P+"px",threshold:Kt(0,to(1,g))||1};let T=!0;function B(H){const $=H[0].intersectionRatio;if($!==g){if(!T)return f();$?f(!1,$):a=setTimeout(()=>{f(!1,1e-7)},1e3)}$===1&&!$v(y,t.getBoundingClientRect())&&f(),T=!1}try{o=new IntersectionObserver(B,{...N,root:l.ownerDocument})}catch{o=new IntersectionObserver(B,N)}o.observe(t)}return f(!0),c}function sN(t,r,o,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=a,y=Ff(t),v=l||c?[...y?$a(y):[],...$a(r)]:[];v.forEach(P=>{l&&P.addEventListener("scroll",o,{passive:!0}),c&&P.addEventListener("resize",o)});const b=y&&h?oN(y,o):null;let C=-1,w=null;f&&(w=new ResizeObserver(P=>{let[j]=P;j&&j.target===y&&w&&(w.unobserve(r),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var N;(N=w)==null||N.observe(r)})),o()}),y&&!g&&w.observe(y),w.observe(r));let E,x=g?Lo(t):null;g&&k();function k(){const P=Lo(t);x&&!$v(x,P)&&o(),x=P,E=requestAnimationFrame(k)}return o(),()=>{var P;v.forEach(j=>{l&&j.removeEventListener("scroll",o),c&&j.removeEventListener("resize",o)}),b==null||b(),(P=w)==null||P.disconnect(),w=null,g&&cancelAnimationFrame(E)}}const aN=TE,iN=ME,lN=PE,cN=OE,uN=RE,Ag=NE,dN=IE,fN=(t,r,o)=>{const a=new Map,l={platform:rN,...o},c={...l.platform,_c:a};return EE(t,r,{...l,platform:c})};var hN=typeof document<"u",pN=function(){},Ul=hN?m.useLayoutEffect:pN;function Jl(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let o,a,l;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(o=t.length,o!==r.length)return!1;for(a=o;a--!==0;)if(!Jl(t[a],r[a]))return!1;return!0}if(l=Object.keys(t),o=l.length,o!==Object.keys(r).length)return!1;for(a=o;a--!==0;)if(!{}.hasOwnProperty.call(r,l[a]))return!1;for(a=o;a--!==0;){const c=l[a];if(!(c==="_owner"&&t.$$typeof)&&!Jl(t[c],r[c]))return!1}return!0}return t!==t&&r!==r}function Wv(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Lg(t,r){const o=Wv(t);return Math.round(r*o)/o}function yd(t){const r=m.useRef(t);return Ul(()=>{r.current=t}),r}function mN(t){t===void 0&&(t={});const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l,elements:{reference:c,floating:f}={},transform:h=!0,whileElementsMounted:g,open:y}=t,[v,b]=m.useState({x:0,y:0,strategy:o,placement:r,middlewareData:{},isPositioned:!1}),[C,w]=m.useState(a);Jl(C,a)||w(a);const[E,x]=m.useState(null),[k,P]=m.useState(null),j=m.useCallback(V=>{V!==H.current&&(H.current=V,x(V))},[]),N=m.useCallback(V=>{V!==$.current&&($.current=V,P(V))},[]),T=c||E,B=f||k,H=m.useRef(null),$=m.useRef(null),Y=m.useRef(v),U=g!=null,G=yd(g),z=yd(l),_=yd(y),Q=m.useCallback(()=>{if(!H.current||!$.current)return;const V={placement:r,strategy:o,middleware:C};z.current&&(V.platform=z.current),fN(H.current,$.current,V).then(q=>{const K={...q,isPositioned:_.current!==!1};J.current&&!Jl(Y.current,K)&&(Y.current=K,Ja.flushSync(()=>{b(K)}))})},[C,r,o,z,_]);Ul(()=>{y===!1&&Y.current.isPositioned&&(Y.current.isPositioned=!1,b(V=>({...V,isPositioned:!1})))},[y]);const J=m.useRef(!1);Ul(()=>(J.current=!0,()=>{J.current=!1}),[]),Ul(()=>{if(T&&(H.current=T),B&&($.current=B),T&&B){if(G.current)return G.current(T,B,Q);Q()}},[T,B,Q,G,U]);const oe=m.useMemo(()=>({reference:H,floating:$,setReference:j,setFloating:N}),[j,N]),le=m.useMemo(()=>({reference:T,floating:B}),[T,B]),ce=m.useMemo(()=>{const V={position:o,left:0,top:0};if(!le.floating)return V;const q=Lg(le.floating,v.x),K=Lg(le.floating,v.y);return h?{...V,transform:"translate("+q+"px, "+K+"px)",...Wv(le.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:q,top:K}},[o,h,le.floating,v.x,v.y]);return m.useMemo(()=>({...v,update:Q,refs:oe,elements:le,floatingStyles:ce}),[v,Q,oe,le,ce])}const gN=t=>{function r(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:t,fn(o){const{element:a,padding:l}=typeof t=="function"?t(o):t;return a&&r(a)?a.current!=null?Ag({element:a.current,padding:l}).fn(o):{}:a?Ag({element:a,padding:l}).fn(o):{}}}},yN=(t,r)=>({...aN(t),options:[t,r]}),vN=(t,r)=>({...iN(t),options:[t,r]}),xN=(t,r)=>({...dN(t),options:[t,r]}),wN=(t,r)=>({...lN(t),options:[t,r]}),bN=(t,r)=>({...cN(t),options:[t,r]}),SN=(t,r)=>({...uN(t),options:[t,r]}),CN=(t,r)=>({...gN(t),options:[t,r]});var kN="Arrow",Hv=m.forwardRef((t,r)=>{const{children:o,width:a=10,height:l=5,...c}=t;return d.jsx(Be.svg,{...c,ref:r,width:a,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?o:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});Hv.displayName=kN;var EN=Hv;function NN(t){const[r,o]=m.useState(void 0);return Ct(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const a=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const c=l[0];let f,h;if("borderBoxSize"in c){const g=c.borderBoxSize,y=Array.isArray(g)?g[0]:g;f=y.inlineSize,h=y.blockSize}else f=t.offsetWidth,h=t.offsetHeight;o({width:f,height:h})});return a.observe(t,{box:"border-box"}),()=>a.unobserve(t)}else o(void 0)},[t]),r}var Uf="Popper",[Vv,fc]=ei(Uf),[PN,Kv]=Vv(Uf),Qv=t=>{const{__scopePopper:r,children:o}=t,[a,l]=m.useState(null);return d.jsx(PN,{scope:r,anchor:a,onAnchorChange:l,children:o})};Qv.displayName=Uf;var qv="PopperAnchor",Gv=m.forwardRef((t,r)=>{const{__scopePopper:o,virtualRef:a,...l}=t,c=Kv(qv,o),f=m.useRef(null),h=Je(r,f),g=m.useRef(null);return m.useEffect(()=>{const y=g.current;g.current=(a==null?void 0:a.current)||f.current,y!==g.current&&c.onAnchorChange(g.current)}),a?null:d.jsx(Be.div,{...l,ref:h})});Gv.displayName=qv;var Bf="PopperContent",[RN,jN]=Vv(Bf),Yv=m.forwardRef((t,r)=>{var ne,pe,Ce,Ne,Te,Ie;const{__scopePopper:o,side:a="bottom",sideOffset:l=0,align:c="center",alignOffset:f=0,arrowPadding:h=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:v=0,sticky:b="partial",hideWhenDetached:C=!1,updatePositionStrategy:w="optimized",onPlaced:E,...x}=t,k=Kv(Bf,o),[P,j]=m.useState(null),N=Je(r,tt=>j(tt)),[T,B]=m.useState(null),H=NN(T),$=(H==null?void 0:H.width)??0,Y=(H==null?void 0:H.height)??0,U=a+(c!=="center"?"-"+c:""),G=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},z=Array.isArray(y)?y:[y],_=z.length>0,Q={padding:G,boundary:z.filter(MN),altBoundary:_},{refs:J,floatingStyles:oe,placement:le,isPositioned:ce,middlewareData:V}=mN({strategy:"fixed",placement:U,whileElementsMounted:(...tt)=>sN(...tt,{animationFrame:w==="always"}),elements:{reference:k.anchor},middleware:[yN({mainAxis:l+Y,alignmentAxis:f}),g&&vN({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?xN():void 0,...Q}),g&&wN({...Q}),bN({...Q,apply:({elements:tt,rects:yt,availableWidth:Nn,availableHeight:sn})=>{const{width:an,height:xr}=yt.reference,Pn=tt.floating.style;Pn.setProperty("--radix-popper-available-width",`${Nn}px`),Pn.setProperty("--radix-popper-available-height",`${sn}px`),Pn.setProperty("--radix-popper-anchor-width",`${an}px`),Pn.setProperty("--radix-popper-anchor-height",`${xr}px`)}}),T&&CN({element:T,padding:h}),IN({arrowWidth:$,arrowHeight:Y}),C&&SN({strategy:"referenceHidden",...Q})]}),[q,K]=Zv(le),M=Oo(E);Ct(()=>{ce&&(M==null||M())},[ce,M]);const L=(ne=V.arrow)==null?void 0:ne.x,ee=(pe=V.arrow)==null?void 0:pe.y,ie=((Ce=V.arrow)==null?void 0:Ce.centerOffset)!==0,[he,we]=m.useState();return Ct(()=>{P&&we(window.getComputedStyle(P).zIndex)},[P]),d.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...oe,transform:ce?oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(Ne=V.transformOrigin)==null?void 0:Ne.x,(Te=V.transformOrigin)==null?void 0:Te.y].join(" "),...((Ie=V.hide)==null?void 0:Ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(RN,{scope:o,placedSide:q,onArrowChange:B,arrowX:L,arrowY:ee,shouldHideArrow:ie,children:d.jsx(Be.div,{"data-side":q,"data-align":K,...x,ref:N,style:{...x.style,animation:ce?void 0:"none"}})})})});Yv.displayName=Bf;var Xv="PopperArrow",TN={top:"bottom",right:"left",bottom:"top",left:"right"},Jv=m.forwardRef(function(r,o){const{__scopePopper:a,...l}=r,c=jN(Xv,a),f=TN[c.placedSide];return d.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:d.jsx(EN,{...l,ref:o,style:{...l.style,display:"block"}})})});Jv.displayName=Xv;function MN(t){return t!==null}var IN=t=>({name:"transformOrigin",options:t,fn(r){var k,P,j;const{placement:o,rects:a,middlewareData:l}=r,f=((k=l.arrow)==null?void 0:k.centerOffset)!==0,h=f?0:t.arrowWidth,g=f?0:t.arrowHeight,[y,v]=Zv(o),b={start:"0%",center:"50%",end:"100%"}[v],C=(((P=l.arrow)==null?void 0:P.x)??0)+h/2,w=(((j=l.arrow)==null?void 0:j.y)??0)+g/2;let E="",x="";return y==="bottom"?(E=f?b:`${C}px`,x=`${-g}px`):y==="top"?(E=f?b:`${C}px`,x=`${a.floating.height+g}px`):y==="right"?(E=`${-g}px`,x=f?b:`${w}px`):y==="left"&&(E=`${a.floating.width+g}px`,x=f?b:`${w}px`),{data:{x:E,y:x}}}});function Zv(t){const[r,o="center"]=t.split("-");return[r,o]}var e0=Qv,t0=Gv,n0=Yv,r0=Jv;function ON(t){const r=m.useRef({value:t,previous:t});return m.useMemo(()=>(r.current.value!==t&&(r.current.previous=r.current.value,r.current.value=t),r.current.previous),[t])}var o0=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"}),AN="VisuallyHidden",s0=m.forwardRef((t,r)=>d.jsx(Be.span,{...t,ref:r,style:{...o0,...t.style}}));s0.displayName=AN;var LN=s0,_N=[" ","Enter","ArrowUp","ArrowDown"],DN=[" ","Enter"],_o="Select",[hc,pc,zN]=uE(_o),[Gs]=ei(_o,[zN,fc]),mc=fc(),[FN,ro]=Gs(_o),[UN,BN]=Gs(_o),a0=t=>{const{__scopeSelect:r,children:o,open:a,defaultOpen:l,onOpenChange:c,value:f,defaultValue:h,onValueChange:g,dir:y,name:v,autoComplete:b,disabled:C,required:w,form:E}=t,x=mc(r),[k,P]=m.useState(null),[j,N]=m.useState(null),[T,B]=m.useState(!1),H=fE(y),[$,Y]=Ql({prop:a,defaultProp:l??!1,onChange:c,caller:_o}),[U,G]=Ql({prop:f,defaultProp:h,onChange:g,caller:_o}),z=m.useRef(null),_=k?E||!!k.closest("form"):!0,[Q,J]=m.useState(new Set),oe=Array.from(Q).map(le=>le.props.value).join(";");return d.jsx(e0,{...x,children:d.jsxs(FN,{required:w,scope:r,trigger:k,onTriggerChange:P,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:T,onValueNodeHasChildrenChange:B,contentId:To(),value:U,onValueChange:G,open:$,onOpenChange:Y,dir:H,triggerPointerDownPosRef:z,disabled:C,children:[d.jsx(hc.Provider,{scope:r,children:d.jsx(UN,{scope:t.__scopeSelect,onNativeOptionAdd:m.useCallback(le=>{J(ce=>new Set(ce).add(le))},[]),onNativeOptionRemove:m.useCallback(le=>{J(ce=>{const V=new Set(ce);return V.delete(le),V})},[]),children:o})}),_?d.jsxs(T0,{"aria-hidden":!0,required:w,tabIndex:-1,name:v,autoComplete:b,value:U,onChange:le=>G(le.target.value),disabled:C,form:E,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(Q)]},oe):null]})})};a0.displayName=_o;var i0="SelectTrigger",l0=m.forwardRef((t,r)=>{const{__scopeSelect:o,disabled:a=!1,...l}=t,c=mc(o),f=ro(i0,o),h=f.disabled||a,g=Je(r,f.onTriggerChange),y=pc(o),v=m.useRef("touch"),[b,C,w]=I0(x=>{const k=y().filter(N=>!N.disabled),P=k.find(N=>N.value===f.value),j=O0(k,x,P);j!==void 0&&f.onValueChange(j.value)}),E=x=>{h||(f.onOpenChange(!0),w()),x&&(f.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return d.jsx(t0,{asChild:!0,...c,children:d.jsx(Be.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":M0(f.value)?"":void 0,...l,ref:g,onClick:De(l.onClick,x=>{x.currentTarget.focus(),v.current!=="mouse"&&E(x)}),onPointerDown:De(l.onPointerDown,x=>{v.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(E(x),x.preventDefault())}),onKeyDown:De(l.onKeyDown,x=>{const k=b.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&C(x.key),!(k&&x.key===" ")&&_N.includes(x.key)&&(E(),x.preventDefault())})})})});l0.displayName=i0;var c0="SelectValue",u0=m.forwardRef((t,r)=>{const{__scopeSelect:o,className:a,style:l,children:c,placeholder:f="",...h}=t,g=ro(c0,o),{onValueNodeHasChildrenChange:y}=g,v=c!==void 0,b=Je(r,g.onValueNodeChange);return Ct(()=>{y(v)},[y,v]),d.jsx(Be.span,{...h,ref:b,style:{pointerEvents:"none"},children:M0(g.value)?d.jsx(d.Fragment,{children:f}):c})});u0.displayName=c0;var $N="SelectIcon",d0=m.forwardRef((t,r)=>{const{__scopeSelect:o,children:a,...l}=t;return d.jsx(Be.span,{"aria-hidden":!0,...l,ref:r,children:a||"▼"})});d0.displayName=$N;var WN="SelectPortal",f0=t=>d.jsx(sc,{asChild:!0,...t});f0.displayName=WN;var Do="SelectContent",h0=m.forwardRef((t,r)=>{const o=ro(Do,t.__scopeSelect),[a,l]=m.useState();if(Ct(()=>{l(new DocumentFragment)},[]),!o.open){const c=a;return c?Ja.createPortal(d.jsx(p0,{scope:t.__scopeSelect,children:d.jsx(hc.Slot,{scope:t.__scopeSelect,children:d.jsx("div",{children:t.children})})}),c):null}return d.jsx(m0,{...t,ref:r})});h0.displayName=Do;var xn=10,[p0,oo]=Gs(Do),HN="SelectContentImpl",VN=Ba("SelectContent.RemoveScroll"),m0=m.forwardRef((t,r)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:c,onPointerDownOutside:f,side:h,sideOffset:g,align:y,alignOffset:v,arrowPadding:b,collisionBoundary:C,collisionPadding:w,sticky:E,hideWhenDetached:x,avoidCollisions:k,...P}=t,j=ro(Do,o),[N,T]=m.useState(null),[B,H]=m.useState(null),$=Je(r,ne=>T(ne)),[Y,U]=m.useState(null),[G,z]=m.useState(null),_=pc(o),[Q,J]=m.useState(!1),oe=m.useRef(!1);m.useEffect(()=>{if(N)return dv(N)},[N]),nv();const le=m.useCallback(ne=>{const[pe,...Ce]=_().map(Ie=>Ie.ref.current),[Ne]=Ce.slice(-1),Te=document.activeElement;for(const Ie of ne)if(Ie===Te||(Ie==null||Ie.scrollIntoView({block:"nearest"}),Ie===pe&&B&&(B.scrollTop=0),Ie===Ne&&B&&(B.scrollTop=B.scrollHeight),Ie==null||Ie.focus(),document.activeElement!==Te))return},[_,B]),ce=m.useCallback(()=>le([Y,N]),[le,Y,N]);m.useEffect(()=>{Q&&ce()},[Q,ce]);const{onOpenChange:V,triggerPointerDownPosRef:q}=j;m.useEffect(()=>{if(N){let ne={x:0,y:0};const pe=Ne=>{var Te,Ie;ne={x:Math.abs(Math.round(Ne.pageX)-(((Te=q.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Ne.pageY)-(((Ie=q.current)==null?void 0:Ie.y)??0))}},Ce=Ne=>{ne.x<=10&&ne.y<=10?Ne.preventDefault():N.contains(Ne.target)||V(!1),document.removeEventListener("pointermove",pe),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[N,V,q]),m.useEffect(()=>{const ne=()=>V(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[V]);const[K,M]=I0(ne=>{const pe=_().filter(Te=>!Te.disabled),Ce=pe.find(Te=>Te.ref.current===document.activeElement),Ne=O0(pe,ne,Ce);Ne&&setTimeout(()=>Ne.ref.current.focus())}),L=m.useCallback((ne,pe,Ce)=>{const Ne=!oe.current&&!Ce;(j.value!==void 0&&j.value===pe||Ne)&&(U(ne),Ne&&(oe.current=!0))},[j.value]),ee=m.useCallback(()=>N==null?void 0:N.focus(),[N]),ie=m.useCallback((ne,pe,Ce)=>{const Ne=!oe.current&&!Ce;(j.value!==void 0&&j.value===pe||Ne)&&z(ne)},[j.value]),he=a==="popper"?Qd:g0,we=he===Qd?{side:h,sideOffset:g,align:y,alignOffset:v,arrowPadding:b,collisionBoundary:C,collisionPadding:w,sticky:E,hideWhenDetached:x,avoidCollisions:k}:{};return d.jsx(p0,{scope:o,content:N,viewport:B,onViewportChange:H,itemRefCallback:L,selectedItem:Y,onItemLeave:ee,itemTextRefCallback:ie,focusSelectedItem:ce,selectedItemText:G,position:a,isPositioned:Q,searchRef:K,children:d.jsx(Ef,{as:VN,allowPinchZoom:!0,children:d.jsx(kf,{asChild:!0,trapped:j.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:De(l,ne=>{var pe;(pe=j.trigger)==null||pe.focus({preventScroll:!0}),ne.preventDefault()}),children:d.jsx(oc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:d.jsx(he,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:ne=>ne.preventDefault(),...P,...we,onPlaced:()=>J(!0),ref:$,style:{display:"flex",flexDirection:"column",outline:"none",...P.style},onKeyDown:De(P.onKeyDown,ne=>{const pe=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!pe&&ne.key.length===1&&M(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let Ne=_().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Te=ne.target,Ie=Ne.indexOf(Te);Ne=Ne.slice(Ie+1)}setTimeout(()=>le(Ne)),ne.preventDefault()}})})})})})})});m0.displayName=HN;var KN="SelectItemAlignedPosition",g0=m.forwardRef((t,r)=>{const{__scopeSelect:o,onPlaced:a,...l}=t,c=ro(Do,o),f=oo(Do,o),[h,g]=m.useState(null),[y,v]=m.useState(null),b=Je(r,$=>v($)),C=pc(o),w=m.useRef(!1),E=m.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:P,focusSelectedItem:j}=f,N=m.useCallback(()=>{if(c.trigger&&c.valueNode&&h&&y&&x&&k&&P){const $=c.trigger.getBoundingClientRect(),Y=y.getBoundingClientRect(),U=c.valueNode.getBoundingClientRect(),G=P.getBoundingClientRect();if(c.dir!=="rtl"){const Te=G.left-Y.left,Ie=U.left-Te,tt=$.left-Ie,yt=$.width+tt,Nn=Math.max(yt,Y.width),sn=window.innerWidth-xn,an=kg(Ie,[xn,Math.max(xn,sn-Nn)]);h.style.minWidth=yt+"px",h.style.left=an+"px"}else{const Te=Y.right-G.right,Ie=window.innerWidth-U.right-Te,tt=window.innerWidth-$.right-Ie,yt=$.width+tt,Nn=Math.max(yt,Y.width),sn=window.innerWidth-xn,an=kg(Ie,[xn,Math.max(xn,sn-Nn)]);h.style.minWidth=yt+"px",h.style.right=an+"px"}const z=C(),_=window.innerHeight-xn*2,Q=x.scrollHeight,J=window.getComputedStyle(y),oe=parseInt(J.borderTopWidth,10),le=parseInt(J.paddingTop,10),ce=parseInt(J.borderBottomWidth,10),V=parseInt(J.paddingBottom,10),q=oe+le+Q+V+ce,K=Math.min(k.offsetHeight*5,q),M=window.getComputedStyle(x),L=parseInt(M.paddingTop,10),ee=parseInt(M.paddingBottom,10),ie=$.top+$.height/2-xn,he=_-ie,we=k.offsetHeight/2,ne=k.offsetTop+we,pe=oe+le+ne,Ce=q-pe;if(pe<=ie){const Te=z.length>0&&k===z[z.length-1].ref.current;h.style.bottom="0px";const Ie=y.clientHeight-x.offsetTop-x.offsetHeight,tt=Math.max(he,we+(Te?ee:0)+Ie+ce),yt=pe+tt;h.style.height=yt+"px"}else{const Te=z.length>0&&k===z[0].ref.current;h.style.top="0px";const tt=Math.max(ie,oe+x.offsetTop+(Te?L:0)+we)+Ce;h.style.height=tt+"px",x.scrollTop=pe-ie+x.offsetTop}h.style.margin=`${xn}px 0`,h.style.minHeight=K+"px",h.style.maxHeight=_+"px",a==null||a(),requestAnimationFrame(()=>w.current=!0)}},[C,c.trigger,c.valueNode,h,y,x,k,P,c.dir,a]);Ct(()=>N(),[N]);const[T,B]=m.useState();Ct(()=>{y&&B(window.getComputedStyle(y).zIndex)},[y]);const H=m.useCallback($=>{$&&E.current===!0&&(N(),j==null||j(),E.current=!1)},[N,j]);return d.jsx(qN,{scope:o,contentWrapper:h,shouldExpandOnScrollRef:w,onScrollButtonChange:H,children:d.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:d.jsx(Be.div,{...l,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});g0.displayName=KN;var QN="SelectPopperPosition",Qd=m.forwardRef((t,r)=>{const{__scopeSelect:o,align:a="start",collisionPadding:l=xn,...c}=t,f=mc(o);return d.jsx(n0,{...f,...c,ref:r,align:a,collisionPadding:l,style:{boxSizing:"border-box",...c.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)"}})});Qd.displayName=QN;var[qN,$f]=Gs(Do,{}),qd="SelectViewport",y0=m.forwardRef((t,r)=>{const{__scopeSelect:o,nonce:a,...l}=t,c=oo(qd,o),f=$f(qd,o),h=Je(r,c.onViewportChange),g=m.useRef(0);return d.jsxs(d.Fragment,{children:[d.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:a}),d.jsx(hc.Slot,{scope:o,children:d.jsx(Be.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:De(l.onScroll,y=>{const v=y.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:C}=f;if(C!=null&&C.current&&b){const w=Math.abs(g.current-v.scrollTop);if(w>0){const E=window.innerHeight-xn*2,x=parseFloat(b.style.minHeight),k=parseFloat(b.style.height),P=Math.max(x,k);if(P<E){const j=P+w,N=Math.min(E,j),T=j-N;b.style.height=N+"px",b.style.bottom==="0px"&&(v.scrollTop=T>0?T:0,b.style.justifyContent="flex-end")}}}g.current=v.scrollTop})})})]})});y0.displayName=qd;var v0="SelectGroup",[GN,YN]=Gs(v0),XN=m.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t,l=To();return d.jsx(GN,{scope:o,id:l,children:d.jsx(Be.div,{role:"group","aria-labelledby":l,...a,ref:r})})});XN.displayName=v0;var x0="SelectLabel",w0=m.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t,l=YN(x0,o);return d.jsx(Be.div,{id:l.id,...a,ref:r})});w0.displayName=x0;var Zl="SelectItem",[JN,b0]=Gs(Zl),S0=m.forwardRef((t,r)=>{const{__scopeSelect:o,value:a,disabled:l=!1,textValue:c,...f}=t,h=ro(Zl,o),g=oo(Zl,o),y=h.value===a,[v,b]=m.useState(c??""),[C,w]=m.useState(!1),E=Je(r,j=>{var N;return(N=g.itemRefCallback)==null?void 0:N.call(g,j,a,l)}),x=To(),k=m.useRef("touch"),P=()=>{l||(h.onValueChange(a),h.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(JN,{scope:o,value:a,disabled:l,textId:x,isSelected:y,onItemTextChange:m.useCallback(j=>{b(N=>N||((j==null?void 0:j.textContent)??"").trim())},[]),children:d.jsx(hc.ItemSlot,{scope:o,value:a,disabled:l,textValue:v,children:d.jsx(Be.div,{role:"option","aria-labelledby":x,"data-highlighted":C?"":void 0,"aria-selected":y&&C,"data-state":y?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...f,ref:E,onFocus:De(f.onFocus,()=>w(!0)),onBlur:De(f.onBlur,()=>w(!1)),onClick:De(f.onClick,()=>{k.current!=="mouse"&&P()}),onPointerUp:De(f.onPointerUp,()=>{k.current==="mouse"&&P()}),onPointerDown:De(f.onPointerDown,j=>{k.current=j.pointerType}),onPointerMove:De(f.onPointerMove,j=>{var N;k.current=j.pointerType,l?(N=g.onItemLeave)==null||N.call(g):k.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:De(f.onPointerLeave,j=>{var N;j.currentTarget===document.activeElement&&((N=g.onItemLeave)==null||N.call(g))}),onKeyDown:De(f.onKeyDown,j=>{var T;((T=g.searchRef)==null?void 0:T.current)!==""&&j.key===" "||(DN.includes(j.key)&&P(),j.key===" "&&j.preventDefault())})})})})});S0.displayName=Zl;var Da="SelectItemText",C0=m.forwardRef((t,r)=>{const{__scopeSelect:o,className:a,style:l,...c}=t,f=ro(Da,o),h=oo(Da,o),g=b0(Da,o),y=BN(Da,o),[v,b]=m.useState(null),C=Je(r,P=>b(P),g.onItemTextChange,P=>{var j;return(j=h.itemTextRefCallback)==null?void 0:j.call(h,P,g.value,g.disabled)}),w=v==null?void 0:v.textContent,E=m.useMemo(()=>d.jsx("option",{value:g.value,disabled:g.disabled,children:w},g.value),[g.disabled,g.value,w]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=y;return Ct(()=>(x(E),()=>k(E)),[x,k,E]),d.jsxs(d.Fragment,{children:[d.jsx(Be.span,{id:g.textId,...c,ref:C}),g.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Ja.createPortal(c.children,f.valueNode):null]})});C0.displayName=Da;var k0="SelectItemIndicator",E0=m.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t;return b0(k0,o).isSelected?d.jsx(Be.span,{"aria-hidden":!0,...a,ref:r}):null});E0.displayName=k0;var Gd="SelectScrollUpButton",N0=m.forwardRef((t,r)=>{const o=oo(Gd,t.__scopeSelect),a=$f(Gd,t.__scopeSelect),[l,c]=m.useState(!1),f=Je(r,a.onScrollButtonChange);return Ct(()=>{if(o.viewport&&o.isPositioned){let h=function(){const y=g.scrollTop>0;c(y)};const g=o.viewport;return h(),g.addEventListener("scroll",h),()=>g.removeEventListener("scroll",h)}},[o.viewport,o.isPositioned]),l?d.jsx(R0,{...t,ref:f,onAutoScroll:()=>{const{viewport:h,selectedItem:g}=o;h&&g&&(h.scrollTop=h.scrollTop-g.offsetHeight)}}):null});N0.displayName=Gd;var Yd="SelectScrollDownButton",P0=m.forwardRef((t,r)=>{const o=oo(Yd,t.__scopeSelect),a=$f(Yd,t.__scopeSelect),[l,c]=m.useState(!1),f=Je(r,a.onScrollButtonChange);return Ct(()=>{if(o.viewport&&o.isPositioned){let h=function(){const y=g.scrollHeight-g.clientHeight,v=Math.ceil(g.scrollTop)<y;c(v)};const g=o.viewport;return h(),g.addEventListener("scroll",h),()=>g.removeEventListener("scroll",h)}},[o.viewport,o.isPositioned]),l?d.jsx(R0,{...t,ref:f,onAutoScroll:()=>{const{viewport:h,selectedItem:g}=o;h&&g&&(h.scrollTop=h.scrollTop+g.offsetHeight)}}):null});P0.displayName=Yd;var R0=m.forwardRef((t,r)=>{const{__scopeSelect:o,onAutoScroll:a,...l}=t,c=oo("SelectScrollButton",o),f=m.useRef(null),h=pc(o),g=m.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return m.useEffect(()=>()=>g(),[g]),Ct(()=>{var v;const y=h().find(b=>b.ref.current===document.activeElement);(v=y==null?void 0:y.ref.current)==null||v.scrollIntoView({block:"nearest"})},[h]),d.jsx(Be.div,{"aria-hidden":!0,...l,ref:r,style:{flexShrink:0,...l.style},onPointerDown:De(l.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(a,50))}),onPointerMove:De(l.onPointerMove,()=>{var y;(y=c.onItemLeave)==null||y.call(c),f.current===null&&(f.current=window.setInterval(a,50))}),onPointerLeave:De(l.onPointerLeave,()=>{g()})})}),ZN="SelectSeparator",j0=m.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t;return d.jsx(Be.div,{"aria-hidden":!0,...a,ref:r})});j0.displayName=ZN;var Xd="SelectArrow",eP=m.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t,l=mc(o),c=ro(Xd,o),f=oo(Xd,o);return c.open&&f.position==="popper"?d.jsx(r0,{...l,...a,ref:r}):null});eP.displayName=Xd;var tP="SelectBubbleInput",T0=m.forwardRef(({__scopeSelect:t,value:r,...o},a)=>{const l=m.useRef(null),c=Je(a,l),f=ON(r);return m.useEffect(()=>{const h=l.current;if(!h)return;const g=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(g,"value").set;if(f!==r&&v){const b=new Event("change",{bubbles:!0});v.call(h,r),h.dispatchEvent(b)}},[f,r]),d.jsx(Be.select,{...o,style:{...o0,...o.style},ref:c,defaultValue:r})});T0.displayName=tP;function M0(t){return t===""||t===void 0}function I0(t){const r=Oo(t),o=m.useRef(""),a=m.useRef(0),l=m.useCallback(f=>{const h=o.current+f;r(h),(function g(y){o.current=y,window.clearTimeout(a.current),y!==""&&(a.current=window.setTimeout(()=>g(""),1e3))})(h)},[r]),c=m.useCallback(()=>{o.current="",window.clearTimeout(a.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(a.current),[]),[o,l,c]}function O0(t,r,o){const l=r.length>1&&Array.from(r).every(y=>y===r[0])?r[0]:r,c=o?t.indexOf(o):-1;let f=nP(t,Math.max(c,0));l.length===1&&(f=f.filter(y=>y!==o));const g=f.find(y=>y.textValue.toLowerCase().startsWith(l.toLowerCase()));return g!==o?g:void 0}function nP(t,r){return t.map((o,a)=>t[(r+a)%t.length])}var rP=a0,A0=l0,oP=u0,sP=d0,aP=f0,L0=h0,iP=y0,_0=w0,D0=S0,lP=C0,cP=E0,z0=N0,F0=P0,U0=j0;const _s=rP,Ds=oP,zo=m.forwardRef(({className:t,children:r,...o},a)=>d.jsxs(A0,{ref:a,className:ve("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-gray-200 bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 bg-white",t),...o,children:[r,d.jsx(sP,{asChild:!0,children:d.jsx(Vy,{className:"h-4 w-4 opacity-50"})})]}));zo.displayName=A0.displayName;const B0=m.forwardRef(({className:t,...r},o)=>d.jsx(z0,{ref:o,className:ve("flex cursor-default items-center justify-center py-1",t),...r,children:d.jsx(ZS,{className:"h-4 w-4"})}));B0.displayName=z0.displayName;const $0=m.forwardRef(({className:t,...r},o)=>d.jsx(F0,{ref:o,className:ve("flex cursor-default items-center justify-center py-1",t),...r,children:d.jsx(Vy,{className:"h-4 w-4"})}));$0.displayName=F0.displayName;const Fo=m.forwardRef(({className:t,children:r,position:o="popper",...a},l)=>d.jsx(aP,{children:d.jsxs(L0,{ref:l,className:ve("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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 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 bg-white",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,...a,children:[d.jsx(B0,{}),d.jsx(iP,{className:ve("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),d.jsx($0,{})]})}));Fo.displayName=L0.displayName;const uP=m.forwardRef(({className:t,...r},o)=>d.jsx(_0,{ref:o,className:ve("px-2 py-1.5 text-sm font-semibold",t),...r}));uP.displayName=_0.displayName;const on=m.forwardRef(({className:t,children:r,...o},a)=>d.jsxs(D0,{ref:a,className:ve("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-gray-100 focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-gray-100",t),...o,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(cP,{children:d.jsx(Hy,{className:"h-4 w-4"})})}),d.jsx(lP,{children:r})]}));on.displayName=D0.displayName;const dP=m.forwardRef(({className:t,...r},o)=>d.jsx(U0,{ref:o,className:ve("-mx-1 my-1 h-px bg-muted",t),...r}));dP.displayName=U0.displayName;function fP({maskedValue:t,isSet:r,className:o,...a}){const[l,c]=m.useState(!1);return d.jsxs("div",{className:"relative",children:[d.jsx(Ke,{type:l?"text":"password",className:ve("pr-20",o),placeholder:r?`${X("apiKeySet")} (Unchanged)`:"",...a}),d.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1",children:(r||t)&&d.jsx(st,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c(!l),children:l?d.jsx(nC,{className:"h-4 w-4"}):d.jsx(rC,{className:"h-4 w-4"})})})]})}function hP({value:t,onChange:r,className:o}){const a=t?Object.entries(t):[],l=(h,g,y)=>{const v=[...a];v[h]=[g,y],r(Object.fromEntries(v))},c=()=>{r({...t,"":""})},f=h=>{const g=a.filter((y,v)=>v!==h);r(Object.fromEntries(g))};return d.jsxs("div",{className:ve("space-y-2",o),children:[a.map(([h,g],y)=>d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ke,{type:"text",value:h,onChange:v=>l(y,v.target.value,g),placeholder:X("headerName"),className:"flex-1"}),d.jsx(Ke,{type:"text",value:g,onChange:v=>l(y,h,v.target.value),placeholder:X("headerValue"),className:"flex-1"}),d.jsx(st,{type:"button",variant:"ghost",size:"icon",onClick:()=>f(y),children:d.jsx(Fd,{className:"h-4 w-4 text-red-500"})})]},y)),d.jsxs(st,{type:"button",variant:"outline",size:"sm",onClick:c,children:[d.jsx(zd,{className:"h-4 w-4 mr-2"}),X("add")]})]})}function pP(){const{providerModal:t,closeProviderModal:r}=Za(),{data:o}=Hs(),{data:a}=Cf(),{data:l}=Vs(),c=v2(),[f,h]=m.useState(""),[g,y]=m.useState(""),[v,b]=m.useState(null),[C,w]=m.useState("auto"),E=t.provider,x=a==null?void 0:a.providers.find($=>$.name===E),k=E?o==null?void 0:o.providers[E]:null,P=l==null?void 0:l.uiHints,j=E?gt(`providers.${E}.apiKey`,P):void 0,N=E?gt(`providers.${E}.apiBase`,P):void 0,T=E?gt(`providers.${E}.extraHeaders`,P):void 0,B=E?gt(`providers.${E}.wireApi`,P):void 0;m.useEffect(()=>{if(k){y(k.apiBase||(x==null?void 0:x.defaultApiBase)||""),b(k.extraHeaders||null),h("");const $=k.wireApi||(x==null?void 0:x.defaultWireApi)||"auto";w($)}},[k,x]);const H=$=>{$.preventDefault();const Y={};if(f!==""&&(Y.apiKey=f),g&&g!==(x==null?void 0:x.defaultApiBase)&&(Y.apiBase=g),v&&Object.keys(v).length>0&&(Y.extraHeaders=v),x!=null&&x.supportsWireApi){const U=(k==null?void 0:k.wireApi)||x.defaultWireApi||"auto";C!==U&&(Y.wireApi=C)}E&&c.mutate({provider:E,data:Y},{onSuccess:()=>r()})};return d.jsx(Mv,{open:t.open,onOpenChange:r,children:d.jsxs(jf,{className:"sm:max-w-[500px]",children:[d.jsx(Tf,{children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center",children:d.jsx(Kl,{className:"h-5 w-5 text-white"})}),d.jsxs("div",{children:[d.jsx(If,{children:(x==null?void 0:x.displayName)||E}),d.jsx(Of,{children:"Configure API keys and parameters for AI provider"})]})]})}),d.jsxs("form",{onSubmit:H,className:"flex flex-col pt-2",children:[d.jsxs("div",{className:"space-y-5 max-h-[60vh] overflow-y-auto pr-1",children:[d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(dr,{htmlFor:"apiKey",className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[d.jsx(Kl,{className:"h-3.5 w-3.5 text-gray-500"}),(j==null?void 0:j.label)??X("apiKey")]}),d.jsx(fP,{id:"apiKey",value:f,isSet:k==null?void 0:k.apiKeySet,onChange:$=>h($.target.value),placeholder:k!=null&&k.apiKeySet?X("apiKeySet"):(j==null?void 0:j.placeholder)??"Enter API Key",className:"rounded-xl"})]}),d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(dr,{htmlFor:"apiBase",className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[d.jsx(Qy,{className:"h-3.5 w-3.5 text-gray-500"}),(N==null?void 0:N.label)??X("apiBase")]}),d.jsx(Ke,{id:"apiBase",type:"text",value:g,onChange:$=>y($.target.value),placeholder:(x==null?void 0:x.defaultApiBase)||(N==null?void 0:N.placeholder)||"https://api.example.com",className:"rounded-xl"}),(N==null?void 0:N.help)&&d.jsx("p",{className:"text-xs text-gray-500",children:N.help})]}),(x==null?void 0:x.supportsWireApi)&&d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(dr,{htmlFor:"wireApi",className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[d.jsx(Vl,{className:"h-3.5 w-3.5 text-gray-500"}),(B==null?void 0:B.label)??X("wireApi")]}),d.jsxs(_s,{value:C,onValueChange:$=>w($),children:[d.jsx(zo,{className:"rounded-xl",children:d.jsx(Ds,{})}),d.jsx(Fo,{children:(x.wireApiOptions||["auto","chat","responses"]).map($=>d.jsx(on,{value:$,children:X($==="chat"?"wireApiChat":$==="responses"?"wireApiResponses":"wireApiAuto")},$))})]})]}),d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(dr,{className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[d.jsx(Vl,{className:"h-3.5 w-3.5 text-gray-500"}),(T==null?void 0:T.label)??X("extraHeaders")]}),d.jsx(hP,{value:v,onChange:b})]})]}),d.jsxs(Mf,{className:"pt-4 flex-shrink-0",children:[d.jsx(st,{type:"button",variant:"outline",onClick:r,children:X("cancel")}),d.jsx(st,{type:"submit",disabled:c.isPending,children:c.isPending?"Saving...":X("save")})]})]})]})})}function Wf({tabs:t,activeTab:r,onChange:o,className:a}){return d.jsx("div",{className:ve("flex items-center gap-8 border-b border-gray-200 mb-8",a),children:t.map(l=>{const c=r===l.id;return d.jsxs("button",{onClick:()=>o(l.id),className:ve("relative pb-4 text-[15px] font-semibold transition-all duration-fast flex items-center gap-2",c?"text-primary":"text-gray-500 hover:text-gray-700"),children:[l.label,l.count!==void 0&&d.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:l.count.toLocaleString()}),c&&d.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary animate-in fade-in slide-in-from-left-2 duration-300"})]},l.id)})})}function W0({name:t,src:r,className:o,imgClassName:a,fallback:l}){const[c,f]=m.useState(!1),h=!!r&&!c;return d.jsx("div",{className:ve("flex items-center justify-center",o),children:h?d.jsx("img",{src:r,alt:`${t} logo`,className:ve("h-6 w-6 object-contain",a),onError:()=>f(!0),draggable:!1}):l??d.jsx("span",{className:"text-lg font-bold uppercase",children:t.slice(0,1)})})}const mP={openrouter:"openrouter.svg",aihubmix:"aihubmix.png",anthropic:"anthropic.svg",openai:"openai.svg",gemini:"gemini.svg",deepseek:"deepseek.png",zhipu:"zhipu.svg",dashscope:"dashscope.png",moonshot:"moonshot.png",minimax:"minimax.svg",vllm:"vllm.svg",groq:"groq.svg"},gP={telegram:"telegram.svg",slack:"slack.svg",discord:"discord.svg",whatsapp:"whatsapp.svg",qq:"qq.svg",feishu:"feishu.svg",dingtalk:"dingtalk.svg",wecom:"wecom.svg",mochat:"mochat.svg",email:"email.svg"};function H0(t,r){const o=r.toLowerCase(),a=t[o];return a?`/logos/${a}`:null}function yP(t){return H0(mP,t)}function vP(t){return H0(gP,t)}function xP(){const{data:t}=Hs(),{data:r}=Cf(),{data:o}=Vs(),{openProviderModal:a}=Za(),[l,c]=m.useState("installed"),f=o==null?void 0:o.uiHints;if(!t||!r)return d.jsx("div",{className:"p-8",children:"Loading..."});const h=[{id:"installed",label:"Configured",count:t.providers?Object.keys(t.providers).filter(y=>t.providers[y].apiKeySet).length:0},{id:"all",label:"All Providers"}],g=l==="installed"?r.providers.filter(y=>{var v;return(v=t.providers[y.name])==null?void 0:v.apiKeySet}):r.providers;return d.jsxs("div",{className:"animate-fade-in pb-20",children:[d.jsx("div",{className:"flex items-center justify-between mb-8",children:d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"AI Providers"})}),d.jsx(Wf,{tabs:h,activeTab:l,onChange:c}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:g.map(y=>{const v=t.providers[y.name],b=v==null?void 0:v.apiKeySet,C=gt(`providers.${y.name}`,f),w=(C==null?void 0:C.help)||"Configure AI services for your agents";return d.jsxs("div",{className:ve("group relative flex-col p-5 rounded-2xl border transition-all duration-base cursor-pointer","hover:shadow-card-hover hover:-translate-y-0.5",b?"bg-white border-gray-200 shadow-sm":"bg-white border-transparent shadow-sm hover:border-gray-200"),onClick:()=>a(y.name),children:[d.jsxs("div",{className:"flex items-start justify-between mb-4",children:[d.jsx(W0,{name:y.name,src:yP(y.name),className:ve("h-12 w-12 rounded-xl border transition-all",b?"bg-white border-primary":"bg-white border-gray-200 group-hover:border-gray-300"),imgClassName:"h-7 w-7",fallback:d.jsx("span",{className:ve("text-lg font-bold uppercase",b?"text-gray-900":"text-gray-500"),children:y.name[0]})}),b?d.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-emerald-50 text-emerald-600",children:[d.jsx(Hy,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-[11px] font-bold",children:"Ready"})]}):d.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-gray-100 text-gray-500",children:[d.jsx(bf,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-[11px] font-bold",children:"Setup"})]})]}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h3",{className:"text-[15px] font-bold text-gray-900 mb-1",children:y.displayName||y.name}),d.jsx("p",{className:"text-[12px] text-gray-500 leading-relaxed line-clamp-2",children:w})]}),d.jsx("div",{className:"mt-4 pt-3",children:d.jsxs("span",{className:"inline-flex items-center gap-1 text-[13px] font-semibold text-gray-600 group-hover:text-primary transition-colors cursor-pointer",children:[b?"Configure":"Add Provider",d.jsx(vf,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]})})]},y.name)})}),g.length===0&&d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[d.jsx("div",{className:"h-16 w-16 flex items-center justify-center rounded-2xl bg-gray-100 mb-4",children:d.jsx(Kl,{className:"h-8 w-8 text-gray-400"})}),d.jsx("h3",{className:"text-[15px] font-bold text-gray-900 mb-2",children:"No providers configured"}),d.jsx("p",{className:"text-[13px] text-gray-500 max-w-sm",children:"Add an AI provider to start using the platform. Click on any provider to configure it."})]}),d.jsx(pP,{})]})}const Hf=m.forwardRef(({className:t,checked:r=!1,onCheckedChange:o,...a},l)=>d.jsx("button",{type:"button",role:"switch","aria-checked":r,ref:l,className:ve("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",r?"bg-primary":"bg-gray-200 hover:bg-gray-300",t),onClick:()=>o==null?void 0:o(!r),...a,children:d.jsx("span",{className:ve("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-fast",r?"translate-x-5":"translate-x-0")})}));Hf.displayName="Switch";function wP({value:t,onChange:r,className:o,placeholder:a="Type and press Enter..."}){const[l,c]=m.useState(""),f=g=>{g.key==="Enter"&&l.trim()?(g.preventDefault(),r([...t,l.trim()]),c("")):g.key==="Backspace"&&!l&&t.length>0&&r(t.slice(0,-1))},h=g=>{r(t.filter((y,v)=>v!==g))};return d.jsxs("div",{className:ve("flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]",o),children:[t.map((g,y)=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm",children:[g,d.jsx("button",{type:"button",onClick:()=>h(y),className:"hover:text-red-300 transition-colors",children:d.jsx(Sf,{className:"h-3 w-3"})})]},y)),d.jsx("input",{type:"text",value:l,onChange:g=>c(g.target.value),onKeyDown:f,className:"flex-1 outline-none min-w-[100px] bg-transparent text-sm",placeholder:a})]})}const _g=[{value:"pairing",label:"pairing"},{value:"allowlist",label:"allowlist"},{value:"open",label:"open"},{value:"disabled",label:"disabled"}],Dg=[{value:"open",label:"open"},{value:"allowlist",label:"allowlist"},{value:"disabled",label:"disabled"}],bP=t=>t.includes("token")||t.includes("secret")||t.includes("password")?d.jsx(Kl,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("url")||t.includes("host")?d.jsx(Qy,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("email")||t.includes("mail")?d.jsx(xf,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("id")||t.includes("from")?d.jsx(Vl,{className:"h-3.5 w-3.5 text-gray-500"}):t==="enabled"||t==="consentGranted"?d.jsx(yC,{className:"h-3.5 w-3.5 text-gray-500"}):d.jsx(bf,{className:"h-3.5 w-3.5 text-gray-500"}),SP={telegram:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"token",type:"password",label:X("botToken")},{name:"allowFrom",type:"tags",label:X("allowFrom")},{name:"proxy",type:"text",label:X("proxy")},{name:"accountId",type:"text",label:"Account ID"},{name:"dmPolicy",type:"select",label:"DM Policy",options:_g},{name:"groupPolicy",type:"select",label:"Group Policy",options:Dg},{name:"groupAllowFrom",type:"tags",label:"Group Allow From"},{name:"requireMention",type:"boolean",label:"Require Mention"},{name:"mentionPatterns",type:"tags",label:"Mention Patterns"},{name:"groups",type:"json",label:"Group Rules (JSON)"}],discord:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"token",type:"password",label:X("botToken")},{name:"allowBots",type:"boolean",label:"Allow Bot Messages"},{name:"allowFrom",type:"tags",label:X("allowFrom")},{name:"gatewayUrl",type:"text",label:X("gatewayUrl")},{name:"intents",type:"number",label:X("intents")},{name:"proxy",type:"text",label:X("proxy")},{name:"mediaMaxMb",type:"number",label:"Attachment Max Size (MB)"},{name:"accountId",type:"text",label:"Account ID"},{name:"dmPolicy",type:"select",label:"DM Policy",options:_g},{name:"groupPolicy",type:"select",label:"Group Policy",options:Dg},{name:"groupAllowFrom",type:"tags",label:"Group Allow From"},{name:"requireMention",type:"boolean",label:"Require Mention"},{name:"mentionPatterns",type:"tags",label:"Mention Patterns"},{name:"groups",type:"json",label:"Group Rules (JSON)"}],whatsapp:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"bridgeUrl",type:"text",label:X("bridgeUrl")},{name:"allowFrom",type:"tags",label:X("allowFrom")}],feishu:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"appId",type:"text",label:X("appId")},{name:"appSecret",type:"password",label:X("appSecret")},{name:"encryptKey",type:"password",label:X("encryptKey")},{name:"verificationToken",type:"password",label:X("verificationToken")},{name:"allowFrom",type:"tags",label:X("allowFrom")}],dingtalk:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"clientId",type:"text",label:X("clientId")},{name:"clientSecret",type:"password",label:X("clientSecret")},{name:"allowFrom",type:"tags",label:X("allowFrom")}],wecom:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"corpId",type:"text",label:X("corpId")},{name:"agentId",type:"text",label:X("agentId")},{name:"secret",type:"password",label:X("secret")},{name:"token",type:"password",label:X("token")},{name:"callbackPort",type:"number",label:X("callbackPort")},{name:"callbackPath",type:"text",label:X("callbackPath")},{name:"allowFrom",type:"tags",label:X("allowFrom")}],slack:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"mode",type:"text",label:X("mode")},{name:"webhookPath",type:"text",label:X("webhookPath")},{name:"allowBots",type:"boolean",label:"Allow Bot Messages"},{name:"botToken",type:"password",label:X("botToken")},{name:"appToken",type:"password",label:X("appToken")}],email:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"consentGranted",type:"boolean",label:X("consentGranted")},{name:"imapHost",type:"text",label:X("imapHost")},{name:"imapPort",type:"number",label:X("imapPort")},{name:"imapUsername",type:"text",label:X("imapUsername")},{name:"imapPassword",type:"password",label:X("imapPassword")},{name:"fromAddress",type:"email",label:X("fromAddress")}],mochat:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"baseUrl",type:"text",label:X("baseUrl")},{name:"clawToken",type:"password",label:X("clawToken")},{name:"agentUserId",type:"text",label:X("agentUserId")},{name:"allowFrom",type:"tags",label:X("allowFrom")}],qq:[{name:"enabled",type:"boolean",label:X("enabled")},{name:"appId",type:"text",label:X("appId")},{name:"secret",type:"password",label:X("appSecret")},{name:"markdownSupport",type:"boolean",label:X("markdownSupport")},{name:"allowFrom",type:"tags",label:X("allowFrom")}]},zg={telegram:vs,slack:vs,email:xf,default:vs},Fg={telegram:"from-sky-400 to-blue-500",slack:"from-purple-400 to-indigo-500",email:"from-rose-400 to-pink-500",default:"from-slate-400 to-gray-500"};function ec(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function V0(t,r){const o={...t};for(const[a,l]of Object.entries(r)){const c=o[a];if(ec(c)&&ec(l)){o[a]=V0(c,l);continue}o[a]=l}return o}function CP(t,r){const o=t.split("."),a={};let l=a;for(let c=0;c<o.length-1;c+=1){const f=o[c];l[f]={},l=l[f]}return l[o[o.length-1]]=r,a}function kP(){var U,G;const{channelModal:t,closeChannelModal:r}=Za(),{data:o}=Hs(),{data:a}=Vs(),l=x2(),c=b2(),[f,h]=m.useState({}),[g,y]=m.useState({}),[v,b]=m.useState(null),C=t.channel,w=C?o==null?void 0:o.channels[C]:null,E=m.useMemo(()=>C?SP[C]:[],[C]),x=a==null?void 0:a.uiHints,k=C?`channels.${C}`:null,P=((U=a==null?void 0:a.actions)==null?void 0:U.filter(z=>z.scope===k))??[],j=C&&(((G=gt(`channels.${C}`,x))==null?void 0:G.label)??C);m.useEffect(()=>{if(w){h({...w});const z={};E.filter(_=>_.type==="json").forEach(_=>{const Q=w[_.name];z[_.name]=JSON.stringify(Q??{},null,2)}),y(z)}else h({}),y({})},[w,C,E]);const N=(z,_)=>{h(Q=>({...Q,[z]:_}))},T=z=>{if(z.preventDefault(),!C)return;const _={...f};for(const Q of E){if(Q.type!=="json")continue;const J=g[Q.name]??"";try{_[Q.name]=J.trim()?JSON.parse(J):{}}catch{Xe.error(`Invalid JSON for ${Q.name}`);return}}l.mutate({channel:C,data:_},{onSuccess:()=>r()})},B=z=>{if(!z||!C)return;const _=z.channels;if(!ec(_))return;const Q=_[C];ec(Q)&&h(J=>V0(J,Q))},H=async z=>{if(!(!C||!k)){b(z.id);try{let _={...f};z.saveBeforeRun&&(_={..._,...z.savePatch??{}},h(_),await l.mutateAsync({channel:C,data:_}));const Q=await c.mutateAsync({actionId:z.id,data:{scope:k,draftConfig:CP(k,_)}});B(Q.patch),Q.ok?Xe.success(Q.message||X("success")):Xe.error(Q.message||X("error"))}catch(_){const Q=_ instanceof Error?_.message:String(_);Xe.error(`${X("error")}: ${Q}`)}finally{b(null)}}},$=zg[C||""]||zg.default,Y=Fg[C||""]||Fg.default;return d.jsx(Mv,{open:t.open,onOpenChange:r,children:d.jsxs(jf,{className:"sm:max-w-[550px] max-h-[85vh] overflow-hidden flex flex-col",children:[d.jsx(Tf,{children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`h-10 w-10 rounded-xl bg-gradient-to-br ${Y} flex items-center justify-center`,children:d.jsx($,{className:"h-5 w-5 text-white"})}),d.jsxs("div",{children:[d.jsx(If,{className:"capitalize",children:j}),d.jsx(Of,{children:"Configure message channel parameters"})]})]})}),d.jsxs("form",{onSubmit:T,className:"flex flex-col flex-1 overflow-hidden",children:[d.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar py-2 pr-2 space-y-5",children:E.map(z=>{const _=C?gt(`channels.${C}.${z.name}`,x):void 0,Q=(_==null?void 0:_.label)??z.label,J=_==null?void 0:_.placeholder;return d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(dr,{htmlFor:z.name,className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[bP(z.name),Q]}),z.type==="boolean"&&d.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-gray-50",children:[d.jsx("span",{className:"text-sm text-gray-500",children:f[z.name]?X("enabled"):X("disabled")}),d.jsx(Hf,{id:z.name,checked:f[z.name]||!1,onCheckedChange:oe=>N(z.name,oe),className:"data-[state=checked]:bg-emerald-500"})]}),(z.type==="text"||z.type==="email")&&d.jsx(Ke,{id:z.name,type:z.type,value:f[z.name]||"",onChange:oe=>N(z.name,oe.target.value),placeholder:J,className:"rounded-xl"}),z.type==="password"&&d.jsx(Ke,{id:z.name,type:"password",value:f[z.name]||"",onChange:oe=>N(z.name,oe.target.value),placeholder:J??"Leave blank to keep unchanged",className:"rounded-xl"}),z.type==="number"&&d.jsx(Ke,{id:z.name,type:"number",value:f[z.name]||0,onChange:oe=>N(z.name,parseInt(oe.target.value)||0),placeholder:J,className:"rounded-xl"}),z.type==="tags"&&d.jsx(wP,{value:f[z.name]||[],onChange:oe=>N(z.name,oe)}),z.type==="select"&&d.jsxs(_s,{value:f[z.name]||"",onValueChange:oe=>N(z.name,oe),children:[d.jsx(zo,{className:"rounded-xl",children:d.jsx(Ds,{})}),d.jsx(Fo,{children:(z.options??[]).map(oe=>d.jsx(on,{value:oe.value,children:oe.label},oe.value))})]}),z.type==="json"&&d.jsx("textarea",{id:z.name,value:g[z.name]??"{}",onChange:oe=>y(le=>({...le,[z.name]:oe.target.value})),className:"min-h-[120px] w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono"})]},z.name)})}),d.jsxs(Mf,{className:"pt-4 flex-shrink-0",children:[d.jsx(st,{type:"button",variant:"outline",onClick:r,children:X("cancel")}),d.jsx(st,{type:"submit",disabled:l.isPending||!!v,children:l.isPending?"Saving...":X("save")}),P.filter(z=>z.trigger==="manual").map(z=>d.jsx(st,{type:"button",onClick:()=>H(z),disabled:l.isPending||!!v,variant:"secondary",children:v===z.id?X("connecting"):z.title},z.id))]})]})]})})}const Ug={telegram:vs,slack:pC,email:xf,webhook:XS,default:wf},EP={telegram:"Connect with Telegram bots for instant messaging",slack:"Integrate with Slack workspaces for team collaboration",email:"Send and receive messages via email protocols",webhook:"Receive HTTP webhooks for custom integrations",discord:"Connect Discord bots to your community servers",feishu:"Enterprise messaging and collaboration platform"};function NP(){const{data:t}=Hs(),{data:r}=Cf(),{data:o}=Vs(),{openChannelModal:a}=Za(),[l,c]=m.useState("active"),f=o==null?void 0:o.uiHints;if(!t||!r)return d.jsx("div",{className:"p-8 text-gray-400",children:"Loading channels..."});const h=[{id:"active",label:"Enabled",count:r.channels.filter(y=>{var v;return(v=t.channels[y.name])==null?void 0:v.enabled}).length},{id:"all",label:"All Channels",count:r.channels.length}],g=r.channels.filter(y=>{var b;const v=((b=t.channels[y.name])==null?void 0:b.enabled)||!1;return l==="all"||v});return d.jsxs("div",{className:"animate-fade-in pb-20",children:[d.jsx("div",{className:"flex items-center justify-between mb-8",children:d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Message Channels"})}),d.jsx(Wf,{tabs:h,activeTab:l,onChange:c}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:g.map(y=>{const v=t.channels[y.name],b=(v==null?void 0:v.enabled)||!1,C=Ug[y.name]||Ug.default,w=gt(`channels.${y.name}`,f),E=(w==null?void 0:w.help)||EP[y.name]||"Configure this communication channel";return d.jsxs("div",{className:ve("group relative flex flex-col p-5 rounded-2xl border transition-all duration-base cursor-pointer","hover:shadow-card-hover hover:-translate-y-0.5",b?"bg-white border-gray-200 shadow-sm":"bg-white border-transparent shadow-sm hover:border-gray-200"),onClick:()=>a(y.name),children:[d.jsxs("div",{className:"flex items-start justify-between mb-4",children:[d.jsx(W0,{name:y.name,src:vP(y.name),className:ve("h-12 w-12 rounded-xl border transition-all",b?"bg-white border-primary":"bg-white border-gray-200 group-hover:border-gray-300"),imgClassName:"h-6 w-6",fallback:d.jsx(C,{className:"h-6 w-6"})}),b?d.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-emerald-50 text-emerald-600",children:[d.jsx(xC,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-[11px] font-bold",children:"Active"})]}):d.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-gray-100 text-gray-500",children:[d.jsx(fC,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-[11px] font-bold",children:"Inactive"})]})]}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h3",{className:"text-[15px] font-bold text-gray-900 mb-1",children:y.displayName||y.name}),d.jsx("p",{className:"text-[12px] text-gray-500 leading-relaxed line-clamp-2",children:E})]}),d.jsxs("div",{className:"mt-4 pt-3 flex items-center justify-between",children:[d.jsxs("span",{className:"inline-flex items-center gap-1 text-[13px] font-semibold text-gray-600 group-hover:text-primary transition-colors cursor-pointer",children:[b?"Configure":"Enable",d.jsx(vf,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]}),y.tutorialUrl&&d.jsx("a",{href:y.tutorialUrl,target:"_blank",rel:"noreferrer",onClick:x=>x.stopPropagation(),className:"flex items-center justify-center h-7 w-7 rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors",title:"View Guide",children:d.jsx(Ky,{className:"h-3.5 w-3.5"})})]})]},y.name)})}),g.length===0&&d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[d.jsx("div",{className:"h-16 w-16 flex items-center justify-center rounded-2xl bg-gray-100 mb-4",children:d.jsx(wf,{className:"h-8 w-8 text-gray-400"})}),d.jsx("h3",{className:"text-[15px] font-bold text-gray-900 mb-2",children:"No channels enabled"}),d.jsx("p",{className:"text-[13px] text-gray-500 max-w-sm",children:"Enable a messaging channel to start receiving messages. Click on any channel to configure it."})]}),d.jsx(kP,{})]})}const PP=[{value:"main",label:"main"},{value:"per-peer",label:"per-peer"},{value:"per-channel-peer",label:"per-channel-peer"},{value:"per-account-channel-peer",label:"per-account-channel-peer"}];function RP(){return{id:"",default:!1,workspace:"",model:"",maxTokens:void 0,contextTokens:void 0,maxToolIterations:void 0}}function jP(){return{agentId:"",match:{channel:"",accountId:""}}}function vd(t){const r=t.trim();if(!r)return;const o=Number.parseInt(r,10);return Number.isFinite(o)?o:void 0}function TP(){const{data:t,isLoading:r}=Hs(),{data:o}=Vs(),a=w2(),[l,c]=m.useState([]),[f,h]=m.useState([]),[g,y]=m.useState("per-channel-peer"),[v,b]=m.useState(0),[C,w]=m.useState(2e5);m.useEffect(()=>{var U,G,z;t&&(c((t.agents.list??[]).map(_=>({id:_.id??"",default:!!_.default,workspace:_.workspace??"",model:_.model??"",maxTokens:_.maxTokens,contextTokens:_.contextTokens,maxToolIterations:_.maxToolIterations}))),h((t.bindings??[]).map(_=>{var Q,J,oe;return{agentId:_.agentId??"",match:{channel:((Q=_.match)==null?void 0:Q.channel)??"",accountId:((J=_.match)==null?void 0:J.accountId)??"",peer:(oe=_.match)!=null&&oe.peer?{kind:_.match.peer.kind,id:_.match.peer.id}:void 0}}})),y(((U=t.session)==null?void 0:U.dmScope)??"per-channel-peer"),b(((z=(G=t.session)==null?void 0:G.agentToAgent)==null?void 0:z.maxPingPongTurns)??0),w(t.agents.defaults.contextTokens??2e5))},[t]);const E=o==null?void 0:o.uiHints,x=gt("session.dmScope",E),k=gt("session.agentToAgent.maxPingPongTurns",E),P=gt("agents.defaults.contextTokens",E),j=gt("agents.list.*.contextTokens",E),N=gt("agents.list",E),T=gt("bindings",E),B=m.useMemo(()=>{const U=new Set(["main"]);return l.forEach(G=>{const z=G.id.trim();z&&U.add(z)}),U},[l]),H=(U,G)=>{c(z=>z.map((_,Q)=>Q===U?{..._,...G}:_))},$=(U,G)=>{h(z=>z.map((_,Q)=>Q===U?G:_))},Y=()=>{try{const U=l.map((_,Q)=>{var le,ce;const J=_.id.trim();if(!J)throw new Error(`agents.list[${Q}].id is required`);const oe={id:J};return _.default&&(oe.default=!0),(le=_.workspace)!=null&&le.trim()&&(oe.workspace=_.workspace.trim()),(ce=_.model)!=null&&ce.trim()&&(oe.model=_.model.trim()),typeof _.maxTokens=="number"&&(oe.maxTokens=_.maxTokens),typeof _.contextTokens=="number"&&(oe.contextTokens=Math.max(1e3,_.contextTokens)),typeof _.maxToolIterations=="number"&&(oe.maxToolIterations=_.maxToolIterations),oe}),G=U.map(_=>_.id).filter((_,Q,J)=>J.indexOf(_)!==Q);if(G.length>0){Xe.error(`Duplicate agent id: ${G[0]}`);return}const z=f.map((_,Q)=>{var K,M,L,ee;const J=_.agentId.trim(),oe=_.match.channel.trim(),le=((K=_.match.accountId)==null?void 0:K.trim())??"",ce=(M=_.match.peer)==null?void 0:M.kind,V=((ee=(L=_.match.peer)==null?void 0:L.id)==null?void 0:ee.trim())??"";if(!J)throw new Error(`bindings[${Q}].agentId is required`);if(!B.has(J))throw new Error(`bindings[${Q}].agentId '${J}' not found in agents.list/main`);if(!oe)throw new Error(`bindings[${Q}].match.channel is required`);const q={agentId:J,match:{channel:oe}};if(le&&(q.match.accountId=le),ce){if(!V)throw new Error(`bindings[${Q}].match.peer.id is required when peer.kind is set`);q.match.peer={kind:ce,id:V}}return q});a.mutate({data:{agents:{defaults:{contextTokens:Math.max(1e3,C)},list:U},bindings:z,session:{dmScope:g,agentToAgent:{maxPingPongTurns:Math.min(5,Math.max(0,v))}}}})}catch(U){const G=U instanceof Error?U.message:String(U);Xe.error(G)}};return r||!t?d.jsx("div",{className:"p-8 text-gray-400",children:"Loading runtime settings..."}):d.jsxs("div",{className:"space-y-6 pb-20 animate-fade-in",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Routing & Runtime"}),d.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Align multi-agent routing with OpenClaw: bindings, agent pool, and DM scope."})]}),d.jsxs(xs,{children:[d.jsxs(Ol,{children:[d.jsx(Al,{children:(x==null?void 0:x.label)??"DM Scope"}),d.jsx(Ll,{children:(x==null?void 0:x.help)??"Control how direct-message sessions are isolated."})]}),d.jsxs(_l,{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium text-gray-800",children:(P==null?void 0:P.label)??"Default Context Tokens"}),d.jsx(Ke,{type:"number",min:1e3,step:1e3,value:C,onChange:U=>w(Math.max(1e3,Number.parseInt(U.target.value,10)||1e3))}),d.jsx("p",{className:"text-xs text-gray-500",children:(P==null?void 0:P.help)??"Input context budget for agents when no per-agent override is set."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium text-gray-800",children:(x==null?void 0:x.label)??"DM Scope"}),d.jsxs(_s,{value:g,onValueChange:U=>y(U),children:[d.jsx(zo,{children:d.jsx(Ds,{})}),d.jsx(Fo,{children:PP.map(U=>d.jsx(on,{value:U.value,children:U.label},U.value))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium text-gray-800",children:(k==null?void 0:k.label)??"Max Ping-Pong Turns"}),d.jsx(Ke,{type:"number",min:0,max:5,value:v,onChange:U=>b(Math.max(0,Number.parseInt(U.target.value,10)||0))}),d.jsx("p",{className:"text-xs text-gray-500",children:(k==null?void 0:k.help)??"Set to 0 to block automatic agent-to-agent ping-pong loops."})]})]})]}),d.jsxs(xs,{children:[d.jsxs(Ol,{children:[d.jsx(Al,{children:(N==null?void 0:N.label)??"Agent List"}),d.jsx(Ll,{children:(N==null?void 0:N.help)??"Run multiple fixed-role agents in one gateway process."})]}),d.jsxs(_l,{className:"space-y-3",children:[l.map((U,G)=>d.jsxs("div",{className:"rounded-xl border border-gray-200 p-3 space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[d.jsx(Ke,{value:U.id,onChange:z=>H(G,{id:z.target.value}),placeholder:"Agent ID (e.g. engineer)"}),d.jsx(Ke,{value:U.workspace??"",onChange:z=>H(G,{workspace:z.target.value}),placeholder:"Workspace override (optional)"}),d.jsx(Ke,{value:U.model??"",onChange:z=>H(G,{model:z.target.value}),placeholder:"Model override (optional)"}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[d.jsx(Ke,{type:"number",min:1,value:U.maxTokens??"",onChange:z=>H(G,{maxTokens:vd(z.target.value)}),placeholder:"Max tokens"}),d.jsx(Ke,{type:"number",min:1e3,step:1e3,value:U.contextTokens??"",onChange:z=>H(G,{contextTokens:vd(z.target.value)}),placeholder:(j==null?void 0:j.label)??"Context tokens"}),d.jsx(Ke,{type:"number",min:1,value:U.maxToolIterations??"",onChange:z=>H(G,{maxToolIterations:vd(z.target.value)}),placeholder:"Max tools"})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[d.jsx(Hf,{checked:!!U.default,onCheckedChange:z=>{if(!z){H(G,{default:!1});return}c(_=>_.map((Q,J)=>({...Q,default:J===G})))}}),d.jsx("span",{children:"Default agent"})]}),d.jsxs(st,{type:"button",variant:"outline",size:"sm",onClick:()=>c(z=>z.filter((_,Q)=>Q!==G)),children:[d.jsx(Fd,{className:"h-4 w-4 mr-1"}),"Remove"]})]})]},`${G}-${U.id}`)),d.jsxs(st,{type:"button",variant:"outline",onClick:()=>c(U=>[...U,RP()]),children:[d.jsx(zd,{className:"h-4 w-4 mr-2"}),"Add Agent"]})]})]}),d.jsxs(xs,{children:[d.jsxs(Ol,{children:[d.jsx(Al,{children:(T==null?void 0:T.label)??"Bindings"}),d.jsx(Ll,{children:(T==null?void 0:T.help)??"Route inbound message by channel + account + peer to target agent."})]}),d.jsxs(_l,{className:"space-y-3",children:[f.map((U,G)=>{var _,Q;const z=((_=U.match.peer)==null?void 0:_.kind)??"";return d.jsxs("div",{className:"rounded-xl border border-gray-200 p-3 space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:[d.jsx(Ke,{value:U.agentId,onChange:J=>$(G,{...U,agentId:J.target.value}),placeholder:"Target agent ID"}),d.jsx(Ke,{value:U.match.channel,onChange:J=>$(G,{...U,match:{...U.match,channel:J.target.value}}),placeholder:"Channel (e.g. discord)"}),d.jsx(Ke,{value:U.match.accountId??"",onChange:J=>$(G,{...U,match:{...U.match,accountId:J.target.value}}),placeholder:"Account ID (optional)"}),d.jsxs(_s,{value:z||"__none__",onValueChange:J=>{var le;const oe=J==="__none__"?"":J;if(!oe){$(G,{...U,match:{...U.match,peer:void 0}});return}$(G,{...U,match:{...U.match,peer:{kind:oe,id:((le=U.match.peer)==null?void 0:le.id)??""}}})},children:[d.jsx(zo,{children:d.jsx(Ds,{})}),d.jsxs(Fo,{children:[d.jsx(on,{value:"__none__",children:"Peer kind (optional)"}),d.jsx(on,{value:"direct",children:"direct"}),d.jsx(on,{value:"group",children:"group"}),d.jsx(on,{value:"channel",children:"channel"})]})]}),d.jsx(Ke,{value:((Q=U.match.peer)==null?void 0:Q.id)??"",onChange:J=>$(G,{...U,match:{...U.match,peer:z?{kind:z,id:J.target.value}:void 0}}),placeholder:"Peer ID (requires peer kind)"})]}),d.jsx("div",{className:"flex justify-end",children:d.jsxs(st,{type:"button",variant:"outline",size:"sm",onClick:()=>h(J=>J.filter((oe,le)=>le!==G)),children:[d.jsx(Fd,{className:"h-4 w-4 mr-1"}),"Remove"]})})]},`${G}-${U.agentId}`)}),d.jsxs(st,{type:"button",variant:"outline",onClick:()=>h(U=>[...U,jP()]),children:[d.jsx(zd,{className:"h-4 w-4 mr-2"}),"Add Binding"]})]})]}),d.jsx("div",{className:"flex justify-end",children:d.jsxs(st,{type:"button",onClick:Y,disabled:a.isPending,children:[d.jsx(hC,{className:"h-4 w-4 mr-2"}),a.isPending?"Saving...":"Save Runtime Settings"]})})]})}const Wa="__unknown_channel__";function K0(t){if(!t)return"-";const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function jl(t){const r=t.indexOf(":");return r<=0?Wa:t.slice(0,r).trim()||Wa}function Jd(t){return t===Wa?X("sessionsUnknownChannel"):t}function MP({session:t,channel:r,isSelected:o,onSelect:a}){const l=Jd(r),c=t.label||t.key.split(":").pop()||t.key;return d.jsxs("button",{onClick:a,className:ve("w-full text-left p-3.5 rounded-xl transition-all duration-200 outline-none focus:outline-none focus:ring-0 group",o?"bg-brand-50 border border-brand-100/50":"bg-transparent border border-transparent hover:bg-gray-50/80"),children:[d.jsxs("div",{className:"flex items-start justify-between mb-1.5",children:[d.jsx("div",{className:ve("font-semibold truncate pr-2 flex-1 text-sm",o?"text-brand-800":"text-gray-900"),children:c}),d.jsx("div",{className:ve("text-[10px] font-bold px-2 py-0.5 rounded-full shrink-0 capitalize",o?"bg-white text-brand-600 shadow-[0_1px_2px_rgba(0,0,0,0.02)]":"bg-gray-100 text-gray-500"),children:l})]}),d.jsxs("div",{className:ve("flex items-center text-xs justify-between mt-2 font-medium",o?"text-brand-600/80":"text-gray-400"),children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(eC,{className:"w-3.5 h-3.5 opacity-70"}),d.jsx("span",{className:"truncate max-w-[100px]",children:K0(t.updatedAt).split(" ")[0]})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(vs,{className:"w-3.5 h-3.5 opacity-70"}),d.jsx("span",{children:t.messageCount})]})]})]})}function IP({message:t}){const r=t.role.toLowerCase()==="user";return d.jsx("div",{className:ve("flex w-full mb-6",r?"justify-end":"justify-start"),children:d.jsxs("div",{className:ve("max-w-[85%] rounded-[1.25rem] p-5 flex gap-3 text-sm",r?"bg-primary text-white rounded-tr-sm":"bg-gray-50 text-gray-800 rounded-tl-sm border border-gray-100/50"),children:[d.jsx("div",{className:"shrink-0 pt-0.5",children:r?d.jsx(vC,{className:"w-4 h-4 text-primary-100"}):d.jsx(JS,{className:"w-4 h-4 text-gray-400"})}),d.jsxs("div",{className:"flex-1 space-y-1 overflow-x-hidden",children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-4 mb-2",children:[d.jsx("span",{className:ve("font-semibold text-xs",r?"text-primary-50":"text-gray-900 capitalize"),children:t.role}),d.jsx("span",{className:ve("text-[10px]",r?"text-primary-200":"text-gray-400"),children:K0(t.timestamp)})]}),d.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-[15px]",children:t.content})]})]})})}function OP(){var G,z,_;const[t,r]=m.useState(""),[o]=m.useState(100),[a]=m.useState(0),[l,c]=m.useState(null),[f,h]=m.useState("all"),[g,y]=m.useState(""),[v,b]=m.useState(""),[C,w]=m.useState(!1),E=m.useMemo(()=>({q:t.trim()||void 0,limit:o,activeMinutes:a}),[t,o,a]),x=S2(E),k=C2(l,200),P=k2(),j=E2(),N=m.useMemo(()=>{var Q;return((Q=x.data)==null?void 0:Q.sessions)??[]},[(G=x.data)==null?void 0:G.sessions]),T=m.useMemo(()=>N.find(Q=>Q.key===l),[N,l]),B=m.useMemo(()=>{const Q=new Set;for(const J of N)Q.add(jl(J.key));return Array.from(Q).sort((J,oe)=>J===Wa?1:oe===Wa?-1:J.localeCompare(oe))},[N]),H=m.useMemo(()=>f==="all"?N:N.filter(Q=>jl(Q.key)===f),[N,f]);m.useEffect(()=>{T?(y(T.label||""),b(T.preferredModel||"")):(y(""),b("")),w(!1)},[T]);const $=()=>{l&&(P.mutate({key:l,data:{label:g.trim()||null,preferredModel:v.trim()||null}}),w(!1))},Y=()=>{l&&window.confirm(X("sessionsClearHistory")+"?")&&P.mutate({key:l,data:{clearHistory:!0}})},U=()=>{l&&window.confirm(`${X("sessionsDeleteConfirm")} ?`)&&j.mutate({key:l},{onSuccess:()=>c(null)})};return d.jsxs("div",{className:"h-[calc(100vh-80px)] w-full max-w-[1400px] mx-auto animate-fade-in flex flex-col pt-6 pb-2",children:[d.jsx("div",{className:"flex items-center justify-between mb-6 shrink-0",children:d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold text-gray-900 tracking-tight",children:X("sessionsPageTitle")}),d.jsx("p",{className:"text-sm text-gray-500 mt-1",children:X("sessionsPageDescription")})]})}),d.jsxs("div",{className:"flex-1 flex gap-6 min-h-0 relative",children:[d.jsxs("div",{className:"w-[320px] flex flex-col shrink-0 bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden",children:[d.jsxs("div",{className:"px-4 py-4 border-b border-gray-100 bg-white z-10 shrink-0 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{className:"text-[11px] font-semibold text-gray-400 uppercase tracking-wider",children:[N.length," ",X("sessionsListTitle")]}),d.jsx(st,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100",onClick:()=>x.refetch(),children:d.jsx(ng,{className:ve("h-3.5 w-3.5",x.isFetching&&"animate-spin")})})]}),d.jsxs(_s,{value:f,onValueChange:h,children:[d.jsx(zo,{className:"w-full h-8.5 rounded-lg bg-gray-50/50 hover:bg-gray-100 border-gray-200 focus:ring-0 shadow-none text-xs font-medium text-gray-700",children:d.jsx(Ds,{placeholder:"All Channels"})}),d.jsxs(Fo,{className:"rounded-xl shadow-lg border-gray-100 max-w-[280px]",children:[d.jsx(on,{value:"all",className:"rounded-lg text-xs",children:"All Channels"}),B.map(Q=>d.jsx(on,{value:Q,className:"rounded-lg text-xs truncate pr-6",children:Jd(Q)},Q))]})]}),d.jsxs("div",{className:"relative w-full",children:[d.jsx(qy,{className:"h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400"}),d.jsx(Ke,{value:t,onChange:Q=>r(Q.target.value),placeholder:X("sessionsSearchPlaceholder"),className:"pl-8 h-8.5 rounded-lg bg-gray-50/50 border-gray-200 focus-visible:bg-white text-xs"})]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1 pb-10 custom-scrollbar relative",children:x.isLoading?d.jsx("div",{className:"text-sm text-gray-400 p-4 text-center",children:X("sessionsLoading")}):H.length===0?d.jsxs("div",{className:"text-sm text-gray-400 p-4 text-center border-2 border-dashed border-gray-100 rounded-xl mt-4",children:[d.jsx(tg,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),X("sessionsEmpty")]}):H.map(Q=>d.jsx(MP,{session:Q,channel:jl(Q.key),isSelected:l===Q.key,onSelect:()=>c(Q.key)},Q.key))})]}),d.jsxs("div",{className:"flex-1 min-w-0 flex flex-col overflow-hidden relative bg-white rounded-2xl shadow-sm border border-gray-200",children:[(P.isPending||j.isPending)&&d.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-primary/20 overflow-hidden z-20",children:d.jsx("div",{className:"h-full bg-primary animate-pulse w-1/3 rounded-r-full"})}),l&&T?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"shrink-0 border-b border-gray-100 bg-white px-8 py-5 z-10 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"h-12 w-12 rounded-[14px] bg-gray-50 border border-gray-100 flex items-center justify-center text-gray-400 shrink-0",children:d.jsx(Vl,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2.5 mb-1.5",children:[d.jsx("h3",{className:"text-lg font-bold text-gray-900 tracking-tight",children:T.label||T.key.split(":").pop()||T.key}),d.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 uppercase tracking-widest",children:Jd(jl(T.key))})]}),d.jsx("div",{className:"text-xs text-gray-500 font-mono break-all line-clamp-1 opacity-70",title:l,children:l})]})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d.jsxs(st,{variant:"outline",size:"sm",onClick:()=>w(!C),className:ve("h-8.5 rounded-lg shadow-none border-gray-200 transition-all text-xs font-semibold",C?"bg-gray-100 text-gray-900":"hover:bg-gray-50 hover:text-gray-900"),children:[d.jsx(bf,{className:"w-3.5 h-3.5 mr-1.5"}),"Metadata"]}),d.jsx(st,{variant:"outline",size:"sm",onClick:Y,className:"h-8.5 rounded-lg shadow-none hover:bg-gray-50 hover:text-gray-900 border-gray-200 text-xs font-semibold text-gray-500",children:X("sessionsClearHistory")}),d.jsx(st,{variant:"outline",size:"sm",onClick:U,className:"h-8.5 rounded-lg shadow-none hover:bg-red-50 hover:text-red-600 hover:border-red-200 border-gray-200 text-xs font-semibold text-red-500",children:X("delete")})]})]}),C&&d.jsxs("div",{className:"flex items-center gap-3 bg-gray-50/50 p-3 rounded-lg border border-gray-100 animate-slide-in",children:[d.jsx(Ke,{placeholder:X("sessionsLabelPlaceholder"),value:g,onChange:Q=>y(Q.target.value),className:"h-8 text-sm bg-white"}),d.jsx(Ke,{placeholder:X("sessionsModelPlaceholder"),value:v,onChange:Q=>b(Q.target.value),className:"h-8 text-sm bg-white"}),d.jsx(st,{size:"sm",onClick:$,className:"h-8 px-4 shrink-0 shadow-none",disabled:P.isPending,children:X("sessionsSaveMeta")})]})]}),d.jsxs("div",{className:`flex-1 overflow-y-auto p-6 relative
332
- [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:bg-gray-300/80 [&::-webkit-scrollbar-thumb]:rounded-full`,children:[k.isLoading&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-50/50 backdrop-blur-sm z-10",children:d.jsxs("div",{className:"flex flex-col items-center gap-3 animate-pulse",children:[d.jsx(ng,{className:"w-6 h-6 text-primary animate-spin"}),d.jsx("span",{className:"text-sm font-medium text-gray-500",children:X("sessionsHistoryLoading")})]})}),k.error&&d.jsx("div",{className:"text-center p-6 bg-red-50 rounded-xl text-red-600 border border-red-100 text-sm",children:k.error.message}),!k.isLoading&&((z=k.data)==null?void 0:z.messages.length)===0&&d.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[d.jsx(vs,{className:"w-12 h-12 mb-3 text-gray-300"}),d.jsx("p",{className:"text-sm",children:X("sessionsEmpty")})]}),d.jsx("div",{className:"max-w-3xl mx-auto",children:(((_=k.data)==null?void 0:_.messages)??[]).map((Q,J)=>d.jsx(IP,{message:Q},`${Q.timestamp}-${J}`))})]})]}):d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-gray-400 p-8 h-full bg-white",children:[d.jsx("div",{className:"w-20 h-20 bg-gray-50 rounded-3xl flex items-center justify-center mb-6 border border-gray-100 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.02)] rotate-3",children:d.jsx(tg,{className:"h-8 w-8 text-gray-300 -rotate-3"})}),d.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-2",children:"No Session Selected"}),d.jsx("p",{className:"text-sm text-center max-w-sm leading-relaxed",children:"Select a session from the list on the left to view its chat history and configure its metadata."})]})]})]})]})}var[gc]=ei("Tooltip",[fc]),yc=fc(),Q0="TooltipProvider",AP=700,Zd="tooltip.open",[LP,Vf]=gc(Q0),q0=t=>{const{__scopeTooltip:r,delayDuration:o=AP,skipDelayDuration:a=300,disableHoverableContent:l=!1,children:c}=t,f=m.useRef(!0),h=m.useRef(!1),g=m.useRef(0);return m.useEffect(()=>{const y=g.current;return()=>window.clearTimeout(y)},[]),d.jsx(LP,{scope:r,isOpenDelayedRef:f,delayDuration:o,onOpen:m.useCallback(()=>{window.clearTimeout(g.current),f.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,a)},[a]),isPointerInTransitRef:h,onPointerInTransitChange:m.useCallback(y=>{h.current=y},[]),disableHoverableContent:l,children:c})};q0.displayName=Q0;var Ha="Tooltip",[_P,ni]=gc(Ha),G0=t=>{const{__scopeTooltip:r,children:o,open:a,defaultOpen:l,onOpenChange:c,disableHoverableContent:f,delayDuration:h}=t,g=Vf(Ha,t.__scopeTooltip),y=yc(r),[v,b]=m.useState(null),C=To(),w=m.useRef(0),E=f??g.disableHoverableContent,x=h??g.delayDuration,k=m.useRef(!1),[P,j]=Ql({prop:a,defaultProp:l??!1,onChange:$=>{$?(g.onOpen(),document.dispatchEvent(new CustomEvent(Zd))):g.onClose(),c==null||c($)},caller:Ha}),N=m.useMemo(()=>P?k.current?"delayed-open":"instant-open":"closed",[P]),T=m.useCallback(()=>{window.clearTimeout(w.current),w.current=0,k.current=!1,j(!0)},[j]),B=m.useCallback(()=>{window.clearTimeout(w.current),w.current=0,j(!1)},[j]),H=m.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{k.current=!0,j(!0),w.current=0},x)},[x,j]);return m.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),d.jsx(e0,{...y,children:d.jsx(_P,{scope:r,contentId:C,open:P,stateAttribute:N,trigger:v,onTriggerChange:b,onTriggerEnter:m.useCallback(()=>{g.isOpenDelayedRef.current?H():T()},[g.isOpenDelayedRef,H,T]),onTriggerLeave:m.useCallback(()=>{E?B():(window.clearTimeout(w.current),w.current=0)},[B,E]),onOpen:T,onClose:B,disableHoverableContent:E,children:o})})};G0.displayName=Ha;var ef="TooltipTrigger",Y0=m.forwardRef((t,r)=>{const{__scopeTooltip:o,...a}=t,l=ni(ef,o),c=Vf(ef,o),f=yc(o),h=m.useRef(null),g=Je(r,h,l.onTriggerChange),y=m.useRef(!1),v=m.useRef(!1),b=m.useCallback(()=>y.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),d.jsx(t0,{asChild:!0,...f,children:d.jsx(Be.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...a,ref:g,onPointerMove:De(t.onPointerMove,C=>{C.pointerType!=="touch"&&!v.current&&!c.isPointerInTransitRef.current&&(l.onTriggerEnter(),v.current=!0)}),onPointerLeave:De(t.onPointerLeave,()=>{l.onTriggerLeave(),v.current=!1}),onPointerDown:De(t.onPointerDown,()=>{l.open&&l.onClose(),y.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:De(t.onFocus,()=>{y.current||l.onOpen()}),onBlur:De(t.onBlur,l.onClose),onClick:De(t.onClick,l.onClose)})})});Y0.displayName=ef;var Kf="TooltipPortal",[DP,zP]=gc(Kf,{forceMount:void 0}),X0=t=>{const{__scopeTooltip:r,forceMount:o,children:a,container:l}=t,c=ni(Kf,r);return d.jsx(DP,{scope:r,forceMount:o,children:d.jsx(Ks,{present:o||c.open,children:d.jsx(sc,{asChild:!0,container:l,children:a})})})};X0.displayName=Kf;var zs="TooltipContent",J0=m.forwardRef((t,r)=>{const o=zP(zs,t.__scopeTooltip),{forceMount:a=o.forceMount,side:l="top",...c}=t,f=ni(zs,t.__scopeTooltip);return d.jsx(Ks,{present:a||f.open,children:f.disableHoverableContent?d.jsx(Z0,{side:l,...c,ref:r}):d.jsx(FP,{side:l,...c,ref:r})})}),FP=m.forwardRef((t,r)=>{const o=ni(zs,t.__scopeTooltip),a=Vf(zs,t.__scopeTooltip),l=m.useRef(null),c=Je(r,l),[f,h]=m.useState(null),{trigger:g,onClose:y}=o,v=l.current,{onPointerInTransitChange:b}=a,C=m.useCallback(()=>{h(null),b(!1)},[b]),w=m.useCallback((E,x)=>{const k=E.currentTarget,P={x:E.clientX,y:E.clientY},j=HP(P,k.getBoundingClientRect()),N=VP(P,j),T=KP(x.getBoundingClientRect()),B=qP([...N,...T]);h(B),b(!0)},[b]);return m.useEffect(()=>()=>C(),[C]),m.useEffect(()=>{if(g&&v){const E=k=>w(k,v),x=k=>w(k,g);return g.addEventListener("pointerleave",E),v.addEventListener("pointerleave",x),()=>{g.removeEventListener("pointerleave",E),v.removeEventListener("pointerleave",x)}}},[g,v,w,C]),m.useEffect(()=>{if(f){const E=x=>{const k=x.target,P={x:x.clientX,y:x.clientY},j=(g==null?void 0:g.contains(k))||(v==null?void 0:v.contains(k)),N=!QP(P,f);j?C():N&&(C(),y())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[g,v,f,y,C]),d.jsx(Z0,{...t,ref:c})}),[UP,BP]=gc(Ha,{isInside:!1}),$P=U2("TooltipContent"),Z0=m.forwardRef((t,r)=>{const{__scopeTooltip:o,children:a,"aria-label":l,onEscapeKeyDown:c,onPointerDownOutside:f,...h}=t,g=ni(zs,o),y=yc(o),{onClose:v}=g;return m.useEffect(()=>(document.addEventListener(Zd,v),()=>document.removeEventListener(Zd,v)),[v]),m.useEffect(()=>{if(g.trigger){const b=C=>{const w=C.target;w!=null&&w.contains(g.trigger)&&v()};return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[g.trigger,v]),d.jsx(oc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:b=>b.preventDefault(),onDismiss:v,children:d.jsxs(n0,{"data-state":g.stateAttribute,...y,...h,ref:r,style:{...h.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:[d.jsx($P,{children:a}),d.jsx(UP,{scope:o,isInside:!0,children:d.jsx(LN,{id:g.contentId,role:"tooltip",children:l||a})})]})})});J0.displayName=zs;var ex="TooltipArrow",WP=m.forwardRef((t,r)=>{const{__scopeTooltip:o,...a}=t,l=yc(o);return BP(ex,o).isInside?null:d.jsx(r0,{...l,...a,ref:r})});WP.displayName=ex;function HP(t,r){const o=Math.abs(r.top-t.y),a=Math.abs(r.bottom-t.y),l=Math.abs(r.right-t.x),c=Math.abs(r.left-t.x);switch(Math.min(o,a,l,c)){case c:return"left";case l:return"right";case o:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function VP(t,r,o=5){const a=[];switch(r){case"top":a.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":a.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":a.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":a.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return a}function KP(t){const{top:r,right:o,bottom:a,left:l}=t;return[{x:l,y:r},{x:o,y:r},{x:o,y:a},{x:l,y:a}]}function QP(t,r){const{x:o,y:a}=t;let l=!1;for(let c=0,f=r.length-1;c<r.length;f=c++){const h=r[c],g=r[f],y=h.x,v=h.y,b=g.x,C=g.y;v>a!=C>a&&o<(b-y)*(a-v)/(C-v)+y&&(l=!l)}return l}function qP(t){const r=t.slice();return r.sort((o,a)=>o.x<a.x?-1:o.x>a.x?1:o.y<a.y?-1:o.y>a.y?1:0),GP(r)}function GP(t){if(t.length<=1)return t.slice();const r=[];for(let a=0;a<t.length;a++){const l=t[a];for(;r.length>=2;){const c=r[r.length-1],f=r[r.length-2];if((c.x-f.x)*(l.y-f.y)>=(c.y-f.y)*(l.x-f.x))r.pop();else break}r.push(l)}r.pop();const o=[];for(let a=t.length-1;a>=0;a--){const l=t[a];for(;o.length>=2;){const c=o[o.length-1],f=o[o.length-2];if((c.x-f.x)*(l.y-f.y)>=(c.y-f.y)*(l.x-f.x))o.pop();else break}o.push(l)}return o.pop(),r.length===1&&o.length===1&&r[0].x===o[0].x&&r[0].y===o[0].y?r:r.concat(o)}var YP=q0,XP=G0,JP=Y0,ZP=X0,tx=J0;const eR=YP,xd=XP,wd=JP,Bl=m.forwardRef(({className:t,sideOffset:r=4,...o},a)=>d.jsx(ZP,{children:d.jsx(tx,{ref:a,sideOffset:r,className:ve("z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",t),...o})}));Bl.displayName=tx.displayName;async function tR(t={}){var l,c;const r=new URLSearchParams;(l=t.q)!=null&&l.trim()&&r.set("q",t.q.trim()),t.type&&r.set("type",t.type),(c=t.tag)!=null&&c.trim()&&r.set("tag",t.tag.trim()),t.sort&&r.set("sort",t.sort),typeof t.page=="number"&&Number.isFinite(t.page)&&r.set("page",String(Math.max(1,Math.trunc(t.page)))),typeof t.pageSize=="number"&&Number.isFinite(t.pageSize)&&r.set("pageSize",String(Math.max(1,Math.trunc(t.pageSize))));const o=r.toString(),a=await kt.get(o?`/api/marketplace/items?${o}`:"/api/marketplace/items");if(!a.ok)throw new Error(a.error.message);return a.data}async function nR(t){const r=await kt.post("/api/marketplace/install",t);if(!r.ok)throw new Error(r.error.message);return r.data}async function rR(){const t=await kt.get("/api/marketplace/installed");if(!t.ok)throw new Error(t.error.message);return t.data}async function oR(t){const r=await kt.post("/api/marketplace/manage",t);if(!r.ok)throw new Error(r.error.message);return r.data}function sR(t){return Uo({queryKey:["marketplace-items",t],queryFn:()=>tR(t),staleTime:15e3})}function aR(){return Uo({queryKey:["marketplace-installed"],queryFn:rR,staleTime:1e4})}function iR(){const t=Qn();return vr({mutationFn:r=>nR(r),onSuccess:r=>{t.invalidateQueries({queryKey:["marketplace-installed"]}),Xe.success(r.message||`${r.type} installed`)},onError:r=>{Xe.error(r.message||"Install failed")}})}function lR(){const t=Qn();return vr({mutationFn:r=>oR(r),onSuccess:r=>{t.invalidateQueries({queryKey:["marketplace-installed"]}),t.invalidateQueries({queryKey:["marketplace-items"]}),Xe.success(r.message||`${r.action} success`)},onError:r=>{Xe.error(r.message||"Operation failed")}})}const cR=12;function tf(t){return(t??"").trim().toLowerCase()}function Ss(t,r){const o=tf(r);return o.length>0?`${t}:${o}`:""}function uR(t){const r=new Map;for(const o of t){const a=[o.install.spec,o.slug,o.id];for(const l of a){const c=Ss(o.type,l);!c||r.has(c)||r.set(c,o)}}return r}function dR(t){const r=new Map;for(const o of t){const a=[o.spec,o.id,o.label];for(const l of a){const c=Ss(o.type,l);!c||r.has(c)||r.set(c,o)}}return r}function fR(t,r){const o=[t.install.spec,t.slug,t.id];for(const a of o){const l=Ss(t.type,a);if(!l)continue;const c=r.get(l);if(c)return c}}function hR(t,r){const o=r.get(Ss(t.type,t.spec));if(o)return o;const a=r.get(Ss(t.type,t.id));return a||r.get(Ss(t.type,t.label))}function pR(t,r,o){const a=tf(o);return a?[t.id,t.spec,t.label,r==null?void 0:r.name,r==null?void 0:r.slug,r==null?void 0:r.summary,...(r==null?void 0:r.tags)??[]].map(c=>tf(c)).filter(Boolean).some(c=>c.includes(a)):!0}function mR(t){const r=["bg-blue-500","bg-indigo-500","bg-purple-500","bg-pink-500","bg-rose-500","bg-orange-500","bg-emerald-500","bg-teal-500","bg-cyan-500"];let o=0;for(let a=0;a<t.length;a++)o=t.charCodeAt(a)+((o<<5)-o);return r[Math.abs(o)%r.length]}function gR({name:t,fallback:r}){const o=t||r,a=o.substring(0,2).toUpperCase(),l=mR(o);return d.jsx("div",{className:ve("flex items-center justify-center w-11 h-11 rounded-2xl text-white font-bold text-base shrink-0 shadow-sm",l),children:a})}function yR(t){return d.jsx("div",{className:"bg-white border border-gray-200 rounded-xl p-4 mb-4",children:d.jsxs("div",{className:"flex gap-3 items-center",children:[d.jsxs("div",{className:"flex-1 min-w-0 relative",children:[d.jsx(uC,{className:"h-4 w-4 text-gray-400 absolute left-3 top-1/2 -translate-y-1/2"}),d.jsx("input",{value:t.searchText,onChange:r=>t.onSearchTextChange(r.target.value),placeholder:"Search extensions...",className:"w-full h-9 border border-gray-200 rounded-lg pl-9 pr-3 text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),d.jsx("div",{className:"inline-flex h-9 rounded-lg bg-gray-100 p-0.5 shrink-0",children:[{value:"all",label:"All"},{value:"plugin",label:"Plugins"},{value:"skill",label:"Skills"}].map(r=>d.jsx("button",{type:"button",onClick:()=>t.onTypeFilterChange(r.value),className:ve("px-3 rounded-md text-sm font-medium transition-all whitespace-nowrap",t.typeFilter===r.value?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:r.label},r.value))}),t.scope==="all"&&d.jsxs(_s,{value:t.sort,onValueChange:r=>t.onSortChange(r),children:[d.jsx(zo,{className:"h-9 w-[150px] shrink-0 rounded-lg",children:d.jsx(Ds,{})}),d.jsxs(Fo,{children:[d.jsx(on,{value:"relevance",children:"Relevance"}),d.jsx(on,{value:"updated",children:"Recently Updated"})]})]})]})})}function Bg(t){var E,x,k,P;const r=t.record,o=((E=t.item)==null?void 0:E.type)??(r==null?void 0:r.type),a=((x=t.item)==null?void 0:x.name)??(r==null?void 0:r.label)??(r==null?void 0:r.id)??(r==null?void 0:r.spec)??"Unknown Item",l=((k=t.item)==null?void 0:k.summary)??(r?"Installed locally. Details are currently unavailable from marketplace.":""),c=((P=t.item)==null?void 0:P.install.spec)??(r==null?void 0:r.spec)??"",f=(r==null?void 0:r.id)||(r==null?void 0:r.spec),h=!!f&&t.manageState.isPending&&t.manageState.targetId===f,g=(r==null?void 0:r.type)==="plugin",y=(r==null?void 0:r.type)==="plugin"&&r.origin!=="bundled",v=(r==null?void 0:r.type)==="skill"&&r.source==="workspace",b=!!(y||v),C=t.installState.isPending&&t.item&&t.installState.installingSpec===t.item.install.spec,w=o==="plugin"?"Plugin":o==="skill"?"Skill":"Extension";return d.jsxs("article",{className:"group bg-white border border-transparent hover:border-gray-200 rounded-xl px-4 py-3 hover:shadow-sm transition-all flex items-start gap-4 justify-between cursor-default h-[90px]",children:[d.jsxs("div",{className:"flex gap-3 min-w-0 flex-1 h-full items-start",children:[d.jsx(gR,{name:a,fallback:c||"Ext"}),d.jsx("div",{className:"min-w-0 flex-1 flex flex-col justify-center h-full",children:d.jsxs(eR,{delayDuration:400,children:[d.jsxs(xd,{children:[d.jsx(wd,{asChild:!0,children:d.jsx("div",{className:"text-[14px] font-semibold text-gray-900 truncate leading-tight cursor-default",children:a})}),d.jsx(Bl,{className:"max-w-[300px] text-xs",children:a})]}),d.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5 mb-1.5",children:[d.jsx("span",{className:"text-[11px] text-gray-500 font-medium",children:w}),c&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-[10px] text-gray-300",children:"•"}),d.jsxs(xd,{children:[d.jsx(wd,{asChild:!0,children:d.jsx("span",{className:"text-[11px] text-gray-400 truncate max-w-full font-mono cursor-default",children:c})}),d.jsx(Bl,{className:"max-w-[300px] text-xs font-mono break-all",children:c})]})]})]}),d.jsxs(xd,{children:[d.jsx(wd,{asChild:!0,children:d.jsx("p",{className:"text-[12px] text-gray-500/90 line-clamp-1 transition-colors leading-relaxed text-left cursor-default",children:l})}),l&&d.jsx(Bl,{className:"max-w-[400px] text-xs leading-relaxed",children:l})]})]})})]}),d.jsxs("div",{className:"shrink-0 flex items-center h-full",children:[t.item&&!r&&d.jsx("button",{onClick:()=>t.onInstall(t.item),disabled:t.installState.isPending,className:"inline-flex items-center gap-1.5 h-8 px-4 rounded-full text-xs font-semibold bg-gray-900 text-white hover:bg-black disabled:opacity-50 transition-colors",children:C?"Installing...":"Install"}),r&&g&&d.jsx("button",{disabled:t.manageState.isPending,onClick:()=>t.onManage(r.enabled===!1?"enable":"disable",r),className:"inline-flex items-center h-8 px-4 rounded-full text-xs font-semibold border border-gray-200 text-gray-700 bg-white hover:bg-gray-50 hover:border-gray-300 disabled:opacity-50 transition-colors",children:h&&t.manageState.action!=="uninstall"?t.manageState.action==="enable"?"Enabling...":"Disabling...":r.enabled===!1?"Enable":"Disable"}),r&&b&&d.jsx("button",{disabled:t.manageState.isPending,onClick:()=>t.onManage("uninstall",r),className:"inline-flex items-center h-8 px-4 rounded-full text-xs font-semibold border border-rose-100 text-rose-600 bg-white hover:bg-rose-50 hover:border-rose-200 disabled:opacity-50 transition-colors",children:h&&t.manageState.action==="uninstall"?"Removing...":"Uninstall"})]})]})}function vR(t){return d.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2",children:[d.jsx("button",{className:"h-8 px-3 rounded-lg border border-gray-200 text-sm text-gray-700 disabled:opacity-40",onClick:t.onPrev,disabled:t.page<=1||t.busy,children:"Prev"}),d.jsx("div",{className:"text-sm text-gray-600 min-w-20 text-center",children:t.totalPages===0?"0 / 0":`${t.page} / ${t.totalPages}`}),d.jsx("button",{className:"h-8 px-3 rounded-lg border border-gray-200 text-sm text-gray-700 disabled:opacity-40",onClick:t.onNext,disabled:t.totalPages===0||t.page>=t.totalPages||t.busy,children:"Next"})]})}function xR(){var Q,J,oe,le,ce,V,q,K,M;const[t,r]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState("all"),[f,h]=m.useState("all"),[g,y]=m.useState("relevance"),[v,b]=m.useState(1);m.useEffect(()=>{const L=setTimeout(()=>{b(1),a(t.trim())},250);return()=>clearTimeout(L)},[t]);const C=aR(),w=sR({q:o||void 0,type:f==="all"?void 0:f,sort:g,page:v,pageSize:cR}),E=iR(),x=lR(),k=m.useMemo(()=>{var L;return((L=C.data)==null?void 0:L.records)??[]},[(Q=C.data)==null?void 0:Q.records]),P=m.useMemo(()=>{var L;return((L=w.data)==null?void 0:L.items)??[]},[(J=w.data)==null?void 0:J.items]),j=m.useMemo(()=>uR(P),[P]),N=m.useMemo(()=>dR(k),[k]),T=m.useMemo(()=>{const L=k.filter(ee=>f==="all"?!0:ee.type===f).map(ee=>({key:`${ee.type}:${ee.spec}:${ee.id??""}`,record:ee,item:hR(ee,j)})).filter(ee=>pR(ee.record,ee.item,o));return L.sort((ee,ie)=>{const he=ee.record.installedAt?Date.parse(ee.record.installedAt):Number.NaN,we=ie.record.installedAt?Date.parse(ie.record.installedAt):Number.NaN,ne=!Number.isNaN(he),pe=!Number.isNaN(we);return ne&&pe&&he!==we?we-he:ee.record.spec.localeCompare(ie.record.spec)}),L},[k,f,j,o]),B=l==="installed"?T.length:((oe=w.data)==null?void 0:oe.total)??0,H=l==="installed"?1:((le=w.data)==null?void 0:le.totalPages)??0,$=m.useMemo(()=>l==="installed"?C.isLoading?"Loading...":`${T.length} installed`:w.data?`${P.length} / ${B}`:"Loading...",[l,C.isLoading,T.length,w.data,P.length,B]),Y={isPending:E.isPending,installingSpec:(ce=E.variables)==null?void 0:ce.spec},U={isPending:x.isPending,targetId:((V=x.variables)==null?void 0:V.id)||((q=x.variables)==null?void 0:q.spec),action:(K=x.variables)==null?void 0:K.action},G=[{id:"all",label:"Marketplace"},{id:"installed",label:"Installed",count:((M=C.data)==null?void 0:M.total)??0}],z=L=>{E.isPending||E.mutate({type:L.type,spec:L.install.spec,kind:L.install.kind})},_=(L,ee)=>{if(x.isPending)return;const ie=ee.id||ee.spec;ie&&(L==="uninstall"&&!window.confirm(`Confirm ${L} ${ie}?`)||x.mutate({type:ee.type,action:L,id:ie,spec:ee.spec}))};return d.jsxs("div",{className:"animate-fade-in pb-20",children:[d.jsxs("div",{className:"mb-5",children:[d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Marketplace"}),d.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"A cleaner extension list focused on install / enable / disable."})]}),d.jsx(Wf,{tabs:G,activeTab:l,onChange:L=>{c(L),b(1)},className:"mb-4"}),d.jsx(yR,{scope:l,searchText:t,typeFilter:f,sort:g,onSearchTextChange:r,onTypeFilterChange:L=>{b(1),h(L)},onSortChange:L=>{b(1),y(L)}}),d.jsxs("section",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h3",{className:"text-[15px] font-bold text-gray-900",children:l==="installed"?"Installed":"Extensions"}),d.jsx("span",{className:"text-[12px] text-gray-500",children:$})]}),l==="all"&&w.isError&&d.jsxs("div",{className:"p-4 rounded-xl bg-rose-50 border border-rose-200 text-rose-700 text-sm",children:["Failed to load marketplace data: ",w.error.message]}),l==="installed"&&C.isError&&d.jsxs("div",{className:"p-4 rounded-xl bg-rose-50 border border-rose-200 text-rose-700 text-sm",children:["Failed to load installed items: ",C.error.message]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-3",children:[l==="all"&&P.map(L=>d.jsx(Bg,{item:L,record:fR(L,N),installState:Y,manageState:U,onInstall:z,onManage:_},L.id)),l==="installed"&&T.map(L=>d.jsx(Bg,{item:L.item,record:L.record,installState:Y,manageState:U,onInstall:z,onManage:_},L.key))]}),l==="all"&&!w.isLoading&&!w.isError&&P.length===0&&d.jsx("div",{className:"text-[13px] text-gray-500 py-8 text-center",children:"No items found."}),l==="installed"&&!C.isLoading&&!C.isError&&T.length===0&&d.jsx("div",{className:"text-[13px] text-gray-500 py-8 text-center",children:"No installed items found."})]}),l==="all"&&d.jsx(vR,{page:v,totalPages:H,busy:w.isFetching,onPrev:()=>b(L=>Math.max(1,L-1)),onNext:()=>b(L=>H>0?Math.min(H,L+1):L+1)})]})}class wR{constructor(r){this.url=r,this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.manualClose=!1}connect(){this.manualClose=!1,this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("WebSocket connected"),this.emit({type:"connection.open",payload:{}})},this.ws.onmessage=r=>{try{const o=JSON.parse(r.data);this.emit(o)}catch(o){console.error("Failed to parse WebSocket message:",o)}},this.ws.onclose=()=>{console.log("WebSocket disconnected"),this.manualClose||this.scheduleReconnect()},this.ws.onerror=r=>{console.error("WebSocket error:",r)}}on(r,o){this.handlers.has(r)||this.handlers.set(r,new Set),this.handlers.get(r).add(o)}off(r,o){var a;(a=this.handlers.get(r))==null||a.delete(o)}emit(r){const o=this.handlers.get(r.type);o==null||o.forEach(a=>a(r))}scheduleReconnect(){this.reconnectTimer||(this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},3e3))}disconnect(){var r;this.manualClose=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(r=this.ws)==null||r.close(),this.ws=null}}function bR(t){const[r,o]=m.useState(null),{setConnectionStatus:a}=Za();return m.useEffect(()=>{const l=(()=>{const f=Dl==null?void 0:Dl.replace(/\/$/,"");if(!f)return"ws://127.0.0.1:18791/ws";try{const h=new URL(f,window.location.origin);return`${h.protocol==="https:"?"wss:":h.protocol==="http:"?"ws:":h.protocol}//${h.host}/ws`}catch{return f.startsWith("wss://")||f.startsWith("ws://")?`${f}/ws`:f.startsWith("https://")?`${f.replace(/^https:/,"wss:")}/ws`:f.startsWith("http://")?`${f.replace(/^http:/,"ws:")}/ws`:`${f}/ws`}})(),c=new wR(l);return c.on("connection.open",()=>{a("connected")}),c.on("config.updated",()=>{t&&t.invalidateQueries({queryKey:["config"]})}),c.on("error",f=>{f.type==="error"&&console.error("WebSocket error:",f.payload.message)}),c.connect(),o(c),()=>c.disconnect()},[a,t]),r}const $g=new nS({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0}}});function SR(){bR($g);const t=yr();return d.jsxs(rS,{client:$g,children:[d.jsx(PC,{children:d.jsx("div",{className:"animate-fade-in w-full h-full",children:d.jsxs(eb,{children:[d.jsx(sr,{path:"/model",element:d.jsx(P2,{})}),d.jsx(sr,{path:"/providers",element:d.jsx(xP,{})}),d.jsx(sr,{path:"/channels",element:d.jsx(NP,{})}),d.jsx(sr,{path:"/runtime",element:d.jsx(TP,{})}),d.jsx(sr,{path:"/sessions",element:d.jsx(OP,{})}),d.jsx(sr,{path:"/marketplace",element:d.jsx(xR,{})}),d.jsx(sr,{path:"/",element:d.jsx(Fm,{to:"/model",replace:!0})}),d.jsx(sr,{path:"*",element:d.jsx(Fm,{to:"/model",replace:!0})})]})},t.pathname)}),d.jsx(g2,{position:"top-right",richColors:!0})]})}r1.createRoot(document.getElementById("root")).render(d.jsx(m.StrictMode,{children:d.jsx(kb,{children:d.jsx(SR,{})})}));