@nylorun/studio 0.2.0-rc.1 → 0.2.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return ee(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function E(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?E(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function oe(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(ne(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=oe(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=oe(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return oe(ae(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function se(e,t,n){if(e==null)return e;var r=[],i=0;return oe(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var D=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},le={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!ne(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=le,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ee(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ne,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,D)}catch(e){D(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,ne());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function te(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ne():S=!1}}}var ne;if(typeof y==`function`)ne=function(){y(te)};else if(typeof MessageChannel<`u`){var E=new MessageChannel,re=E.port2;E.port1.onmessage=te,ne=function(){re.postMessage(null)}}else ne=function(){_(te,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ne()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function be(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function xe(){me(ge),me(_e),me(ve)}function Se(e){e.memoizedState!==null&&he(ye,e);var t=ge.current,n=Jd(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Ce(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),rp._currentValue=ue)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ee(n):``}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee(`Lazy`);case 13:return e.child!==t&&t!==null?Ee(`Suspense Fallback`):Ee(`Suspense`);case 19:return Ee(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Ee(`Activity`);default:return``}}function Ae(e){try{var t=``,n=null;do t+=ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var je=Object.prototype.hasOwnProperty,Me=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,Fe=t.unstable_requestPaint,Ie=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,He=t.unstable_IdlePriority,Ue=t.log,We=t.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&lt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=le.p;return e===0?(e=window.event,e===void 0?32:yp(e.type)):e}function ht(e,t){var n=le.p;try{return le.p=e,t()}finally{le.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,St=`__reactHandles$`+gt,Ct=`__reactResources$`+gt,wt=`__reactMarker$`+gt;function Tt(e){delete e[_t],delete e[vt],delete e[bt],delete e[xt],delete e[St]}function Et(e){var t=e[_t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[_t])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[Ct];return t||=e[Ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[wt]=!0}var jt=new Set,Mt={};function Nt(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Mt[e]=t,e=0;e<t.length;e++)jt.add(t[e])}var Ft=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),It={},Lt={};function Rt(e){return je.call(Lt,e)?!0:je.call(It,e)?!1:Ft.test(e)?Lt[e]=!0:(It[e]=!0,!1)}function zt(e,t,n){if(Rt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Bt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Vt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ht(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Wt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gt(e){if(!e._valueTracker){var t=Ut(e)?`checked`:`value`;e._valueTracker=Wt(e,t,``+e[t])}}function Kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ut(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function qt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Jt=/[\n"\\]/g;function Yt(e){return e.replace(Jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Xt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ht(t)):e.value!==``+Ht(t)&&(e.value=``+Ht(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Qt(e,o,Ht(n)):Qt(e,o,Ht(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ht(s):e.removeAttribute(`name`)}function Zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Gt(e);return}n=n==null?``:``+Ht(n),t=t==null?n:``+Ht(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Gt(e)}function Qt(e,t,n){t===`number`&&qt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function $t(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ht(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function en(e,t,n){if(t!=null&&(t=``+Ht(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ht(n)}function tn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ce(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ht(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Gt(e)}function nn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function an(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||rn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function on(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&an(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&an(e,o,t[o])}function sn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var cn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),ln=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function un(e){return ln.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function dn(){}var fn=null;function pn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mn=null,hn=null;function gn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Xt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Yt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[vt]||null;if(!a)throw Error(i(90));Xt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Kt(r)}break a;case`textarea`:en(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&$t(e,!!n.multiple,t,!1)}}}var _n=!1;function vn(e,t,n){if(_n)return e(t,n);_n=!0;try{return e(t)}finally{if(_n=!1,(mn!==null||hn!==null)&&(ku(),mn&&(t=mn,e=hn,hn=mn=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function yn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var bn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),xn=!1;if(bn)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){xn=!0}}),window.addEventListener(`test`,Sn,Sn),window.removeEventListener(`test`,Sn,Sn)}catch{xn=!1}var Cn=null,wn=null,Tn=null;function En(){if(Tn)return Tn;var e,t=wn,n=t.length,r,i=`value`in Cn?Cn.value:Cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Tn=i.slice(e,1<r?1-r:void 0)}function Dn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function On(){return!0}function kn(){return!1}function An(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?On:kn,this.isPropagationStopped=kn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=On)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=On)},persist:function(){},isPersistent:On}),t}var jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mn=An(jn),Nn=m({},jn,{view:0,detail:0}),Pn=An(Nn),Fn,In,Ln,Rn=m({},Nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Ln&&(Ln&&e.type===`mousemove`?(Fn=e.screenX-Ln.screenX,In=e.screenY-Ln.screenY):In=Fn=0,Ln=e),Fn)},movementY:function(e){return`movementY`in e?e.movementY:In}}),zn=An(Rn),Bn=An(m({},Rn,{dataTransfer:0})),Vn=An(m({},Nn,{relatedTarget:0})),Hn=An(m({},jn,{animationName:0,elapsedTime:0,pseudoElement:0})),Un=An(m({},jn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Wn=An(m({},jn,{data:0})),Gn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Kn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qn[e])?!!t[e]:!1}function Yn(){return Jn}var Xn=An(m({},Nn,{key:function(e){if(e.key){var t=Gn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yn,charCode:function(e){return e.type===`keypress`?Dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Zn=An(m({},Rn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Qn=An(m({},Nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yn})),$n=An(m({},jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),er=An(m({},Rn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),tr=An(m({},jn,{newState:0,oldState:0})),O=[9,13,27,32],nr=bn&&`CompositionEvent`in window,k=null;bn&&`documentMode`in document&&(k=document.documentMode);var rr=bn&&`TextEvent`in window&&!k,ir=bn&&(!nr||k&&8<k&&11>=k),ar=` `,or=!1;function sr(e,t){switch(e){case`keyup`:return O.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function A(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var cr=!1;function j(e,t){switch(e){case`compositionend`:return A(t);case`keypress`:return t.which===32?(or=!0,ar):null;case`textInput`:return e=t.data,e===ar&&or?null:e;default:return null}}function lr(e,t){if(cr)return e===`compositionend`||!nr&&sr(e,t)?(e=En(),Tn=wn=Cn=null,cr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return ir&&t.locale!==`ko`?null:t.data;default:return null}}var ur={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 dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ur[e.type]:t===`textarea`}function fr(e,t,n,r){mn?hn?hn.push(r):hn=[r]:mn=r,t=jd(t,`onChange`),0<t.length&&(n=new Mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var pr=null,mr=null;function M(e){Cd(e,0)}function hr(e){if(Kt(Ot(e)))return e}function gr(e,t){if(e===`change`)return t}var _r=!1;if(bn){var vr;if(bn){var yr=`oninput`in document;if(!yr){var br=document.createElement(`div`);br.setAttribute(`oninput`,`return;`),yr=typeof br.oninput==`function`}vr=yr}else vr=!1;_r=vr&&(!document.documentMode||9<document.documentMode)}function xr(){pr&&(pr.detachEvent(`onpropertychange`,Sr),mr=pr=null)}function Sr(e){if(e.propertyName===`value`&&hr(mr)){var t=[];fr(t,mr,e,pn(e)),vn(M,t)}}function Cr(e,t,n){e===`focusin`?(xr(),pr=t,mr=n,pr.attachEvent(`onpropertychange`,Sr)):e===`focusout`&&xr()}function wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return hr(mr)}function Tr(e,t){if(e===`click`)return hr(t)}function Er(e,t){if(e===`input`||e===`change`)return hr(t)}function Dr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Or=typeof Object.is==`function`?Object.is:Dr;function kr(e,t){if(Or(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!je.call(t,i)||!Or(e[i],t[i]))return!1}return!0}function Ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jr(e,t){var n=Ar(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=qt(e.document)}return t}function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Fr=bn&&`documentMode`in document&&11>=document.documentMode,Ir=null,Lr=null,Rr=null,zr=!1;function Br(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zr||Ir==null||Ir!==qt(r)||(r=Ir,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Rr&&kr(Rr,r)||(Rr=r,r=jd(Lr,`onSelect`),0<r.length&&(t=new Mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ir)))}function Vr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Hr={animationend:Vr(`Animation`,`AnimationEnd`),animationiteration:Vr(`Animation`,`AnimationIteration`),animationstart:Vr(`Animation`,`AnimationStart`),transitionrun:Vr(`Transition`,`TransitionRun`),transitionstart:Vr(`Transition`,`TransitionStart`),transitioncancel:Vr(`Transition`,`TransitionCancel`),transitionend:Vr(`Transition`,`TransitionEnd`)},Ur={},Wr={};bn&&(Wr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Hr.animationend.animation,delete Hr.animationiteration.animation,delete Hr.animationstart.animation),`TransitionEvent`in window||delete Hr.transitionend.transition);function Gr(e){if(Ur[e])return Ur[e];if(!Hr[e])return e;var t=Hr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Wr)return Ur[e]=t[n];return e}var Kr=Gr(`animationend`),qr=Gr(`animationiteration`),Jr=Gr(`animationstart`),Yr=Gr(`transitionrun`),Xr=Gr(`transitionstart`),Zr=Gr(`transitioncancel`),Qr=Gr(`transitionend`),$r=new Map,ei=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ei.push(`scrollEnd`);function ti(e,t){$r.set(e,t),Nt(t,[e])}var ni=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ri=[],ii=0,ai=0;function oi(){for(var e=ii,t=ai=ii=0;t<e;){var n=ri[t];ri[t++]=null;var r=ri[t];ri[t++]=null;var i=ri[t];ri[t++]=null;var a=ri[t];if(ri[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ui(n,i,a)}}function si(e,t,n,r){ri[ii++]=e,ri[ii++]=t,ri[ii++]=n,ri[ii++]=r,ai|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ci(e,t,n,r){return si(e,t,n,r),di(e)}function li(e,t){return si(e,null,null,t),di(e)}function ui(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function di(e){if(50<bu)throw bu=0,xu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fi={};function pi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mi(e,t,n,r){return new pi(e,t,n,r)}function hi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gi(e,t){var n=e.alternate;return n===null?(n=mi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function _i(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function vi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)hi(e)&&(s=1);else if(typeof e==`string`)s=Jf(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=mi(31,n,t,a),e.elementType=E,e.lanes=o,e;case y:return yi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=mi(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=mi(13,n,t,a),e.elementType=T,e.lanes=o,e;case ee:return e=mi(19,n,t,a),e.elementType=ee,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case te:s=14;break a;case ne:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=mi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function yi(e,t,n,r){return e=mi(7,e,r,t),e.lanes=n,e}function bi(e,t,n){return e=mi(6,e,null,t),e.lanes=n,e}function xi(e){var t=mi(18,null,null,0);return t.stateNode=e,t}function Si(e,t,n){return t=mi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ci=new WeakMap;function wi(e,t){if(typeof e==`object`&&e){var n=Ci.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Ci.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var Ti=[],Ei=0,Di=null,Oi=0,ki=[],N=0,P=null,Ai=1,F=``;function ji(e,t){Ti[Ei++]=Oi,Ti[Ei++]=Di,Di=e,Oi=t}function Mi(e,t,n){ki[N++]=Ai,ki[N++]=F,ki[N++]=P,P=e;var r=Ai;e=F;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ai=1<<32-Je(t)+i|n<<i|r,F=a+e}else Ai=1<<a|n<<i|r,F=e}function Ni(e){e.return!==null&&(ji(e,1),Mi(e,1,0))}function Pi(e){for(;e===Di;)Di=Ti[--Ei],Ti[Ei]=null,Oi=Ti[--Ei],Ti[Ei]=null;for(;e===P;)P=ki[--N],ki[N]=null,F=ki[--N],ki[N]=null,Ai=ki[--N],ki[N]=null}function Fi(e,t){ki[N++]=Ai,ki[N++]=F,ki[N++]=P,Ai=t.id,F=t.overflow,P=e}var Ii=null,Li=null,I=!1,Ri=null,zi=!1,Bi=Error(i(519));function Vi(e){throw qi(wi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:wd(`cancel`,t),wd(`close`,t);break;case`iframe`:case`object`:case`embed`:wd(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)wd(xd[n],t);break;case`source`:wd(`error`,t);break;case`img`:case`image`:case`link`:wd(`error`,t),wd(`load`,t);break;case`details`:wd(`toggle`,t);break;case`input`:wd(`invalid`,t),Zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:wd(`invalid`,t);break;case`textarea`:wd(`invalid`,t),tn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ld(t.textContent,n)?(r.popover!=null&&(wd(`beforetoggle`,t),wd(`toggle`,t)),r.onScroll!=null&&wd(`scroll`,t),r.onScrollEnd!=null&&wd(`scrollend`,t),r.onClick!=null&&(t.onclick=dn),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Ii=e.return;Ii;)switch(Ii.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Ii=Ii.return}}function Wi(e){if(e!==Ii)return!1;if(!I)return Ui(e),I=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Yd(e.type,e.memoizedProps)),n=!n),n&&Li&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=J(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=J(e)}else t===27?(t=Li,rf(e.type)?(e=hf,hf=null,Li=e):Li=t):Li=Ii?mf(e.stateNode.nextSibling):null;return!0}function Gi(){Li=Ii=null,I=!1}function Ki(){var e=Ri;return e!==null&&(ou===null?ou=e:ou.push.apply(ou,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=pe(null),Yi=null,Xi=null;function Zi(e,t,n){he(Ji,t._currentValue),t._currentValue=n}function Qi(e){e._currentValue=Ji.current,me(Ji)}function $i(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ea(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),$i(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),$i(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Or(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[rp]:e.push(rp))}a=a.return}e!==null&&ea(t,e,n,r),t.flags|=262144}function na(e){for(e=e.firstContext;e!==null;){if(!Or(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){Yi=e,Xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ia(e){return oa(Yi,e)}function aa(e,t){return Yi===null&&ra(e),oa(e,t)}function oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xi===null){if(e===null)throw Error(i(308));Xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xi=Xi.next=t;return n}var sa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ca=t.unstable_scheduleCallback,la=t.unstable_NormalPriority,ua={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function da(){return{controller:new sa,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&ca(la,function(){e.controller.abort()})}var pa=null,ma=0,ha=0,ga=null;function _a(e,t){if(pa===null){var n=pa=[];ma=0,ha=hd(),ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ma++,t.then(va,va),t}function va(){if(--ma===0&&pa!==null){ga!==null&&(ga.status=`fulfilled`);var e=pa;pa=null,ha=0,ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ya(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ba=D.S;D.S=function(e,t){lu=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&_a(e,t),ba!==null&&ba(e,t)};var xa=pe(null);function L(){var e=xa.current;return e===null?Gl.pooledCache:e}function Sa(e,t){t===null?he(xa,xa.current):he(xa,t.pool)}function Ca(){var e=L();return e===null?null:{parent:ua._currentValue,pool:e}}var wa=Error(i(460)),Ta=Error(i(474)),Ea=Error(i(542)),Da={then:function(){}};function Oa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ka(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(dn,dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e;default:if(typeof t.status==`string`)t.then(dn,dn);else{if(e=Gl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e}throw ja=t,wa}}function Aa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ja=e,wa):e}}var ja=null;function Ma(){if(ja===null)throw Error(i(459));var e=ja;return ja=null,e}function Na(e){if(e===wa||e===Ea)throw Error(i(483))}var Pa=null,Fa=0;function Ia(e){var t=Fa;return Fa+=1,Pa===null&&(Pa=[]),ka(Pa,e,t)}function La(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ra(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function za(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=gi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=bi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ne&&Aa(i)===t.type)?(t=a(t,n.props),La(t,n),t.return=e,t):(t=vi(n.type,n.key,n.props,null,e.mode,r),La(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Si(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=yi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=vi(t.type,t.key,t.props,null,e.mode,n),La(n,t),n.return=e,n;case v:return t=Si(t,e.mode,n),t.return=e,t;case ne:return t=Aa(t),f(e,t,n)}if(ce(t)||ae(t))return t=yi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ia(t),n);if(t.$$typeof===C)return f(e,aa(e,t),n);Ra(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case ne:return n=Aa(n),p(e,t,n,r)}if(ce(n)||ae(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ia(n),r);if(n.$$typeof===C)return p(e,t,aa(e,n),r);Ra(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:return r=Aa(r),m(e,t,n,r,i)}if(ce(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ia(r),i);if(r.$$typeof===C)return m(e,t,n,aa(t,r),i);Ra(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),I&&ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return I&&ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),I&&ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),I&&ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return I&&ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),I&&ji(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ne&&Aa(l)===r.type){n(e,r.sibling),c=a(r,o.props),La(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=yi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=vi(o.type,o.key,o.props,null,e.mode,c),La(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Si(o,e.mode,c),c.return=e,e=c}return s(e);case ne:return o=Aa(o),b(e,r,o,c)}if(ce(o))return h(e,r,o,c);if(ae(o)){if(l=ae(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ia(o),c);if(o.$$typeof===C)return b(e,r,aa(e,o),c);Ra(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Fa=0;var i=b(e,t,n,r);return Pa=null,i}catch(t){if(t===wa||t===Ea)throw t;var a=mi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ba=za(!0),Va=za(!1),Ha=!1;function Ua(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ga(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=di(e),ui(e,null,n),t}return si(e,r,t,n),di(e)}function qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}function Ja(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ya=!1;function Xa(){if(Ya){var e=ga;if(e!==null)throw e}}function Za(e,t,n,r){Ya=!1;var i=e.updateQueue;Ha=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(ql&f)===f:(r&f)===f){f!==0&&f===ha&&(Ya=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ha=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),eu|=o,e.lanes=o,e.memoizedState=d}}function Qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function $a(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Qa(n[e],t)}var eo=pe(null),to=pe(0);function no(e,t){e=Ql,he(to,e),he(eo,t),Ql=e|t.baseLanes}function ro(){he(to,Ql),he(eo,eo.current)}function io(){Ql=to.current,me(eo),me(to)}var ao=pe(null),oo=null;function so(e){var t=e.alternate;he(po,po.current&1),he(ao,e),oo===null&&(t===null||eo.current!==null||t.memoizedState!==null)&&(oo=e)}function co(e){he(po,po.current),he(ao,e),oo===null&&(oo=e)}function lo(e){e.tag===22?(he(po,po.current),he(ao,e),oo===null&&(oo=e)):uo(e)}function uo(){he(po,po.current),he(ao,ao.current)}function fo(e){me(ao),oo===e&&(oo=null),me(po)}var po=pe(0);function mo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||df(n)||ff(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ho=0,R=null,go=null,_o=null,vo=!1,yo=!1,bo=!1,xo=0,So=0,Co=null,wo=0;function To(){throw Error(i(321))}function Eo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function Do(e,t,n,r,i,a){return ho=a,R=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?Ws:Gs,bo=!1,a=n(r,i),bo=!1,yo&&(a=ko(t,n,r,i)),Oo(e),a}function Oo(e){D.H=Us;var t=go!==null&&go.next!==null;if(ho=0,_o=go=R=null,vo=!1,So=0,Co=null,t)throw Error(i(300));e===null||cc||(e=e.dependencies,e!==null&&na(e)&&(cc=!0))}function ko(e,t,n,r){R=e;var a=0;do{if(yo&&(Co=null),So=0,yo=!1,25<=a)throw Error(i(301));if(a+=1,_o=go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}D.H=Ks,o=t(n,r)}while(yo);return o}function Ao(){var e=D.H,t=e.useState()[0];return t=typeof t.then==`function`?Lo(t):t,e=e.useState()[0],(go===null?null:go.memoizedState)!==e&&(R.flags|=1024),t}function jo(){var e=xo!==0;return xo=0,e}function Mo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function No(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}ho=0,_o=go=R=null,yo=!1,So=xo=0,Co=null}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?R.memoizedState=_o=e:_o=_o.next=e,_o}function Fo(){if(go===null){var e=R.alternate;e=e===null?null:e.memoizedState}else e=go.next;var t=_o===null?R.memoizedState:_o.next;if(t!==null)_o=t,go=e;else{if(e===null)throw R.alternate===null?Error(i(467)):Error(i(310));go=e,e={memoizedState:go.memoizedState,baseState:go.baseState,baseQueue:go.baseQueue,queue:go.queue,next:null},_o===null?R.memoizedState=_o=e:_o=_o.next=e}return _o}function Io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var t=So;return So+=1,Co===null&&(Co=[]),e=ka(Co,e,t),t=R,(_o===null?t.memoizedState:_o.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?Ws:Gs),e}function Ro(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Lo(e);if(e.$$typeof===C)return ia(e)}throw Error(i(438,String(e)))}function zo(e){var t=null,n=R.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=R.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Io(),R.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=re;return t.index++,n}function Bo(e,t){return typeof t==`function`?t(e):t}function Vo(e){return Ho(Fo(),go,e)}function Ho(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ho&f)===f:(ql&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ha&&(d=!0);else if((ho&p)===p){u=u.next,p===ha&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,R.lanes|=p,eu|=p;f=u.action,bo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,R.lanes|=f,eu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Or(o,e.memoizedState)&&(cc=!0,d&&(n=ga,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Uo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Or(o,t.memoizedState)||(cc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Wo(e,t,n){var r=R,a=Fo(),o=I;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Or((go||a).memoizedState,n);if(s&&(a.memoizedState=n,cc=!0),a=a.queue,hs(qo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||_o!==null&&_o.memoizedState.tag&1){if(r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,a,n,t),null),Gl===null)throw Error(i(349));o||ho&127||Go(r,t,n)}return n}function Go(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=R.updateQueue,t===null?(t=Io(),R.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ko(e,t,n,r){t.value=n,t.getSnapshot=r,Jo(t)&&Yo(e)}function qo(e,t,n){return n(function(){Jo(t)&&Yo(e)})}function Jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function Yo(e){var t=li(e,2);t!==null&&wu(t,e,2)}function Xo(e){var t=Po();if(typeof e==`function`){var n=e;if(e=n(),bo){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t}function Zo(e,t,n,r){return e.baseState=n,Ho(e,go,typeof r==`function`?r:Bo)}function Qo(e,t,n,r,a){if(Bs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};D.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,$o(t,o)):(o.next=n.next,t.pending=n.next=o)}}function $o(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=D.T,o={};D.T=o;try{var s=n(i,r),c=D.S;c!==null&&c(o,s),es(e,t,s)}catch(n){ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),D.T=a}}else try{a=n(i,r),es(e,t,a)}catch(n){ns(e,t,n)}}function es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ts(e,t,n)},function(n){return ns(e,t,n)}):ts(e,t,n)}function ts(e,t,n){t.status=`fulfilled`,t.value=n,rs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,$o(e,n)))}function ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,rs(t),t=t.next;while(t!==r)}e.action=null}function rs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function is(e,t){return t}function as(e,t){if(I){var n=Gl.formState;if(n!==null){a:{var r=R;if(I){if(Li){b:{for(var i=Li,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=mf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Li=mf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=Po(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:t},n.queue=r,n=Ls.bind(null,R,r),r.dispatch=n,r=Xo(!1),a=zs.bind(null,R,!1,r.queue),r=Po(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Qo.bind(null,R,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function os(e){return ss(Fo(),go,e)}function ss(e,t,n){if(t=Ho(e,t,is)[0],e=Vo(Bo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Lo(t)}catch(e){throw e===wa?Ea:e}else r=t;t=Fo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(R.flags|=2048,us(9,{destroy:void 0},cs.bind(null,i,n),null)),[r,a,e]}function cs(e,t){e.action=t}function ls(e){var t=Fo(),n=go;if(n!==null)return ss(t,n,e);Fo(),t=t.memoizedState,n=Fo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function us(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=R.updateQueue,t===null&&(t=Io(),R.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ds(){return Fo().memoizedState}function fs(e,t,n,r){var i=Po();R.flags|=e,i.memoizedState=us(1|t,{destroy:void 0},n,r===void 0?null:r)}function ps(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=i.memoizedState.inst;go!==null&&r!==null&&Eo(r,go.memoizedState.deps)?i.memoizedState=us(t,a,n,r):(R.flags|=e,i.memoizedState=us(1|t,a,n,r))}function ms(e,t){fs(8390656,8,e,t)}function hs(e,t){ps(2048,8,e,t)}function gs(e){R.flags|=4;var t=R.updateQueue;if(t===null)t=Io(),R.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function _s(e){var t=Fo().memoizedState;return gs({ref:t,nextImpl:e}),function(){if(Wl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function vs(e,t){return ps(4,2,e,t)}function ys(e,t){return ps(4,4,e,t)}function bs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xs(e,t,n){n=n==null?null:n.concat([e]),ps(4,4,bs.bind(null,t,e),n)}function Ss(){}function Cs(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Eo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ws(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Eo(t,r[1]))return r[0];if(r=e(),bo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Ts(e,t,n){return n===void 0||ho&1073741824&&!(ql&261930)?e.memoizedState=t:(e.memoizedState=n,e=Cu(),R.lanes|=e,eu|=e,n)}function Es(e,t,n,r){return Or(n,t)?n:eo.current===null?!(ho&42)||ho&1073741824&&!(ql&261930)?(cc=!0,e.memoizedState=n):(e=Cu(),R.lanes|=e,eu|=e,t):(e=Ts(e,n,r),Or(e,t)||(cc=!0),e)}function Ds(e,t,n,r,i){var a=le.p;le.p=a!==0&&8>a?a:8;var o=D.T,s={};D.T=s,zs(e,!1,t,n);try{var c=i(),l=D.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Rs(e,t,ya(c,r),Su(e)):Rs(e,t,r,Su(e))}catch(n){Rs(e,t,{then:function(){},status:`rejected`,reason:n},Su())}finally{le.p=a,o!==null&&s.types!==null&&(o.types=s.types),D.T=o}}function Os(){}function ks(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=As(e).queue;Ds(e,a,t,ue,n===null?Os:function(){return js(e),n(r)})}function As(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function js(e){var t=As(e);t.next===null&&(t=e.alternate.memoizedState),Rs(e,t.next.queue,{},Su())}function Ms(){return ia(rp)}function Ns(){return Fo().memoizedState}function Ps(){return Fo().memoizedState}function Fs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Su();e=Ga(n);var r=Ka(t,e,n);r!==null&&(wu(r,t,n),qa(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Is(e,t,n){var r=Su();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bs(e)?Vs(t,n):(n=ci(e,t,n,r),n!==null&&(wu(n,e,r),Hs(n,t,r)))}function Ls(e,t,n){Rs(e,t,n,Su())}function Rs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bs(e))Vs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Or(s,o))return si(e,t,i,0),Gl===null&&oi(),!1}catch{}if(n=ci(e,t,i,r),n!==null)return wu(n,e,r),Hs(n,t,r),!0}return!1}function zs(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Bs(e)){if(t)throw Error(i(479))}else t=ci(e,n,r,2),t!==null&&wu(t,e,2)}function Bs(e){var t=e.alternate;return e===R||t!==null&&t===R}function Vs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var Us={readContext:ia,use:Ro,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useInsertionEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useSyncExternalStore:To,useId:To,useHostTransitionStatus:To,useFormState:To,useActionState:To,useOptimistic:To,useMemoCache:To,useCacheRefresh:To};Us.useEffectEvent=To;var Ws={readContext:ia,use:Ro,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),fs(4194308,4,bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fs(4194308,4,e,t)},useInsertionEffect:function(e,t){fs(4,2,e,t)},useMemo:function(e,t){var n=Po();t=t===void 0?null:t;var r=e();if(bo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Po();if(n!==void 0){var i=n(t);if(bo){qe(!0);try{n(t)}finally{qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Is.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:function(e){e=Xo(e);var t=e.queue,n=Ls.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ss,useDeferredValue:function(e,t){return Ts(Po(),e,t)},useTransition:function(){var e=Xo(!1);return e=Ds.bind(null,R,e.queue,!0,!1),Po().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,a=Po();if(I){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Gl===null)throw Error(i(349));ql&127||Go(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ms(qo.bind(null,r,o,e),[e]),r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,o,n,t),null),n},useId:function(){var e=Po(),t=Gl.identifierPrefix;if(I){var n=F,r=Ai;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ms,useFormState:as,useActionState:as,useOptimistic:function(e){var t=Po();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=zs.bind(null,R,!0,n),n.dispatch=t,[e,t]},useMemoCache:zo,useCacheRefresh:function(){return Po().memoizedState=Fs.bind(null,R)},useEffectEvent:function(e){var t=Po(),n={impl:e};return t.memoizedState=n,function(){if(Wl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Gs={readContext:ia,use:Ro,useCallback:Cs,useContext:ia,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Vo,useRef:ds,useState:function(){return Vo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){return Es(Fo(),go.memoizedState,e,t)},useTransition:function(){var e=Vo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:os,useActionState:os,useOptimistic:function(e,t){return Zo(Fo(),go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Gs.useEffectEvent=_s;var Ks={readContext:ia,use:Ro,useCallback:Cs,useContext:ia,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Uo,useRef:ds,useState:function(){return Uo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){var n=Fo();return go===null?Ts(n,e,t):Es(n,go.memoizedState,e,t)},useTransition:function(){var e=Uo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:ls,useActionState:ls,useOptimistic:function(e,t){var n=Fo();return go===null?(n.baseState=e,[e,n.queue.dispatch]):Zo(n,go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Ks.useEffectEvent=_s;function qs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Js={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Ga(r);i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(wu(t,e,r),qa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Ga(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(wu(t,e,r),qa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Su(),r=Ga(n);r.tag=2,t!=null&&(r.callback=t),t=Ka(e,r,n),t!==null&&(wu(t,e,n),qa(t,e,n))}};function Ys(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!kr(n,r)||!kr(i,a):!0}function Xs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Js.enqueueReplaceState(t,t.state,null)}function Zs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Qs(e){ni(e)}function $s(e){console.error(e)}function ec(e){ni(e)}function tc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function nc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function rc(e,t,n){return n=Ga(n),n.tag=3,n.payload={element:null},n.callback=function(){tc(e,t)},n}function ic(e){return e=Ga(e),e.tag=3,e}function ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){nc(t,n,r),typeof i!=`function`&&(fu===null?fu=new Set([this]):fu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function oc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ta(t,n,a,!0),n=ao.current,n!==null){switch(n.tag){case 31:case 13:return oo===null?Iu():n.alternate===null&&$l===0&&($l=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Zu(e,r,a)),!1;case 22:return n.flags|=65536,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Zu(e,r,a)),!1}throw Error(i(435,n.tag))}return Zu(e,r,a),Iu(),!1}if(I)return t=ao.current,t===null?(r!==Bi&&(t=Error(i(423),{cause:r}),qi(wi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=wi(r,n),a=rc(e.stateNode,r,a),Ja(e,a),$l!==4&&($l=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Bi&&(e=Error(i(422),{cause:r}),qi(wi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=wi(o,n),au===null?au=[o]:au.push(o),$l!==4&&($l=2),t===null)return!0;r=wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=rc(n.stateNode,r,e),Ja(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(fu===null||!fu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ic(a),ac(a,e,n,r),Ja(n,a),!1}n=n.return}while(n!==null);return!1}var sc=Error(i(461)),cc=!1;function lc(e,t,n,r){t.child=e===null?Va(t,null,n,r):Ba(t,e.child,n,r)}function uc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ra(t),r=Do(e,t,n,o,a,i),s=jo(),e!==null&&!cc?(Mo(e,t,i),Pc(e,t,i)):(I&&s&&Ni(t),t.flags|=1,lc(e,t,r,i),t.child)}function dc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!hi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,fc(e,t,a,r,i)):(e=vi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Fc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?kr:n,n(o,r)&&e.ref===t.ref)return Pc(e,t,i)}return t.flags|=1,e=gi(a,r),e.ref=t.ref,e.return=t,t.child=e}function fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(kr(a,r)&&e.ref===t.ref){if(cc=!1,t.pendingProps=r=a,Fc(e,i))e.flags&131072&&(cc=!0);else return t.lanes=e.lanes,Pc(e,t,i)}}return bc(e,t,n,r,i)}function pc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Sa(t,a===null?null:a.cachePool),a===null?ro():no(t,a),lo(t);else return r=t.lanes=536870912,hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Sa(t,null),ro(),uo(t)):(Sa(t,a.cachePool),no(t,a),uo(t),t.memoizedState=null);return lc(e,t,i,n),t.child}function mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hc(e,t,n,r,i){var a=L();return a=a===null?null:{parent:ua._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Sa(t,null),ro(),lo(t),e!==null&&ta(e,t,r,!0),t.childLanes=i,null}function gc(e,t){return t=kc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function _c(e,t,n){return Ba(t,e.child,null,n),e=gc(t,t.pendingProps),e.flags|=2,fo(t),t.memoizedState=null,e}function vc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(I){if(r.mode===`hidden`)return e=gc(t,r),t.lanes=536870912,mc(null,e);if(co(t),(e=Li)?(e=uf(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:P===null?null:{id:Ai,overflow:F},retryLane:536870912,hydrationErrors:null},n=xi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return gc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(co(t),a){if(t.flags&256)t.flags&=-257,t=_c(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(cc||ta(e,t,n,!1),a=(n&e.childLanes)!==0,cc||a){if(r=Gl,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,li(e,s),wu(r,e,s),sc;Iu(),t=_c(e,t,n)}else e=o.treeContext,Li=mf(s.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=gc(t,r),t.flags|=4096;return t}return e=gi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function yc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function bc(e,t,n,r,i){return ra(t),n=Do(e,t,n,r,void 0,i),r=jo(),e!==null&&!cc?(Mo(e,t,i),Pc(e,t,i)):(I&&r&&Ni(t),t.flags|=1,lc(e,t,n,i),t.child)}function xc(e,t,n,r,i,a){return ra(t),t.updateQueue=null,n=ko(t,r,n,i),Oo(e),r=jo(),e!==null&&!cc?(Mo(e,t,a),Pc(e,t,a)):(I&&r&&Ni(t),t.flags|=1,lc(e,t,n,a),t.child)}function Sc(e,t,n,r,i){if(ra(t),t.stateNode===null){var a=fi,o=n.contextType;typeof o==`object`&&o&&(a=ia(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Js,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ua(t),o=n.contextType,a.context=typeof o==`object`&&o?ia(o):fi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(qs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Js.enqueueReplaceState(a,a.state,null),Za(t,r,a,i),Xa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=fi,typeof u==`object`&&u&&(o=ia(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Xs(t,a,r,o),Ha=!1;var f=t.memoizedState;a.state=f,Za(t,r,a,i),Xa(),l=t.memoizedState,s||f!==l||Ha?(typeof d==`function`&&(qs(t,n,d,r),l=t.memoizedState),(c=Ha||Ys(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Wa(e,t),o=t.memoizedProps,u=Zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=fi,typeof l==`object`&&l&&(c=ia(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Xs(t,a,r,c),Ha=!1,f=t.memoizedState,a.state=f,Za(t,r,a,i),Xa();var p=t.memoizedState;o!==d||f!==p||Ha||e!==null&&e.dependencies!==null&&na(e.dependencies)?(typeof s==`function`&&(qs(t,n,s,r),p=t.memoizedState),(u=Ha||Ys(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&na(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,yc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ba(t,e.child,null,i),t.child=Ba(t,null,n,i)):lc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Pc(e,t,i),e}function Cc(e,t,n,r){return Gi(),t.flags|=256,lc(e,t,n,r),t.child}var wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tc(e){return{baseLanes:e,cachePool:Ca()}}function Ec(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ru),e}function Dc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(po.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(I){if(a?so(t):uo(t),(e=Li)?(e=uf(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:P===null?null:{id:Ai,overflow:F},retryLane:536870912,hydrationErrors:null},n=xi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return ff(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(uo(t),a=t.mode,c=kc({mode:`hidden`,children:c},a),r=yi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,mc(null,r)):(so(t),Oc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(so(t),t.flags&=-257,t=Ac(e,t,n)):t.memoizedState===null?(uo(t),c=r.fallback,a=t.mode,r=kc({mode:`visible`,children:r.children},a),c=yi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ba(t,e.child,null,n),r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,t=mc(null,r)):(uo(t),t.child=e.child,t.flags|=128,t=null);else if(so(t),ff(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=Ac(e,t,n)}else if(cc||ta(e,t,n,!1),s=(n&e.childLanes)!==0,cc||s){if(s=Gl,s!==null&&(r=dt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,li(e,r),wu(s,e,r),sc;df(c)||Iu(),t=Ac(e,t,n)}else df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Li=mf(c.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=Oc(t,r.children),t.flags|=4096);return t}return a?(uo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=gi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=yi(c,a,n,null),c.flags|=2):c=gi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,mc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Tc(n):(a=c.cachePool,a===null?a=Ca():(l=ua._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Ec(e,s,n),t.memoizedState=wc,mc(e.child,r)):(so(t),n=e.child,e=n.sibling,n=gi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Oc(e,t){return t=kc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function kc(e,t){return e=mi(22,e,null,t),e.lanes=0,e}function Ac(e,t,n){return Ba(t,e.child,null,n),e=Oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$i(e.return,t,n)}function Mc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Nc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=po.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,he(po,o),lc(e,t,r,n),r=I?Oi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jc(e,n,t);else if(e.tag===19)jc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&mo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Mc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&mo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Mc(t,!0,n,null,a,r);break;case`together`:Mc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Pc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eu|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=gi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&na(e)))}function Ic(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),Zi(t,ua,e.memoizedState.cache),Gi();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:Zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,co(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(so(t),e=Pc(e,t,n),e===null?null:e.sibling):Dc(e,t,n):(so(t),t.flags|=128,null);so(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Nc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),he(po,po.current),r)break;return null;case 22:return t.lanes=0,pc(e,t,n,t.pendingProps);case 24:Zi(t,ua,e.memoizedState.cache)}return Pc(e,t,n)}function Lc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)cc=!0;else{if(!Fc(e,n)&&!(t.flags&128))return cc=!1,Ic(e,t,n);cc=!!(e.flags&131072)}}else cc=!1,I&&t.flags&1048576&&Mi(t,Oi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Aa(t.elementType),t.type=e,typeof e==`function`)hi(e)?(r=Zs(e,r),t.tag=1,t=Sc(null,t,e,r,n)):(t.tag=0,t=bc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=uc(null,t,e,r,n);break a}if(a===te){t.tag=14,t=dc(null,t,e,r,n);break a}}throw t=se(e)||e,Error(i(306,t,``))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Zs(r,t.pendingProps),Sc(e,t,r,a,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Wa(e,t),Za(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Zi(t,ua,r),r!==o.cache&&ea(t,[ua],n,!0),Xa(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Cc(e,t,r,n);break a}if(r!==a){a=wi(Error(i(424)),t),qi(a),t=Cc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Li=mf(e.firstChild),Ii=t,I=!0,Ri=null,zi=!0,n=Va(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===a){t=Pc(e,t,n);break a}lc(e,t,r,n)}t=t.child}return t;case 26:return yc(e,t),e===null?(n=Pf(t.type,null,t.pendingProps,null))?t.memoizedState=n:I||(n=t.type,e=t.pendingProps,r=Kd(ve.current).createElement(n),r[_t]=t,r[vt]=e,Bd(r,n,e),At(r),t.stateNode=r):t.memoizedState=Pf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&I&&(r=t.stateNode=_f(t.type,t.pendingProps,ve.current),Ii=t,zi=!0,a=Li,rf(t.type)?(hf=a,Li=mf(r.firstChild)):Li=a),lc(e,t,t.pendingProps.children,n),yc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((a=r=Li)&&(r=cf(r,t.type,t.pendingProps,zi),r===null?a=!1:(t.stateNode=r,Ii=t,Li=mf(r.firstChild),zi=!1,a=!0)),a||Vi(t)),Se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Do(e,t,Ao,null,null,n),rp._currentValue=a),yc(e,t),lc(e,t,r,n),t.child;case 6:return e===null&&I&&((e=n=Li)&&(n=lf(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Ii=t,Li=null,e=!0)),e||Vi(t)),null;case 13:return Dc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ba(t,null,r,n):lc(e,t,r,n),t.child;case 11:return uc(e,t,t.type,t.pendingProps,n);case 7:return lc(e,t,t.pendingProps,n),t.child;case 8:return lc(e,t,t.pendingProps.children,n),t.child;case 12:return lc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Zi(t,t.type,r.value),lc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ra(t),a=ia(a),r=r(a),t.flags|=1,lc(e,t,r,n),t.child;case 14:return dc(e,t,t.type,t.pendingProps,n);case 15:return fc(e,t,t.type,t.pendingProps,n);case 19:return Nc(e,t,n);case 31:return vc(e,t,n);case 22:return pc(e,t,n,t.pendingProps);case 24:return ra(t),r=ia(ua),e===null?(a=L(),a===null&&(a=Gl,o=da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ua(t),Zi(t,ua,a)):((e.lanes&n)!==0&&(Wa(e,t),Za(t,null,null,n),Xa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Zi(t,ua,r),r!==a.cache&&ea(t,[ua],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Zi(t,ua,r))),lc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Rc(e){e.flags|=4}function zc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Nu())e.flags|=8192;else throw ja=Da,Ta}}else e.flags&=-16777217}function Bc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Yf(t)){if(Nu())e.flags|=8192;else throw ja=Da,Ta}}function Vc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,iu|=t)}function Hc(e,t){if(!I)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Uc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Wc(e,t,n){var r=t.pendingProps;switch(Pi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Uc(t),null;case 1:return Uc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qi(ua),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Rc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),Uc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Rc(t),o===null?(Uc(t),zc(t,a,null,r,n)):(Uc(t),Bc(t,o))):o?o===e.memoizedState?(Uc(t),t.flags&=-16777217):(Rc(t),Uc(t),Bc(t,o)):(e=e.memoizedProps,e!==r&&Rc(t),Uc(t),zc(t,a,e,r,n)),null;case 27:if(Ce(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Uc(t),null}e=ge.current,Wi(t)?Hi(t,e):(e=_f(a,r,n),t.stateNode=e,Rc(t))}return Uc(t),null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Uc(t),null}if(o=ge.current,Wi(t))Hi(t,o);else{var s=Kd(ve.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[_t]=t,o[vt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Rc(t)}}return Uc(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ii,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ld(e.nodeValue,n)),e||Vi(t,!0)}else e=Kd(e).createTextNode(r),e[_t]=t,t.stateNode=e}return Uc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[_t]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(fo(t),t):(fo(t),null);if(t.flags&128)throw Error(i(558))}return Uc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[_t]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(fo(t),t):(fo(t),null)}return fo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vc(t,t.updateQueue),Uc(t),null);case 4:return xe(),e===null&&Dd(t.stateNode.containerInfo),Uc(t),null;case 10:return Qi(t.type),Uc(t),null;case 19:if(me(po),r=t.memoizedState,r===null)return Uc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Hc(r,!1);else{if($l!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=mo(e),o!==null){for(t.flags|=128,Hc(r,!1),e=o.updateQueue,t.updateQueue=e,Vc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)_i(n,e),n=n.sibling;return he(po,po.current&1|2),I&&ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>uu&&(t.flags|=128,a=!0,Hc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=mo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Vc(t,e),Hc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!I)return Uc(t),null}else 2*Ie()-r.renderingStartTime>uu&&n!==536870912&&(t.flags|=128,a=!0,Hc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Uc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,n=po.current,he(po,a?n&1|2:n&1),I&&ji(t,r.treeForkCount),e);case 22:case 23:return fo(t),io(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Uc(t),t.subtreeFlags&6&&(t.flags|=8192)):Uc(t),n=t.updateQueue,n!==null&&Vc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&me(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),Uc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Gc(e,t){switch(Pi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(fo(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(po),null;case 4:return xe(),null;case 10:return Qi(t.type),null;case 22:case 23:return fo(t),io(),e!==null&&me(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function Kc(e,t){switch(Pi(t),t.tag){case 3:Qi(ua),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&fo(t);break;case 13:fo(t);break;case 19:me(po);break;case 10:Qi(t.type);break;case 22:case 23:fo(t),io(),e!==null&&me(xa);break;case 24:Qi(ua)}}function qc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Xu(t,t.return,e)}}function Jc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Xu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Xu(t,t.return,e)}}function Yc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{$a(t,n)}catch(t){Xu(e,e.return,t)}}}function Xc(e,t,n){n.props=Zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Xu(e,t,n)}}function Zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Xu(e,t,n)}}function Qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Xu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Xu(e,t,n)}else n.current=null}}function $c(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Xu(e,e.return,t)}}function el(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[vt]=t}catch(t){Xu(e,e.return,t)}}function tl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||tl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=dn));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[_t]=e,t[vt]=n}catch(t){Xu(e,e.return,t)}}var ol=!1,z=!1,sl=!1,cl=typeof WeakSet==`function`?WeakSet:Set,ll=null;function ul(e,t){if(e=e.containerInfo,Wd=fp,e=Nr(e),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},fp=!1,ll=t;ll!==null;)if(t=ll,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ll=e;else for(;ll!==null;){switch(t=ll,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Xu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:sf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ll=e;break}ll=t.return}}function dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Tl(e,n),r&4&&qc(5,n);break;case 1:if(Tl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Xu(n,n.return,e)}else{var i=Zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Xu(n,n.return,e)}}}r&64&&Yc(n),r&512&&Zc(n,n.return);break;case 3:if(Tl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{$a(e,t)}catch(e){Xu(n,n.return,e)}}break;case 27:t===null&&r&4&&al(n);case 26:case 5:Tl(e,n),t===null&&r&4&&$c(n),r&512&&Zc(n,n.return);break;case 12:Tl(e,n);break;case 31:Tl(e,n),r&4&&gl(e,n);break;case 13:Tl(e,n),r&4&&_l(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ed.bind(null,n),pf(e,n))));break;case 22:if(r=n.memoizedState!==null||ol,!r){t=t!==null&&t.memoizedState!==null||z,i=ol;var a=z;ol=r,(z=t)&&!a?Dl(e,n,!!(n.subtreeFlags&8772)):Tl(e,n),ol=i,z=a}break;case 30:break;default:Tl(e,n)}}function fl(e){var t=e.alternate;t!==null&&(e.alternate=null,fl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var pl=null,ml=!1;function hl(e,t,n){for(n=n.child;n!==null;)B(e,t,n),n=n.sibling}function B(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:z||Qc(n,t),hl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:z||Qc(n,t);var r=pl,i=ml;rf(n.type)&&(pl=n.stateNode,ml=!1),hl(e,t,n),vf(n.stateNode),pl=r,ml=i;break;case 5:z||Qc(n,t);case 6:if(r=pl,i=ml,pl=null,hl(e,t,n),pl=r,ml=i,pl!==null){if(ml)try{(pl.nodeType===9?pl.body:pl.nodeName===`HTML`?pl.ownerDocument.body:pl).removeChild(n.stateNode)}catch(e){Xu(n,t,e)}else try{pl.removeChild(n.stateNode)}catch(e){Xu(n,t,e)}}break;case 18:pl!==null&&(ml?(e=pl,af(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Rp(e)):af(pl,n.stateNode));break;case 4:r=pl,i=ml,pl=n.stateNode.containerInfo,ml=!0,hl(e,t,n),pl=r,ml=i;break;case 0:case 11:case 14:case 15:Jc(2,n,t),z||Jc(4,n,t),hl(e,t,n);break;case 1:z||(Qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Xc(n,t,r)),hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:z=(r=z)||n.memoizedState!==null,hl(e,t,n),z=r;break;default:hl(e,t,n)}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rp(e)}catch(e){Xu(t,t.return,e)}}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rp(e)}catch(e){Xu(t,t.return,e)}}function vl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cl),t;default:throw Error(i(435,e.tag))}}function yl(e,t){var n=vl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=K.bind(null,e,t);t.then(r,r)}})}function bl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(rf(c.type)){pl=c.stateNode,ml=!1;break a}break;case 5:pl=c.stateNode,ml=!1;break a;case 3:case 4:pl=c.stateNode.containerInfo,ml=!0;break a}c=c.return}if(pl===null)throw Error(i(160));B(o,s,a),pl=null,ml=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sl(t,e),t=t.sibling}var xl=null;function Sl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bl(t,e),Cl(e),r&4&&(Jc(3,e,e.return),qc(3,e),Jc(5,e,e.return));break;case 1:bl(t,e),Cl(e),r&512&&(z||n===null||Qc(n,n.return)),r&64&&ol&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=xl;if(bl(t,e),Cl(e),r&512&&(z||n===null||Qc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[wt]||o[_t]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Bd(o,r,n),o[_t]=e,At(o),r=o;break a;case`link`:var s=Kf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Kf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[_t]=e,At(o),r=o}e.stateNode=r}else qf(a,e.type,e.stateNode)}else e.stateNode=Vf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&el(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?qf(a,e.type,e.stateNode):Vf(a,r,e.memoizedProps))}break;case 27:bl(t,e),Cl(e),r&512&&(z||n===null||Qc(n,n.return)),n!==null&&r&4&&el(e,e.memoizedProps,n.memoizedProps);break;case 5:if(bl(t,e),Cl(e),r&512&&(z||n===null||Qc(n,n.return)),e.flags&32){a=e.stateNode;try{nn(a,``)}catch(t){Xu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,el(e,a,n===null?a:n.memoizedProps)),r&1024&&(sl=!0);break;case 6:if(bl(t,e),Cl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Xu(e,e.return,t)}}break;case 3:if(Gf=null,a=xl,xl=xf(t.containerInfo),bl(t,e),xl=a,Cl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rp(t.containerInfo)}catch(t){Xu(e,e.return,t)}sl&&(sl=!1,wl(e));break;case 4:r=xl,xl=xf(e.stateNode.containerInfo),bl(t,e),Cl(e),xl=r;break;case 12:bl(t,e),Cl(e);break;case 31:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 13:bl(t,e),Cl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(cu=Ie()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=ol,d=z;if(ol=u||a,z=d||l,bl(t,e),z=d,ol=u,Cl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||ol||z||El(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Xu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Xu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?of(m,!0):of(l.stateNode,!1)}catch(e){Xu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,yl(e,n))));break;case 19:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 30:break;case 21:break;default:bl(t,e),Cl(e)}}function Cl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(tl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;il(e,nl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(nn(o,``),n.flags&=-33),il(e,nl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;rl(e,nl(e),s);break;default:throw Error(i(161))}}catch(t){Xu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Tl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dl(e,t.alternate,t),t=t.sibling}function El(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Jc(4,t,t.return),El(t);break;case 1:Qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Xc(t,t.return,n),El(t);break;case 27:vf(t.stateNode);case 26:case 5:Qc(t,t.return),El(t);break;case 22:t.memoizedState===null&&El(t);break;case 30:El(t);break;default:El(t)}e=e.sibling}}function Dl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Dl(i,a,n),qc(4,a);break;case 1:if(Dl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Xu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Qa(c[i],s)}catch(e){Xu(r,r.return,e)}}n&&o&64&&Yc(a),Zc(a,a.return);break;case 27:al(a);case 26:case 5:Dl(i,a,n),n&&r===null&&o&4&&$c(a),Zc(a,a.return);break;case 12:Dl(i,a,n);break;case 31:Dl(i,a,n),n&&o&4&&gl(i,a);break;case 13:Dl(i,a,n),n&&o&4&&_l(i,a);break;case 22:a.memoizedState===null&&Dl(i,a,n),Zc(a,a.return);break;case 30:break;default:Dl(i,a,n)}t=t.sibling}}function Ol(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&fa(n))}function kl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e))}function Al(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jl(e,t,n,r),t=t.sibling}function jl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Al(e,t,n,r),i&2048&&qc(9,t);break;case 1:Al(e,t,n,r);break;case 3:Al(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e)));break;case 12:if(i&2048){Al(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Xu(t,t.return,e)}}else Al(e,t,n,r);break;case 31:Al(e,t,n,r);break;case 13:Al(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Al(e,t,n,r):(a._visibility|=2,Ml(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Al(e,t,n,r):Nl(e,t),i&2048&&Ol(o,t);break;case 24:Al(e,t,n,r),i&2048&&kl(t.alternate,t);break;default:Al(e,t,n,r)}}function Ml(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ml(a,o,s,c,i),qc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ml(a,o,s,c,i)):u._visibility&2?Ml(a,o,s,c,i):Nl(a,o),i&&l&2048&&Ol(o.alternate,o);break;case 24:Ml(a,o,s,c,i),i&&l&2048&&kl(o.alternate,o);break;default:Ml(a,o,s,c,i)}t=t.sibling}}function Nl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Nl(n,r),i&2048&&Ol(r.alternate,r);break;case 24:Nl(n,r),i&2048&&kl(r.alternate,r);break;default:Nl(n,r)}t=t.sibling}}var Pl=8192;function Fl(e,t,n){if(e.subtreeFlags&Pl)for(e=e.child;e!==null;)Il(e,t,n),e=e.sibling}function Il(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Pl&&e.memoizedState!==null&&Xf(n,xl,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var r=xl;xl=xf(e.stateNode.containerInfo),Fl(e,t,n),xl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Pl,Pl=16777216,Fl(e,t,n),Pl=r):Fl(e,t,n));break;default:Fl(e,t,n)}}function Ll(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Vl(r,e)}Ll(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zl(e),e=e.sibling}function zl(e){switch(e.tag){case 0:case 11:case 15:Rl(e),e.flags&2048&&Jc(9,e,e.return);break;case 3:Rl(e);break;case 12:Rl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Bl(e)):Rl(e);break;default:Rl(e)}}function Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Vl(r,e)}Ll(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Jc(8,t,t.return),Bl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Bl(t));break;default:Bl(t)}e=e.sibling}}function Vl(e,t){for(;ll!==null;){var n=ll;switch(n.tag){case 0:case 11:case 15:Jc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ll=r;else a:for(n=e;ll!==null;){r=ll;var i=r.sibling,a=r.return;if(fl(r),r===n){ll=null;break a}if(i!==null){i.return=a,ll=i;break a}ll=a}}}var Hl={getCacheForType:function(e){var t=ia(ua),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ia(ua).controller.signal}},Ul=typeof WeakMap==`function`?WeakMap:Map,Wl=0,Gl=null,Kl=null,ql=0,Jl=0,V=null,Yl=!1,Xl=!1,Zl=!1,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=null,ou=null,su=!1,cu=0,lu=0,uu=1/0,du=null,fu=null,pu=0,mu=null,hu=null,gu=0,_u=0,vu=null,yu=null,bu=0,xu=null;function Su(){return Wl&2&&ql!==0?ql&-ql:D.T===null?mt():hd()}function Cu(){if(ru===0){if(!(ql&536870912)||I){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),ru=e}else ru=536870912}return e=ao.current,e!==null&&(e.flags|=32),ru}function wu(e,t,n){(e===Gl&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)&&(ju(e,0),Ou(e,ql,ru,!1)),st(e,n),(!(Wl&2)||e!==Gl)&&(e===Gl&&(!(Wl&2)&&(tu|=n),$l===4&&Ou(e,ql,ru,!1)),sd(e))}function Tu(e,t,n){if(Wl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||rt(e,t),a=r?zu(e,t):Lu(e,t,!0),o=r;do{if(a===0){Xl&&!r&&Ou(e,t,0,!1);break}if(n=e.current.alternate,o&&!Du(n)){a=Lu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=au;var l=c.current.memoizedState.isDehydrated;if(l&&(ju(c,s).flags|=256),s=Lu(c,s,!1),s!==2){if(Zl&&!l){c.errorRecoveryDisabledLanes|=o,tu|=o,a=4;break a}o=ou,ou=a,o!==null&&(ou===null?ou=o:ou.push.apply(ou,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ju(e,0),Ou(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Ou(r,t,ru,!Yl);break a;case 2:ou=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=cu+300-Ie(),10<a)){if(Ou(r,t,ru,!Yl),nt(r,0,!0)!==0)break a;gu=t,r.timeoutHandle=Qd(Eu.bind(null,r,n,ou,du,su,t,ru,tu,iu,Yl,o,`Throttled`,-0,0),a);break a}Eu(r,n,ou,du,su,t,ru,tu,iu,Yl,o,null,-0,0)}break}while(1);sd(e)}function Eu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dn},Il(t,a,d);var m=(a&62914560)===a?cu-Ie():(a&4194048)===a?lu-Ie():0;if(m=Qf(d,m),m!==null){gu=a,e.cancelPendingCommit=m(Wu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Ou(e,a,o,!l);return}}Wu(e,t,a,n,r,i,o,s,c)}function Du(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Or(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ou(e,t,n,r){t&=~nu,t&=~tu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&lt(e,n,t)}function ku(){return Wl&6?!0:(cd(0,!1),!1)}function Au(){if(Kl!==null){if(Jl===0)var e=Kl.return;else e=Kl,Xi=Yi=null,No(e),Pa=null,Fa=0,e=Kl;for(;e!==null;)Kc(e.alternate,e),e=e.return;Kl=null}}function ju(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$d(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gu=0,Au(),Gl=e,Kl=n=gi(e.current,null),ql=t,Jl=0,V=null,Yl=!1,Xl=rt(e,t),Zl=!1,iu=ru=nu=tu=eu=$l=0,ou=au=null,su=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Je(r),a=1<<i;t|=e[i],r&=~a}return Ql=t,oi(),n}function Mu(e,t){R=null,D.H=Us,t===wa||t===Ea?(t=Ma(),Jl=3):t===Ta?(t=Ma(),Jl=4):Jl=t===sc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,V=t,Kl===null&&($l=1,tc(e,wi(t,e.current)))}function Nu(){var e=ao.current;return e===null?!0:(ql&4194048)===ql?oo===null:(ql&62914560)===ql||ql&536870912?e===oo:!1}function Pu(){var e=D.H;return D.H=Us,e===null?Us:e}function Fu(){var e=D.A;return D.A=Hl,e}function Iu(){$l=4,Yl||(ql&4194048)!==ql&&ao.current!==null||(Xl=!0),!(eu&134217727)&&!(tu&134217727)||Gl===null||Ou(Gl,ql,ru,!1)}function Lu(e,t,n){var r=Wl;Wl|=2;var i=Pu(),a=Fu();(Gl!==e||ql!==t)&&(du=null,ju(e,t)),t=!1;var o=$l;a:do try{if(Jl!==0&&Kl!==null){var s=Kl,c=V;switch(Jl){case 8:Au(),o=6;break a;case 3:case 2:case 9:case 6:ao.current===null&&(t=!0);var l=Jl;if(Jl=0,V=null,Hu(e,s,c,l),n&&Xl){o=0;break a}break;default:l=Jl,Jl=0,V=null,Hu(e,s,c,l)}}Ru(),o=$l;break}catch(t){Mu(e,t)}while(1);return t&&e.shellSuspendCounter++,Xi=Yi=null,Wl=r,D.H=i,D.A=a,Kl===null&&(Gl=null,ql=0,oi()),o}function Ru(){for(;Kl!==null;)Vu(Kl)}function zu(e,t){var n=Wl;Wl|=2;var r=Pu(),a=Fu();Gl!==e||ql!==t?(du=null,uu=Ie()+500,ju(e,t)):Xl=rt(e,t);a:do try{if(Jl!==0&&Kl!==null){t=Kl;var o=V;b:switch(Jl){case 1:Jl=0,V=null,Hu(e,t,o,1);break;case 2:case 9:if(Oa(o)){Jl=0,V=null,H(t);break}t=function(){Jl!==2&&Jl!==9||Gl!==e||(Jl=7),sd(e)},o.then(t,t);break a;case 3:Jl=7;break a;case 4:Jl=5;break a;case 7:Oa(o)?(Jl=0,V=null,H(t)):(Jl=0,V=null,Hu(e,t,o,7));break;case 5:var s=null;switch(Kl.tag){case 26:s=Kl.memoizedState;case 5:case 27:var c=Kl;if(s?Yf(s):c.stateNode.complete){Jl=0,V=null;var l=c.sibling;if(l!==null)Kl=l;else{var u=c.return;u===null?Kl=null:(Kl=u,U(u))}break b}}Jl=0,V=null,Hu(e,t,o,5);break;case 6:Jl=0,V=null,Hu(e,t,o,6);break;case 8:Au(),$l=6;break a;default:throw Error(i(462))}}Bu();break}catch(t){Mu(e,t)}while(1);return Xi=Yi=null,D.H=r,D.A=a,Wl=n,Kl===null?(Gl=null,ql=0,oi(),$l):0}function Bu(){for(;Kl!==null&&!Pe();)Vu(Kl)}function Vu(e){var t=Lc(e.alternate,e,Ql);e.memoizedProps=e.pendingProps,t===null?U(e):Kl=t}function H(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=xc(n,t,t.pendingProps,t.type,void 0,ql);break;case 11:t=xc(n,t,t.pendingProps,t.type.render,t.ref,ql);break;case 5:No(t);default:Kc(n,t),t=Kl=_i(t,Ql),t=Lc(n,t,Ql)}e.memoizedProps=e.pendingProps,t===null?U(e):Kl=t}function Hu(e,t,n,r){Xi=Yi=null,No(t),Pa=null,Fa=0;var i=t.return;try{if(oc(e,i,t,n,ql)){$l=1,tc(e,wi(n,e.current)),Kl=null;return}}catch(t){if(i!==null)throw Kl=i,t;$l=1,tc(e,wi(n,e.current)),Kl=null;return}t.flags&32768?(I||r===1?e=!0:Xl||ql&536870912?e=!1:(Yl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ao.current,r!==null&&r.tag===13&&(r.flags|=16384))),Uu(t,e)):U(t)}function U(e){var t=e;do{if(t.flags&32768){Uu(t,Yl);return}e=t.return;var n=Wc(t.alternate,t,Ql);if(n!==null){Kl=n;return}if(t=t.sibling,t!==null){Kl=t;return}Kl=t=e}while(t!==null);$l===0&&($l=5)}function Uu(e,t){do{var n=Gc(e.alternate,e);if(n!==null){n.flags&=32767,Kl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Kl=e;return}Kl=e=n}while(e!==null);$l=6,Kl=null}function Wu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Ju();while(pu!==0);if(Wl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ai,ct(e,n,o,s,c,l),e===Gl&&(Kl=Gl=null,ql=0),hu=t,mu=e,gu=n,_u=o,vu=a,yu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,td(Be,function(){return G(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=D.T,D.T=null,a=le.p,le.p=2,s=Wl,Wl|=4;try{ul(e,t,n)}finally{Wl=s,le.p=a,D.T=r}}pu=1,Gu(),Ku(),qu()}}function Gu(){if(pu===1){pu=0;var e=mu,t=hu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=D.T,D.T=null;var r=le.p;le.p=2;var i=Wl;Wl|=4;try{Sl(t,e);var a=Gd,o=Nr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Mr(s.ownerDocument.documentElement,s)){if(c!==null&&Pr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=jr(s,h),v=jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}fp=!!Wd,Gd=Wd=null}finally{Wl=i,le.p=r,D.T=n}}e.current=t,pu=2}}function Ku(){if(pu===2){pu=0;var e=mu,t=hu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=D.T,D.T=null;var r=le.p;le.p=2;var i=Wl;Wl|=4;try{dl(e,t.alternate,t)}finally{Wl=i,le.p=r,D.T=n}}pu=3}}function qu(){if(pu===4||pu===3){pu=0,Fe();var e=mu,t=hu,n=gu,r=yu;t.subtreeFlags&10256||t.flags&10256?pu=5:(pu=0,hu=mu=null,W(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(fu=null),pt(n),t=t.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=D.T,i=le.p,le.p=2,D.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{D.T=t,le.p=i}}gu&3&&Ju(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===xu?bu++:(bu=0,xu=e):bu=0,cd(0,!1)}}function W(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fa(t)))}function Ju(){return Gu(),Ku(),qu(),G()}function G(){if(pu!==5)return!1;var e=mu,t=_u;_u=0;var n=pt(gu),r=D.T,a=le.p;try{le.p=32>n?32:n,D.T=null,n=vu,vu=null;var o=mu,s=gu;if(pu=0,hu=mu=null,gu=0,Wl&6)throw Error(i(331));var c=Wl;if(Wl|=4,zl(o.current),jl(o,o.current,s,n),Wl=c,cd(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{le.p=a,D.T=r,W(e,t)}}function Yu(e,t,n){t=wi(n,t),t=rc(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&(st(e,2),sd(e))}function Xu(e,t,n){if(e.tag===3)Yu(e,e,n);else for(;t!==null;){if(t.tag===3){Yu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(fu===null||!fu.has(r))){e=wi(n,e),n=ic(2),r=Ka(t,n,2),r!==null&&(ac(n,r,t,e),st(r,2),sd(r));break}}t=t.return}}function Zu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ul;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Zl=!0,i.add(n),e=Qu.bind(null,e,t,n),t.then(e,e))}function Qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gl===e&&(ql&n)===n&&($l===4||$l===3&&(ql&62914560)===ql&&300>Ie()-cu?!(Wl&2)&&ju(e,0):nu|=n,iu===ql&&(iu=0)),sd(e)}function $u(e,t){t===0&&(t=at()),e=li(e,t),e!==null&&(st(e,t),sd(e))}function ed(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$u(e,n)}function K(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),$u(e,n)}function td(e,t){return Me(e,t)}var nd=null,q=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==q&&e.next===null&&(q===null?nd=q=e:q=q.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=nd;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=ql,a=nt(r,r===Gl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,pd(r,a))}r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Zd()&&(e=od);for(var t=Ie(),n=null,r=nd;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?nd=i:n.next=i,i===null&&(q=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}pu!==0&&pu!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Gl,n=ql,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),pt(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=fd.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(pu!==0&&pu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ju()&&e.callbackNode!==n)return null;var r=ql;return r=nt(e,e===Gl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Tu(e,r,t),dd(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Ju())return null;Tu(e,t,!0)}function md(){tf(function(){Wl&6?Me(Re,ld):ud()})}function hd(){if(od===0){var e=ha;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:un(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);ks(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),ks(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<ei.length;yd++){var bd=ei[yd];ti(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}ti(Kr,`onAnimationEnd`),ti(qr,`onAnimationIteration`),ti(Jr,`onAnimationStart`),ti(`dblclick`,`onDoubleClick`),ti(`focusin`,`onFocus`),ti(`focusout`,`onBlur`),ti(Yr,`onTransitionRun`),ti(Xr,`onTransitionStart`),ti(Zr,`onTransitionCancel`),ti(Qr,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),Nt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Nt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Nt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Nt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`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(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ni(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ni(e)}i.currentTarget=null,a=c}}}}function wd(e,t){var n=t[bt];n===void 0&&(n=t[bt]=new Set);var r=e+`__bubble`;n.has(r)||(Od(t,e,2,!1),n.add(r))}function Td(e,t,n){var r=0;t&&(r|=4),Od(n,e,r,t)}var Ed=`_reactListening`+Math.random().toString(36).slice(2);function Dd(e){if(!e[Ed]){e[Ed]=!0,jt.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||Td(t,!1,e),Td(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Td(`selectionchange`,!1,t))}}function Od(e,t,n,r){switch(yp(t)){case 2:var i=pp;break;case 8:i=mp;break;default:i=hp}n=i.bind(null,t,n,e),i=void 0,!xn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function kd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Et(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}vn(function(){var r=a,i=pn(n),s=[];a:{var c=$r.get(e);if(c!==void 0){var l=Mn,u=e;switch(e){case`keypress`:if(Dn(n)===0)break a;case`keydown`:case`keyup`:l=Xn;break;case`focusin`:u=`focus`,l=Vn;break;case`focusout`:u=`blur`,l=Vn;break;case`beforeblur`:case`afterblur`:l=Vn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=zn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Qn;break;case Kr:case qr:case Jr:l=Hn;break;case Qr:l=$n;break;case`scroll`:case`scrollend`:l=Pn;break;case`wheel`:l=er;break;case`copy`:case`cut`:case`paste`:l=Un;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Zn;break;case`toggle`:case`beforetoggle`:l=tr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=yn(m,p),g!=null&&d.push(Ad(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==fn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[yt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?Et(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Ot(l),h=u==null?c:Ot(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Md,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Nd(s,c,l,d,!1),u!==null&&f!==null&&Nd(s,f,u,d,!0)}}a:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=gr;else if(dr(c)){if(_r)v=Er;else{v=wr;var y=Cr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&sn(r.elementType)&&(v=gr):v=Tr;if(v&&=v(e,r)){fr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Qt(c,`number`,c.value)}switch(y=r?Ot(r):window,e){case`focusin`:(dr(y)||y.contentEditable===`true`)&&(Ir=y,Lr=r,Rr=null);break;case`focusout`:Rr=Lr=Ir=null;break;case`mousedown`:zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:zr=!1,Br(s,n,i);break;case`selectionchange`:if(Fr)break;case`keydown`:case`keyup`:Br(s,n,i)}var b;if(nr)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else cr?sr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(ir&&n.locale!==`ko`&&(cr||x!==`onCompositionStart`?x===`onCompositionEnd`&&cr&&(b=En()):(Cn=i,wn=`value`in Cn?Cn.value:Cn.textContent,cr=!0)),y=jd(r,x),0<y.length&&(x=new Wn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=A(n),b!==null&&(x.data=b)))),(b=rr?j(e,n):lr(e,n))&&(x=jd(r,`onBeforeInput`),0<x.length&&(y=new Wn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function Ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=yn(e,n),i!=null&&r.unshift(Ad(e,i,a)),i=yn(e,t),i!=null&&r.push(Ad(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Md(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=yn(n,a),l!=null&&o.unshift(Ad(n,l,c))):i||(l=yn(n,a),l!=null&&o.push(Ad(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Pd=/\r\n?/g,Fd=/\u0000|\uFFFD/g;function Id(e){return(typeof e==`string`?e:``+e).replace(Pd,`
9
+ `).replace(Fd,``)}function Ld(e,t){return t=Id(t),Id(e)===t}function Rd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&nn(e,``+r);break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:on(e,r,o);break;case`data`:if(t!==`object`){Bt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Rd(e,t,`name`,a.name,a,null),Rd(e,t,`formEncType`,a.formEncType,a,null),Rd(e,t,`formMethod`,a.formMethod,a,null),Rd(e,t,`formTarget`,a.formTarget,a,null)):(Rd(e,t,`encType`,a.encType,a,null),Rd(e,t,`method`,a.method,a,null),Rd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=un(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:wd(`beforetoggle`,e),wd(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=cn.get(n)||n,zt(e,n,r))}}function zd(e,t,n,r,a,o){switch(n){case`style`:on(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&nn(e,``+r);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[vt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}}}function Bd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:wd(`error`,e),wd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,o,s,n,null)}}a&&Rd(e,t,`srcSet`,n.srcSet,n,null),r&&Rd(e,t,`src`,n.src,n,null);return;case`input`:wd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Rd(e,t,r,d,n,null)}}Zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in wd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Rd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&$t(e,!!r,n,!0):$t(e,!!r,t,!1);return;case`textarea`:for(s in wd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Rd(e,t,s,c,n,null)}tn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Rd(e,t,l,r,n,null)}return;case`dialog`:wd(`beforetoggle`,e),wd(`toggle`,e),wd(`cancel`,e),wd(`close`,e);break;case`iframe`:case`object`:wd(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)wd(xd[r],e);break;case`image`:wd(`error`,e),wd(`load`,e);break;case`details`:wd(`toggle`,e);break;case`embed`:case`source`:case`link`:wd(`error`,e),wd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,u,r,n,null)}return;default:if(sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&zd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Rd(e,t,c,r,n,null))}function Vd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Rd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Rd(e,t,p,m,r,f)}}Xt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Rd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Rd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?$t(e,!!n,n?[]:``,!1):$t(e,!!n,t,!0)):$t(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Rd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Rd(e,t,s,a,r,o)}en(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Rd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Rd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Rd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Rd(e,t,u,p,r,m)}return;default:if(sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&zd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||zd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Rd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Rd(e,t,f,p,r,m)}function Hd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ud(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Hd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Wd=null,Gd=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Jd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Yd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e!==Xd&&(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Rp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[wt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body)}n=i}while(n);Rp(t)}function of(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function sf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:sf(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[wt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function mf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var hf=null;function J(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _f(e,t,n){switch(t=Kd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=le.d;le.d={f:Cf,r:wf,D:Df,C:Of,L:kf,m:Af,X:Mf,S:jf,M:Nf};function Cf(){var e=Sf.f(),t=ku();return e||t}function wf(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?js(t):Sf.r(e)}var Tf=typeof document>`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=Yt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),At(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Yt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Yt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Yt(n.imageSizes)+`"]`)):i+=`[href="`+Yt(e)+`"]`;var a=i;switch(t){case`style`:a=Ff(e);break;case`script`:a=zf(e)}yf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(If(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),At(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Yt(r)+`"][href="`+Yt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!yf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),At(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=kt(r).hoistableStyles,a=Ff(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(If(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Uf(e,n);var c=o=r.createElement(`link`);At(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=kt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=m({src:e,async:!0},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),At(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=kt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),At(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=ve.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Ff(n.href),n=kt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Ff(n.href);var o=kt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(If(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Rf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=kt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ff(e){return`href="`+Yt(e)+`"`}function If(e){return`link[rel="stylesheet"][`+e+`]`}function Lf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Rf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),At(t),e.head.appendChild(t))}function zf(e){return`[src="`+Yt(e)+`"]`}function Bf(e){return`script[async]`+e}function Vf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Yt(n.href)+`"]`);if(r)return t.instance=r,At(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),Bd(r,`style`,a),Hf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ff(n.href);var o=e.querySelector(If(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Lf(n),(a=yf.get(a))&&Uf(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Hf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,At(a),a):(r=n,(a=yf.get(o))&&(r=m({},n),Wf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hf(r,n.precedence,e));return t.instance}function Hf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gf=null;function Kf(e,t,n){if(Gf===null){var r=new Map,i=Gf=new Map;i.set(n,r)}else i=Gf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[wt]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Yf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Ff(r.href),a=t.querySelector(If(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=$f.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Lf(r),(i=yf.get(i))&&Uf(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=$f.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Zf=0;function Qf(e,t){return e.stylesheets&&e.count===0&&tp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Zf===0&&(Zf=62500*Ud());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Zf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function $f(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ep=null;function tp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ep=new Map,t.forEach(np,e),ep=null,$f.call(e))}function np(e,t){if(!(t.state.loading&4)){var n=ep.get(e);if(n)var r=n.get(null);else{n=new Map,ep.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=$f.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var rp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function ip(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ap(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ip(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=mi(3,null,null,t),e.current=a,a.stateNode=e,t=da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ua(a),e}function op(e){return e?(e=fi,e):fi}function sp(e,t,n,r,i,a){i=op(i),r.context===null?r.context=i:r.pendingContext=i,r=Ga(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ka(e,r,t),n!==null&&(wu(n,e,t),qa(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function up(e){if(e.tag===13||e.tag===31){var t=li(e,67108864);t!==null&&wu(t,e,67108864),lp(e,67108864)}}function dp(e){if(e.tag===13||e.tag===31){var t=Su();t=ft(t);var n=li(e,t);n!==null&&wu(n,e,t),lp(e,t)}}var fp=!0;function pp(e,t,n,r){var i=D.T;D.T=null;var a=le.p;try{le.p=2,hp(e,t,n,r)}finally{le.p=a,D.T=i}}function mp(e,t,n,r){var i=D.T;D.T=null;var a=le.p;try{le.p=8,hp(e,t,n,r)}finally{le.p=a,D.T=i}}function hp(e,t,n,r){if(fp){var i=gp(r);if(i===null)kd(e,t,r,_p,n),Op(e,r);else if(Ap(i,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Dp.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}sd(a),!(Wl&6)&&(uu=Ie()+500,cd(0,!1))}}break;case 31:case 13:s=li(a,2),s!==null&&wu(s,a,2),ku(),lp(a,2)}if(a=gp(r),a===null&&kd(e,t,r,_p,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else kd(e,t,r,null,n)}}function gp(e){return e=pn(e),vp(e)}var _p=null;function vp(e){if(_p=null,e=Et(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _p=e,null}function yp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var bp=!1,xp=null,Sp=null,Cp=null,wp=new Map,Tp=new Map,Ep=[],Dp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Op(e,t){switch(e){case`focusin`:case`focusout`:xp=null;break;case`dragenter`:case`dragleave`:Sp=null;break;case`mouseover`:case`mouseout`:Cp=null;break;case`pointerover`:case`pointerout`:wp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Tp.delete(t.pointerId)}}function kp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dt(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ap(e,t,n,r,i){switch(t){case`focusin`:return xp=kp(xp,e,t,n,r,i),!0;case`dragenter`:return Sp=kp(Sp,e,t,n,r,i),!0;case`mouseover`:return Cp=kp(Cp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return wp.set(a,kp(wp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Tp.set(a,kp(Tp.get(a)||null,e,t,n,r,i)),!0}return!1}function jp(e){var t=Et(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ht(e.priority,function(){dp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ht(e.priority,function(){dp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fn=r,n.target.dispatchEvent(r),fn=null}else return t=Dt(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function Np(e,t,n){Mp(e)&&n.delete(t)}function Pp(){bp=!1,xp!==null&&Mp(xp)&&(xp=null),Sp!==null&&Mp(Sp)&&(Sp=null),Cp!==null&&Mp(Cp)&&(Cp=null),wp.forEach(Np),Tp.forEach(Np)}function Fp(e,n){e.blockedOn===n&&(e.blockedOn=null,bp||(bp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Pp)))}var Ip=null;function Lp(e){Ip!==e&&(Ip=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ip===e&&(Ip=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(vp(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Rp(e){function t(t){return Fp(t,e)}xp!==null&&Fp(xp,e),Sp!==null&&Fp(Sp,e),Cp!==null&&Fp(Cp,e),wp.forEach(t),Tp.forEach(t);for(var n=0;n<Ep.length;n++){var r=Ep[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ep.length&&(n=Ep[0],n.blockedOn===null);)jp(n),n.blockedOn===null&&Ep.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||Lp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(vp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Lp(n)}}}function zp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Bp(e){this._internalRoot=e}Vp.prototype.render=Bp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;sp(n,Su(),e,t,null,null)},Vp.prototype.unmount=Bp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sp(e.current,2,null,e,null,null),ku(),t[yt]=null}};function Vp(e){this._internalRoot=e}Vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ep.length&&t!==0&&t<Ep[n].priority;n++);Ep.splice(n,0,e),n===0&&jp(e)}};var Hp=n.version;if(Hp!==`19.2.8`)throw Error(i(527,Hp,`19.2.8`));le.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Up={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:D,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wp.isDisabled&&Wp.supportsFiber)try{Ge=Wp.inject(Up),Ke=Wp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Qs,s=$s,c=ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ap(e,1,!1,null,null,n,r,null,o,s,c,zp),e[yt]=t.current,Dd(e),new Bp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=`modulepreload`,y=function(e){return`/`+e},b={},x=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=y(t,n),t=s(t),t in b)return;b[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:v,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},S=l(d(),1),C=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,w=/^[\\/]{2}/;function T(e,t){return t+e.replace(/\\/g,`/`)}var ee=`popstate`;function te(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ne(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return oe(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:se(t)}return D(t,n,null,e)}function E(e,t){if(e===!1||e==null)throw Error(t)}function re(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ie(){return Math.random().toString(36).substring(2,10)}function ae(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function oe(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?ce(t):t,state:n,key:t&&t.key||r||ie(),mask:i}}function se({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function ce(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function D(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=te(e)?e:oe(h.location,e,t);n&&n(r,e),l=u()+1;let d=ae(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=te(e)?e:oe(h.location,e,t);n&&n(r,e),l=u();let i=ae(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return le(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ee,d),c=e,()=>{i.removeEventListener(ee,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function le(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),E(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:se(t);return i=i.replace(/ $/,`%20`),!n&&w.test(i)&&(i=r+i),new URL(i,r)}function ue(e,t,n=`/`){return de(e,t,n,!1)}function de(e,t,n,r,i){let a=Ae((typeof t==`string`?ce(t):t).pathname||`/`,n);if(a==null)return null;let o=i??fe(e),s=null,c=ke(a);for(let e=0;s==null&&e<o.length;++e)s=Te(o[e],c,r);return s}function fe(e){let t=pe(e);return he(t),t}function pe(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;E(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Re([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(E(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),pe(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ce(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Oe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of me(e.path))a(e,t,!0,n)}),t}function me(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=me(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function he(e){e.sort((e,t)=>e.score===t.score?we(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ge=/^:[\w-]+$/,_e=3,ve=2,ye=1,be=10,xe=-2,Se=e=>e===`*`;function Ce(e,t){let n=e.split(`/`),r=n.length;return n.some(Se)&&(r+=xe),t&&(r+=ve),n.filter(e=>!Se(e)).reduce((e,t)=>e+(ge.test(t)?_e:t===``?ye:be),r)}function we(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Te(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?De(u,l,s.matcher,s.compiledParams):Ee(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ee({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Re([a,d.pathname]),pathnameBase:Be(Re([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Re([a,d.pathnameBase]))}return o}function Ee(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Oe(e.path,e.caseSensitive,e.end);return De(e,t,n,r)}function De(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=ze(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=ze(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Oe(e,t=!1,n=!0){re(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ke(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return re(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ae(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function je(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ce(e):e,a;return n?(n=Le(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Me(n.substring(1),`/`):Me(n,t)):a=t,{pathname:a,search:Ve(r),hash:He(i)}}function Me(e,t){let n=ze(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ne(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Pe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Fe(e){let t=Pe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ie(e,t,n,r=!1){let i;typeof e==`string`?i=ce(e):(i={...e},E(!i.pathname||!i.pathname.includes(`?`),Ne(`?`,`pathname`,`search`,i)),E(!i.pathname||!i.pathname.includes(`#`),Ne(`#`,`pathname`,`hash`,i)),E(!i.search||!i.search.includes(`#`),Ne(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=je(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Le=e=>e.replace(/[\\/]{2,}/g,`/`),Re=e=>Le(e.join(`/`));function ze(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Be=e=>ze(e).replace(/^\/*/,`/`),Ve=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,He=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ue=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function We(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ge(e){return Re(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ke=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function qe(e,t){let n=e;if(typeof n!=`string`||!C.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ke)try{let e=new URL(window.location.href),r=w.test(n)?new URL(T(n,e.protocol)):new URL(n),a=Ae(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{re(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Je=new URL(`http://localhost`);function Ye(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Je)}catch{return Je}}function Xe(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Ze(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Qe(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Xe(i,n),s=!Xe(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Ze(e,i)||!Xe(i,a)))throw Error(`External navigation is not allowed`)}var $e=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set($e);var et=[`GET`,...$e];new Set(et);var tt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function nt(e){try{return tt.includes(new URL(e).protocol)}catch{return!1}}var rt=S.createContext(null);rt.displayName=`DataRouter`;var it=S.createContext(null);it.displayName=`DataRouterState`;var at=S.createContext(!1);function ot(){return S.useContext(at)}var st=S.createContext({isTransitioning:!1});st.displayName=`ViewTransition`;var ct=S.createContext(new Map);ct.displayName=`Fetchers`;var lt=S.createContext(null);lt.displayName=`Await`;var ut=S.createContext(null);ut.displayName=`Navigation`;var dt=S.createContext(null);dt.displayName=`Location`;var ft=S.createContext({outlet:null,matches:[],isDataRoute:!1});ft.displayName=`Route`;var pt=S.createContext(null);pt.displayName=`RouteError`;var mt=`REACT_ROUTER_ERROR`,ht=`REDIRECT`,gt=`ROUTE_ERROR_RESPONSE`;function _t(e){if(e.startsWith(`${mt}:${ht}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function vt(e){if(e.startsWith(`${mt}:${gt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ue(t.status,t.statusText,t.data)}catch{}}function yt(e,{relative:t}={}){E(bt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=S.useContext(ut),{hash:i,pathname:a,search:o}=Dt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Re([n,a])),r.createHref({pathname:s,search:o,hash:i})}function bt(){return S.useContext(dt)!=null}function xt(){return E(bt(),`useLocation() may be used only in the context of a <Router> component.`),S.useContext(dt).location}var St=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Ct(e){S.useContext(ut).static||S.useLayoutEffect(e)}function wt(){let{isDataRoute:e}=S.useContext(ft);return e?Wt():Tt()}function Tt(){E(bt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=S.useContext(rt),{basename:t,navigator:n}=S.useContext(ut),{matches:r}=S.useContext(ft),{pathname:i}=xt(),a=JSON.stringify(Fe(r)),o=S.useRef(!1);return Ct(()=>{o.current=!0}),S.useCallback((r,s={})=>{if(re(o.current,St),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Ie(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Re([t,c.pathname])),Qe(typeof r==`string`?r:se(r),n.createHref(c),Ye(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}S.createContext(null);function Et(){let{matches:e}=S.useContext(ft);return e[e.length-1]?.params??{}}function Dt(e,{relative:t}={}){let{matches:n}=S.useContext(ft),{pathname:r}=xt(),i=JSON.stringify(Fe(n));return S.useMemo(()=>Ie(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Ot(e,t){return kt(e,t)}function kt(e,t,n){E(bt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=S.useContext(ut),{matches:i}=S.useContext(ft),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Kt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) 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.
10
+
11
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=xt(),d;if(t){let e=typeof t==`string`?ce(t):t;E(c===`/`||e.pathname?.startsWith(c),`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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ue(e,{pathname:p});re(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),re(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 h=It(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Re([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Re([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?S.createElement(dt.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function At(){let e=Ut(),t=We(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=S.createElement(S.Fragment,null,S.createElement(`p`,null,`💿 Hey developer 👋`),S.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,S.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,S.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),S.createElement(S.Fragment,null,S.createElement(`h2`,null,`Unexpected Application Error!`),S.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?S.createElement(`pre`,{style:i},n):null,o)}var jt=S.createElement(At,null),Mt=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=vt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:S.createElement(ft.Provider,{value:this.props.routeContext},S.createElement(pt.Provider,{value:e,children:this.props.component}));return this.context?S.createElement(Pt,{error:e},t):t}};Mt.contextType=at;var Nt=new WeakMap;function Pt({children:e,error:t}){let{basename:n,navigator:r}=S.useContext(ut);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=_t(t.digest);if(e){let i=Nt.get(t);if(i)throw i;let a=qe(e.location,n),o=a.absoluteURL||a.to;if(Qe(e.location,o,Ye(r),`allow-explicit`),nt(o))throw Error(`Invalid redirect location`);if(Ke&&!Nt.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Nt.set(t,n),n}}return S.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Ft({routeContext:e,match:t,children:n}){let r=S.useContext(rt);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(ft.Provider,{value:e},n)}function It(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);E(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ge(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||jt,o&&(s<0&&c===0?(Kt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?S.createElement(n.route.Component,null):n.route.element?n.route.element:e,S.createElement(Ft,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?S.createElement(Mt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Lt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rt(e){let t=S.useContext(rt);return E(t,Lt(e)),t}function zt(e){let t=S.useContext(it);return E(t,Lt(e)),t}function Bt(e){let t=S.useContext(ft);return E(t,Lt(e)),t}function Vt(e){let t=Bt(e),n=t.matches[t.matches.length-1];return E(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ht(){return Vt(`useRouteId`)}function Ut(){let e=S.useContext(pt),t=zt(`useRouteError`),n=Vt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Wt(){let{router:e}=Rt(`useNavigate`),t=Vt(`useNavigate`),n=S.useRef(!1);return Ct(()=>{n.current=!0}),S.useCallback(async(r,i={})=>{re(n.current,St),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Gt={};function Kt(e,t,n){!t&&!Gt[e]&&(Gt[e]=!0,re(!1,n))}S.memo(qt);function qt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return kt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Jt(e){E(!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 Yt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){E(!bt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=S.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=ce(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=S.useMemo(()=>{let e=Ae(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return re(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:S.createElement(ut.Provider,{value:c},S.createElement(dt.Provider,{children:t,value:h}))}function Xt({children:e,location:t}){return Ot(Zt(e),t)}S.Component;function Zt(e,t=[]){let n=[];return S.Children.forEach(e,(e,r)=>{if(!S.isValidElement(e))return;let i=[...t,r];if(e.type===S.Fragment){n.push.apply(n,Zt(e.props.children,i));return}E(e.type===Jt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Zt(e.props.children,i)),n.push(a)}),n}var Qt=`get`,$t=`application/x-www-form-urlencoded`;function en(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function tn(e){return en(e)&&e.tagName.toLowerCase()===`button`}function nn(e){return en(e)&&e.tagName.toLowerCase()===`form`}function rn(e){return en(e)&&e.tagName.toLowerCase()===`input`}function an(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function on(e,t){return e.button===0&&(!t||t===`_self`)&&!an(e)}var sn=null;function cn(){if(sn===null)try{new FormData(document.createElement(`form`),0),sn=!1}catch{sn=!0}return sn}var ln=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function un(e){return e!=null&&!ln.has(e)?(re(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$t}"`),null):e}function dn(e,t){let n,r,i,a,o;if(nn(e)){let o=e.getAttribute(`action`);r=o?Ae(o,t):null,n=e.getAttribute(`method`)||Qt,i=un(e.getAttribute(`enctype`))||$t,a=new FormData(e)}else if(tn(e)||rn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ae(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Qt,i=un(e.getAttribute(`formenctype`))||un(o.getAttribute(`enctype`))||$t,a=new FormData(o,e),!cn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(en(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Qt,r=null,i=$t,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function fn(e,t){if(e===!1||e==null)throw Error(t)}function pn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Ae(i.pathname,t)===`/`?`${ze(t)}/_root.${r}`:`${ze(i.pathname)}.${r}`,i}async function mn(e,t){if(e.id in t)return t[e.id];try{let n=await x(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function hn(e){return e!=null&&typeof e.page==`string`}function gn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function _n(e,t,n){return Sn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await mn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(gn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function vn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function yn(e,t,{includeHydrateFallback:n}={}){return bn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function bn(e){return[...new Set(e)]}function xn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Sn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!hn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(xn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Cn(){let e=S.useContext(rt);return fn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function wn(){let e=S.useContext(it);return fn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Tn=S.createContext(void 0);Tn.displayName=`FrameworkContext`;function En(){let e=S.useContext(Tn);return fn(e,`You must render this element inside a <HydratedRouter> element`),e}function Dn(e,t){let n=S.useContext(Tn),[r,i]=S.useState(!1),[a,o]=S.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=S.useRef(null);S.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),S.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:On(s,p),onBlur:On(c,m),onMouseEnter:On(l,p),onMouseLeave:On(u,m),onTouchStart:On(d,p)}]:[a,f,{}]:[!1,f,{}]}function On(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function kn({page:e,...t}){let n=ot(),{nonce:r}=En(),{router:i}=Cn(),a=S.useMemo(()=>ue(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?S.createElement(jn,{page:e,matches:a,...t}):S.createElement(Mn,{page:e,matches:a,...t})):null}function An(e){let{manifest:t,routeModules:n}=En(),[r,i]=S.useState([]);return S.useEffect(()=>{let r=!1;return _n(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function jn({page:e,matches:t,...n}){let r=xt(),{future:i}=En(),{basename:a}=Cn(),o=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=pn(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return S.createElement(S.Fragment,null,o.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Mn({page:e,matches:t,...n}){let r=xt(),{future:i,manifest:a,routeModules:o}=En(),{basename:s}=Cn(),{loaderData:c,matches:l}=wn(),u=S.useMemo(()=>vn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=S.useMemo(()=>vn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=pn(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=S.useMemo(()=>yn(d,a),[d,a]),m=An(d);return S.createElement(S.Fragment,null,f.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>S.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>S.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Nn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}S.Component;var Pn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Pn&&(window.__reactRouterVersion=`7.18.3`)}catch{}function Fn({basename:e,children:t,useTransitions:n,window:r}){let i=S.useRef();i.current??=ne({window:r,v5Compat:!0});let a=i.current,[o,s]=S.useState({action:a.action,location:a.location}),c=S.useCallback(e=>{n===!1?s(e):S.startTransition(()=>s(e))},[n]);return S.useLayoutEffect(()=>a.listen(c),[a,c]),S.createElement(Yt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var In=S.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=S.useContext(ut),v=typeof l==`string`&&C.test(l),y=qe(l,h);l=y.to;let b=yt(l,{relative:r}),x=xt(),w=null;if(o){let e=Ie(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Re([h,e.pathname])),w=g.createHref(e)}let[T,ee,te]=Dn(n,p),ne=Vn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function E(t){e&&e(t),t.defaultPrevented||ne(t)}let re=!(y.isExternal||i),ie=S.createElement(`a`,{...p,...te,href:(re?w:void 0)||y.absoluteURL||b,onClick:re?E:e,ref:Nn(m,ee),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return T&&!v?S.createElement(S.Fragment,null,ie,S.createElement(kn,{page:b})):ie});In.displayName=`Link`;var Ln=S.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Dt(a,{relative:c.relative}),d=xt(),f=S.useContext(it),{navigator:p,basename:m}=S.useContext(ut),h=f!=null&&Kn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Ae(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:x,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(C):i;return S.createElement(In,{...c,"aria-current":w,className:T,ref:l,style:ee,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Ln.displayName=`NavLink`;var Rn=S.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Qt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=S.useContext(ut),g=Wn(),_=Gn(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&C.test(s);return S.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?S.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Rn.displayName=`Form`;function zn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bn(e){let t=S.useContext(rt);return E(t,zn(e)),t}function Vn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=wt(),d=xt(),f=Dt(e,{relative:o});return S.useCallback(p=>{if(on(p,t)){p.preventDefault();let t=n===void 0?se(d)===se(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?S.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Hn=0,Un=()=>`__${String(++Hn)}__`;function Wn(){let{router:e}=Bn(`useSubmit`),{basename:t}=S.useContext(ut),n=Ht(),r=e.fetch,i=e.navigate;return S.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=dn(e,t);if(a.navigate===!1){let e=a.fetcherKey||Un();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Gn(e,{relative:t}={}){let{basename:n}=S.useContext(ut),r=S.useContext(ft);E(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Dt(e||`.`,{relative:t})},o=xt();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Re([n,a.pathname])),se(a)}function Kn(e,{relative:t}={}){let n=S.useContext(st);E(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Bn(`useViewTransitionState`),i=Dt(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ae(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ae(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ee(i.pathname,o)!=null||Ee(i.pathname,a)!=null}var qn=[];for(let e=0;e<256;++e)qn.push((e+256).toString(16).slice(1));function Jn(e,t=0){return(qn[e[t+0]]+qn[e[t+1]]+qn[e[t+2]]+qn[e[t+3]]+`-`+qn[e[t+4]]+qn[e[t+5]]+`-`+qn[e[t+6]]+qn[e[t+7]]+`-`+qn[e[t+8]]+qn[e[t+9]]+`-`+qn[e[t+10]]+qn[e[t+11]]+qn[e[t+12]]+qn[e[t+13]]+qn[e[t+14]]+qn[e[t+15]]).toLowerCase()}var Yn,Xn=new Uint8Array(16);function Zn(){if(!Yn){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Yn=crypto.getRandomValues.bind(crypto)}return Yn(Xn)}var Qn={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function $n(e,t,n){if(Qn.randomUUID&&!t&&!e)return Qn.randomUUID();e||={};let r=e.random??e.rng?.()??Zn();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Jn(r)}var er;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(er||={});var tr;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(tr||={});var O=er.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),nr=e=>{switch(typeof e){case`undefined`:return O.undefined;case`string`:return O.string;case`number`:return Number.isNaN(e)?O.nan:O.number;case`boolean`:return O.boolean;case`function`:return O.function;case`bigint`:return O.bigint;case`symbol`:return O.symbol;case`object`:return Array.isArray(e)?O.array:e===null?O.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?O.promise:typeof Map<`u`&&e instanceof Map?O.map:typeof Set<`u`&&e instanceof Set?O.set:typeof Date<`u`&&e instanceof Date?O.date:O.object;default:return O.unknown}},k=er.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),rr=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,er.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};rr.create=e=>new rr(e);var ir=(e,t)=>{let n;switch(e.code){case k.invalid_type:n=e.received===O.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case k.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,er.jsonStringifyReplacer)}`;break;case k.unrecognized_keys:n=`Unrecognized key(s) in object: ${er.joinValues(e.keys,`, `)}`;break;case k.invalid_union:n=`Invalid input`;break;case k.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${er.joinValues(e.options)}`;break;case k.invalid_enum_value:n=`Invalid enum value. Expected ${er.joinValues(e.options)}, received '${e.received}'`;break;case k.invalid_arguments:n=`Invalid function arguments`;break;case k.invalid_return_type:n=`Invalid function return type`;break;case k.invalid_date:n=`Invalid date`;break;case k.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:er.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case k.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case k.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case k.custom:n=`Invalid input`;break;case k.invalid_intersection_types:n=`Intersection results could not be merged`;break;case k.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case k.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,er.assertNever(e)}return{message:n}},ar=ir;function or(){return ar}var sr=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function A(e,t){let n=or(),r=sr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ir?void 0:ir].filter(e=>!!e)});e.common.issues.push(r)}var cr=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return j;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return j;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},j=Object.freeze({status:`aborted`}),lr=e=>({status:`dirty`,value:e}),ur=e=>({status:`valid`,value:e}),dr=e=>e.status===`aborted`,fr=e=>e.status===`dirty`,pr=e=>e.status===`valid`,mr=e=>typeof Promise<`u`&&e instanceof Promise,M;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(M||={});var hr=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},gr=(e,t)=>{if(pr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new rr(e.common.issues);return this._error=t,this._error}}};function _r(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var vr=class{get description(){return this._def.description}_getType(e){return nr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new cr,ctx:{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(mr(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)};return gr(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return pr(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>pr(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},r=this._parse({data:e,path:n.path,parent:n});return gr(n,await(mr(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:k.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new xi({schema:this,typeName:N.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Si.create(this,this._def)}nullable(){return Ci.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ni.create(this)}promise(){return bi.create(this,this._def)}or(e){return ai.create([this,e],this._def)}and(e){return li.create(this,e,this._def)}transform(e){return new xi({..._r(this._def),schema:this,typeName:N.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new wi({..._r(this._def),innerType:this,defaultValue:t,typeName:N.ZodDefault})}brand(){return new Di({typeName:N.ZodBranded,type:this,..._r(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Ti({..._r(this._def),innerType:this,catchValue:t,typeName:N.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Oi.create(this,e)}readonly(){return ki.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yr=/^c[^\s-]{8,}$/i,br=/^[0-9a-z]+$/,xr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Sr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Cr=/^[a-z0-9_-]{21}$/i,wr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Er=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dr=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Or,kr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ar=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,jr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Mr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fr=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Ir=RegExp(`^${Fr}$`);function Lr(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Rr(e){return RegExp(`^${Lr(e)}$`)}function zr(e){let t=`${Fr}T${Lr(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Br(e,t){return!!((t===`v4`||!t)&&kr.test(e)||(t===`v6`||!t)&&jr.test(e))}function Vr(e,t){if(!wr.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Hr(e,t){return!!((t===`v4`||!t)&&Ar.test(e)||(t===`v6`||!t)&&Mr.test(e))}var Ur=class e extends vr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==O.string){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.string,received:t.parsedType}),j}let t=new cr,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:k.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:k.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?A(n,{code:k.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&A(n,{code:k.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Er.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`email`,code:k.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Or||=new RegExp(Dr,`u`),Or.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`emoji`,code:k.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Sr.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`uuid`,code:k.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Cr.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`nanoid`,code:k.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)yr.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`cuid`,code:k.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)br.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`cuid2`,code:k.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)xr.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`ulid`,code:k.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),A(n,{validation:`url`,code:k.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`regex`,code:k.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),A(n,{code:k.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),A(n,{code:k.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),A(n,{code:k.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?zr(r).test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:k.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Ir.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:k.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Rr(r).test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:k.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Tr.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`duration`,code:k.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Br(e.data,r.version)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`ip`,code:k.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Vr(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`jwt`,code:k.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Hr(e.data,r.version)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`cidr`,code:k.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Nr.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`base64`,code:k.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Pr.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:`base64url`,code:k.invalid_string,message:r.message}),t.dirty()):er.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:k.invalid_string,...M.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...M.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...M.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...M.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...M.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...M.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...M.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...M.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...M.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...M.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...M.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...M.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...M.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...M.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...M.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...M.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...M.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...M.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...M.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...M.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...M.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...M.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...M.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...M.errToObj(t)})}nonempty(e){return this.min(1,M.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Ur.create=e=>new Ur({checks:[],typeName:N.ZodString,coerce:e?.coerce??!1,..._r(e)});function Wr(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Gr=class e extends vr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==O.number){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.number,received:t.parsedType}),j}let t,n=new cr;for(let r of this._def.checks)r.kind===`int`?er.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),A(t,{code:k.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),A(t,{code:k.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),A(t,{code:k.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Wr(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),A(t,{code:k.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),A(t,{code:k.not_finite,message:r.message}),n.dirty()):er.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,M.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,M.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,M.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,M.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:M.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:M.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:M.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:M.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:M.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:M.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:M.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&er.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Gr.create=e=>new Gr({checks:[],typeName:N.ZodNumber,coerce:e?.coerce||!1,..._r(e)});var Kr=class e extends vr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==O.bigint)return this._getInvalidInput(e);let t,n=new cr;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),A(t,{code:k.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),A(t,{code:k.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),A(t,{code:k.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):er.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.bigint,received:t.parsedType}),j}gte(e,t){return this.setLimit(`min`,e,!0,M.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,M.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,M.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,M.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:M.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:M.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:M.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Kr.create=e=>new Kr({checks:[],typeName:N.ZodBigInt,coerce:e?.coerce??!1,..._r(e)});var qr=class extends vr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==O.boolean){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.boolean,received:t.parsedType}),j}return ur(e.data)}};qr.create=e=>new qr({typeName:N.ZodBoolean,coerce:e?.coerce||!1,..._r(e)});var Jr=class e extends vr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==O.date){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.date,received:t.parsedType}),j}if(Number.isNaN(e.data.getTime()))return A(this._getOrReturnCtx(e),{code:k.invalid_date}),j;let t=new cr,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:k.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:k.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):er.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:M.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:M.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Jr.create=e=>new Jr({checks:[],coerce:e?.coerce||!1,typeName:N.ZodDate,..._r(e)});var Yr=class extends vr{_parse(e){if(this._getType(e)!==O.symbol){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.symbol,received:t.parsedType}),j}return ur(e.data)}};Yr.create=e=>new Yr({typeName:N.ZodSymbol,..._r(e)});var Xr=class extends vr{_parse(e){if(this._getType(e)!==O.undefined){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.undefined,received:t.parsedType}),j}return ur(e.data)}};Xr.create=e=>new Xr({typeName:N.ZodUndefined,..._r(e)});var Zr=class extends vr{_parse(e){if(this._getType(e)!==O.null){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.null,received:t.parsedType}),j}return ur(e.data)}};Zr.create=e=>new Zr({typeName:N.ZodNull,..._r(e)});var Qr=class extends vr{constructor(){super(...arguments),this._any=!0}_parse(e){return ur(e.data)}};Qr.create=e=>new Qr({typeName:N.ZodAny,..._r(e)});var $r=class extends vr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ur(e.data)}};$r.create=e=>new $r({typeName:N.ZodUnknown,..._r(e)});var ei=class extends vr{_parse(e){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.never,received:t.parsedType}),j}};ei.create=e=>new ei({typeName:N.ZodNever,..._r(e)});var ti=class extends vr{_parse(e){if(this._getType(e)!==O.undefined){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.void,received:t.parsedType}),j}return ur(e.data)}};ti.create=e=>new ti({typeName:N.ZodVoid,..._r(e)});var ni=class e extends vr{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==O.array)return A(t,{code:k.invalid_type,expected:O.array,received:t.parsedType}),j;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(A(t,{code:e?k.too_big:k.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(A(t,{code:k.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(A(t,{code:k.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new hr(t,e,t.path,n)))).then(e=>cr.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new hr(t,e,t.path,n)));return cr.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:M.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:M.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:M.toString(n)}})}nonempty(e){return this.min(1,e)}};ni.create=(e,t)=>new ni({type:e,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,..._r(t)});function ri(e){if(e instanceof ii){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Si.create(ri(r))}return new ii({...e._def,shape:()=>t})}return e instanceof ni?new ni({...e._def,type:ri(e.element)}):e instanceof Si?Si.create(ri(e.unwrap())):e instanceof Ci?Ci.create(ri(e.unwrap())):e instanceof ui?ui.create(e.items.map(e=>ri(e))):e}var ii=class e extends vr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=er.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==O.object){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.object,received:t.parsedType}),j}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ei&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new hr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ei){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(A(n,{code:k.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new hr(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>cr.mergeObjectSync(t,e)):cr.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return M.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:M.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:N.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of er.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of er.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return ri(this)}partial(t){let n={};for(let e of er.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of er.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Si;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return _i(er.objectKeys(this.shape))}};ii.create=(e,t)=>new ii({shape:()=>e,unknownKeys:`strip`,catchall:ei.create(),typeName:N.ZodObject,..._r(t)}),ii.strictCreate=(e,t)=>new ii({shape:()=>e,unknownKeys:`strict`,catchall:ei.create(),typeName:N.ZodObject,..._r(t)}),ii.lazycreate=(e,t)=>new ii({shape:e,unknownKeys:`strip`,catchall:ei.create(),typeName:N.ZodObject,..._r(t)});var ai=class extends vr{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new rr(e.ctx.common.issues));return A(t,{code:k.invalid_union,unionErrors:n}),j}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new rr(e));return A(t,{code:k.invalid_union,unionErrors:i}),j}}get options(){return this._def.options}};ai.create=(e,t)=>new ai({options:e,typeName:N.ZodUnion,..._r(t)});var oi=e=>e instanceof hi?oi(e.schema):e instanceof xi?oi(e.innerType()):e instanceof gi?[e.value]:e instanceof vi?e.options:e instanceof yi?er.objectValues(e.enum):e instanceof wi?oi(e._def.innerType):e instanceof Xr?[void 0]:e instanceof Zr?[null]:e instanceof Si?[void 0,...oi(e.unwrap())]:e instanceof Ci?[null,...oi(e.unwrap())]:e instanceof Di||e instanceof ki?oi(e.unwrap()):e instanceof Ti?oi(e._def.innerType):[],si=class e extends vr{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==O.object)return A(t,{code:k.invalid_type,expected:O.object,received:t.parsedType}),j;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(A(t,{code:k.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=oi(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:N.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,..._r(r)})}};function ci(e,t){let n=nr(e),r=nr(t);if(e===t)return{valid:!0,data:e};if(n===O.object&&r===O.object){let n=er.objectKeys(t),r=er.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ci(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===O.array&&r===O.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ci(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}return n===O.date&&r===O.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var li=class extends vr{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(dr(e)||dr(r))return j;let i=ci(e.value,r.value);return i.valid?((fr(e)||fr(r))&&t.dirty(),{status:t.value,value:i.data}):(A(n,{code:k.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};li.create=(e,t,n)=>new li({left:e,right:t,typeName:N.ZodIntersection,..._r(n)});var ui=class e extends vr{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==O.array)return A(n,{code:k.invalid_type,expected:O.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return A(n,{code:k.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),j;!this._def.rest&&n.data.length>this._def.items.length&&(A(n,{code:k.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new hr(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>cr.mergeArray(t,e)):cr.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ui.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ui({items:e,typeName:N.ZodTuple,rest:null,..._r(t)})};var di=class e extends vr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==O.object)return A(n,{code:k.invalid_type,expected:O.object,received:n.parsedType}),j;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new hr(n,e,n.path,e)),value:a._parse(new hr(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?cr.mergeObjectAsync(t,r):cr.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof vr?new e({keyType:t,valueType:n,typeName:N.ZodRecord,..._r(r)}):new e({keyType:Ur.create(),valueType:t,typeName:N.ZodRecord,..._r(n)})}},fi=class extends vr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==O.map)return A(n,{code:k.invalid_type,expected:O.map,received:n.parsedType}),j;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new hr(n,e,n.path,[a,`key`])),value:i._parse(new hr(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return j;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return j;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};fi.create=(e,t,n)=>new fi({valueType:t,keyType:e,typeName:N.ZodMap,..._r(n)});var pi=class e extends vr{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==O.set)return A(n,{code:k.invalid_type,expected:O.set,received:n.parsedType}),j;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(A(n,{code:k.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(A(n,{code:k.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return j;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new hr(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:M.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:M.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};pi.create=(e,t)=>new pi({valueType:e,minSize:null,maxSize:null,typeName:N.ZodSet,..._r(t)});var mi=class e extends vr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==O.function)return A(t,{code:k.invalid_type,expected:O.function,received:t.parsedType}),j;function n(e,n){return sr({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,or(),ir].filter(e=>!!e),issueData:{code:k.invalid_arguments,argumentsError:n}})}function r(e,n){return sr({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,or(),ir].filter(e=>!!e),issueData:{code:k.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof bi){let e=this;return ur(async function(...t){let o=new rr([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return ur(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new rr([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new rr([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ui.create(t).rest($r.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||ui.create([]).rest($r.create()),returns:n||$r.create(),typeName:N.ZodFunction,..._r(r)})}},hi=class extends vr{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};hi.create=(e,t)=>new hi({getter:e,typeName:N.ZodLazy,..._r(t)});var gi=class extends vr{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return A(t,{received:t.data,code:k.invalid_literal,expected:this._def.value}),j}return{status:`valid`,value:e.data}}get value(){return this._def.value}};gi.create=(e,t)=>new gi({value:e,typeName:N.ZodLiteral,..._r(t)});function _i(e,t){return new vi({values:e,typeName:N.ZodEnum,..._r(t)})}var vi=class e extends vr{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return A(t,{expected:er.joinValues(n),received:t.parsedType,code:k.invalid_type}),j}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return A(t,{received:t.data,code:k.invalid_enum_value,options:n}),j}return ur(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};vi.create=_i;var yi=class extends vr{_parse(e){let t=er.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==O.string&&n.parsedType!==O.number){let e=er.objectValues(t);return A(n,{expected:er.joinValues(e),received:n.parsedType,code:k.invalid_type}),j}if(this._cache||=new Set(er.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=er.objectValues(t);return A(n,{received:n.data,code:k.invalid_enum_value,options:e}),j}return ur(e.data)}get enum(){return this._def.values}};yi.create=(e,t)=>new yi({values:e,typeName:N.ZodNativeEnum,..._r(t)});var bi=class extends vr{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==O.promise&&t.common.async===!1?(A(t,{code:k.invalid_type,expected:O.promise,received:t.parsedType}),j):ur((t.parsedType===O.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};bi.create=(e,t)=>new bi({type:e,typeName:N.ZodPromise,..._r(t)});var xi=class extends vr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{A(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return j;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?j:r.status===`dirty`||t.value===`dirty`?lr(r.value):r});{if(t.value===`aborted`)return j;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?j:r.status===`dirty`||t.value===`dirty`?lr(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?j:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?j:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!pr(e))return j;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>pr(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):j)}er.assertNever(r)}};xi.create=(e,t,n)=>new xi({schema:e,typeName:N.ZodEffects,effect:t,..._r(n)}),xi.createWithPreprocess=(e,t,n)=>new xi({schema:t,effect:{type:`preprocess`,transform:e},typeName:N.ZodEffects,..._r(n)});var Si=class extends vr{_parse(e){return this._getType(e)===O.undefined?ur(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Si.create=(e,t)=>new Si({innerType:e,typeName:N.ZodOptional,..._r(t)});var Ci=class extends vr{_parse(e){return this._getType(e)===O.null?ur(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ci.create=(e,t)=>new Ci({innerType:e,typeName:N.ZodNullable,..._r(t)});var wi=class extends vr{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===O.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};wi.create=(e,t)=>new wi({innerType:e,typeName:N.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,..._r(t)});var Ti=class extends vr{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return mr(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new rr(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new rr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ti.create=(e,t)=>new Ti({innerType:e,typeName:N.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,..._r(t)});var Ei=class extends vr{_parse(e){if(this._getType(e)!==O.nan){let t=this._getOrReturnCtx(e);return A(t,{code:k.invalid_type,expected:O.nan,received:t.parsedType}),j}return{status:`valid`,value:e.data}}};Ei.create=e=>new Ei({typeName:N.ZodNaN,..._r(e)});var Di=class extends vr{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Oi=class e extends vr{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?j:e.status===`dirty`?(t.dirty(),lr(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?j:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:N.ZodPipeline})}},ki=class extends vr{_parse(e){let t=this._def.innerType._parse(e),n=e=>(pr(e)&&(e.value=Object.freeze(e.value)),e);return mr(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};ki.create=(e,t)=>new ki({innerType:e,typeName:N.ZodReadonly,..._r(t)}),ii.lazycreate;var N;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(N||={});var P=Ur.create,Ai=Gr.create;Ei.create,Kr.create;var F=qr.create;Jr.create,Yr.create,Xr.create,Zr.create;var ji=Qr.create,Mi=$r.create;ei.create,ti.create;var Ni=ni.create,Pi=ii.create;ii.strictCreate;var Fi=ai.create,Ii=si.create;li.create,ui.create;var Li=di.create;fi.create,pi.create,mi.create,hi.create;var I=gi.create,Ri=vi.create,zi=yi.create;bi.create,xi.create,Si.create,Ci.create,xi.createWithPreprocess,Oi.create;var Bi=_(),Vi=Pi({name:P(),arguments:P()}),Hi=Pi({id:P(),type:I(`function`),function:Vi,encryptedValue:P().optional()}),Ui=Pi({id:P(),role:P(),content:P().optional(),name:P().optional(),encryptedValue:P().optional()}),Wi=Pi({type:I(`text`),text:P()}),Gi=Ii(`type`,[Pi({type:I(`data`),value:P(),mimeType:P()}),Pi({type:I(`url`),value:P(),mimeType:P().optional()})]),Ki=Pi({type:I(`image`),source:Gi,metadata:Mi().optional()}),qi=Pi({type:I(`audio`),source:Gi,metadata:Mi().optional()}),Ji=Pi({type:I(`video`),source:Gi,metadata:Mi().optional()}),Yi=Pi({type:I(`document`),source:Gi,metadata:Mi().optional()}),Xi=Pi({type:I(`binary`),mimeType:P(),id:P().optional(),url:P().optional(),data:P().optional(),filename:P().optional()}),Zi=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:k.custom,message:`BinaryInputContent requires at least one of id, url, or data.`,path:[`id`]})};Xi.superRefine((e,t)=>{Zi(e,t)});var Qi=Ii(`type`,[Wi,Ki,qi,Ji,Yi,Xi]).superRefine((e,t)=>{e.type===`binary`&&Zi(e,t)}),$i=Ii(`role`,[Ui.extend({role:I(`developer`),content:P()}),Ui.extend({role:I(`system`),content:P()}),Ui.extend({role:I(`assistant`),content:P().optional(),toolCalls:Ni(Hi).optional()}),Ui.extend({role:I(`user`),content:Fi([P(),Ni(Qi)])}),Pi({id:P(),content:P(),role:I(`tool`),toolCallId:P(),error:P().optional(),encryptedValue:P().optional()}),Pi({id:P(),role:I(`activity`),activityType:P(),content:Li(ji())}),Pi({id:P(),role:I(`reasoning`),content:P(),encryptedValue:P().optional()})]);Fi([I(`developer`),I(`system`),I(`assistant`),I(`user`),I(`tool`),I(`activity`),I(`reasoning`)]);var ea=Pi({description:P(),value:P()}),ta=Pi({name:P(),description:P(),parameters:ji(),metadata:Li(ji()).optional()}),na=Pi({id:P(),reason:P(),message:P().optional(),toolCallId:P().optional(),responseSchema:Li(ji()).optional(),expiresAt:P().optional(),metadata:Li(ji()).optional()}),ra=Pi({interruptId:P(),status:Ri([`resolved`,`cancelled`]),payload:ji().optional()}),ia=Pi({threadId:P(),runId:P(),parentRunId:P().optional(),state:ji(),messages:Ni($i),tools:Ni(ta),context:Ni(ea),forwardedProps:ji(),resume:Ni(ra).optional()}),aa=ji(),oa=class extends Error{constructor(e){super(e)}},sa=class extends oa{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}},ca=Pi({name:P(),description:P().optional()}),la=Pi({name:P().optional(),type:P().optional(),description:P().optional(),version:P().optional(),provider:P().optional(),documentationUrl:P().optional(),metadata:Li(Mi()).optional()}),ua=Pi({streaming:F().optional(),websocket:F().optional(),httpBinary:F().optional(),pushNotifications:F().optional(),resumable:F().optional()}),da=Pi({supported:F().optional(),items:Ni(ta).optional(),parallelCalls:F().optional(),clientProvided:F().optional()}),fa=Pi({structuredOutput:F().optional(),supportedMimeTypes:Ni(P()).optional()}),pa=Pi({snapshots:F().optional(),deltas:F().optional(),memory:F().optional(),persistentState:F().optional()}),ma=Pi({supported:F().optional(),delegation:F().optional(),handoffs:F().optional(),subAgents:Ni(ca).optional()}),ha=Pi({supported:F().optional(),streaming:F().optional(),encrypted:F().optional()}),ga=Pi({image:F().optional(),audio:F().optional(),video:F().optional(),pdf:F().optional(),file:F().optional()}),_a=Pi({image:F().optional(),audio:F().optional()}),va=Pi({input:ga.optional(),output:_a.optional()}),ya=Pi({codeExecution:F().optional(),sandboxed:F().optional(),maxIterations:Ai().optional(),maxExecutionTime:Ai().optional()}),ba=Pi({supported:F().optional(),approvals:F().optional(),interventions:F().optional(),feedback:F().optional(),interrupts:F().optional(),approveWithEdits:F().optional()});Pi({identity:la.optional(),transport:ua.optional(),tools:da.optional(),output:fa.optional(),state:pa.optional(),multiAgent:ma.optional(),reasoning:ha.optional(),multimodal:va.optional(),execution:ya.optional(),humanInTheLoop:ba.optional(),custom:Li(Mi()).optional()});var xa=Fi([I(`developer`),I(`system`),I(`assistant`),I(`user`)]),L=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.THINKING_START=`THINKING_START`,e.THINKING_END=`THINKING_END`,e.THINKING_TEXT_MESSAGE_START=`THINKING_TEXT_MESSAGE_START`,e.THINKING_TEXT_MESSAGE_CONTENT=`THINKING_TEXT_MESSAGE_CONTENT`,e.THINKING_TEXT_MESSAGE_END=`THINKING_TEXT_MESSAGE_END`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e}({}),Sa=Pi({type:zi(L),timestamp:Ai().optional(),rawEvent:ji().optional()}).passthrough(),Ca=Sa.extend({type:I(L.TEXT_MESSAGE_START),messageId:P(),role:xa.default(`assistant`),name:P().optional()}),wa=Sa.extend({type:I(L.TEXT_MESSAGE_CONTENT),messageId:P(),delta:P()}),Ta=Sa.extend({type:I(L.TEXT_MESSAGE_END),messageId:P()}),Ea=Sa.extend({type:I(L.TEXT_MESSAGE_CHUNK),messageId:P().optional(),role:xa.optional(),delta:P().optional(),name:P().optional()}),Da=Sa.extend({type:I(L.THINKING_TEXT_MESSAGE_START)}),Oa=wa.omit({messageId:!0,type:!0}).extend({type:I(L.THINKING_TEXT_MESSAGE_CONTENT)}),ka=Sa.extend({type:I(L.THINKING_TEXT_MESSAGE_END)}),Aa=Sa.extend({type:I(L.TOOL_CALL_START),toolCallId:P(),toolCallName:P(),parentMessageId:P().nullable().optional().transform(e=>e??void 0)}),ja=Sa.extend({type:I(L.TOOL_CALL_ARGS),toolCallId:P(),delta:P()}),Ma=Sa.extend({type:I(L.TOOL_CALL_END),toolCallId:P()}),Na=Sa.extend({messageId:P(),type:I(L.TOOL_CALL_RESULT),toolCallId:P(),content:P(),role:I(`tool`).optional()}),Pa=Sa.extend({type:I(L.TOOL_CALL_CHUNK),toolCallId:P().optional(),toolCallName:P().optional(),parentMessageId:P().nullable().optional().transform(e=>e??void 0),delta:P().optional()}),Fa=Sa.extend({type:I(L.THINKING_START),title:P().optional()}),Ia=Sa.extend({type:I(L.THINKING_END)}),La=Sa.extend({type:I(L.STATE_SNAPSHOT),snapshot:aa}),Ra=Sa.extend({type:I(L.STATE_DELTA),delta:Ni(ji())}),za=Sa.extend({type:I(L.MESSAGES_SNAPSHOT),messages:Ni($i)}),Ba=Sa.extend({type:I(L.ACTIVITY_SNAPSHOT),messageId:P(),activityType:P(),content:Li(ji()),replace:F().optional().default(!0)}),Va=Sa.extend({type:I(L.ACTIVITY_DELTA),messageId:P(),activityType:P(),patch:Ni(ji())}),Ha=Sa.extend({type:I(L.RAW),event:ji(),source:P().optional()}),Ua=Sa.extend({type:I(L.CUSTOM),name:P(),value:ji()}),Wa=Sa.extend({type:I(L.RUN_STARTED),threadId:P(),runId:P(),parentRunId:P().optional(),input:ia.optional()}),Ga=Ii(`type`,[Pi({type:I(`success`)}).strict(),Pi({type:I(`interrupt`),interrupts:Ni(na).min(1)}).strict()]),Ka=Pi({provider:P().optional(),model:P().optional(),inputTokens:Ai().int().nonnegative().optional(),outputTokens:Ai().int().nonnegative().optional(),totalTokens:Ai().int().nonnegative().optional(),reasoningTokens:Ai().int().nonnegative().optional(),cachedInputTokens:Ai().int().nonnegative().optional()}),qa=Sa.extend({type:I(L.RUN_FINISHED),threadId:P(),runId:P(),result:ji().optional(),outcome:Ga.nullable().optional().transform(e=>e??void 0),usage:Ni(Ka).optional()}),Ja=Sa.extend({type:I(L.RUN_ERROR),message:P(),code:P().optional(),usage:Ni(Ka).optional()}),Ya=Sa.extend({type:I(L.STEP_STARTED),stepName:P()}),Xa=Sa.extend({type:I(L.STEP_FINISHED),stepName:P()}),Za=Fi([I(`tool-call`),I(`message`)]),Qa=Ii(`type`,[Ca,wa,Ta,Ea,Fa,Ia,Da,Oa,ka,Aa,ja,Ma,Pa,Na,La,Ra,za,Ba,Va,Ha,Ua,Wa,qa,Ja,Ya,Xa,Sa.extend({type:I(L.REASONING_START),messageId:P()}),Sa.extend({type:I(L.REASONING_MESSAGE_START),messageId:P(),role:I(`reasoning`)}),Sa.extend({type:I(L.REASONING_MESSAGE_CONTENT),messageId:P(),delta:P()}),Sa.extend({type:I(L.REASONING_MESSAGE_END),messageId:P()}),Sa.extend({type:I(L.REASONING_MESSAGE_CHUNK),messageId:P().optional(),delta:P().optional()}),Sa.extend({type:I(L.REASONING_END),messageId:P()}),Sa.extend({type:I(L.REASONING_ENCRYPTED_VALUE),subtype:Za,entityId:P(),encryptedValue:P()})]),$a=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),eo=Object.prototype.hasOwnProperty;function to(e,t){return eo.call(e,t)}function no(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n<t.length;n++)t[n]=``+n;return t}if(Object.keys)return Object.keys(e);var r=[];for(var i in e)to(e,i)&&r.push(i);return r}function ro(e){switch(typeof e){case`object`:return JSON.parse(JSON.stringify(e));case`undefined`:return null;default:return e}}function io(e){for(var t=0,n=e.length,r;t<n;){if(r=e.charCodeAt(t),r>=48&&r<=57){t++;continue}return!1}return!0}function ao(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function oo(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function so(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(so(e[t]))return!0}else if(typeof e==`object`){for(var r=no(e),i=r.length,a=0;a<i;a++)if(so(e[r[a]]))return!0}}return!1}function co(e,t){var n=[e];for(var r in t){var i=typeof t[r]==`object`?JSON.stringify(t[r],null,2):t[r];i!==void 0&&n.push(r+`: `+i)}return n.join(`
12
+ `)}var lo=function(e){$a(t,e);function t(t,n,r,i,a){var o=this.constructor,s=e.call(this,co(t,{name:n,index:r,operation:i,tree:a}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=a,Object.setPrototypeOf(s,o.prototype),s.message=co(t,{name:n,index:r,operation:i,tree:a}),s}return t}(Error),uo=s({JsonPatchError:()=>fo,_areEquals:()=>xo,applyOperation:()=>go,applyPatch:()=>_o,applyReducer:()=>vo,deepClone:()=>po,getValueByPointer:()=>R,validate:()=>bo,validator:()=>yo}),fo=lo,po=ro,mo={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=R(n,this.path);r&&=ro(r);var i=go(n,{op:`remove`,path:this.from}).removed;return go(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=R(n,this.from);return go(n,{op:`add`,path:this.path,value:ro(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:xo(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},ho={add:function(e,t,n){return io(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:mo.move,copy:mo.copy,test:mo.test,_get:mo._get};function R(e,t){if(t==``)return e;var n={op:`_get`,path:t};return go(e,n),n.value}function go(e,t,n,r,i,a){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),a===void 0&&(a=0),n&&(typeof n==`function`?n(t,0,e,t.path):yo(t,0)),t.path===``){var o={newDocument:e};if(t.op===`add`)return o.newDocument=t.value,o;if(t.op===`replace`)return o.newDocument=t.value,o.removed=e,o;if(t.op===`move`||t.op===`copy`)return o.newDocument=R(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=xo(e,t.value),o.test===!1)throw new fo(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o.newDocument=e,o}if(t.op===`remove`)return o.removed=e,o.newDocument=null,o;if(t.op===`_get`)return t.value=e,o;if(n)throw new fo("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);return o}r||(e=ro(e));var s=(t.path||``).split(`/`),c=e,l=1,u=s.length,d=void 0,f=void 0,p=void 0;for(p=typeof n==`function`?n:yo;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=oo(f)),i&&(f==`__proto__`||f==`prototype`&&l>0&&s[l-1]==`constructor`))throw TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[f]===void 0?d=s.slice(0,l).join(`/`):l==u-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),l++,Array.isArray(c)){if(f===`-`)f=c.length;else if(n&&!io(f))throw new fo(`Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index`,`OPERATION_PATH_ILLEGAL_ARRAY_INDEX`,a,t,e);else io(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new fo(`The specified index MUST NOT be greater than the number of elements in the array`,`OPERATION_VALUE_OUT_OF_BOUNDS`,a,t,e);var o=ho[t.op].call(t,c,f,e);if(o.test===!1)throw new fo(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=mo[t.op].call(t,c,f,e);if(o.test===!1)throw new fo(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l<u&&(!c||typeof c!=`object`))throw new fo(`Cannot perform operation at the desired path`,`OPERATION_PATH_UNRESOLVABLE`,a,t,e)}}function _o(e,t,n,r,i){if(r===void 0&&(r=!0),i===void 0&&(i=!0),n&&!Array.isArray(t))throw new fo(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);r||(e=ro(e));for(var a=Array(t.length),o=0,s=t.length;o<s;o++)a[o]=go(e,t[o],n,!0,i,o),e=a[o].newDocument;return a.newDocument=e,a}function vo(e,t,n){var r=go(e,t);if(r.test===!1)throw new fo(`Test operation failed`,`TEST_OPERATION_FAILED`,n,t,e);return r.newDocument}function yo(e,t,n,r){if(typeof e!=`object`||!e||Array.isArray(e))throw new fo(`Operation is not an object`,`OPERATION_NOT_AN_OBJECT`,t,e,n);if(!mo[e.op])throw new fo("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,t,e,n);if(typeof e.path!=`string`)throw new fo("Operation `path` property is not a string",`OPERATION_PATH_INVALID`,t,e,n);if(e.path.indexOf(`/`)!==0&&e.path.length>0)throw new fo('Operation `path` property must start with "/"',`OPERATION_PATH_INVALID`,t,e,n);if((e.op===`move`||e.op===`copy`)&&typeof e.from!=`string`)throw new fo("Operation `from` property is not present (applicable in `move` and `copy` operations)",`OPERATION_FROM_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&e.value===void 0)throw new fo("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&so(e.value))throw new fo("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED`,t,e,n);if(n){if(e.op==`add`){var i=e.path.split(`/`).length,a=r.split(`/`).length;if(i!==a+1&&i!==a)throw new fo("Cannot perform an `add` operation at the desired path",`OPERATION_PATH_CANNOT_ADD`,t,e,n)}else if(e.op===`replace`||e.op===`remove`||e.op===`_get`){if(e.path!==r)throw new fo(`Cannot perform the operation at a path that does not exist`,`OPERATION_PATH_UNRESOLVABLE`,t,e,n)}else if(e.op===`move`||e.op===`copy`){var o=bo([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new fo(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function bo(e,t,n){try{if(!Array.isArray(e))throw new fo(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)_o(ro(t),ro(e),n||!0);else{n||=yo;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(e){if(e instanceof fo)return e;throw e}}function xo(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){var n=Array.isArray(e),r=Array.isArray(t),i,a,o;if(n&&r){if(a=e.length,a!=t.length)return!1;for(i=a;i--!==0;)if(!xo(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=Object.keys(e);if(a=s.length,a!==Object.keys(t).length)return!1;for(i=a;i--!==0;)if(!t.hasOwnProperty(s[i]))return!1;for(i=a;i--!==0;)if(o=s[i],!xo(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var So=s({compare:()=>No,generate:()=>jo,observe:()=>Ao,unobserve:()=>ko}),Co=new WeakMap,wo=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),To=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function Eo(e){return Co.get(e)}function Do(e,t){return e.observers.get(t)}function Oo(e,t){e.observers.delete(t.callback)}function ko(e,t){t.unobserve()}function Ao(e,t){var n=[],r,i=Eo(e);if(!i)i=new wo(e),Co.set(e,i);else{var a=Do(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=ro(e),t){r.callback=t,r.next=null;var o=function(){jo(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<`u`&&(window.addEventListener(`mouseup`,s),window.addEventListener(`keyup`,s),window.addEventListener(`mousedown`,s),window.addEventListener(`keydown`,s),window.addEventListener(`change`,s))}return r.patches=n,r.object=e,r.unobserve=function(){jo(r),clearTimeout(r.next),Oo(i,r),typeof window<`u`&&(window.removeEventListener(`mouseup`,s),window.removeEventListener(`keyup`,s),window.removeEventListener(`mousedown`,s),window.removeEventListener(`keydown`,s),window.removeEventListener(`change`,s))},i.observers.set(t,new To(t,r)),r}function jo(e,t){t===void 0&&(t=!1);var n=Co.get(e.object);Mo(n.value,e.object,e.patches,``,t),e.patches.length&&_o(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function Mo(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=no(t),o=no(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(to(t,l)&&(t[l]!==void 0||u===void 0||Array.isArray(t)!==!1)){var d=t[l];typeof u==`object`&&u&&typeof d==`object`&&d&&Array.isArray(u)===Array.isArray(d)?Mo(u,d,n,r+`/`+ao(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+ao(l),value:ro(u)}),n.push({op:`replace`,path:r+`/`+ao(l),value:ro(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+ao(l),value:ro(u)}),n.push({op:`remove`,path:r+`/`+ao(l)}),s=!0):(i&&n.push({op:`test`,path:r,value:e}),n.push({op:`replace`,path:r,value:t}))}if(!(!s&&a.length==o.length))for(var c=0;c<a.length;c++){var l=a[c];!to(e,l)&&t[l]!==void 0&&n.push({op:`add`,path:r+`/`+ao(l),value:ro(t[l])})}}}function No(e,t,n){n===void 0&&(n=!1);var r=[];return Mo(e,t,r,``,n),r}var Po=Object.assign({},uo,So,{JsonPatchError:lo,deepClone:ro,escapePathComponent:ao,unescapePathComponent:oo}),Fo=function(e,t){return Fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Fo(e,t)};function Io(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Fo(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Lo=function(){return Lo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Lo.apply(this,arguments)};function Ro(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function zo(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Bo(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Vo(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Ho(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Uo(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Wo(e){return this instanceof Wo?(this.v=e,this):new Wo(e)}function Go(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Wo?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Ko(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Vo==`function`?Vo(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function qo(e){return typeof e==`function`}function Jo(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Yo=Jo(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
13
+ `+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
14
+ `):``,this.name=`UnsubscriptionError`,this.errors=t}});function Xo(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Zo=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=Vo(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(qo(c))try{c()}catch(e){i=e instanceof Yo?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Vo(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{es(f)}catch(e){i??=[],e instanceof Yo?i=Uo(Uo([],Ho(i)),Ho(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new Yo(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)es(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Xo(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Xo(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),Qo=Zo.EMPTY;function $o(e){return e instanceof Zo||e&&`closed`in e&&qo(e.remove)&&qo(e.add)&&qo(e.unsubscribe)}function es(e){qo(e)?e():e.unsubscribe()}var ts={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ns={setTimeout:function(e,t){var n=[...arguments].slice(2),r=ns.delegate;return r?.setTimeout?r.setTimeout.apply(r,Uo([e,t],Ho(n))):setTimeout.apply(void 0,Uo([e,t],Ho(n)))},clearTimeout:function(e){return(ns.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function rs(e){ns.setTimeout(function(){var t=ts.onUnhandledError;if(t)t(e);else throw e})}function is(){}var as=(function(){return cs(`C`,void 0,void 0)})();function os(e){return cs(`E`,void 0,e)}function ss(e){return cs(`N`,e,void 0)}function cs(e,t,n){return{kind:e,value:t,error:n}}var ls=null;function us(e){if(ts.useDeprecatedSynchronousErrorHandling){var t=!ls;if(t&&(ls={errorThrown:!1,error:null}),e(),t){var n=ls,r=n.errorThrown,i=n.error;if(ls=null,r)throw i}}else e()}function ds(e){ts.useDeprecatedSynchronousErrorHandling&&ls&&(ls.errorThrown=!0,ls.error=e)}var fs=function(e){Io(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,$o(t)&&t.add(n)):n.destination=bs,n}return t.create=function(e,t,n){return new gs(e,t,n)},t.prototype.next=function(e){this.isStopped?ys(ss(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?ys(os(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?ys(as,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Zo),ps=Function.prototype.bind;function ms(e,t){return ps.call(e,t)}var hs=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){_s(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){_s(e)}else _s(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){_s(e)}},e}(),gs=function(e){Io(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(qo(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&ts.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&ms(t.next,o),error:t.error&&ms(t.error,o),complete:t.complete&&ms(t.complete,o)}):a=t}return i.destination=new hs(a),i}return t}(fs);function _s(e){ts.useDeprecatedSynchronousErrorHandling?ds(e):rs(e)}function vs(e){throw e}function ys(e,t){var n=ts.onStoppedNotification;n&&ns.setTimeout(function(){return n(e,t)})}var bs={closed:!0,next:is,error:vs,complete:is},xs=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function Ss(e){return e}function Cs(){return ws([...arguments])}function ws(e){return e.length===0?Ss:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var Ts=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Os(e)?e:new gs(e,t,n);return us(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Es(t),new t(function(t,r){var i=new gs({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[xs]=function(){return this},e.prototype.pipe=function(){return ws([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=Es(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Es(e){return e??ts.Promise??Promise}function Ds(e){return e&&qo(e.next)&&qo(e.error)&&qo(e.complete)}function Os(e){return e&&e instanceof fs||Ds(e)&&$o(e)}function ks(e){return qo(e?.lift)}function As(e){return function(t){if(ks(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function js(e,t,n,r,i){return new Ms(e,t,n,r,i)}var Ms=function(e){Io(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(fs),Ns=Jo(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Ps=function(e){Io(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Fs(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ns},t.prototype.next=function(e){var t=this;us(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=Vo(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;us(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;us(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?Qo:(this.currentObservers=null,a.push(e),new Zo(function(){t.currentObservers=null,Xo(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new Ts;return e.source=this,e},t.create=function(e,t){return new Fs(e,t)},t}(Ts),Fs=function(e){Io(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??Qo},t}(Ps),Is={now:function(){return(Is.delegate||Date).now()},delegate:void 0},Ls=function(e){Io(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Is);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a<i.length&&!e.closed;a+=r?1:2)e.next(i[a]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,c=1;c<r.length&&r[c]<=o;c+=2)s=c;s&&r.splice(0,s+1)}},t}(Ps),Rs=new Ts(function(e){return e.complete()});function zs(e){return e&&qo(e.schedule)}function Bs(e){return e[e.length-1]}function Vs(e){return zs(Bs(e))?e.pop():void 0}var Hs=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function Us(e){return qo(e?.then)}function Ws(e){return qo(e[xs])}function Gs(e){return Symbol.asyncIterator&&qo(e?.[Symbol.asyncIterator])}function Ks(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function qs(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var Js=qs();function Ys(e){return qo(e?.[Js])}function Xs(e){return Go(this,arguments,function(){var t,n,r,i;return Bo(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Wo(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,Wo(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Wo(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Zs(e){return qo(e?.getReader)}function Qs(e){if(e instanceof Ts)return e;if(e!=null){if(Ws(e))return $s(e);if(Hs(e))return ec(e);if(Us(e))return tc(e);if(Gs(e))return rc(e);if(Ys(e))return nc(e);if(Zs(e))return ic(e)}throw Ks(e)}function $s(e){return new Ts(function(t){var n=e[xs]();if(qo(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function ec(e){return new Ts(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function tc(e){return new Ts(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,rs)})}function nc(e){return new Ts(function(t){var n,r;try{for(var i=Vo(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function rc(e){return new Ts(function(t){ac(e,t).catch(function(e){return t.error(e)})})}function ic(e){return rc(Xs(e))}function ac(e,t){var n,r,i,a;return zo(this,void 0,void 0,function(){var o,s;return Bo(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Ko(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function oc(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function sc(e,t){return t===void 0&&(t=0),As(function(n,r){n.subscribe(js(r,function(n){return oc(r,e,function(){return r.next(n)},t)},function(){return oc(r,e,function(){return r.complete()},t)},function(n){return oc(r,e,function(){return r.error(n)},t)}))})}function cc(e,t){return t===void 0&&(t=0),As(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function lc(e,t){return Qs(e).pipe(cc(t),sc(t))}function uc(e,t){return Qs(e).pipe(cc(t),sc(t))}function dc(e,t){return new Ts(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function fc(e,t){return new Ts(function(n){var r;return oc(n,t,function(){r=e[Js](),oc(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return qo(r?.return)&&r.return()}})}function pc(e,t){if(!e)throw Error(`Iterable cannot be null`);return new Ts(function(n){oc(n,t,function(){var r=e[Symbol.asyncIterator]();oc(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function mc(e,t){return pc(Xs(e),t)}function hc(e,t){if(e!=null){if(Ws(e))return lc(e,t);if(Hs(e))return dc(e,t);if(Us(e))return uc(e,t);if(Gs(e))return pc(e,t);if(Ys(e))return fc(e,t);if(Zs(e))return mc(e,t)}throw Ks(e)}function gc(e,t){return t?hc(e,t):Qs(e)}function _c(){var e=[...arguments];return gc(e,Vs(e))}function vc(e,t){var n=qo(e)?e:function(){return e},r=function(e){return e.error(n())};return new Ts(t?function(e){return t.schedule(r,0,e)}:r)}var yc=Jo(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function bc(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=!1,o;e.subscribe({next:function(e){o=e,a=!0},error:i,complete:function(){a?r(o):n?r(t.defaultValue):i(new yc)}})})}function xc(e,t){return As(function(n,r){var i=0;n.subscribe(js(r,function(n){r.next(e.call(t,n,i++))}))})}function Sc(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;Qs(n(e,u++)).subscribe(js(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?oc(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(js(t,p,function(){d=!0,f()})),function(){s?.()}}function Cc(e,t,n){return n===void 0&&(n=1/0),qo(t)?Cc(function(n,r){return xc(function(e,i){return t(n,e,r,i)})(Qs(e(n,r)))},n):(typeof t==`number`&&(n=t),As(function(t,r){return Sc(t,r,e,n)}))}function wc(e){return e===void 0&&(e=1/0),Cc(Ss,e)}function Tc(e){return new Ts(function(t){Qs(e()).subscribe(t)})}function Ec(e){return As(function(t,n){var r=null,i=!1,a;r=t.subscribe(js(n,void 0,void 0,function(o){a=Qs(e(o,Ec(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function Dc(e,t){return qo(t)?Cc(e,t,1):Cc(e,1)}function Oc(e){return As(function(t,n){var r=!1;t.subscribe(js(n,function(e){r=!0,n.next(e)},function(){r||n.next(e),n.complete()}))})}function kc(e){return As(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}function Ac(e,t){return As(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(js(r,function(n){i?.unsubscribe();var o=0,c=a++;Qs(e(n,c)).subscribe(i=js(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function jc(e){return As(function(t,n){Qs(e).subscribe(js(n,function(){return n.complete()},is)),!n.closed&&t.subscribe(n)})}function Mc(e,t,n){var r=qo(e)||t||n?{next:e,error:t,complete:n}:e;return r?As(function(e,t){var n;(n=r.subscribe)==null||n.call(r);var i=!0;e.subscribe(js(t,function(e){var n;(n=r.next)==null||n.call(r,e),t.next(e)},function(){var e;i=!1,(e=r.complete)==null||e.call(r),t.complete()},function(e){var n;i=!1,(n=r.error)==null||n.call(r,e),t.error(e)},function(){var e,t;i&&((e=r.unsubscribe)==null||e.call(r)),(t=r.finalize)==null||t.call(r)}))}):Ss}function Nc(e){return` \r
15
+ `.indexOf(e)>=0}function Pc(e){for(var t=[`topLevel`],n=0,r,i,a,o=function(e){return t.push(e)},s=function(e){return t[t.length-1]=e},c=function(e){r??(r=n,i=t.length,a=e)},l=function(e){e===a&&(r=void 0,i=void 0,a=void 0)},u=function(){return t.pop()},d=function(){return n--},f=function(e){if(`0`<=e&&e<=`9`){o(`number`);return}switch(e){case`"`:o(`string`);return;case`-`:o(`numberNeedsDigit`);return;case`t`:o(`true`);return;case`f`:o(`false`);return;case`n`:o(`null`);return;case`[`:o(`arrayNeedsValue`);return;case`{`:o(`objectNeedsKey`);return}},p=e.length;n<p;n++){var m=e[n];switch(t[t.length-1]){case`topLevel`:f(m);break;case`string`:switch(m){case`"`:u();break;case`\\`:c(`stringEscape`),o(`stringEscaped`)}break;case`stringEscaped`:m===`u`?o(`stringUnicode`):(l(`stringEscape`),u());break;case`stringUnicode`:n-e.lastIndexOf(`u`,n)===4&&(l(`stringEscape`),u());break;case`number`:m===`.`?s(`numberNeedsDigit`):m===`e`||m===`E`?s(`numberNeedsExponent`):(m<`0`||m>`9`)&&(d(),u());break;case`numberNeedsDigit`:s(`number`);break;case`numberNeedsExponent`:s(m===`+`||m===`-`?`numberNeedsDigit`:`number`);break;case`true`:case`false`:case`null`:(m<`a`||m>`z`)&&(d(),u());break;case`arrayNeedsValue`:m===`]`?u():Nc(m)||(l(`collectionItem`),s(`arrayNeedsComma`),f(m));break;case`arrayNeedsComma`:m===`]`?u():m===`,`&&(c(`collectionItem`),s(`arrayNeedsValue`));break;case`objectNeedsKey`:m===`}`?u():m===`"`&&(c(`collectionItem`),s(`objectNeedsColon`),o(`string`));break;case`objectNeedsColon`:m===`:`&&s(`objectNeedsValue`);break;case`objectNeedsValue`:Nc(m)||(l(`collectionItem`),s(`objectNeedsComma`),f(m));break;case`objectNeedsComma`:m===`}`?u():m===`,`&&(c(`collectionItem`),s(`objectNeedsKey`))}}i!=null&&(t.length=i);for(var h=[r==null?e:e.slice(0,r)],g=function(t){return h.push(t.slice(e.length-e.lastIndexOf(t[0])))},_=t.length-1;_>=0;_--)switch(t[_]){case`string`:h.push(`"`);break;case`numberNeedsDigit`:case`numberNeedsExponent`:h.push(`0`);break;case`true`:g(`true`);break;case`false`:g(`false`);break;case`null`:g(`null`);break;case`arrayNeedsValue`:case`arrayNeedsComma`:h.push(`]`);break;case`objectNeedsKey`:case`objectNeedsColon`:case`objectNeedsValue`:case`objectNeedsComma`:h.push(`}`)}return h.join(``)}function Fc(){let e=this.buf,t=this.pos,n=0,r=0;for(let i=0;i<28;i+=7){let a=e[t++];if(n|=(a&127)<<i,!(a&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}}let i=e[t++];if(n|=(i&15)<<28,r=(i&112)>>4,!(i&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}for(let i=3;i<=31;i+=7){let a=e[t++];if(r|=(a&127)<<i,!(a&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}}throw Error(`invalid varint`)}var Ic=4294967296;function Lc(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(t,a){let o=Number(e.slice(t,a));i*=n,r=r*n+o,r>=Ic&&(i+=r/Ic|0,r%=Ic)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?Hc(r,i):Vc(r,i)}function Rc(e,t){let n=Vc(e,t),r=n.hi&2147483648;r&&(n=Hc(n.lo,n.hi));let i=zc(n.lo,n.hi);return r?`-`+i:i}function zc(e,t){if({lo:e,hi:t}=Bc(e,t),t<=2097151)return String(Ic*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+Uc(o)+Uc(a)}function Bc(e,t){return{lo:e>>>0,hi:t>>>0}}function Vc(e,t){return{lo:e|0,hi:t|0}}function Hc(e,t){return t=~t,e?e=~e+1:t+=1,Vc(e,t)}var Uc=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function Wc(){let e=this.buf[this.pos++];if(!(e&128))return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var Gc=Kc();function Kc(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||r<t)throw Error(`invalid int64: ${e}`);return r},uParse(e){let t=typeof e==`bigint`?e:BigInt(e);if(t>i||t<r)throw Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(t,n){return e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)},uDec(t,n){return e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0)}}}return{zero:`0`,supported:!1,parse(e){return typeof e!=`string`&&(e=e.toString()),qc(e),e},uParse(e){return typeof e!=`string`&&(e=e.toString()),Jc(e),e},enc(e){return typeof e!=`string`&&(e=e.toString()),qc(e),Lc(e)},uEnc(e){return typeof e!=`string`&&(e=e.toString()),Jc(e),Lc(e)},dec(e,t){return Rc(e,t)},uDec(e,t){return zc(e,t)}}}function qc(e){if(!/^-?[0-9]+$/.test(e))throw Error(`invalid int64: `+e)}function Jc(e){if(!/^[0-9]+$/.test(e))throw Error(`invalid uint64: `+e)}var Yc=Symbol.for(`@bufbuild/protobuf/text-encoding`);function Xc(e){globalThis[Yc]=Object.assign(Object.assign({},e),{encodeUtf8Into:e.encodeUtf8Into??Qc(e.encodeUtf8.bind(e))})}function Zc(){let e=globalThis;if(!e[Yc]){let t=new e.TextEncoder,n=new e.TextDecoder,r,i={encodeUtf8(e){return t.encode(e)},decodeUtf8(t,i){return i?(r||=new e.TextDecoder(`utf-8`,{fatal:!0}),r.decode(t)):n.decode(t)},checkUtf8(e){try{return!0}catch{return!1}}};t.encodeInto&&(i.encodeUtf8Into=t.encodeInto.bind(t));let a=String.prototype.isWellFormed;a&&(i.checkUtf8=e=>a.call(e)),Xc(i)}return e[Yc]}function Qc(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var $c;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})($c||={});var el=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?Qc(e):Zc().encodeUtf8Into,this.buffer=rl,this.viewCache=il,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||tl;for(;e<t;)e*=2;let n=new Uint8Array(e);this.pos>0&&n.set(this.buffer),this.buffer=n}}view(){let e=this.buffer,t=this.viewCache;if(t.byteLength===e.byteLength)return t;let n=new DataView(e.buffer);return this.viewCache=n,n}finish(){let e=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],e}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(nl),this.buffer[this.pos++]=0,this}join(){let e=this.stackPos.pop();if(e===void 0)throw Error(`invalid state, fork stack empty`);let t=this.pos-e-nl,n=ol(t);return n>nl&&(this.ensureCapacity(n-nl),this.buffer.copyWithin(e+n,e+nl,this.pos)),this.pos=e,this.uint32(t),this.pos+=t,this}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.ensureCapacity(e.length),this.buffer.set(e,this.pos),this.pos+=e.length,this}uint32(e){if(cl(e),this.ensureCapacity(5),e<128)return this.buffer[this.pos++]=e,this;for(;e>127;)this.buffer[this.pos++]=e&127|128,e>>>=7;return this.buffer[this.pos++]=e,this}int32(e){if(sl(e),e>=0)return this.uint32(e);this.ensureCapacity(10);for(let t=0;t<9;t++)this.buffer[this.pos++]=e&127|128,e>>=7;return this.buffer[this.pos++]=1,this}bool(e){return this.ensureCapacity(1),this.buffer[this.pos++]=+!!e,this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){typeof e!=`string`&&(e=String(e));let t=e.length;if(t<=al){this.ensureCapacity(t+1);let n=this.buffer,r=this.pos;n[r++]=t;let i=0;for(;i<t;i++){let t=e.charCodeAt(i);if(t>127)break;n[r++]=t}if(i==t)return this.pos=r,this}this.ensureCapacity(t*3+5);let n=ol(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=ol(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return ll(e),this.ensureCapacity(4),this.view().setFloat32(this.pos,e,!0),this.pos+=4,this}double(e){return this.ensureCapacity(8),this.view().setFloat64(this.pos,e,!0),this.pos+=8,this}fixed32(e){return cl(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return sl(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return sl(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=Gc.enc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}fixed64(e){let t=Gc.uEnc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}int64(e){let t=Gc.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=Gc.enc(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return this.writeVarint64(r,i)}uint64(e){let t=Gc.uEnc(e);return this.writeVarint64(t.lo,t.hi)}writeVarint64(e,t){this.ensureCapacity(10);let n=this.buffer,r=this.pos;for(let i=0;i<28;i+=7){let a=e>>>i,o=!(!(a>>>7)&&t==0);if(n[r++]=(o?a|128:a)&255,!o)return this.pos=r,this}let i=e>>>28&15|(t&7)<<4,a=!!(t>>3);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this;for(let e=3;e<31;e+=7){let i=t>>>e,a=!!(i>>>7);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this}return n[r++]=t>>>31&1,this.pos=r,this}},tl=128,nl=1,rl=new Uint8Array,il=new DataView(rl.buffer),al=32;function ol(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var z=class{constructor(e,t=Zc().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=Fc,this.uint32=Wc,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case $c.Varint:for(;this.buf[this.pos++]&128;);break;case $c.Bit64:this.pos+=4;case $c.Bit32:this.pos+=4;break;case $c.LengthDelimited:let r=this.uint32();this.pos+=r;break;case $c.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===$c.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return this.varint64(),Gc.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),Gc.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let e=this.varint64Lo,t=this.varint64Hi,n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,Gc.dec(e,t)}bool(){let e=this.buf[this.pos];return e<128?(this.pos++,e!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Gc.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Gc.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){let t=this.bytes(),n=t.length;if(n<=al){let r=Array(n);for(let i=0;i<n;i++){let n=t[i];if(n>127)return this.decodeUtf8(t,e);r[i]=n}return String.fromCharCode.apply(String,r)}return this.decodeUtf8(t,e)}};function sl(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function cl(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function ll(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}var ul=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function dl(){return{fields:{}}}var fl={encode(e,t=new el){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&ml.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=dl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:{if(e!==10)break;let t=ml.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fl.fromPartial(e??{})},fromPartial(e){let t=dl();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=dl();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function pl(){return{key:``,value:void 0}}var ml={encode(e,t=new el){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&B.encode(B.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=pl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ml.fromPartial(e??{})},fromPartial(e){let t=pl();return t.key=e.key??``,t.value=e.value??void 0,t}};function hl(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var B={encode(e,t=new el){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&fl.encode(fl.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&_l.encode(_l.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=hl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=fl.unwrap(fl.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=_l.unwrap(_l.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return B.fromPartial(e??{})},fromPartial(e){let t=hl();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=hl();if(e===null)t.nullValue=ul.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function gl(){return{values:[]}}var _l={encode(e,t=new el){for(let n of e.values)B.encode(B.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=gl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(B.unwrap(B.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return _l.fromPartial(e??{})},fromPartial(e){let t=gl();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=gl();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},vl=function(e){return e[e.ADD=0]=`ADD`,e[e.REMOVE=1]=`REMOVE`,e[e.REPLACE=2]=`REPLACE`,e[e.MOVE=3]=`MOVE`,e[e.COPY=4]=`COPY`,e[e.TEST=5]=`TEST`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function yl(){return{op:0,path:``,from:void 0,value:void 0}}var bl={encode(e,t=new el){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==``&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&B.encode(B.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=yl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==8)break;i.op=n.int32();continue;case 2:if(e!==18)break;i.path=n.string();continue;case 3:if(e!==26)break;i.from=n.string();continue;case 4:if(e!==34)break;i.value=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bl.fromPartial(e??{})},fromPartial(e){let t=yl();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function xl(){return{id:``,type:``,function:void 0}}var Sl={encode(e,t=new el){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&wl.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=xl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.type=n.string();continue;case 3:if(e!==26)break;i.function=wl.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Sl.fromPartial(e??{})},fromPartial(e){let t=xl();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?wl.fromPartial(e.function):void 0,t}};function Cl(){return{name:``,arguments:``}}var wl={encode(e,t=new el){return e.name!==``&&t.uint32(10).string(e.name),e.arguments!==``&&t.uint32(18).string(e.arguments),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Cl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.arguments=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wl.fromPartial(e??{})},fromPartial(e){let t=Cl();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function Tl(){return{value:``,mimeType:``}}var El={encode(e,t=new el){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==``&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Tl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return El.fromPartial(e??{})},fromPartial(e){let t=Tl();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function Dl(){return{value:``,mimeType:void 0}}var Ol={encode(e,t=new el){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Dl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ol.fromPartial(e??{})},fromPartial(e){let t=Dl();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function kl(){return{data:void 0,url:void 0}}var Al={encode(e,t=new el){return e.data!==void 0&&El.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&Ol.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=kl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.data=El.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=Ol.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Al.fromPartial(e??{})},fromPartial(e){let t=kl();return t.data=e.data!==void 0&&e.data!==null?El.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?Ol.fromPartial(e.url):void 0,t}};function jl(){return{text:``}}var Ml={encode(e,t=new el){return e.text!==``&&t.uint32(10).string(e.text),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=jl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.text=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ml.fromPartial(e??{})},fromPartial(e){let t=jl();return t.text=e.text??``,t}};function Nl(){return{source:void 0,metadata:void 0}}var Pl={encode(e,t=new el){return e.source!==void 0&&Al.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&B.encode(B.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Nl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.source=Al.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Pl.fromPartial(e??{})},fromPartial(e){let t=Nl();return t.source=e.source!==void 0&&e.source!==null?Al.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function Fl(){return{source:void 0,metadata:void 0}}var Il={encode(e,t=new el){return e.source!==void 0&&Al.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&B.encode(B.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Fl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.source=Al.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Il.fromPartial(e??{})},fromPartial(e){let t=Fl();return t.source=e.source!==void 0&&e.source!==null?Al.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function Ll(){return{source:void 0,metadata:void 0}}var Rl={encode(e,t=new el){return e.source!==void 0&&Al.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&B.encode(B.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Ll();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.source=Al.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Rl.fromPartial(e??{})},fromPartial(e){let t=Ll();return t.source=e.source!==void 0&&e.source!==null?Al.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function zl(){return{source:void 0,metadata:void 0}}var Bl={encode(e,t=new el){return e.source!==void 0&&Al.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&B.encode(B.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=zl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.source=Al.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Bl.fromPartial(e??{})},fromPartial(e){let t=zl();return t.source=e.source!==void 0&&e.source!==null?Al.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function Vl(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var Hl={encode(e,t=new el){return e.text!==void 0&&Ml.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Pl.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&Il.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&Rl.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&Bl.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Vl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.text=Ml.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=Pl.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=Il.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=Rl.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=Bl.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Hl.fromPartial(e??{})},fromPartial(e){let t=Vl();return t.text=e.text!==void 0&&e.text!==null?Ml.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Pl.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?Il.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?Rl.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?Bl.fromPartial(e.document):void 0,t}};function Ul(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var Wl={encode(e,t=new el){e.id!==``&&t.uint32(10).string(e.id),e.role!==``&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let n of e.toolCalls)Sl.encode(n,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let n of e.contentParts)Hl.encode(n,t.uint32(66).fork()).join();return t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Ul();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.role=n.string();continue;case 3:if(e!==26)break;i.content=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.toolCalls.push(Sl.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.toolCallId=n.string();continue;case 7:if(e!==58)break;i.error=n.string();continue;case 8:if(e!==66)break;i.contentParts.push(Hl.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Wl.fromPartial(e??{})},fromPartial(e){let t=Ul();return t.id=e.id??``,t.role=e.role??``,t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>Sl.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>Hl.fromPartial(e))||[],t}};function Gl(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0}}var Kl={encode(e,t=new el){return e.id!==``&&t.uint32(10).string(e.id),e.reason!==``&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&B.encode(B.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&B.encode(B.wrap(e.metadata),t.uint32(58).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Gl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.reason=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.responseSchema=B.unwrap(B.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Kl.fromPartial(e??{})},fromPartial(e){let t=Gl();return t.id=e.id??``,t.reason=e.reason??``,t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t}},ql=function(e){return e[e.TEXT_MESSAGE_START=0]=`TEXT_MESSAGE_START`,e[e.TEXT_MESSAGE_CONTENT=1]=`TEXT_MESSAGE_CONTENT`,e[e.TEXT_MESSAGE_END=2]=`TEXT_MESSAGE_END`,e[e.TOOL_CALL_START=3]=`TOOL_CALL_START`,e[e.TOOL_CALL_ARGS=4]=`TOOL_CALL_ARGS`,e[e.TOOL_CALL_END=5]=`TOOL_CALL_END`,e[e.STATE_SNAPSHOT=6]=`STATE_SNAPSHOT`,e[e.STATE_DELTA=7]=`STATE_DELTA`,e[e.MESSAGES_SNAPSHOT=8]=`MESSAGES_SNAPSHOT`,e[e.RAW=9]=`RAW`,e[e.CUSTOM=10]=`CUSTOM`,e[e.RUN_STARTED=11]=`RUN_STARTED`,e[e.RUN_FINISHED=12]=`RUN_FINISHED`,e[e.RUN_ERROR=13]=`RUN_ERROR`,e[e.STEP_STARTED=14]=`STEP_STARTED`,e[e.STEP_FINISHED=15]=`STEP_FINISHED`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Jl(){return{type:0,timestamp:void 0,rawEvent:void 0}}var V={encode(e,t=new el){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&B.encode(B.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Jl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=Fu(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return V.fromPartial(e??{})},fromPartial(e){let t=Jl();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function Yl(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0}}var Xl={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Yl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Xl.fromPartial(e??{})},fromPartial(e){let t=Yl();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t}};function Zl(){return{baseEvent:void 0,messageId:``,delta:``}}var Ql={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Zl();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ql.fromPartial(e??{})},fromPartial(e){let t=Zl();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t}};function $l(){return{baseEvent:void 0,messageId:``}}var eu={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=$l();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eu.fromPartial(e??{})},fromPartial(e){let t=$l();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t}};function tu(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0}}var nu={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.toolCallName!==``&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=tu();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nu.fromPartial(e??{})},fromPartial(e){let t=tu();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t}};function ru(){return{baseEvent:void 0,toolCallId:``,delta:``}}var iu={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=ru();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return iu.fromPartial(e??{})},fromPartial(e){let t=ru();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t}};function au(){return{baseEvent:void 0,toolCallId:``}}var ou={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=au();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ou.fromPartial(e??{})},fromPartial(e){let t=au();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t}};function su(){return{baseEvent:void 0,snapshot:void 0}}var cu={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&B.encode(B.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=su();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cu.fromPartial(e??{})},fromPartial(e){let t=su();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function lu(){return{baseEvent:void 0,delta:[]}}var uu={encode(e,t=new el){e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)bl.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=lu();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(bl.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return uu.fromPartial(e??{})},fromPartial(e){let t=lu();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>bl.fromPartial(e))||[],t}};function du(){return{baseEvent:void 0,messages:[]}}var fu={encode(e,t=new el){e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)Wl.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=du();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(Wl.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fu.fromPartial(e??{})},fromPartial(e){let t=du();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>Wl.fromPartial(e))||[],t}};function pu(){return{baseEvent:void 0,event:void 0,source:void 0}}var mu={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&B.encode(B.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=pu();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=B.unwrap(B.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mu.fromPartial(e??{})},fromPartial(e){let t=pu();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function hu(){return{baseEvent:void 0,name:``,value:void 0}}var gu={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&B.encode(B.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=hu();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=B.unwrap(B.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gu.fromPartial(e??{})},fromPartial(e){let t=hu();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t}};function _u(){return{baseEvent:void 0,threadId:``,runId:``}}var vu={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=_u();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vu.fromPartial(e??{})},fromPartial(e){let t=_u();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t}};function yu(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0}}var bu={encode(e,t=new el){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=yu();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.provider=n.string();continue;case 2:if(e!==18)break;i.model=n.string();continue;case 3:if(e!==24)break;i.inputTokens=Fu(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=Fu(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=Fu(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=Fu(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=Fu(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bu.fromPartial(e??{})},fromPartial(e){let t=yu();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t}};function xu(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[]}}var Su={encode(e,t=new el){e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.result!==void 0&&B.encode(B.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)Kl.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)bu.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=xu();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.result=B.unwrap(B.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.outcome=n.string();continue;case 6:if(e!==50)break;i.interrupts.push(Kl.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(bu.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Su.fromPartial(e??{})},fromPartial(e){let t=xu();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interrupts=e.interrupts?.map(e=>Kl.fromPartial(e))||[],t.usage=e.usage?.map(e=>bu.fromPartial(e))||[],t}};function Cu(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var wu={encode(e,t=new el){e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==``&&t.uint32(26).string(e.message);for(let n of e.usage)bu.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Cu();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.code=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.usage.push(bu.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wu.fromPartial(e??{})},fromPartial(e){let t=Cu();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>bu.fromPartial(e))||[],t}};function Tu(){return{baseEvent:void 0,stepName:``}}var Eu={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Tu();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Eu.fromPartial(e??{})},fromPartial(e){let t=Tu();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t}};function Du(){return{baseEvent:void 0,stepName:``}}var Ou={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Du();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ou.fromPartial(e??{})},fromPartial(e){let t=Du();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t}};function ku(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var Au={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=ku();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue;case 5:if(e!==42)break;i.name=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Au.fromPartial(e??{})},fromPartial(e){let t=ku();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t}};function ju(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Mu={encode(e,t=new el){return e.baseEvent!==void 0&&V.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=ju();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.baseEvent=V.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Mu.fromPartial(e??{})},fromPartial(e){let t=ju();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?V.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function Nu(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var Pu={encode(e,t=new el){return e.textMessageStart!==void 0&&Xl.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Ql.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&eu.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&nu.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&iu.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&ou.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&cu.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&uu.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&fu.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&mu.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&gu.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&vu.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Su.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&wu.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Eu.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Ou.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Au.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Mu.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let n=e instanceof z?e:new z(e),r=t===void 0?n.len:n.pos+t,i=Nu();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.textMessageStart=Xl.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=Ql.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=eu.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=nu.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=iu.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=ou.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=cu.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=uu.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=fu.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=mu.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=gu.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=vu.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=Su.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=wu.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=Eu.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=Ou.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=Au.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=Mu.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Pu.fromPartial(e??{})},fromPartial(e){let t=Nu();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Xl.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Ql.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?eu.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?nu.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?iu.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?ou.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?cu.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?uu.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?fu.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?mu.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?gu.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?vu.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Su.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?wu.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Eu.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Ou.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Au.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Mu.fromPartial(e.toolCallChunk):void 0,t}};function Fu(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t<globalThis.Number.MIN_SAFE_INTEGER)throw new globalThis.Error(`Value is smaller than Number.MIN_SAFE_INTEGER`);return t}var Iu=e=>e&&typeof e==`object`?e:void 0,Lu=e=>{let t=Iu(e);if(t){if(t.data){let e=t.data;return{type:`data`,value:e.value,mimeType:e.mimeType}}if(t.url){let e=t.url;return{type:`url`,value:e.value,mimeType:e.mimeType}}}},Ru=e=>{let t=Iu(e);if(t){if(t.text)return{type:`text`,text:t.text.text};if(t.image){let e=t.image;return{type:`image`,source:Lu(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return{type:`audio`,source:Lu(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return{type:`video`,source:Lu(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return{type:`document`,source:Lu(e.source),metadata:e.metadata}}}};function zu(e){let t=Pu.decode(e),n=Object.values(t).find(e=>e!==void 0);if(!n)throw Error(`Invalid event`);if(n.type=ql[n.baseEvent.type],n.timestamp=n.baseEvent.timestamp,n.rawEvent=n.baseEvent.rawEvent,delete n.baseEvent,n.type===L.MESSAGES_SNAPSHOT)for(let e of n.messages){let t=e;if(t.role===`user`&&Array.isArray(t.contentParts)){let e=t.contentParts.map(e=>Ru(e)).filter(e=>e!==void 0);e.length>0&&(t.content=e)}Array.isArray(t.contentParts)&&t.contentParts.length===0&&(t.contentParts=void 0),t.toolCalls?.length===0&&(t.toolCalls=void 0)}if(n.type===L.RUN_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interrupts)?e.interrupts:[];delete e.interrupts,t===`interrupt`?e.outcome={type:`interrupt`,interrupts:r}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if((n.type===L.RUN_FINISHED||n.type===L.RUN_ERROR)&&Array.isArray(n.usage)&&n.usage.length===0&&delete n.usage,n.type===L.STATE_DELTA)for(let e of n.delta)e.op=vl[e.op].toLowerCase(),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]});return Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),Qa.parse(n)}var Bu;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(Bu||={});var Vu;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Vu||={});var H=Bu.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Hu=e=>{switch(typeof e){case`undefined`:return H.undefined;case`string`:return H.string;case`number`:return Number.isNaN(e)?H.nan:H.number;case`boolean`:return H.boolean;case`function`:return H.function;case`bigint`:return H.bigint;case`symbol`:return H.symbol;case`object`:return Array.isArray(e)?H.array:e===null?H.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?H.promise:typeof Map<`u`&&e instanceof Map?H.map:typeof Set<`u`&&e instanceof Set?H.set:typeof Date<`u`&&e instanceof Date?H.date:H.object;default:return H.unknown}},U=Bu.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),Uu=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Bu.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Uu.create=e=>new Uu(e);var Wu=(e,t)=>{let n;switch(e.code){case U.invalid_type:n=e.received===H.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case U.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Bu.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:n=`Unrecognized key(s) in object: ${Bu.joinValues(e.keys,`, `)}`;break;case U.invalid_union:n=`Invalid input`;break;case U.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Bu.joinValues(e.options)}`;break;case U.invalid_enum_value:n=`Invalid enum value. Expected ${Bu.joinValues(e.options)}, received '${e.received}'`;break;case U.invalid_arguments:n=`Invalid function arguments`;break;case U.invalid_return_type:n=`Invalid function return type`;break;case U.invalid_date:n=`Invalid date`;break;case U.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Bu.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case U.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case U.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case U.custom:n=`Invalid input`;break;case U.invalid_intersection_types:n=`Intersection results could not be merged`;break;case U.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case U.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,Bu.assertNever(e)}return{message:n}},Gu=Wu;function Ku(){return Gu}var qu=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function W(e,t){let n=Ku(),r=qu({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Wu?void 0:Wu].filter(e=>!!e)});e.common.issues.push(r)}var Ju=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return G;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return G;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},G=Object.freeze({status:`aborted`}),Yu=e=>({status:`dirty`,value:e}),Xu=e=>({status:`valid`,value:e}),Zu=e=>e.status===`aborted`,Qu=e=>e.status===`dirty`,$u=e=>e.status===`valid`,ed=e=>typeof Promise<`u`&&e instanceof Promise,K;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(K||={});var td=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},nd=(e,t)=>{if($u(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new Uu(e.common.issues);return this._error=t,this._error}}};function q(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var rd=class{get description(){return this._def.description}_getType(e){return Hu(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Hu(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ju,ctx:{common:e.parent.common,data:e.data,parsedType:Hu(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ed(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hu(e)};return nd(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hu(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return $u(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>$u(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hu(e)},r=this._parse({data:e,path:n.path,parent:n});return nd(n,await(ed(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:U.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new sf({schema:this,typeName:J.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return cf.create(this,this._def)}nullable(){return lf.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vd.create(this)}promise(){return of.create(this,this._def)}or(e){return Wd.create([this,e],this._def)}and(e){return Jd.create(this,e,this._def)}transform(e){return new sf({...q(this._def),schema:this,typeName:J.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new uf({...q(this._def),innerType:this,defaultValue:t,typeName:J.ZodDefault})}brand(){return new pf({typeName:J.ZodBranded,type:this,...q(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new df({...q(this._def),innerType:this,catchValue:t,typeName:J.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return mf.create(this,e)}readonly(){return hf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},id=/^c[^\s-]{8,}$/i,ad=/^[0-9a-z]+$/,od=/^[0-9A-HJKMNP-TV-Z]{26}$/i,sd=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cd=/^[a-z0-9_-]{21}$/i,ld=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ud=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dd=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fd=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,pd,md=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hd=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,gd=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_d=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vd=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yd=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bd=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,xd=RegExp(`^${bd}$`);function Sd(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Cd(e){return RegExp(`^${Sd(e)}$`)}function wd(e){let t=`${bd}T${Sd(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Td(e,t){return!!((t===`v4`||!t)&&md.test(e)||(t===`v6`||!t)&&gd.test(e))}function Ed(e,t){if(!ld.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Dd(e,t){return!!((t===`v4`||!t)&&hd.test(e)||(t===`v6`||!t)&&_d.test(e))}var Od=class e extends rd{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==H.string){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.string,received:t.parsedType}),G}let t=new Ju,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)dd.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`email`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)pd||=new RegExp(fd,`u`),pd.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`emoji`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)sd.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`uuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)cd.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`nanoid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)id.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)ad.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid2`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)od.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ulid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),W(n,{validation:`url`,code:U.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`regex`,code:U.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?wd(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?xd.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Cd(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?ud.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`duration`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Td(e.data,r.version)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ip`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Ed(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`jwt`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Dd(e.data,r.version)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cidr`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?vd.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`base64`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?yd.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`base64url`,code:U.invalid_string,message:r.message}),t.dirty()):Bu.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:U.invalid_string,...K.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...K.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...K.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...K.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...K.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...K.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...K.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...K.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...K.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...K.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...K.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...K.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...K.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...K.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...K.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...K.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...K.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...K.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...K.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...K.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...K.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...K.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...K.errToObj(t)})}nonempty(e){return this.min(1,K.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Od.create=e=>new Od({checks:[],typeName:J.ZodString,coerce:e?.coerce??!1,...q(e)});function kd(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Ad=class e extends rd{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==H.number){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.number,received:t.parsedType}),G}let t,n=new Ju;for(let r of this._def.checks)r.kind===`int`?Bu.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?kd(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_finite,message:r.message}),n.dirty()):Bu.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:K.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:K.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:K.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:K.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&Bu.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Ad.create=e=>new Ad({checks:[],typeName:J.ZodNumber,coerce:e?.coerce||!1,...q(e)});var jd=class e extends rd{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==H.bigint)return this._getInvalidInput(e);let t,n=new Ju;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Bu.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.bigint,received:t.parsedType}),G}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};jd.create=e=>new jd({checks:[],typeName:J.ZodBigInt,coerce:e?.coerce??!1,...q(e)});var Md=class extends rd{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==H.boolean){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.boolean,received:t.parsedType}),G}return Xu(e.data)}};Md.create=e=>new Md({typeName:J.ZodBoolean,coerce:e?.coerce||!1,...q(e)});var Nd=class e extends rd{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==H.date){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.date,received:t.parsedType}),G}if(Number.isNaN(e.data.getTime()))return W(this._getOrReturnCtx(e),{code:U.invalid_date}),G;let t=new Ju,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):Bu.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:K.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:K.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Nd.create=e=>new Nd({checks:[],coerce:e?.coerce||!1,typeName:J.ZodDate,...q(e)});var Pd=class extends rd{_parse(e){if(this._getType(e)!==H.symbol){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.symbol,received:t.parsedType}),G}return Xu(e.data)}};Pd.create=e=>new Pd({typeName:J.ZodSymbol,...q(e)});var Fd=class extends rd{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.undefined,received:t.parsedType}),G}return Xu(e.data)}};Fd.create=e=>new Fd({typeName:J.ZodUndefined,...q(e)});var Id=class extends rd{_parse(e){if(this._getType(e)!==H.null){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.null,received:t.parsedType}),G}return Xu(e.data)}};Id.create=e=>new Id({typeName:J.ZodNull,...q(e)});var Ld=class extends rd{constructor(){super(...arguments),this._any=!0}_parse(e){return Xu(e.data)}};Ld.create=e=>new Ld({typeName:J.ZodAny,...q(e)});var Rd=class extends rd{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Xu(e.data)}};Rd.create=e=>new Rd({typeName:J.ZodUnknown,...q(e)});var zd=class extends rd{_parse(e){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.never,received:t.parsedType}),G}};zd.create=e=>new zd({typeName:J.ZodNever,...q(e)});var Bd=class extends rd{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.void,received:t.parsedType}),G}return Xu(e.data)}};Bd.create=e=>new Bd({typeName:J.ZodVoid,...q(e)});var Vd=class e extends rd{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==H.array)return W(t,{code:U.invalid_type,expected:H.array,received:t.parsedType}),G;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(W(t,{code:e?U.too_big:U.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(W(t,{code:U.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(W(t,{code:U.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new td(t,e,t.path,n)))).then(e=>Ju.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new td(t,e,t.path,n)));return Ju.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:K.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:K.toString(n)}})}nonempty(e){return this.min(1,e)}};Vd.create=(e,t)=>new Vd({type:e,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...q(t)});function Hd(e){if(e instanceof Ud){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=cf.create(Hd(r))}return new Ud({...e._def,shape:()=>t})}return e instanceof Vd?new Vd({...e._def,type:Hd(e.element)}):e instanceof cf?cf.create(Hd(e.unwrap())):e instanceof lf?lf.create(Hd(e.unwrap())):e instanceof Yd?Yd.create(e.items.map(e=>Hd(e))):e}var Ud=class e extends rd{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Bu.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==H.object){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof zd&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new td(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof zd){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(W(n,{code:U.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new td(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Ju.mergeObjectSync(t,e)):Ju.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return K.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:K.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:J.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of Bu.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of Bu.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return Hd(this)}partial(t){let n={};for(let e of Bu.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of Bu.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof cf;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return nf(Bu.objectKeys(this.shape))}};Ud.create=(e,t)=>new Ud({shape:()=>e,unknownKeys:`strip`,catchall:zd.create(),typeName:J.ZodObject,...q(t)}),Ud.strictCreate=(e,t)=>new Ud({shape:()=>e,unknownKeys:`strict`,catchall:zd.create(),typeName:J.ZodObject,...q(t)}),Ud.lazycreate=(e,t)=>new Ud({shape:e,unknownKeys:`strip`,catchall:zd.create(),typeName:J.ZodObject,...q(t)});var Wd=class extends rd{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Uu(e.ctx.common.issues));return W(t,{code:U.invalid_union,unionErrors:n}),G}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new Uu(e));return W(t,{code:U.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};Wd.create=(e,t)=>new Wd({options:e,typeName:J.ZodUnion,...q(t)});var Gd=e=>e instanceof ef?Gd(e.schema):e instanceof sf?Gd(e.innerType()):e instanceof tf?[e.value]:e instanceof rf?e.options:e instanceof af?Bu.objectValues(e.enum):e instanceof uf?Gd(e._def.innerType):e instanceof Fd?[void 0]:e instanceof Id?[null]:e instanceof cf?[void 0,...Gd(e.unwrap())]:e instanceof lf?[null,...Gd(e.unwrap())]:e instanceof pf||e instanceof hf?Gd(e.unwrap()):e instanceof df?Gd(e._def.innerType):[],Kd=class e extends rd{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.object)return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(W(t,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),G)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=Gd(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:J.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...q(r)})}};function qd(e,t){let n=Hu(e),r=Hu(t);if(e===t)return{valid:!0,data:e};if(n===H.object&&r===H.object){let n=Bu.objectKeys(t),r=Bu.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=qd(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===H.array&&r===H.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=qd(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}return n===H.date&&r===H.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Jd=class extends rd{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Zu(e)||Zu(r))return G;let i=qd(e.value,r.value);return i.valid?((Qu(e)||Qu(r))&&t.dirty(),{status:t.value,value:i.data}):(W(n,{code:U.invalid_intersection_types}),G)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Jd.create=(e,t,n)=>new Jd({left:e,right:t,typeName:J.ZodIntersection,...q(n)});var Yd=class e extends rd{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.array)return W(n,{code:U.invalid_type,expected:H.array,received:n.parsedType}),G;if(n.data.length<this._def.items.length)return W(n,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),G;!this._def.rest&&n.data.length>this._def.items.length&&(W(n,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new td(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Ju.mergeArray(t,e)):Ju.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Yd.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new Yd({items:e,typeName:J.ZodTuple,rest:null,...q(t)})};var Xd=class e extends rd{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.object)return W(n,{code:U.invalid_type,expected:H.object,received:n.parsedType}),G;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new td(n,e,n.path,e)),value:a._parse(new td(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Ju.mergeObjectAsync(t,r):Ju.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof rd?new e({keyType:t,valueType:n,typeName:J.ZodRecord,...q(r)}):new e({keyType:Od.create(),valueType:t,typeName:J.ZodRecord,...q(n)})}},Zd=class extends rd{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.map)return W(n,{code:U.invalid_type,expected:H.map,received:n.parsedType}),G;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new td(n,e,n.path,[a,`key`])),value:i._parse(new td(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return G;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return G;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Zd.create=(e,t,n)=>new Zd({valueType:t,keyType:e,typeName:J.ZodMap,...q(n)});var Qd=class e extends rd{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.set)return W(n,{code:U.invalid_type,expected:H.set,received:n.parsedType}),G;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(W(n,{code:U.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(W(n,{code:U.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return G;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new td(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:K.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Qd.create=(e,t)=>new Qd({valueType:e,minSize:null,maxSize:null,typeName:J.ZodSet,...q(t)});var $d=class e extends rd{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.function)return W(t,{code:U.invalid_type,expected:H.function,received:t.parsedType}),G;function n(e,n){return qu({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ku(),Wu].filter(e=>!!e),issueData:{code:U.invalid_arguments,argumentsError:n}})}function r(e,n){return qu({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ku(),Wu].filter(e=>!!e),issueData:{code:U.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof of){let e=this;return Xu(async function(...t){let o=new Uu([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return Xu(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Uu([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Uu([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Yd.create(t).rest(Rd.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||Yd.create([]).rest(Rd.create()),returns:n||Rd.create(),typeName:J.ZodFunction,...q(r)})}},ef=class extends rd{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};ef.create=(e,t)=>new ef({getter:e,typeName:J.ZodLazy,...q(t)});var tf=class extends rd{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return W(t,{received:t.data,code:U.invalid_literal,expected:this._def.value}),G}return{status:`valid`,value:e.data}}get value(){return this._def.value}};tf.create=(e,t)=>new tf({value:e,typeName:J.ZodLiteral,...q(t)});function nf(e,t){return new rf({values:e,typeName:J.ZodEnum,...q(t)})}var rf=class e extends rd{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{expected:Bu.joinValues(n),received:t.parsedType,code:U.invalid_type}),G}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{received:t.data,code:U.invalid_enum_value,options:n}),G}return Xu(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};rf.create=nf;var af=class extends rd{_parse(e){let t=Bu.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==H.string&&n.parsedType!==H.number){let e=Bu.objectValues(t);return W(n,{expected:Bu.joinValues(e),received:n.parsedType,code:U.invalid_type}),G}if(this._cache||=new Set(Bu.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=Bu.objectValues(t);return W(n,{received:n.data,code:U.invalid_enum_value,options:e}),G}return Xu(e.data)}get enum(){return this._def.values}};af.create=(e,t)=>new af({values:e,typeName:J.ZodNativeEnum,...q(t)});var of=class extends rd{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==H.promise&&t.common.async===!1?(W(t,{code:U.invalid_type,expected:H.promise,received:t.parsedType}),G):Xu((t.parsedType===H.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};of.create=(e,t)=>new of({type:e,typeName:J.ZodPromise,...q(t)});var sf=class extends rd{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{W(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return G;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?Yu(r.value):r});{if(t.value===`aborted`)return G;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?Yu(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?G:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?G:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!$u(e))return G;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>$u(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):G)}Bu.assertNever(r)}};sf.create=(e,t,n)=>new sf({schema:e,typeName:J.ZodEffects,effect:t,...q(n)}),sf.createWithPreprocess=(e,t,n)=>new sf({schema:t,effect:{type:`preprocess`,transform:e},typeName:J.ZodEffects,...q(n)});var cf=class extends rd{_parse(e){return this._getType(e)===H.undefined?Xu(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};cf.create=(e,t)=>new cf({innerType:e,typeName:J.ZodOptional,...q(t)});var lf=class extends rd{_parse(e){return this._getType(e)===H.null?Xu(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lf.create=(e,t)=>new lf({innerType:e,typeName:J.ZodNullable,...q(t)});var uf=class extends rd{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===H.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};uf.create=(e,t)=>new uf({innerType:e,typeName:J.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...q(t)});var df=class extends rd{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ed(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Uu(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Uu(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};df.create=(e,t)=>new df({innerType:e,typeName:J.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...q(t)});var ff=class extends rd{_parse(e){if(this._getType(e)!==H.nan){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.nan,received:t.parsedType}),G}return{status:`valid`,value:e.data}}};ff.create=e=>new ff({typeName:J.ZodNaN,...q(e)});var pf=class extends rd{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},mf=class e extends rd{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),Yu(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:J.ZodPipeline})}},hf=class extends rd{_parse(e){let t=this._def.innerType._parse(e),n=e=>($u(e)&&(e.value=Object.freeze(e.value)),e);return ed(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};hf.create=(e,t)=>new hf({innerType:e,typeName:J.ZodReadonly,...q(t)}),Ud.lazycreate;var J;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(J||={});var gf=Od.create;Ad.create,ff.create,jd.create;var _f=Md.create;Nd.create,Pd.create,Fd.create,Id.create;var vf=Ld.create;Rd.create,zd.create,Bd.create,Vd.create;var yf=Ud.create;Ud.strictCreate,Wd.create;var bf=Kd.create;Jd.create,Yd.create,Xd.create,Zd.create,Qd.create,$d.create,ef.create;var xf=tf.create,Sf=rf.create;af.create,of.create,sf.create,cf.create,lf.create,sf.createWithPreprocess,mf.create;var Cf=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,wf=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(Cf);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Tf=e=>e===`*`||e===`x`||e===`X`,Ef=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},Df=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],Of=(e,t)=>{if(Tf(e)||Tf(t))return 0;let[n,r]=Df(Ef(e),Ef(t));return n>r?1:n<r?-1:0},kf=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){let r=Of(e[n]||`0`,t[n]||`0`);if(r!==0)return r}return 0},Af=(e,t)=>{let n=wf(e),r=wf(t),i=n.pop(),a=r.pop(),o=kf(n,r);return o===0?i&&a?kf(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},jf=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function Mf(){return $n()}function Nf(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&Nf(t);return e}var Pf=524288;function Ff(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;t<e.length;t++)i.push(e[t]);else{let t=Object.keys(e);for(let a=0;a<t.length;a++){let o=t[a];if(r+=o.length,r>n)return!0;i.push(e[o])}}}}return!1}async function If(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!Ff(t,n,Pf),c=s?jf(t):t,l=s?jf(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(Nf(c),Nf(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=jf(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=jf(e.state),d=!0,n=!0),s&&n&&Ff(c,l,Pf)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(o&&e instanceof TypeError){if(a)throw e;console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e)}else a||console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?jf(c):c}:{},...d?{state:Object.isFrozen(l)?jf(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function Lf(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function Rf(e){if(e instanceof zf)return e;if(e===!0)return new zf(Lf(!0))}var zf=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function Bf(e){return e.enabled?new zf(e):void 0}function Vf(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}var Hf=(e,t,n,r,i)=>{let a=Rf(i),o=jf(n.messages),s=jf(e.state),c={},l=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},u=()=>{let e=jf(c);return c={},e.messages!==void 0||e.state!==void 0?_c(e):Rs};return t.pipe(Dc(async t=>{let i=await If(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(l(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return u();switch(t.type){case L.TEXT_MESSAGE_START:{let i=await If(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r}=t;if(!o.find(t=>t.id===e)){let t={id:e,role:n,content:``,...r!==void 0&&{name:r}};o.push(t),l({messages:o})}}return u()}case L.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),u();let d=await If(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,l({messages:o})),u()}case L.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);return a?(l(await If(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}))),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),u())}case L.TOOL_CALL_START:{let i=await If(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r}=t,i=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(i)return i.function.name!==n&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${i.function.name}' — updating it to '${n}'`),i.function.name=n,l({messages:o})),u();let a=Vf(o,r,e);a.toolCalls??=[],a.toolCalls.push({id:e,type:`function`,function:{name:n,arguments:``}}),l({messages:o})}return u()}case L.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),u();let d=c.toolCalls?.find(e=>e.id===i);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),u();let f=await If(r,o,s,(r,i,a)=>{let o=d.function.arguments,s=d.function.name,c={};try{c=Pc(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return l(f),f.stopPropagation!==!0&&(d.function.arguments+=a,l({messages:o})),u()}case L.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),u();let c=a.toolCalls?.find(e=>e.id===i);return c?(l(await If(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})})),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),u()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),u())}case L.TOOL_CALL_RESULT:{let i=await If(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:u}=t,d={id:i,toolCallId:a,role:u||`tool`,content:c},f=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(f===-1)o.push(d);else{let e=f+1;for(;e<o.length&&o[e].role===`tool`;)e++;o.splice(e,0,d)}await Promise.all(r.map(t=>{t.onNewMessage?.({message:d,messages:o,state:s,agent:n,input:e})})),l({messages:o})}return u()}case L.STATE_SNAPSHOT:{let i=await If(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,l({state:s})}return u()}case L.STATE_DELTA:{let i=await If(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=Po.applyPatch(s,e,!0,!1).newDocument,l({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return u()}case L.MESSAGES_SNAPSHOT:{let i=await If(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messages:e}=t,n=new Map(e.map(e=>[e.id,e])),r=e.some(e=>e.role===`activity`),i=e.some(e=>e.role===`reasoning`),a=e=>e.role===`activity`&&!r||e.role===`reasoning`&&!i;o=o.filter(e=>a(e)||n.has(e.id)).map(e=>a(e)?e:n.get(e.id));let s=new Set(o.map(e=>e.id));for(let t of e)s.has(t.id)||o.push(t);l({messages:o})}return u()}case L.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,d=c?.role===`activity`?c:void 0,f=i.replace??!0,p=await If(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d,existingMessage:c}));if(l(p),p.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:jf(i.content)},c;a===-1?(o.push(t),c=t):d?f&&(o[a]={...d,activityType:i.activityType,content:jf(i.content)}):f&&(o[a]=t,c=t),l({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return u()}case L.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return u();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),u();let d=c,f=await If(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d}));if(l(f),f.stopPropagation!==!0)try{let e=jf(d.content??{}),t=Po.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...d,content:jf(t),activityType:i.activityType},l({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return u()}case L.RAW:return l(await If(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case L.CUSTOM:return l(await If(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case L.RUN_STARTED:{let i=await If(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages)o.find(e=>e.id===t.id)||o.push(t);l({messages:o})}}return u()}case L.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:{event:i,outcome:`success`,result:i.result},c=await If(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return l(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?[...a.interrupts]:[]),u()}case L.RUN_ERROR:return l(await If(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case L.STEP_STARTED:return l(await If(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case L.STEP_FINISHED:return l(await If(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case L.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be tranformed before being applied`);case L.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be tranformed before being applied`);case L.THINKING_START:return u();case L.THINKING_END:return u();case L.THINKING_TEXT_MESSAGE_START:return u();case L.THINKING_TEXT_MESSAGE_CONTENT:return u();case L.THINKING_TEXT_MESSAGE_END:return u();case L.REASONING_START:return l(await If(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case L.REASONING_MESSAGE_START:{let i=await If(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e}=t;if(!o.find(t=>t.id===e)){let t={id:e,role:`reasoning`,content:``};o.push(t),l({messages:o})}}return u()}case L.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),u();let d=await If(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,l({messages:o})),u()}case L.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);return a?(l(await If(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}))),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),u())}case L.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case L.REASONING_END:return l(await If(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case L.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:d}=t,f=await If(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(f),f.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=d,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=d,e=!0)}e&&(c.messages=o)}return u()}}return t.type,u()}),wc(),r.length>0?Oc({}):e=>e)},Uf=e=>t=>{let n=Rf(e),r=new Map,i=new Map,a=!1,o=!1,s=!1,c=new Map,l=!1,u=!1,d=!1,f=()=>{r.clear(),i.clear(),c.clear(),l=!1,u=!1,a=!1,o=!1,d=!0};return t.pipe(Cc(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),o)return vc(()=>new oa(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&t!==L.RUN_ERROR&&t!==L.RUN_STARTED)return vc(()=>new oa(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!s){if(s=!0,t!==L.RUN_STARTED&&t!==L.RUN_ERROR)return vc(()=>new oa(`First event must be 'RUN_STARTED'`))}else if(t===L.RUN_STARTED){if(d&&!a)return vc(()=>new oa(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));a&&f()}switch(t){case L.TEXT_MESSAGE_START:{let t=e.messageId;return r.has(t)?vc(()=>new oa(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${t}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(t,!0),_c(e))}case L.TEXT_MESSAGE_CONTENT:{let t=e.messageId;return r.has(t)?_c(e):vc(()=>new oa(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${t}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case L.TEXT_MESSAGE_END:{let t=e.messageId;return r.has(t)?(r.delete(t),_c(e)):vc(()=>new oa(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${t}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case L.TOOL_CALL_START:{let t=e.toolCallId;return i.has(t)?vc(()=>new oa(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${t}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(i.set(t,!0),_c(e))}case L.TOOL_CALL_ARGS:{let t=e.toolCallId;return i.has(t)?_c(e):vc(()=>new oa(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${t}'. Start a tool call with 'TOOL_CALL_START' first.`))}case L.TOOL_CALL_END:{let t=e.toolCallId;return i.has(t)?(i.delete(t),_c(e)):vc(()=>new oa(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${t}'. A 'TOOL_CALL_START' event must be sent first.`))}case L.STEP_STARTED:{let t=e.stepName;return c.has(t)?vc(()=>new oa(`Step "${t}" is already active for 'STEP_STARTED'`)):(c.set(t,!0),_c(e))}case L.STEP_FINISHED:{let t=e.stepName;return c.has(t)?(c.delete(t),_c(e)):vc(()=>new oa(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}case L.RUN_STARTED:return d=!0,_c(e);case L.RUN_FINISHED:if(c.size>0){let e=Array.from(c.keys()).join(`, `);return vc(()=>new oa(`Cannot send 'RUN_FINISHED' while steps are still active: ${e}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return vc(()=>new oa(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return vc(()=>new oa(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}return a=!0,_c(e);case L.RUN_ERROR:return o=!0,_c(e);case L.CUSTOM:return _c(e);case L.THINKING_TEXT_MESSAGE_START:return l?u?vc(()=>new oa(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.`)):(u=!0,_c(e)):vc(()=>new oa(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first.`));case L.THINKING_TEXT_MESSAGE_CONTENT:return u?_c(e):vc(()=>new oa(`Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first.`));case L.THINKING_TEXT_MESSAGE_END:return u?(u=!1,_c(e)):vc(()=>new oa(`Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first.`));case L.THINKING_START:return l?vc(()=>new oa(`Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.`)):(l=!0,_c(e));case L.THINKING_END:return l?(l=!1,_c(e)):vc(()=>new oa(`Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first.`));default:return _c(e)}}))},Wf=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),Gf=e=>Tc(()=>gc(e())).pipe(Ac(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return gc(e.text()).pipe(Cc(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,vc(()=>i)}))}let t={type:Wf.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Ts(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:r}=await n.read();if(t)break;let i={type:Wf.DATA,data:r};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{n.cancel().catch(e=>{if(e?.name!==`AbortError`)throw e})})):vc(()=>Error(`Failed to getReader() from response`))})),Kf=(e,t)=>{let n=Rf(t),r=new Ps,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==Wf.HEADERS&&e.type===Wf.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e)}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(`
16
+ `),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(`
17
+ `),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},qf=e=>{let t=new Ps,n=new Uint8Array;e.subscribe({next:e=>{if(e.type!==Wf.HEADERS&&e.type===Wf.DATA&&e.data){let t=new Uint8Array(n.length+e.data.length);t.set(n,0),t.set(e.data,n.length),n=t,r()}},error:e=>t.error(e),complete:()=>{if(n.length>0)try{r()}catch{console.warn(`Incomplete or invalid protocol buffer data at stream end`)}t.complete()}});function r(){for(;n.length>=4;){let e=4+new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(n.length<e)break;try{let r=zu(n.slice(4,e));t.next(r),n=n.slice(e)}catch(e){let n=e instanceof Error?e.message:String(e);t.error(Error(`Failed to decode protocol buffer message: ${n}`));return}}}return t.asObservable()},Jf=(e,t)=>{let n=Rf(t),r=new Ps,i=new Ls,a=!1;return e.subscribe({next:e=>{if(i.next(e),e.type===Wf.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?qf(i).subscribe({next:e=>r.next(e),error:e=>r.error(e),complete:()=>r.complete()}):Kf(i,n).subscribe({next:e=>{try{let t=Qa.parse(e);n?.event(`HTTP`,`Event validated:`,t,{type:t.type,valid:!0}),r.next(t)}catch(t){n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),r.error(t)}},error:e=>{if(e?.name===`AbortError`){r.next({type:L.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),r.complete();return}return r.error(e)},complete:()=>r.complete()})}else a||r.error(Error(`No headers event received before data events`))},error:e=>{i.error(e),r.error(e)},complete:()=>{i.complete()}}),r.asObservable()},Yf=Sf([`TextMessageStart`,`TextMessageContent`,`TextMessageEnd`,`ActionExecutionStart`,`ActionExecutionArgs`,`ActionExecutionEnd`,`ActionExecutionResult`,`AgentStateMessage`,`MetaEvent`,`RunStarted`,`RunFinished`,`RunError`,`NodeStarted`,`NodeFinished`]),Xf=Sf([`LangGraphInterruptEvent`,`PredictState`,`Exit`]);bf(`type`,[yf({type:xf(Yf.enum.TextMessageStart),messageId:gf(),parentMessageId:gf().optional(),role:gf().optional()}),yf({type:xf(Yf.enum.TextMessageContent),messageId:gf(),content:gf()}),yf({type:xf(Yf.enum.TextMessageEnd),messageId:gf()}),yf({type:xf(Yf.enum.ActionExecutionStart),actionExecutionId:gf(),actionName:gf(),parentMessageId:gf().optional()}),yf({type:xf(Yf.enum.ActionExecutionArgs),actionExecutionId:gf(),args:gf()}),yf({type:xf(Yf.enum.ActionExecutionEnd),actionExecutionId:gf()}),yf({type:xf(Yf.enum.ActionExecutionResult),actionName:gf(),actionExecutionId:gf(),result:gf()}),yf({type:xf(Yf.enum.AgentStateMessage),threadId:gf(),agentName:gf(),nodeName:gf(),runId:gf(),active:_f(),role:gf(),state:gf(),running:_f()}),yf({type:xf(Yf.enum.MetaEvent),name:Xf,value:vf()}),yf({type:xf(Yf.enum.RunError),message:gf(),code:gf().optional()})]),yf({id:gf(),role:gf(),content:gf(),parentMessageId:gf().optional()}),yf({id:gf(),name:gf(),arguments:vf(),parentMessageId:gf().optional()}),yf({id:gf(),result:vf(),actionExecutionId:gf(),actionName:gf()});var Zf=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(`
18
+ `)},Qf=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Cc(r=>{switch(r.type){case L.TEXT_MESSAGE_START:{let e=r;return[{type:Yf.enum.TextMessageStart,messageId:e.messageId,role:e.role}]}case L.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:Yf.enum.TextMessageContent,messageId:e.messageId,content:e.delta}]}case L.TEXT_MESSAGE_END:{let e=r;return[{type:Yf.enum.TextMessageEnd,messageId:e.messageId}]}case L.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:Yf.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case L.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let p=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Pc(d.function.arguments));e.tool_argument&&e.tool_argument in t?(f({...i,[e.state_key]:t[e.tool_argument]}),p=!0):e.tool_argument||(f({...i,[e.state_key]:t}),p=!0)}catch{}}return[{type:Yf.enum.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...p?[{type:Yf.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case L.TOOL_CALL_END:{let e=r;return[{type:Yf.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case L.TOOL_CALL_RESULT:{let e=r;return[{type:Yf.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||`unknown`}]}case L.RAW:return[];case L.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:Yf.enum.MetaEvent,name:e.name,value:e.value}]}case L.STATE_SNAPSHOT:return f(r.snapshot),[{type:Yf.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case L.STATE_DELTA:{let c=r,l=Po.applyPatch(i,c.delta,!0,!1);return l?(f(l.newDocument),[{type:Yf.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]):[]}case L.MESSAGES_SNAPSHOT:return c=r.messages,[{type:Yf.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case L.RUN_STARTED:return[];case L.RUN_FINISHED:return c&&(i.messages=c),Object.keys(i).length===0?[]:[{type:Yf.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:$f(c)}:{}}),active:!1}];case L.RUN_ERROR:{let e=r;return[{type:Yf.enum.RunError,message:e.message,code:e.code}]}case L.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:Yf.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case L.STEP_FINISHED:return u=[],l=null,[{type:Yf.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function $f(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=Zf(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:n.id};t.push(r)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:n.content,actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var ep=e=>t=>{let n=Rf(e),r,i,a,o,s=()=>{if(!r||o!==`text`)throw Error(`No text message to close`);let e={type:L.TEXT_MESSAGE_END,messageId:r.messageId};return o=void 0,r=void 0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),e},c=()=>{if(!i||o!==`tool`)throw Error(`No tool call to close`);let e={type:L.TOOL_CALL_END,toolCallId:i.toolCallId};return o=void 0,i=void 0,n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),e},l=()=>{if(!a||o!==`reasoning`)throw Error(`No reasoning message to close`);let e={type:L.REASONING_MESSAGE_END,messageId:a.messageId};return o=void 0,a=void 0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),e},u=()=>o===`text`?[s()]:o===`tool`?[c()]:o===`reasoning`?[l()]:[];return t.pipe(Cc(e=>{switch(e.type){case L.TEXT_MESSAGE_START:case L.TEXT_MESSAGE_CONTENT:case L.TEXT_MESSAGE_END:case L.TOOL_CALL_START:case L.TOOL_CALL_ARGS:case L.TOOL_CALL_END:case L.TOOL_CALL_RESULT:case L.STATE_SNAPSHOT:case L.STATE_DELTA:case L.MESSAGES_SNAPSHOT:case L.CUSTOM:case L.RUN_STARTED:case L.RUN_FINISHED:case L.RUN_ERROR:case L.STEP_STARTED:case L.STEP_FINISHED:case L.THINKING_START:case L.THINKING_END:case L.THINKING_TEXT_MESSAGE_START:case L.THINKING_TEXT_MESSAGE_CONTENT:case L.THINKING_TEXT_MESSAGE_END:case L.REASONING_START:case L.REASONING_MESSAGE_START:case L.REASONING_MESSAGE_CONTENT:case L.REASONING_MESSAGE_END:case L.REASONING_END:return[...u(),e];case L.RAW:case L.ACTIVITY_SNAPSHOT:case L.ACTIVITY_DELTA:case L.REASONING_ENCRYPTED_VALUE:return[e];case L.TEXT_MESSAGE_CHUNK:{let t=e,i=[];if((o!==`text`||t.messageId!==void 0&&t.messageId!==r?.messageId)&&i.push(...u()),o!==`text`){if(t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);r={messageId:t.messageId,name:t.name},o=`text`;let e={type:L.TEXT_MESSAGE_START,messageId:t.messageId,role:t.role||`assistant`,...t.name!==void 0&&{name:t.name}};i.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e={type:L.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:t.delta};i.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,e,{messageId:r.messageId})}return i}case L.TOOL_CALL_CHUNK:{let t=e,r=[];if((o!==`tool`||t.toolCallId!==void 0&&t.toolCallId!==i?.toolCallId)&&r.push(...u()),o!==`tool`){if(t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);i={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId},o=`tool`;let e={type:L.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId};r.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0){let e={type:L.TOOL_CALL_ARGS,toolCallId:i.toolCallId,delta:t.delta};r.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,e,{toolCallId:i.toolCallId})}return r}case L.REASONING_MESSAGE_CHUNK:{let t=e,r=[];if((o!==`reasoning`||t.messageId&&t.messageId!==a?.messageId)&&r.push(...u()),o!==`reasoning`){if(t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);a={messageId:t.messageId},o=`reasoning`;let e={type:L.REASONING_MESSAGE_START,messageId:t.messageId};r.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e={type:L.REASONING_MESSAGE_CONTENT,messageId:a.messageId,delta:t.delta};r.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,e,{messageId:a.messageId})}return r}}return e.type,[]}),kc(()=>{u()}))};function tp(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}var np=class{runNext(e,t){return t.run(e).pipe(ep(!1))}runNextWithState(e,t){let n=jf(e.messages||[]),r=jf(e.state||{}),i=new Ls;return Hf(e,i,t,[]).subscribe(e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)}),this.runNext(e,t).pipe(Dc(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:jf(n),state:jf(r)})))}},rp=class extends np{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function ip(e){let t=e.content;if(Array.isArray(t)){let n=t.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``);return{...e,content:n}}return typeof t==`string`?e:{...e,content:``}}var ap=class extends np{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(ip)};return this.runNext(i,t)}},op=`THINKING_START`,sp=`THINKING_END`,cp=`THINKING_TEXT_MESSAGE_START`,lp=`THINKING_TEXT_MESSAGE_CONTENT`,up=`THINKING_TEXT_MESSAGE_END`,dp=class extends np{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(xc(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case op:{this.currentReasoningId=Mf();let{title:t,...n}=e;return this.warnAboutTransformation(op,L.REASONING_START),{...n,type:L.REASONING_START,messageId:this.currentReasoningId}}case cp:return this.currentMessageId=Mf(),this.warnAboutTransformation(cp,L.REASONING_MESSAGE_START),{...e,type:L.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`assistant`};case lp:{let{delta:t,...n}=e;return this.warnAboutTransformation(lp,L.REASONING_MESSAGE_CONTENT),{...n,type:L.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Mf(),delta:t}}case up:{let t=this.currentMessageId??Mf();return this.warnAboutTransformation(up,L.REASONING_MESSAGE_END),{...e,type:L.REASONING_MESSAGE_END,messageId:t}}case sp:{let t=this.currentReasoningId??Mf();return this.warnAboutTransformation(sp,L.REASONING_END),{...e,type:L.REASONING_END,messageId:t}}default:return e}}};function fp(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function pp(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function mp(e){let t=fp(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e}function hp(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>pp(e)?mp(e):e);return{...e,content:n}}var gp=class extends np{run(e,t){let n={...e,messages:e.messages.map(hp)};return this.runNext(n,t)}},_p=`0.0.58`,vp=class{get maxVersion(){return _p}get debug(){return this._debug}set debug(e){this._debug=Lf(e),this._debugLogger=Bf(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?Bf(Lf(!0)):void 0:e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??``,this.threadId=n??$n(),this.messages=jf(r??[]),this.state=jf(i??{}),this._debug=Lf(a),this._debugLogger=Bf(this._debug),Af(this.maxVersion,`0.0.39`)<=0&&this.middlewares.unshift(new ap),Af(this.maxVersion,`0.0.45`)<=0&&this.middlewares.unshift(new dp),Af(this.maxVersion,`0.0.47`)<=0&&this.middlewares.unshift(new gp)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new rp(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??$n();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Ps;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await bc(Cs(()=>this.middlewares.length===0?this.run(n):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),ep(this.debugLogger),Uf(this.debugLogger),e=>e.pipe(jc(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Ec(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),kc(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(_c(null)));let s=jf(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new sa}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??$n();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Ps;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await bc(Cs(()=>Tc(()=>this.connect(n)),ep(this.debugLogger),Uf(this.debugLogger),e=>e.pipe(jc(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Ec(e=>(this.isRunning=!1,e instanceof sa?Rs:this.onError(n,e,a))),kc(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(_c(null)),{defaultValue:void 0});let s=jf(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return Hf(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Mc(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=jf(this.messages).filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||$n(),tools:jf(e?.tools??[]),context:jf(e?.context??[]),forwardedProps:jf(e?.forwardedProps??{}),state:jf(this.state),messages:t,...e?.resume===void 0?{}:{resume:jf(e.resume)}}}async onInitialize(e,t){if(this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new oa(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let e of this.pendingInterrupts)if(tp(e))throw new oa(`Interrupt ${e.id} expired at ${e.expiresAt}`)}let n=await If(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages&&(this.messages=n.messages,e.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}onError(e,t,n){return gc(If(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(xc(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await If(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=jf(this.messages),e.state=jf(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=jf(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=jf(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=jf(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??$n();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t)).pipe(ep(this.debugLogger),Uf(this.debugLogger),Qf(this.threadId,t.runId,this.agentId),e=>e.pipe(xc(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}},yp=class extends vp{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=jf(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return Jf(Gf(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=jf(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},bp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),xp=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Sp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Cp=e=>{let t=Sp(e);return t.charAt(0).toUpperCase()+t.slice(1)},wp={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`},Tp=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ep=(0,S.createContext)({}),Dp=()=>(0,S.useContext)(Ep),Op=(0,S.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Dp()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,S.createElement)(`svg`,{ref:c,...wp,width:t??l??wp.width,height:t??l??wp.height,stroke:e??f,strokeWidth:m,className:bp(`lucide`,p,i),...!a&&!Tp(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,S.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),kp=(e,t)=>{let n=(0,S.forwardRef)(({className:n,...r},i)=>(0,S.createElement)(Op,{ref:i,iconNode:t,className:bp(`lucide-${xp(Cp(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Cp(e),n},Ap=kp(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),jp=kp(`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`}]]),Mp=kp(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Np=kp(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Pp=kp(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Fp=kp(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ip=kp(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),Lp=kp(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Rp=kp(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),zp=kp(`grip-vertical`,[[`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`}]]),Bp=kp(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Vp=kp(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Hp=kp(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),Up=kp(`server-off`,[[`path`,{d:`M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5`,key:`bt2siv`}],[`path`,{d:`M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z`,key:`1hjrv1`}],[`path`,{d:`M22 17v-1a2 2 0 0 0-2-2h-1`,key:`1iynyr`}],[`path`,{d:`M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z`,key:`161ggg`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Wp=kp(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Gp=Object.defineProperty,Kp=(e,t)=>Gp(e,`name`,{value:t,configurable:!0});function qp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Kp(qp,`setRef`);function Jp(...e){return t=>{let n=!1,r=e.map(e=>{let r=qp(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():qp(e[t],null)}}}}Kp(Jp,`composeRefs`);function Yp(...e){return S.useCallback(Jp(...e),e)}Kp(Yp,`useComposedRefs`);var Xp=Object.defineProperty,Zp=(e,t)=>Xp(e,`name`,{value:t,configurable:!0});function Qp(e){let t=S.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];sm(r)&&typeof dm==`function`&&(r=dm(r._payload)),S.Children.forEach(r,e=>{if(am(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;sm(n)&&typeof dm==`function`&&(n=dm(n._payload)),a=nm(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=S.cloneElement(a,void 0,s):!o&&S.Children.count(r)===1&&S.isValidElement(r)&&(a=r);let c=a?im(a):void 0,l=Yp(n,c);if(!a){if(r||r===0)throw Error(o?um(e):lm(e));return r}let u=rm(i,a.props??{});return a.type!==S.Fragment&&(u.ref=n?l:c),S.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Zp(Qp,`createSlot`);var $p=Qp(`Slot`),em=Symbol.for(`radix.slottable`);function tm(e){let t=Zp(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=em,t}Zp(tm,`createSlottable`);var nm=Zp((e,t)=>{if(`child`in e.props){let t=e.props.child;return S.isValidElement(t)?S.cloneElement(t,void 0,e.props.children(t.props.children)):null}return S.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function rm(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Zp(rm,`mergeProps`);function im(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Zp(im,`getElementRef`);function am(e){return S.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===em}Zp(am,`isSlottable`);var om=Symbol.for(`react.lazy`);function sm(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===om&&`_payload`in e&&cm(e._payload)}Zp(sm,`isLazyComponent`);function cm(e){return typeof e==`object`&&!!e&&`then`in e}Zp(cm,`isPromiseLike`);var lm=Zp(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),um=Zp(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),dm=S.use,fm=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),pm=o(((e,t)=>{t.exports=fm()})),mm=l(h(),1),Y=pm(),hm=Object.defineProperty,gm=(e,t)=>hm(e,`name`,{value:t,configurable:!0}),_m=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Qp(`Primitive.${t}`),r=S.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,Y.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vm(e,t){e&&mm.flushSync(()=>e.dispatchEvent(t))}gm(vm,`dispatchDiscreteCustomEvent`);var ym=Object.defineProperty,bm=(e,t)=>ym(e,`name`,{value:t,configurable:!0}),xm=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`}),Sm=S.forwardRef(bm(function(e,t){return(0,Y.jsx)(_m.span,{...e,ref:t,style:{...xm,...e.style}})},`VisuallyHidden`)),Cm=Object.defineProperty,wm=(e,t)=>Cm(e,`name`,{value:t,configurable:!0});function Tm(e,t){let n=S.createContext(t);n.displayName=e+`Context`;let r=wm(e=>{let{children:t,...r}=e,i=S.useMemo(()=>r,Object.values(r));return(0,Y.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=S.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return wm(i,`useContext`),[r,i]}wm(Tm,`createContext`);function Em(e,t=[]){let n=[];function r(t,r){let i=S.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=wm(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=S.useMemo(()=>o,Object.values(o));return(0,Y.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=S.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return wm(s,`useContext`),[o,s]}wm(r,`createContext`);let i=wm(()=>{let t=n.map(e=>S.createContext(e));return wm(function(n){let r=n?.[e]||t;return S.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Dm(i,...t)]}wm(Em,`createContextScope`);function Dm(...e){let t=e[0];if(e.length===1)return t;let n=wm(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return wm(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}wm(Dm,`composeContextScopes`);var Om=Object.defineProperty,km=(e,t)=>Om(e,`name`,{value:t,configurable:!0});function Am(e){let t=e+`CollectionProvider`,[n,r]=Em(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=km(e=>{let{scope:t,children:n}=e,r=S.useRef(null),a=S.useRef(new Map).current;return(0,Y.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Qp(s),l=S.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Yp(t,a(s,n).collectionRef);return(0,Y.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Qp(u),p=S.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=S.useRef(null),s=Yp(t,o),c=a(u,n);return S.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,Y.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return S.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return km(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}km(Am,`createCollection`);var jm=new WeakMap,Mm=class e extends Map{static{km(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],jm.set(this,!0)}set(e,t){return jm.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Fm(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Nm(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Nm(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Nm(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Nm(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Pm(e,t);return n===-1?void 0:e[n]}km(Nm,`at`);function Pm(e,t){let n=e.length,r=Fm(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}km(Pm,`toSafeIndex`);function Fm(e){return e!==e||e===0?0:Math.trunc(e)}km(Fm,`toSafeInteger`);function Im(e){let t=e+`CollectionProvider`,[n,r]=Em(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Mm,setItemMap:km(()=>void 0,`setItemMap`)}),o=km(({state:e,...t})=>e?(0,Y.jsx)(c,{...t,state:e}):(0,Y.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=km(e=>{let t=h();return(0,Y.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=km(e=>{let{scope:t,children:n,state:r}=e,a=S.useRef(null),[o,s]=S.useState(null),c=Yp(a,s),[l,u]=r;return S.useEffect(()=>{if(!o)return;let e=Bm(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,Y.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=Qp(l),d=S.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Yp(t,a(l,n).collectionRef);return(0,Y.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=Qp(f),m=S.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=S.useRef(null),[s,c]=S.useState(null),l=Yp(t,o,c),{setItemMap:u}=a(f,n),d=S.useRef(i);Lm(d.current,i)||(d.current=i);let m=d.current;return S.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(zm):(t.set(s,{...e,element:s}),t.toSorted(zm)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Mm(e)))}},[s,m,u]),(0,Y.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return S.useState(new Mm)}km(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return km(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}km(Im,`createCollection`);function Lm(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}km(Lm,`shallowEqual`);function Rm(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}km(Rm,`isElementPreceding`);function zm(e,t){return!e[1].element||!t[1].element?0:Rm(e[1].element,t[1].element)?-1:1}km(zm,`sortByDocumentPosition`);function Bm(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}km(Bm,`getChildListObserver`);var Vm=Object.defineProperty,Hm=(e,t)=>Vm(e,`name`,{value:t,configurable:!0}),Um=!!(typeof window<`u`&&window.document&&window.document.createElement);function X(e,t,{checkForDefaultPrevented:n=!0}={}){return Hm(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Hm(X,`composeEventHandlers`);function Wm(e){if(!Um)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Hm(Wm,`getOwnerWindow`);function Gm(e){if(!Um)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Hm(Gm,`getOwnerDocument`);function Km(e,t=!1){let{activeElement:n}=Gm(e);if(!n?.nodeName)return null;if(qm(n)&&n.contentDocument)return Km(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Gm(n).getElementById(e);if(t)return t}}return n}Hm(Km,`getActiveElement`);function qm(e){return e.tagName===`IFRAME`}Hm(qm,`isFrame`);var Jm=globalThis?.document?S.useLayoutEffect:()=>{},Ym=Object.defineProperty,Xm=(e,t)=>Ym(e,`name`,{value:t,configurable:!0}),Zm=S.useEffectEvent,Qm=S.useInsertionEffect;function $m(e){if(typeof Zm==`function`)return Zm(e);let t=S.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Qm==`function`?Qm(()=>{t.current=e}):Jm(()=>{t.current=e}),S.useMemo(()=>((...e)=>t.current?.(...e)),[])}Xm($m,`useEffectEvent`);var eh=Object.defineProperty,th=(e,t)=>eh(e,`name`,{value:t,configurable:!0}),nh=S.useInsertionEffect||Jm;function rh({prop:e,defaultProp:t,onChange:n=th(()=>{},`onChange`),caller:r}){let[i,a,o]=ih({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,S.useCallback(t=>{if(s){let n=ah(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}th(rh,`useControllableState`);function ih({defaultProp:e,onChange:t}){let[n,r]=S.useState(e),i=S.useRef(n),a=S.useRef(t);return nh(()=>{a.current=t},[t]),S.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}th(ih,`useUncontrolledState`);function ah(e){return typeof e==`function`}th(ah,`isFunction`);var oh=Symbol(`RADIX:SYNC_STATE`);function sh(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=$m(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=S.useReducer((t,n)=>{if(n.type===oh)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=S.useRef(p);S.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=S.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return S.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:oh,state:i})},[i,d.state,c]),[h,f]}th(sh,`useControllableStateReducer`);var ch=Object.defineProperty,lh=(e,t)=>ch(e,`name`,{value:t,configurable:!0});function uh(e,t){return S.useReducer((e,n)=>t[e][n]??e,e)}lh(uh,`useStateMachine`);var dh=lh(e=>{let{present:t,children:n}=e,r=fh(t),i=typeof n==`function`?n({present:r.isPresent}):S.Children.only(n),a=mh(r.ref,gh(i));return typeof n==`function`||r.isPresent?S.cloneElement(i,{ref:a}):null},`Presence`);function fh(e){let[t,n]=S.useState(),r=S.useRef(null),i=S.useRef(e),a=S.useRef(`none`),o=S.useRef(void 0),[s,c]=uh(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return S.useEffect(()=>{s===`mounted`?(a.current=o.current??hh(r.current),o.current=void 0):a.current=`none`},[s]),Jm(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=hh(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Jm(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=lh(a=>{let o=hh(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=lh(e=>{e.target===t&&(a.current=hh(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:S.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=hh(t)}else r.current=null;n(e)},[])}}lh(fh,`usePresence`);function ph(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}lh(ph,`setRef`);function mh(...e){let t=S.useRef(e);return t.current=e,S.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ph(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ph(n[e],null)}}},[])}lh(mh,`useStableComposedRefs`);function hh(e){return e?.animationName||`none`}lh(hh,`getAnimationName`);function gh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}lh(gh,`getElementRef`);var _h=Object.defineProperty,vh=(e,t)=>_h(e,`name`,{value:t,configurable:!0}),yh=S.useId||(()=>void 0),bh=0;function xh(e){let[t,n]=S.useState(yh());return Jm(()=>{e||n(e=>e??String(bh++))},[e]),e||(t?`radix-${t}`:``)}vh(xh,`useId`);var Sh=Object.defineProperty,Ch=(e,t)=>Sh(e,`name`,{value:t,configurable:!0}),wh=`Collapsible`,[Th,Eh]=Em(wh),[Dh,Oh]=Th(wh),kh=S.forwardRef(Ch(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=rh({prop:r,defaultProp:i??!1,onChange:o,caller:wh});return(0,Y.jsx)(Dh,{scope:n,disabled:a,contentId:xh(),open:c,onOpenToggle:S.useCallback(()=>l(e=>!e),[l]),children:(0,Y.jsx)(_m.div,{"data-state":Fh(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),Ah=`CollapsibleTrigger`,jh=S.forwardRef(Ch(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Oh(Ah,n);return(0,Y.jsx)(_m.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Fh(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:X(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Mh=`CollapsibleContent`,Nh=S.forwardRef(Ch(function(e,t){let{forceMount:n,...r}=e,i=Oh(Mh,e.__scopeCollapsible);return(0,Y.jsx)(dh,{present:n||i.open,children:({present:e})=>(0,Y.jsx)(Ph,{...r,ref:t,present:e})})},`CollapsibleContent`)),Ph=S.forwardRef(Ch(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Oh(Mh,n),[s,c]=S.useState(r),l=S.useRef(null),u=Yp(t,l),d=S.useRef(0),f=d.current,p=S.useRef(0),m=p.current,h=o.open||s,g=S.useRef(h),_=S.useRef(void 0);return S.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Jm(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,Y.jsx)(_m.div,{"data-state":Fh(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})},`CollapsibleContentImpl`));function Fh(e){return e?`open`:`closed`}Ch(Fh,`getState`);var Ih=kh,Lh=Object.defineProperty,Rh=(e,t)=>Lh(e,`name`,{value:t,configurable:!0}),zh=S.createContext(void 0);function Bh(e){let t=S.useContext(zh);return e||t||`ltr`}Rh(Bh,`useDirection`);var Vh=Object.defineProperty,Hh=(e,t)=>Vh(e,`name`,{value:t,configurable:!0});function Uh(e){let t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>((...e)=>t.current?.(...e)),[])}Hh(Uh,`useCallbackRef`);var Wh=Object.defineProperty,Gh=(e,t)=>Wh(e,`name`,{value:t,configurable:!0}),Kh=`dismissableLayer.update`,qh=`dismissableLayer.pointerDownOutside`,Jh=`dismissableLayer.focusOutside`,Yh,Xh=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Zh=S.forwardRef(Gh(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=S.useContext(Xh),[d,f]=S.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=S.useState({}),h=Yp(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,C=S.useRef(!1),w=eg(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),T=tg(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),ee=d?y===g.length-1:!1,te=Uh(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return S.useEffect(()=>{if(ee)return p.addEventListener(`keydown`,te,{capture:!0}),()=>p.removeEventListener(`keydown`,te,{capture:!0})},[p,ee,te]),S.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Yh=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ng(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Yh))}},[d,p,n,u]),S.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ng())},[d,u]),S.useEffect(()=>{let e=Gh(()=>m({}),`handleUpdate`);return document.addEventListener(Kh,e),()=>document.removeEventListener(Kh,e)},[]),(0,Y.jsx)(_m.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:X(e.onFocusCapture,T.onFocusCapture),onBlurCapture:X(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Qh(){let e=S.useContext(Xh),[t,n]=S.useState(null);return S.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Gh(Qh,`useDismissableLayerSurface`);var $h=Gh(()=>!0,`IS_TRUE`);function eg(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=$h}=t,s=Uh(e),c=S.useRef(!1),l=S.useRef(!1),u=S.useRef(new Map),d=S.useRef(()=>{});return S.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Gh(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Gh(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Gh(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Gh(p,`handleInteractionBubble`);let m=Gh(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||rg(qh,s,p,{discrete:!0})};if(Gh(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Gh(()=>c.current=!0,`onPointerDownCapture`)}}Gh(eg,`usePointerDownOutside`);function tg(e,t=globalThis?.document){let n=Uh(e),r=S.useRef(!1);return S.useEffect(()=>{let e=Gh(e=>{e.target&&!r.current&&rg(Jh,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Gh(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Gh(()=>r.current=!1,`onBlurCapture`)}}Gh(tg,`useFocusOutside`);function ng(){let e=new CustomEvent(Kh);document.dispatchEvent(e)}Gh(ng,`dispatchUpdate`);function rg(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?vm(i,a):i.dispatchEvent(a)}Gh(rg,`handleAndDispatchCustomEvent`);var ig=Object.defineProperty,ag=(e,t)=>ig(e,`name`,{value:t,configurable:!0}),og=`focusScope.autoFocusOnMount`,sg=`focusScope.autoFocusOnUnmount`,cg={bubbles:!1,cancelable:!0},lg=S.forwardRef(ag(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=S.useState(null),l=Uh(i),u=Uh(a),d=S.useRef(null),f=Yp(t,c),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:gg(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||gg(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&gg(s)};ag(e,`handleFocusIn`),ag(t,`handleFocusOut`),ag(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),S.useEffect(()=>{if(s){_g.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(og,cg);s.addEventListener(og,l),s.dispatchEvent(t),t.defaultPrevented||(ug(bg(fg(s)),{select:!0}),document.activeElement===e&&gg(s))}return()=>{s.removeEventListener(og,l),setTimeout(()=>{let t=new CustomEvent(sg,cg);s.addEventListener(sg,u),s.dispatchEvent(t),t.defaultPrevented||gg(e??document.body,{select:!0}),s.removeEventListener(sg,u),_g.remove(p)},0)}}},[s,l,u,p]);let m=S.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=dg(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&gg(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&gg(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,Y.jsx)(_m.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function ug(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(gg(r,{select:t}),document.activeElement!==n)return}ag(ug,`focusFirst`);function dg(e){let t=fg(e);return[pg(t,e),pg(t.reverse(),e)]}ag(dg,`getTabbableEdges`);function fg(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ag(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ag(fg,`getTabbableCandidates`);function pg(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):mg(r,{upTo:t})))return r}ag(pg,`findVisible`);function mg(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ag(mg,`isHidden`);function hg(e){return e instanceof HTMLInputElement&&`select`in e}ag(hg,`isSelectableInput`);function gg(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hg(e)&&t&&e.select()}}ag(gg,`focus`);var _g=vg();function vg(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=yg(e,t),e.unshift(t)},remove(t){e=yg(e,t),e[0]?.resume()}}}ag(vg,`createFocusScopesStack`);function yg(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ag(yg,`arrayRemove`);function bg(e){return e.filter(e=>e.tagName!==`A`)}ag(bg,`removeLinks`);var xg=Object.defineProperty,Sg=S.forwardRef(((e,t)=>xg(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=S.useState(!1);Jm(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?mm.createPortal((0,Y.jsx)(_m.div,{...r,ref:t}),o):null},`Portal`)),Cg=Object.defineProperty,wg=(e,t)=>Cg(e,`name`,{value:t,configurable:!0}),Tg=0,Eg=null;function Dg(e){return Og(),e.children}wg(Dg,`FocusGuards`);function Og(){S.useEffect(()=>{Eg||={start:kg(),end:kg()};let{start:e,end:t}=Eg;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Tg++,()=>{Tg===1&&(Eg?.start.remove(),Eg?.end.remove(),Eg=null),Tg=Math.max(0,Tg-1)}},[])}wg(Og,`useFocusGuards`);function kg(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}wg(kg,`createFocusGuard`);var Ag=`right-scroll-bar-position`,jg=`width-before-scroll-bar`,Mg=`with-scroll-bars-hidden`,Ng=`--removed-body-scroll-bar-size`;function Pg(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Fg(e,t){var n=(0,S.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ig=typeof window<`u`?S.useLayoutEffect:S.useEffect,Lg=new WeakMap;function Rg(e,t){var n=Fg(t||null,function(t){return e.forEach(function(e){return Pg(e,t)})});return Ig(function(){var t=Lg.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Pg(e,null)}),i.forEach(function(e){r.has(e)||Pg(e,a)})}Lg.set(n,e)},[e]),n}function zg(e){return e}function Bg(e,t){t===void 0&&(t=zg);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Vg(e){e===void 0&&(e={});var t=Bg(null);return t.options=Lo({async:!0,ssr:!1},e),t}var Hg=function(e){var t=e.sideCar,n=Ro(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return S.createElement(r,Lo({},n))};Hg.isSideCarExport=!0;function Ug(e,t){return e.useMedium(t),Hg}var Wg=Vg(),Gg=function(){},Kg=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:Gg,onWheelCapture:Gg,onTouchMoveCapture:Gg}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Ro(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,C=Rg([n,t]),w=Lo(Lo({},b),i);return S.createElement(S.Fragment,null,u&&S.createElement(x,{sideCar:Wg,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?S.cloneElement(S.Children.only(s),Lo(Lo({},w),{ref:C})):S.createElement(v,Lo({},w,{className:c,ref:C}),s))});Kg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Kg.classNames={fullWidth:jg,zeroRight:Ag};var qg=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Jg(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=qg();return t&&e.setAttribute(`nonce`,t),e}function Yg(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Xg(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Zg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Jg())&&(Yg(t,n),Xg(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Qg=function(){var e=Zg();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$g=function(){var e=Qg();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},e_={left:0,top:0,right:0,gap:0},t_=function(e){return parseInt(e||``,10)||0},n_=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[t_(n),t_(r),t_(i)]},r_=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return e_;var t=n_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},i_=$g(),a_=`data-scroll-locked`,o_=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
19
+ .${Mg} {
20
+ overflow: hidden ${r};
21
+ padding-right: ${s}px ${r};
22
+ }
23
+ body[${a_}] {
24
+ overflow: hidden ${r};
25
+ overscroll-behavior: contain;
26
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
27
+ padding-left: ${i}px;
28
+ padding-top: ${a}px;
29
+ padding-right: ${o}px;
30
+ margin-left:0;
31
+ margin-top:0;
32
+ margin-right: ${s}px ${r};
33
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
34
+ }
35
+
36
+ .${Ag} {
37
+ right: ${s}px ${r};
38
+ }
39
+
40
+ .${jg} {
41
+ margin-right: ${s}px ${r};
42
+ }
43
+
44
+ .${Ag} .${Ag} {
45
+ right: 0 ${r};
46
+ }
47
+
48
+ .${jg} .${jg} {
49
+ margin-right: 0 ${r};
50
+ }
51
+
52
+ body[${a_}] {
53
+ ${Ng}: ${s}px;
54
+ }
55
+ `},s_=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},c_=function(){S.useEffect(function(){return document.body.setAttribute(a_,(s_()+1).toString()),function(){var e=s_()-1;e<=0?document.body.removeAttribute(a_):document.body.setAttribute(a_,e.toString())}},[])},l_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;c_();var a=S.useMemo(function(){return r_(i)},[i]);return S.createElement(i_,{styles:o_(a,!t,i,n?``:`!important`)})},u_=!1;if(typeof window<`u`)try{var d_=Object.defineProperty({},"passive",{get:function(){return u_=!0,!0}});window.addEventListener(`test`,d_,d_),window.removeEventListener(`test`,d_,d_)}catch{u_=!1}var f_=u_?{passive:!1}:!1,p_=function(e){return e.tagName===`TEXTAREA`},m_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!p_(e)&&n[t]===`visible`)},h_=function(e){return m_(e,`overflowY`)},g_=function(e){return m_(e,`overflowX`)},__=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),b_(e,r)){var i=x_(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},v_=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},y_=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},b_=function(e,t){return e===`v`?h_(t):g_(t)},x_=function(e,t){return e===`v`?v_(t):y_(t)},S_=function(e,t){return e===`h`&&t===`rtl`?-1:1},C_=function(e,t,n,r,i){var a=S_(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=x_(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&b_(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},w_=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},T_=function(e){return[e.deltaX,e.deltaY]},E_=function(e){return e&&`current`in e?e.current:e},D_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},O_=function(e){return`
56
+ .block-interactivity-${e} {pointer-events: none;}
57
+ .allow-interactivity-${e} {pointer-events: all;}
58
+ `},k_=0,A_=[];function j_(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(k_++)[0],a=S.useState($g)[0],o=S.useRef(e);S.useEffect(function(){o.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Uo([e.lockRef.current],(e.shards||[]).map(E_),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=S.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=w_(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=__(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=__(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return C_(h,t,e,h===`h`?s:c,!0)},[]),c=S.useCallback(function(e){var n=e;if(!(!A_.length||A_[A_.length-1]!==a)){var r=`deltaY`in n?T_(n):w_(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&D_(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(E_).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=S.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:M_(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=S.useCallback(function(e){n.current=w_(e),r.current=void 0},[]),d=S.useCallback(function(t){l(t.type,T_(t),t.target,s(t,e.lockRef.current))},[]),f=S.useCallback(function(t){l(t.type,w_(t),t.target,s(t,e.lockRef.current))},[]);S.useEffect(function(){return A_.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,f_),document.addEventListener(`touchmove`,c,f_),document.addEventListener(`touchstart`,u,f_),function(){A_=A_.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,f_),document.removeEventListener(`touchmove`,c,f_),document.removeEventListener(`touchstart`,u,f_)}},[]);var p=e.removeScrollBar,m=e.inert;return S.createElement(S.Fragment,null,m?S.createElement(a,{styles:O_(i)}):null,p?S.createElement(l_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function M_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var N_=Ug(Wg,j_),P_=S.forwardRef(function(e,t){return S.createElement(Kg,Lo({},e,{ref:t,sideCar:N_}))});P_.classNames=Kg.classNames;var F_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},I_=new WeakMap,L_=new WeakMap,R_={},z_=0,B_=function(e){return e&&(e.host||B_(e.parentNode))},V_=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=B_(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},H_=function(e,t,n,r){var i=V_(t,Array.isArray(e)?e:[e]);R_[n]||(R_[n]=new WeakMap);var a=R_[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(I_.get(e)||0)+1,l=(a.get(e)||0)+1;I_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&L_.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),z_++,function(){o.forEach(function(e){var t=I_.get(e)-1,i=a.get(e)-1;I_.set(e,t),a.set(e,i),t||(L_.has(e)||e.removeAttribute(r),L_.delete(e)),i||e.removeAttribute(n)}),z_--,z_||(I_=new WeakMap,I_=new WeakMap,L_=new WeakMap,R_={})}},U_=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||F_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),H_(r,i,n,`aria-hidden`)):function(){return null}},W_=Object.defineProperty,G_=(e,t)=>W_(e,`name`,{value:t,configurable:!0}),K_=`Dialog`,[q_,J_]=Em(K_),[Y_,X_]=q_(K_),Z_=G_(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=S.useRef(null),c=S.useRef(null),[l,u]=rh({prop:r,defaultProp:i??!1,onChange:a,caller:K_}),[d,f]=S.useState(0),[p,m]=S.useState(0);return(0,Y.jsx)(Y_,{scope:t,triggerRef:s,contentRef:c,contentId:xh(),titleId:xh(),descriptionId:xh(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:S.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Q_=`DialogPortal`,[$_,ev]=q_(Q_,{forceMount:void 0}),tv=G_(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=X_(Q_,t);return(0,Y.jsx)($_,{scope:t,forceMount:n,children:S.Children.map(r,e=>(0,Y.jsx)(dh,{present:n||a.open,children:(0,Y.jsx)(Sg,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),nv=`DialogOverlay`,rv=S.forwardRef(G_(function(e,t){let n=ev(nv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X_(nv,e.__scopeDialog);return a.modal?(0,Y.jsx)(dh,{present:r||a.open,children:(0,Y.jsx)(av,{...i,ref:t})}):null},`DialogOverlay`)),iv=Qp(`DialogOverlay.RemoveScroll`),av=S.forwardRef(G_(function(e,t){let{__scopeDialog:n,...r}=e,i=X_(nv,n),a=Yp(t,Qh());return(0,Y.jsx)(P_,{as:iv,allowPinchZoom:!0,shards:[i.contentRef],children:(0,Y.jsx)(_m.div,{"data-state":_v(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ov=`DialogContent`,sv=S.forwardRef(G_(function(e,t){let n=ev(ov,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X_(ov,e.__scopeDialog);return(0,Y.jsx)(dh,{present:r||a.open,children:a.modal?(0,Y.jsx)(cv,{...i,ref:t}):(0,Y.jsx)(lv,{...i,ref:t})})},`DialogContent`)),cv=S.forwardRef(G_(function(e,t){let n=X_(ov,e.__scopeDialog),r=S.useRef(null),i=Yp(t,n.contentRef,r);return S.useEffect(()=>{let e=r.current;if(e)return U_(e)},[]),(0,Y.jsx)(uv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),lv=S.forwardRef(G_(function(e,t){let n=X_(ov,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return(0,Y.jsx)(uv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),uv=S.forwardRef(G_(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=X_(ov,n);return Og(),(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsx)(lg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,Y.jsx)(Zh,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":_v(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),dv=`DialogTitle`,fv=S.forwardRef(G_(function(e,t){let{__scopeDialog:n,...r}=e,i=X_(dv,n),{setTitleCount:a}=i;return Jm(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,Y.jsx)(_m.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),pv=`DialogDescription`,mv=S.forwardRef(G_(function(e,t){let{__scopeDialog:n,...r}=e,i=X_(pv,n),{setDescriptionCount:a}=i;return Jm(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,Y.jsx)(_m.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),hv=`DialogClose`,gv=S.forwardRef(G_(function(e,t){let{__scopeDialog:n,...r}=e,i=X_(hv,n);return(0,Y.jsx)(_m.button,{type:`button`,...r,ref:t,onClick:X(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function _v(e){return e?`open`:`closed`}G_(_v,`getState`);var vv=Object.defineProperty,yv=(e,t)=>vv(e,`name`,{value:t,configurable:!0});function bv(e){let[t,n]=S.useState(void 0);return Jm(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}yv(bv,`useSize`);var xv=[`top`,`right`,`bottom`,`left`],Sv=Math.min,Cv=Math.max,wv=Math.round,Tv=Math.floor,Ev=e=>({x:e,y:e}),Dv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ov(e,t,n){return Cv(e,Sv(t,n))}function kv(e,t){return typeof e==`function`?e(t):e}function Av(e){return e.split(`-`)[0]}function jv(e){return e.split(`-`)[1]}function Mv(e){return e===`x`?`y`:`x`}function Nv(e){return e===`y`?`height`:`width`}function Pv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Fv(e){return Mv(Pv(e))}function Iv(e,t,n){n===void 0&&(n=!1);let r=jv(e),i=Fv(e),a=Nv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Gv(o)),[o,Gv(o)]}function Lv(e){let t=Gv(e);return[Rv(e),t,Rv(t)]}function Rv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var zv=[`left`,`right`],Bv=[`right`,`left`],Vv=[`top`,`bottom`],Hv=[`bottom`,`top`];function Uv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Bv:zv:t?zv:Bv;case`left`:case`right`:return t?Vv:Hv;default:return[]}}function Wv(e,t,n,r){let i=jv(e),a=Uv(Av(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Rv)))),a}function Gv(e){let t=Av(e);return Dv[t]+e.slice(t.length)}function Kv(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function qv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Kv(e)}function Jv(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Yv(e,t,n){let{reference:r,floating:i}=e,a=Pv(t),o=Fv(t),s=Nv(o),c=Av(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=jv(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Xv(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=kv(t,e),p=qv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Jv(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Jv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Zv=50,Qv=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Xv},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Yv(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Zv&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Yv(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},$v=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=kv(e,t)||{};if(l==null)return{};let d=qv(u),f={x:n,y:r},p=Fv(i),m=Nv(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=Sv(d[_],T),te=Sv(d[v],T),ne=C-h[m]-te,E=C/2-h[m]/2+w,re=Ov(ee,E,ne),ie=!c.arrow&&jv(i)!=null&&E!==re&&a.reference[m]/2-(E<ee?ee:te)-h[m]/2<0,ae=ie?E<ee?E-ee:E-ne:0;return{[p]:f[p]+ae,data:{[p]:re,centerOffset:E-re-ae,...ie&&{alignmentOffset:ae}},reset:ie}}}),ey=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=kv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Av(r),_=Pv(o),v=Av(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Gv(o)]:Lv(o)),x=p!==`none`;!d&&x&&b.push(...Wv(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Iv(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Pv(t)||T.every(e=>Pv(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Pv(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ty(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ny(e){return xv.some(t=>e[t]>=0)}var ry=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=kv(e,t);switch(i){case`referenceHidden`:{let e=ty(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ny(e)}}}case`escaped`:{let e=ty(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ny(e)}}}default:return{}}}}},iy=new Set([`left`,`top`]);async function ay(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Av(n),s=jv(n),c=Pv(n)===`y`,l=iy.has(o)?-1:1,u=a&&c?-1:1,d=kv(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var oy=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ay(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},sy=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=kv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Pv(i),p=Mv(f),m=u[p],h=u[f],g=(e,t)=>Ov(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},cy=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=kv(e,t),u={x:n,y:r},d=Pv(i),f=Mv(d),p=u[f],m=u[d],h=kv(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=iy.has(Av(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ly=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=kv(e,t),c=await i.detectOverflow(t,s),l=Av(n),u=jv(n),d=Pv(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Sv(p-c[m],g),y=Sv(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Cv(c.left,c.right):S=p-2*Cv(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function uy(){return typeof window<`u`}function dy(e){return my(e)?(e.nodeName||``).toLowerCase():`#document`}function fy(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function py(e){return((my(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function my(e){return uy()?e instanceof Node||e instanceof fy(e).Node:!1}function hy(e){return uy()?e instanceof Element||e instanceof fy(e).Element:!1}function gy(e){return uy()?e instanceof HTMLElement||e instanceof fy(e).HTMLElement:!1}function _y(e){return!uy()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof fy(e).ShadowRoot}function vy(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ky(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function yy(e){return/^(table|td|th)$/.test(dy(e))}function by(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var xy=/transform|translate|scale|rotate|perspective|filter/,Sy=/paint|layout|strict|content/,Cy=e=>!!e&&e!==`none`,wy;function Ty(e){let t=hy(e)?ky(e):e;return Cy(t.transform)||Cy(t.translate)||Cy(t.scale)||Cy(t.rotate)||Cy(t.perspective)||!Dy()&&(Cy(t.backdropFilter)||Cy(t.filter))||xy.test(t.willChange||``)||Sy.test(t.contain||``)}function Ey(e){let t=jy(e);for(;gy(t)&&!Oy(t);){if(Ty(t))return t;if(by(t))return null;t=jy(t)}return null}function Dy(){return wy??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),wy}function Oy(e){return/^(html|body|#document)$/.test(dy(e))}function ky(e){return fy(e).getComputedStyle(e)}function Ay(e){return hy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jy(e){if(dy(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_y(e)&&e.host||py(e);return _y(t)?t.host:t}function My(e){let t=jy(e);return Oy(t)?(e.ownerDocument||e).body:gy(t)&&vy(t)?t:My(t)}function Ny(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=My(e),i=r===e.ownerDocument?.body,a=fy(r);if(i){let e=Py(a);return t.concat(a,a.visualViewport||[],vy(r)?r:[],e&&n?Ny(e):[])}return t.concat(r,Ny(r,[],n))}function Py(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fy(e){let t=ky(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=gy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=wv(n)!==a||wv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Iy(e){return hy(e)?e:e.contextElement}function Ly(e){let t=Iy(e);if(!gy(t))return Ev(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Fy(t),o=(a?wv(n.width):n.width)/r,s=(a?wv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ry=Ev(0);function zy(e){let t=fy(e);return!Dy()||!t.visualViewport?Ry:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function By(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===fy(e)}function Vy(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Iy(e),o=Ev(1);t&&(r?hy(r)&&(o=Ly(r)):o=Ly(e));let s=By(a,n,r)?zy(a):Ev(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=fy(a),t=hy(r)?fy(r):r,n=e,i=Py(n);for(;i&&t!==n;){let e=Ly(i),t=i.getBoundingClientRect(),r=ky(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=fy(i),i=Py(n)}}return Jv({width:u,height:d,x:c,y:l})}function Hy(e,t){let n=Ay(e).scrollLeft;return t?t.left+n:Vy(py(e)).left+n}function Uy(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Hy(e,n),y:n.top+t.scrollTop}}function Wy(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=py(r),s=t?by(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ev(1),u=Ev(0),d=gy(r);if((d||!a)&&((dy(r)!==`body`||vy(o))&&(c=Ay(r)),d)){let e=Vy(r);l=Ly(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Uy(o,c):Ev(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Gy(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ky(e){let t=Ay(e),n=e.ownerDocument.body,r=Cv(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Cv(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Hy(e),o=-t.scrollTop;return ky(n).direction===`rtl`&&(a+=Cv(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var qy=25;function Jy(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=fy(e),a=py(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Dy()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Hy(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=qy&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Yy(e,t){let n=Vy(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ly(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Xy(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Jy(e,n,t);else if(t===`document`)r=Ky(py(e));else if(hy(t))r=Yy(t,n);else{let n=zy(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Jv(r)}function Zy(e,t){let n=t.get(e);if(n)return n;let r=Ny(e,[],!1).filter(e=>hy(e)&&dy(e)!==`body`),i=null,a=ky(e).position===`fixed`,o=a?jy(e):e;for(;hy(o)&&!Oy(o);){let e=ky(o),t=Ty(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=jy(o)}return t.set(e,r),r}function Qy(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?by(t)?[]:Zy(t,this._c):[].concat(n),r],o=Xy(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Xy(t,a[e],i);s=Cv(n.top,s),c=Sv(n.right,c),l=Sv(n.bottom,l),u=Cv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $y(e){let{width:t,height:n}=Fy(e);return{width:t,height:n}}function eb(e,t,n){let r=gy(t),i=py(t),a=n===`fixed`,o=Vy(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ev(0);if((r||!a)&&((dy(t)!==`body`||vy(i))&&(s=Ay(t)),r)){let e=Vy(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Hy(i));let l=i&&!r&&!a?Uy(i,s):Ev(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function tb(e){return ky(e).position===`static`}function nb(e,t){if(!gy(e)||ky(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return py(e)===n&&(n=n.ownerDocument.body),n}function rb(e,t){let n=fy(e);if(by(e))return n;if(!gy(e)){let t=jy(e);for(;t&&!Oy(t);){if(hy(t)&&!tb(t))return t;t=jy(t)}return n}let r=nb(e,t);for(;r&&yy(r)&&tb(r);)r=nb(r,t);return r&&Oy(r)&&tb(r)&&!Ty(r)?n:r||Ey(e)||n}var ib=async function(e){let t=this.getOffsetParent||rb,n=this.getDimensions,r=await n(e.floating);return{reference:eb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ab(e){return ky(e).direction===`rtl`}var ob={convertOffsetParentRelativeRectToViewportRelativeRect:Wy,getDocumentElement:py,getClippingRect:Qy,getOffsetParent:rb,getElementRects:ib,getClientRects:Gy,getDimensions:$y,getScale:Ly,isElement:hy,isRTL:ab};function sb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cb(e,t,n){let r=null,i,a=py(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Tv(d),h=Tv(a.clientWidth-(u+f)),g=Tv(a.clientHeight-(d+p)),_=Tv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Cv(0,Sv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!sb(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=fy(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function lb(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Iy(e),u=i||a?[...l?Ny(l):[],...t?Ny(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?cb(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Vy(e):null;c&&g();function g(){let t=Vy(e);h&&!sb(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ub=oy,db=sy,fb=ey,pb=ly,mb=ry,hb=$v,gb=cy,_b=(e,t,n)=>{let r=new Map,i=n??{},a={...ob,...i.platform,_c:r};return Qv(e,t,{...i,platform:a})},vb=typeof document<`u`?S.useLayoutEffect:function(){};function yb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!yb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function bb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xb(e,t){let n=bb(e);return Math.round(t*n)/n}function Sb(e){let t=S.useRef(e);return vb(()=>{t.current=e}),t}function Cb(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=S.useState(r);yb(f,r)||p(r);let[m,h]=S.useState(null),[g,_]=S.useState(null),v=S.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=S.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),b=a||m,x=o||g,C=S.useRef(null),w=S.useRef(null),T=S.useRef(u),ee=c!=null,te=Sb(c),ne=Sb(i),E=Sb(l),re=S.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};ne.current&&(e.platform=ne.current),_b(C.current,w.current,e).then(e=>{let t={...e,isPositioned:E.current!==!1};ie.current&&!yb(T.current,t)&&(T.current=t,mm.flushSync(()=>{d(t)}))})},[f,t,n,ne,E]);vb(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=S.useRef(!1);vb(()=>(ie.current=!0,()=>{ie.current=!1}),[]),vb(()=>{if(b&&(C.current=b),x&&(w.current=x),b&&x){if(te.current)return te.current(b,x,re);re()}},[b,x,re,te,ee]);let ae=S.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),oe=S.useMemo(()=>({reference:b,floating:x}),[b,x]),se=S.useMemo(()=>{let e={position:n,left:0,top:0};if(!oe.floating)return e;let t=xb(oe.floating,u.x),r=xb(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...bb(oe.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,oe.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:re,refs:ae,elements:oe,floatingStyles:se}),[u,re,ae,oe,se])}var wb=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:hb({element:r.current,padding:i}).fn(n):r?hb({element:r,padding:i}).fn(n):{}}}},Tb=(e,t)=>{let n=ub(e);return{name:n.name,fn:n.fn,options:[e,t]}},Eb=(e,t)=>{let n=db(e);return{name:n.name,fn:n.fn,options:[e,t]}},Db=(e,t)=>({fn:gb(e).fn,options:[e,t]}),Ob=(e,t)=>{let n=fb(e);return{name:n.name,fn:n.fn,options:[e,t]}},kb=(e,t)=>{let n=pb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ab=(e,t)=>{let n=mb(e);return{name:n.name,fn:n.fn,options:[e,t]}},jb=(e,t)=>{let n=wb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mb=Object.defineProperty,Nb=S.forwardRef(((e,t)=>Mb(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,Y.jsx)(_m.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,Y.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Pb=Object.defineProperty,Fb=(e,t)=>Pb(e,`name`,{value:t,configurable:!0}),Ib=`Popper`,[Lb,Rb]=Em(Ib),[zb,Bb]=Lb(Ib),Vb=Fb(e=>{let{__scopePopper:t,children:n}=e,[r,i]=S.useState(null),[a,o]=S.useState(void 0);return(0,Y.jsx)(zb,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Hb=`PopperAnchor`,Ub=S.forwardRef(Fb(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Bb(Hb,n),o=S.useRef(null),s=a.onAnchorChange,c=Yp(t,S.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=S.useRef(null);S.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&$b(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,Y.jsx)(_m.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Wb=`PopperContent`,[Gb,Kb]=Lb(Wb),qb=S.forwardRef(Fb(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Bb(Wb,n),[_,v]=S.useState(null),y=Yp(t,v),[b,x]=S.useState(null),C=bv(b),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),te=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ne=Array.isArray(l)?l:[l],E=ne.length>0,re={padding:te,boundary:ne.filter(Zb),altBoundary:E},{refs:ie,floatingStyles:ae,placement:oe,isPositioned:se,middlewareData:ce}=Cb({strategy:`fixed`,placement:ee,whileElementsMounted:Fb((...e)=>lb(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Tb({mainAxis:i+T,alignmentAxis:o}),c&&Eb({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Db():void 0,...re}),c&&Ob({...re}),kb({...re,apply:Fb(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&jb({element:b,padding:s}),Qb({arrowWidth:w,arrowHeight:T}),f&&Ab({strategy:`referenceHidden`,...re,boundary:E?re.boundary:void 0})]}),D=g.setPlacementState;Jm(()=>(D(oe),()=>{D(void 0)}),[oe,D]);let[le,ue]=$b(oe),de=Uh(m);Jm(()=>{se&&de?.()},[se,de]);let fe=ce.arrow?.x,pe=ce.arrow?.y,me=ce.arrow?.centerOffset!==0,[he,ge]=S.useState();return Jm(()=>{_&&ge(window.getComputedStyle(_).zIndex)},[_]),(0,Y.jsx)(`div`,{ref:ie.setFloating,"data-radix-popper-content-wrapper":``,style:{...ae,transform:se?ae.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:he,"--radix-popper-transform-origin":[ce.transformOrigin?.x,ce.transformOrigin?.y].join(` `),...ce.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,Y.jsx)(Gb,{scope:n,placedSide:le,placedAlign:ue,onArrowChange:x,arrowX:fe,arrowY:pe,shouldHideArrow:me,children:(0,Y.jsx)(_m.div,{"data-side":le,"data-align":ue,...h,ref:y,style:{...h.style,animation:se?h.style?.animation:`none`}})})})},`PopperContent`)),Jb=`PopperArrow`,Yb={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Xb=S.forwardRef(Fb(function(e,t){let{__scopePopper:n,...r}=e,i=Kb(Jb,n),a=Yb[i.placedSide];return(0,Y.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,Y.jsx)(Nb,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Zb(e){return e!==null}Fb(Zb,`isNotNull`);var Qb=Fb(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=$b(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function $b(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Fb($b,`getSideAndAlignFromPlacement`);var ex=Vb,tx=Ub,nx=qb,rx=Xb,ix=Object.defineProperty,ax=(e,t)=>ix(e,`name`,{value:t,configurable:!0}),ox=!1;function sx(){let[e,t]=S.useState(ox);return S.useEffect(()=>{ox||(ox=!0,t(!0))},[]),e}ax(sx,`useIsHydrated`);var cx=S.useSyncExternalStore;function lx(){return()=>{}}ax(lx,`subscribe`);function ux(){return cx(lx,()=>!0,()=>!1)}ax(ux,`useIsHydratedModern`);var dx=typeof cx==`function`?ux:sx,fx=Object.defineProperty,px=(e,t)=>fx(e,`name`,{value:t,configurable:!0}),mx=`rovingFocusGroup.onEntryFocus`,hx={bubbles:!1,cancelable:!0},gx=`RovingFocusGroup`,[_x,vx,yx]=Am(gx),[bx,xx]=Em(gx,[yx]),[Sx,Cx]=bx(gx),wx=S.forwardRef(px(function(e,t){return(0,Y.jsx)(_x.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,Y.jsx)(_x.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,Y.jsx)(Tx,{...e,ref:t})})})},`RovingFocusGroup`)),Tx=S.forwardRef(px(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=S.useRef(null),p=Yp(t,f),m=Bh(a),[h,g]=rh({prop:o,defaultProp:s??null,onChange:c,caller:gx}),[_,v]=S.useState(!1),y=Uh(l),b=vx(n),x=S.useRef(!1),[C,w]=S.useState(0);return S.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(mx,y),()=>e.removeEventListener(mx,y)},[y]),(0,Y.jsx)(Sx,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:S.useCallback(e=>g(e),[g]),onItemShiftTab:S.useCallback(()=>v(!0),[]),onFocusableItemAdd:S.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:S.useCallback(()=>w(e=>e-1),[]),children:(0,Y.jsx)(_m.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:X(e.onMouseDown,()=>{x.current=!0}),onFocus:X(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(mx,hx);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);jx([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:X(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),Ex=`RovingFocusGroupItem`,Dx=S.forwardRef(px(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=xh(),l=a||c,u=Cx(Ex,n),d=u.currentTabStopId===l,f=vx(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=dx();return Jm(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),S.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,Y.jsx)(_x.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,Y.jsx)(_m.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:X(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:X(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:X(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ax(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Mx(n,r+1):n.slice(r+1)}setTimeout(()=>jx(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Ox={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function kx(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}px(kx,`getDirectionAwareKey`);function Ax(e,t,n){let r=kx(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ox[r]}px(Ax,`getFocusIntent`);function jx(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}px(jx,`focusFirst`);function Mx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}px(Mx,`wrapArray`);var Nx=wx,Px=Dx,Fx=Object.defineProperty,Ix=(e,t)=>Fx(e,`name`,{value:t,configurable:!0});function Lx(e){let t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Ix(Lx,`usePrevious`);var Rx=Object.defineProperty,zx=(e,t)=>Rx(e,`name`,{value:t,configurable:!0});function Bx(e,[t,n]){return Math.min(n,Math.max(t,e))}zx(Bx,`clamp`);var Vx=Object.defineProperty,Hx=(e,t)=>Vx(e,`name`,{value:t,configurable:!0});function Ux(e,t){return S.useReducer((e,n)=>t[e][n]??e,e)}Hx(Ux,`useStateMachine`);var Wx=`ScrollArea`,[Gx,Kx]=Em(Wx),[qx,Jx]=Gx(Wx),Yx=S.forwardRef(Hx(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=S.useState(null),[l,u]=S.useState(null),[d,f]=S.useState(null),[p,m]=S.useState(null),[h,g]=S.useState(null),[_,v]=S.useState(0),[y,b]=S.useState(0),[x,C]=S.useState(!1),[w,T]=S.useState(!1),ee=Yp(t,c),te=Bh(i);return(0,Y.jsx)(qx,{scope:n,type:r,dir:te,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,Y.jsx)(_m.div,{dir:te,...o,ref:ee,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})},`ScrollArea`)),Xx=`ScrollAreaViewport`,Zx=S.forwardRef(Hx(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Jx(Xx,n),s=Yp(t,S.useRef(null),o.onViewportChange);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Qx,{nonce:i}),(0,Y.jsx)(_m.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,Y.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),Qx=S.memo(Hx(function({nonce:e}){return(0,Y.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),$x=`ScrollAreaScrollbar`,eS=S.forwardRef(Hx(function(e,t){let{forceMount:n,...r}=e,i=Jx($x,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return S.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,Y.jsx)(tS,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,Y.jsx)(nS,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,Y.jsx)(rS,{...r,ref:t,forceMount:n}):i.type===`always`?(0,Y.jsx)(iS,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),tS=S.forwardRef(Hx(function(e,t){let{forceMount:n,...r}=e,i=Jx($x,e.__scopeScrollArea),[a,o]=S.useState(!1);return S.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=Hx(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=Hx(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,Y.jsx)(dh,{present:n||a,children:(0,Y.jsx)(rS,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),nS=S.forwardRef(Hx(function(e,t){let{forceMount:n,...r}=e,i=Jx($x,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=wS(()=>c(`SCROLL_END`),100),[s,c]=Ux(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return S.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),S.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=Hx(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,Y.jsx)(dh,{present:n||s!==`hidden`,children:(0,Y.jsx)(iS,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:X(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:X(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),rS=S.forwardRef(Hx(function(e,t){let n=Jx($x,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=S.useState(!1),s=e.orientation===`horizontal`,c=wS(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return TS(n.viewport,c),TS(n.content,c),(0,Y.jsx)(dh,{present:r||a,children:(0,Y.jsx)(iS,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),iS=S.forwardRef(Hx(function(e,t){let{orientation:n=`vertical`,...r}=e,i=Jx($x,e.__scopeScrollArea),a=S.useRef(null),o=S.useRef(0),[s,c]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=_S(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:Hx(e=>a.current=e,`onThumbChange`),onThumbPointerUp:Hx(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:Hx(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return yS(e,o.current,s,t)}return Hx(d,`getScrollPosition`),n===`horizontal`?(0,Y.jsx)(aS,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=bS(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,Y.jsx)(oS,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=bS(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),aS=S.forwardRef(Hx(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Jx($x,e.__scopeScrollArea),[o,s]=S.useState(),c=S.useRef(null),l=Yp(t,c,a.onScrollbarXChange);return S.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,Y.jsx)(lS,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":vS(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),SS(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:gS(o.paddingLeft),paddingEnd:gS(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),oS=S.forwardRef(Hx(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Jx($x,e.__scopeScrollArea),[o,s]=S.useState(),c=S.useRef(null),l=Yp(t,c,a.onScrollbarYChange);return S.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,Y.jsx)(lS,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":vS(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),SS(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:gS(o.paddingTop),paddingEnd:gS(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[sS,cS]=Gx($x),lS=S.forwardRef(Hx(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=Jx($x,n),[m,h]=S.useState(null),g=Yp(t,h),_=S.useRef(null),v=S.useRef(``),y=p.viewport,b=r.content-r.viewport,x=Uh(u),C=Uh(c),w=wS(d,10);function T(e){if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;l({x:t,y:n})}}return Hx(T,`handleDragScroll`),S.useEffect(()=>{let e=Hx(e=>{let t=e.target;m?.contains(t)&&x(e,b)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),S.useEffect(C,[r,C]),TS(m,w),TS(p.content,w),(0,Y.jsx)(sS,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Uh(a),onThumbPointerUp:Uh(o),onThumbPositionChange:C,onThumbPointerDown:Uh(s),children:(0,Y.jsx)(_m.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:X(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:X(e.onPointerMove,T),onPointerUp:X(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})},`ScrollAreaScrollbarImpl`)),uS=`ScrollAreaThumb`,dS=S.forwardRef(Hx(function(e,t){let{forceMount:n,...r}=e,i=cS(uS,e.__scopeScrollArea);return(0,Y.jsx)(dh,{present:n||i.hasThumb,children:(0,Y.jsx)(fS,{ref:t,...r})})},`ScrollAreaThumb`)),fS=S.forwardRef(Hx(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=Jx(uS,n),o=cS(uS,n),{onThumbPositionChange:s}=o,c=Yp(t,o.onThumbChange),l=S.useRef(void 0),u=wS(()=>{l.current&&=(l.current(),void 0)},100);return S.useEffect(()=>{let e=a.viewport;if(e){let t=Hx(()=>{if(u(),!l.current){let t=CS(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,Y.jsx)(_m.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:X(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:X(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),pS=`ScrollAreaCorner`,mS=S.forwardRef(Hx(function(e,t){let n=Jx(pS,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,Y.jsx)(hS,{...e,ref:t}):null},`ScrollAreaCorner`)),hS=S.forwardRef(Hx(function(e,t){let{__scopeScrollArea:n,...r}=e,i=Jx(pS,n),[a,o]=S.useState(0),[s,c]=S.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return TS(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),TS(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),S.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,Y.jsx)(_m.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function gS(e){return e?parseInt(e,10):0}Hx(gS,`toInt`);function _S(e,t){let n=e/t;return isNaN(n)?0:n}Hx(_S,`getThumbRatio`);function vS(e){let t=_S(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}Hx(vS,`getThumbSize`);function yS(e,t,n,r=`ltr`){let i=vS(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return xS([c,l],d)(e)}Hx(yS,`getScrollPositionFromPointer`);function bS(e,t,n=`ltr`){let r=vS(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Bx(e,n===`ltr`?[0,o]:[o*-1,0]);return xS([0,o],[0,s])(c)}Hx(bS,`getThumbOffsetFromScroll`);function xS(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Hx(xS,`linearScale`);function SS(e,t){return e>0&&e<t}Hx(SS,`isScrollingWithinScrollbarBounds`);var CS=Hx((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return Hx((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function wS(e,t){let n=Uh(e),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}Hx(wS,`useDebounceCallback`);function TS(e,t){let n=Uh(t);Jm(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}Hx(TS,`useResizeObserver`);var ES=Yx,DS=Zx,OS=mS,kS=Object.defineProperty,AS=(e,t)=>kS(e,`name`,{value:t,configurable:!0}),jS=[` `,`Enter`,`ArrowUp`,`ArrowDown`],MS=[` `,`Enter`],NS=`Select`,[PS,FS,IS]=Am(NS),[LS,RS]=Em(NS,[IS,Rb]),zS=Rb(),[BS,VS]=LS(NS),[HS,US]=LS(NS);function WS(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=zS(t),[_,v]=S.useState(null),[y,b]=S.useState(null),[x,C]=S.useState(!1),w=Bh(l),[T,ee]=rh({prop:r,defaultProp:i??!1,onChange:a,caller:NS}),[te,ne]=rh({prop:o,defaultProp:s,onChange:c,caller:NS}),E=S.useRef(null),re=S.useRef(te);S.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=AS(()=>ne(re.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,ne]);let ie=!_||!!m||!!_.closest(`form`),[ae,oe]=S.useState(new Set),se=xh(),ce=Array.from(ae).map(e=>e.props.value).join(`;`),D=S.useCallback(e=>{oe(t=>new Set(t).add(e))},[]),le=S.useCallback(e=>{oe(t=>{let n=new Set(t);return n.delete(e),n})},[]),ue={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:C,contentId:se,value:te,onValueChange:ne,open:T,onOpenChange:ee,dir:w,triggerPointerDownPosRef:E,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:ae,nativeSelectKey:ce,isFormControl:ie};return(0,Y.jsx)(ex,{...g,children:(0,Y.jsx)(BS,{scope:t,...ue,children:(0,Y.jsx)(PS.Provider,{scope:t,children:(0,Y.jsx)(HS,{scope:t,onNativeOptionAdd:D,onNativeOptionRemove:le,children:jC(h)?h(ue):n})})})})}AS(WS,`SelectProvider`);var GS=AS(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,Y.jsx)(WS,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,Y.jsxs)(Y.Fragment,{children:[n,e?(0,Y.jsx)(AC,{__scopeSelect:t}):null]})})},`Select`),KS=`SelectTrigger`,qS=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=zS(n),o=VS(KS,n),s=o.disabled||r,c=Yp(t,o.onTriggerChange),l=FS(n),u=S.useRef(`touch`),[d,f,p]=NC(e=>{let t=l().filter(e=>!e.disabled),n=PC(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=AS(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,Y.jsx)(tx,{asChild:!0,...a,children:(0,Y.jsx)(_m.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":MC(o.value)?``:void 0,...i,ref:c,onClick:X(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:X(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:X(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&jS.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),JS=`SelectValue`,YS=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=VS(JS,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Yp(t,c.onValueNodeChange);Jm(()=>{l(u)},[l,u]);let f=MC(c.value);return(0,Y.jsx)(_m.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,Y.jsx)(S.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),XS=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,Y.jsx)(_m.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[ZS,QS]=LS(`SelectPortal`,{forceMount:void 0}),$S=AS(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,Y.jsx)(ZS,{scope:e.__scopeSelect,forceMount:n,children:(0,Y.jsx)(Sg,{asChild:!0,...r})})},`SelectPortal`),eC=`SelectContent`,tC=S.forwardRef(AS(function(e,t){let n=QS(eC,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=VS(eC,e.__scopeSelect),[o,s]=S.useState();return Jm(()=>{s(new DocumentFragment)},[]),(0,Y.jsx)(dh,{present:r||a.open,children:({present:e})=>e?(0,Y.jsx)(sC,{...i,ref:t}):(0,Y.jsx)(nC,{...i,fragment:o})})},`SelectContent`)),nC=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?mm.createPortal((0,Y.jsx)(iC,{scope:n,children:(0,Y.jsx)(PS.Slot,{scope:n,children:(0,Y.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),rC=10,[iC,aC]=LS(eC),oC=Qp(`SelectContent.RemoveScroll`),sC=S.forwardRef(AS(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=VS(eC,n),[y,b]=S.useState(null),[x,C]=S.useState(null),w=Yp(t,b),[T,ee]=S.useState(null),[te,ne]=S.useState(null),E=FS(n),[re,ie]=S.useState(!1),ae=S.useRef(!1);S.useEffect(()=>{if(y)return U_(y)},[y]),Og();let oe=S.useCallback(e=>{let[t,...n]=E().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[E,x]),se=S.useCallback(()=>oe([T,y]),[oe,T,y]);S.useEffect(()=>{re&&se()},[re,se]);let{onOpenChange:ce,triggerPointerDownPosRef:D}=v;S.useEffect(()=>{if(y){let e={x:0,y:0},t=AS(t=>{e={x:Math.abs(Math.round(t.pageX)-(D.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(D.current?.y??0))}},`handlePointerMove`),n=AS(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||ce(!1),document.removeEventListener(`pointermove`,t),D.current=null},`handlePointerUp`);return D.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,ce,D]),S.useEffect(()=>{let e=AS(()=>ce(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ce]);let[le,ue]=NC(e=>{let t=E().filter(e=>!e.disabled),n=PC(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),de=S.useCallback((e,t,n)=>{let r=!ae.current&&!n;(v.value!==void 0&&v.value===t||r)&&(ee(e),r&&(ae.current=!0))},[v.value]),fe=S.useCallback(()=>y?.focus(),[y]),pe=S.useCallback((e,t,n)=>{let r=!ae.current&&!n;(v.value!==void 0&&v.value===t||r)&&ne(e)},[v.value]),me=r===`popper`?lC:cC,he=me===lC?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,Y.jsx)(iC,{scope:n,content:y,viewport:x,onViewportChange:C,itemRefCallback:de,selectedItem:T,onItemLeave:fe,itemTextRefCallback:pe,focusSelectedItem:se,selectedItemText:te,position:r,isPositioned:re,searchRef:le,children:(0,Y.jsx)(P_,{as:oC,allowPinchZoom:!0,children:(0,Y.jsx)(lg,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:X(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,Y.jsx)(Zh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,Y.jsx)(me,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...he,onPlaced:()=>ie(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:X(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ue(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=E().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>oe(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),cC=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=VS(eC,n),o=aC(eC,n),[s,c]=S.useState(null),[l,u]=S.useState(null),d=Yp(t,u),f=FS(n),p=S.useRef(!1),m=S.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=S.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-rC,d=Bx(a,[rC,Math.max(rC,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-rC,d=Bx(a,[rC,Math.max(rC,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-rC*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),ee=e.top+e.height/2-rC,te=c-ee,ne=g.offsetHeight/2,E=g.offsetTop+ne,re=m+v+E,ie=x-re;if(re<=ee){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=re+Math.max(te,ne+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(ee,m+h.offsetTop+(e?w:0)+ne)+ie;s.style.height=t+`px`,h.scrollTop=re-ee+h.offsetTop}s.style.margin=`${rC}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Jm(()=>y(),[y]);let[b,x]=S.useState();Jm(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let C=S.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]);return(0,Y.jsx)(uC,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,Y.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,Y.jsx)(_m.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),lC=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=rC,...a}=e,o=zS(n);return(0,Y.jsx)(nx,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[uC,dC]=LS(eC,{}),fC=`SelectViewport`,pC=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=aC(fC,n),o=dC(fC,n),s=Yp(t,a.onViewportChange),c=S.useRef(0);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,Y.jsx)(PS.Slot,{scope:n,children:(0,Y.jsx)(_m.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:X(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-rC*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[mC,hC]=LS(`SelectGroup`),gC=`SelectItem`,[_C,vC]=LS(gC),yC=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=VS(gC,n),c=aC(gC,n),l=s.value===r,[u,d]=S.useState(a??``),[f,p]=S.useState(!1),m=Yp(t,Uh(e=>c.itemRefCallback?.(e,r,i))),h=xh(),g=S.useRef(`touch`),_=AS(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,Y.jsx)(_C,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:S.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,Y.jsx)(PS.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,Y.jsx)(_m.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:X(o.onFocus,()=>p(!0)),onBlur:X(o.onBlur,()=>p(!1)),onClick:X(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:X(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:X(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:X(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:X(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:X(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(MS.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),bC=`SelectItemText`,xC=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=VS(bC,n),s=aC(bC,n),c=vC(bC,n),l=US(bC,n),[u,d]=S.useState(null),f=Uh(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Yp(t,d,c.onItemTextChange,f),m=u?.textContent,h=S.useMemo(()=>(0,Y.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Jm(()=>(g(h),()=>_(h)),[g,_,h]),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(_m.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!MC(o.value)?mm.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),SC=`SelectItemIndicator`,CC=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,...r}=e;return vC(SC,n).isSelected?(0,Y.jsx)(_m.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),wC=`SelectScrollUpButton`,TC=S.forwardRef(AS(function(e,t){let n=aC(wC,e.__scopeSelect),r=dC(wC,e.__scopeSelect),[i,a]=S.useState(!1),o=Yp(t,r.onScrollButtonChange);return Jm(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};AS(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,Y.jsx)(OC,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),EC=`SelectScrollDownButton`,DC=S.forwardRef(AS(function(e,t){let n=aC(EC,e.__scopeSelect),r=dC(EC,e.__scopeSelect),[i,a]=S.useState(!1),o=Yp(t,r.onScrollButtonChange);return Jm(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};AS(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,Y.jsx)(OC,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),OC=S.forwardRef(AS(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=aC(`SelectScrollButton`,n),o=S.useRef(null),s=FS(n),c=S.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return S.useEffect(()=>()=>c(),[c]),Jm(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,Y.jsx)(_m.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:X(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:X(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:X(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),kC=`SelectBubbleInput`,AC=S.forwardRef(AS(function({__scopeSelect:e,...t},n){let r=VS(kC,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=S.useRef(null),m=Yp(n,p),h=i??``,g=Lx(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return S.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,Y.jsxs)(_m.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...xm,...t.style},ref:m,defaultValue:h,children:[MC(i)&&!_?(0,Y.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function jC(e){return typeof e==`function`}AS(jC,`isFunction`);function MC(e){return e===``||e===void 0}AS(MC,`shouldShowPlaceholder`);function NC(e){let t=Uh(e),n=S.useRef(``),r=S.useRef(0),i=S.useCallback(e=>{let i=n.current+e;t(i),AS((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=S.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}AS(NC,`useTypeaheadSearch`);function PC(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=FC(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}AS(PC,`findNextItem`);function FC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}AS(FC,`wrapArray`);var IC=Object.defineProperty,LC=(e,t)=>IC(e,`name`,{value:t,configurable:!0}),RC=`Tabs`,[zC,BC]=Em(RC,[xx]),VC=xx(),[HC,UC]=zC(RC),WC=S.forwardRef(LC(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Bh(s),[d,f]=rh({prop:r,onChange:i,defaultProp:a??``,caller:RC});return(0,Y.jsx)(HC,{scope:n,baseId:xh(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,Y.jsx)(_m.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),GC=`TabsList`,KC=S.forwardRef(LC(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=UC(GC,n),o=VC(n);return(0,Y.jsx)(Nx,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,Y.jsx)(_m.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),qC=`TabsTrigger`,JC=S.forwardRef(LC(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=UC(qC,n),s=VC(n),c=ZC(o.baseId,r),l=QC(o.baseId,r),u=r===o.value;return(0,Y.jsx)(Px,{asChild:!0,...s,focusable:!i,active:u,children:(0,Y.jsx)(_m.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:X(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:X(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:X(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),YC=`TabsContent`,XC=S.forwardRef(LC(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=UC(YC,n),c=ZC(s.baseId,r),l=QC(s.baseId,r),u=r===s.value,d=S.useRef(u);return S.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,Y.jsx)(dh,{present:i||u,children:({present:n})=>(0,Y.jsx)(_m.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function ZC(e,t){return`${e}-trigger-${t}`}LC(ZC,`makeTriggerId`);function QC(e,t){return`${e}-content-${t}`}LC(QC,`makeContentId`);var $C=WC,ew=KC,tw=JC,nw=XC,rw=Object.defineProperty,iw=(e,t)=>rw(e,`name`,{value:t,configurable:!0}),[aw,ow]=Em(`Tooltip`,[Rb]),sw=Rb(),cw=`TooltipProvider`,lw=700,uw=`tooltip.open`,[dw,fw]=aw(cw),pw=iw(e=>{let{__scopeTooltip:t,delayDuration:n=lw,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=S.useRef(!0),s=S.useRef(!1),c=S.useRef(0);return S.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,Y.jsx)(dw,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:S.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:S.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:S.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),mw=`Tooltip`,[hw,gw]=aw(mw),_w=iw(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=fw(mw,e.__scopeTooltip),l=sw(t),[u,d]=S.useState(null),[f,p]=S.useState(void 0),m=xh(),h=S.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=S.useRef(!1),[y,b]=rh({prop:r,defaultProp:i??!1,onChange:iw(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(uw))):c.onClose(),a?.(e)},`onChange`),caller:mw}),x=S.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),C=S.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),w=S.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),T=S.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);S.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let ee=f??m;return(0,Y.jsx)(ex,{...l,children:(0,Y.jsx)(hw,{scope:t,contentId:ee,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:S.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:S.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),vw=`TooltipTrigger`,yw=S.forwardRef(iw(function(e,t){let{__scopeTooltip:n,...r}=e,i=gw(vw,n),a=fw(vw,n),o=sw(n),s=Yp(t,S.useRef(null),i.onTriggerChange),c=S.useRef(!1),l=S.useRef(!1),u=S.useCallback(()=>c.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,Y.jsx)(tx,{asChild:!0,...o,children:(0,Y.jsx)(_m.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:X(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:X(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:X(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:X(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:X(e.onBlur,i.onClose),onClick:X(e.onClick,i.onClose)})})},`TooltipTrigger`)),bw=`TooltipPortal`,[xw,Sw]=aw(bw,{forceMount:void 0}),Cw=iw(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=gw(bw,t);return(0,Y.jsx)(xw,{scope:t,forceMount:n,children:(0,Y.jsx)(dh,{present:n||a.open,children:(0,Y.jsx)(Sg,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),ww=`TooltipContent`,Tw=S.forwardRef(iw(function(e,t){let n=Sw(ww,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=gw(ww,e.__scopeTooltip);return(0,Y.jsx)(dh,{present:r||o.open,children:o.disableHoverableContent?(0,Y.jsx)(Ow,{side:i,...a,ref:t}):(0,Y.jsx)(Ew,{side:i,...a,ref:t})})},`TooltipContent`)),Ew=S.forwardRef(iw(function(e,t){let n=gw(ww,e.__scopeTooltip),r=fw(ww,e.__scopeTooltip),i=S.useRef(null),a=Yp(t,i),[o,s]=S.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=S.useCallback(()=>{s(null),d(!1)},[d]),p=S.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=jw(r,Aw(r,n.getBoundingClientRect())),a=Mw(t.getBoundingClientRect()),o=Pw([...i,...a]);s(o),d(!0)},[d]);return S.useEffect(()=>()=>f(),[f]),S.useEffect(()=>{if(c&&u){let e=iw(e=>p(e,u),`handleTriggerLeave`),t=iw(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),S.useEffect(()=>{if(o){let e=iw(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Nw(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,Y.jsx)(Ow,{...e,ref:a})},`TooltipContentHoverable`)),Dw=tm(`TooltipContent`),Ow=S.forwardRef(iw(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=gw(ww,n),u=sw(n),{onClose:d}=l;S.useEffect(()=>(document.addEventListener(uw,d),()=>document.removeEventListener(uw,d)),[d]),S.useEffect(()=>{if(l.trigger){let e=iw(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Jm(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,Y.jsx)(Zh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,Y.jsxs)(nx,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,Y.jsx)(Dw,{children:r}),i?(0,Y.jsx)(Sm,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),kw=S.forwardRef(iw(function(e,t){let{__scopeTooltip:n,...r}=e,i=sw(n);return(0,Y.jsx)(rx,{...i,...r,ref:t})},`TooltipArrow`));function Aw(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}iw(Aw,`getExitSideFromRect`);function jw(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}iw(jw,`getPaddedExitPoints`);function Mw(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}iw(Mw,`getPointsFromRect`);function Nw(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}iw(Nw,`isPointInPolygon`);function Pw(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Fw(t)}iw(Pw,`getHull`);function Fw(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}iw(Fw,`getHullPresorted`);var Iw=pw,Lw=_w,Rw=yw,zw=Cw,Bw=Tw,Vw=kw;function Hw({...e}){return(0,Y.jsx)(Ih,{"data-slot":`collapsible`,...e})}function Uw({...e}){return(0,Y.jsx)(jh,{"data-slot":`collapsible-trigger`,...e})}function Ww({...e}){return(0,Y.jsx)(Nh,{"data-slot":`collapsible-content`,...e})}function Gw(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Gw(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Kw(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Gw(e))&&(r&&(r+=` `),r+=t);return r}var qw=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Jw=Kw,Yw=(e,t)=>n=>{if(t?.variants==null)return Jw(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=qw(t)||qw(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Jw(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Xw=768;function Zw(){let[e,t]=S.useState(void 0);return S.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<Xw)};return e.addEventListener(`change`,n),t(window.innerWidth<Xw),()=>e.removeEventListener(`change`,n)},[]),!!e}var Qw=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},$w=(e,t)=>({classGroupId:e,validator:t}),eT=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),tT=`-`,nT=[],rT=`arbitrary..`,iT=e=>{let t=sT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return oT(e);let n=e.split(tT);return aT(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Qw(i,t):t:i||nT}return n[e]||nT}}},aT=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=aT(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(tT):e.slice(t).join(tT),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},oT=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?rT+r:void 0})(),sT=e=>{let{theme:t,classGroups:n}=e;return cT(n,t)},cT=(e,t)=>{let n=eT();for(let r in e){let i=e[r];lT(i,n,r,t)}return n},lT=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];uT(i,t,n,r)}},uT=(e,t,n,r)=>{if(typeof e==`string`){dT(e,t,n);return}if(typeof e==`function`){fT(e,t,n,r);return}pT(e,t,n,r)},dT=(e,t,n)=>{let r=e===``?t:mT(t,e);r.classGroupId=n},fT=(e,t,n,r)=>{if(hT(e)){lT(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push($w(n,e))},pT=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];lT(o,mT(t,a),n,r)}},mT=(e,t)=>{let n=e,r=t.split(tT),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=eT(),n.nextPart.set(t,i)),n=i}return n},hT=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,gT=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},_T=`!`,vT=`:`,yT=[],bT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),xT=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===vT){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(_T)?(c=s.slice(0,-1),l=!0):s.startsWith(_T)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return bT(t,l,c,u)};if(t){let e=t+vT,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):bT(yT,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ST=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},CT=e=>({cache:gT(e.cacheSize),parseClassName:xT(e),sortModifiers:ST(e),postfixLookupClassGroupIds:wT(e),...iT(e)}),wT=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},TT=/\s+/,ET=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(TT),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+_T:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},DT=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=OT(n))&&(i&&(i+=` `),i+=r);return i},OT=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=OT(e[r]))&&(n&&(n+=` `),n+=t);return n},kT=(e,...t)=>{let n,r,i,a,o=o=>(n=CT(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ET(e,n);return i(e,a),a};return a=o,(...e)=>a(DT(...e))},AT=[],jT=e=>{let t=t=>t[e]||AT;return t.isThemeGetter=!0,t},MT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,NT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PT=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,FT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IT=/\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$/,LT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,RT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,BT=e=>PT.test(e),VT=e=>!!e&&!Number.isNaN(Number(e)),HT=e=>!!e&&Number.isInteger(Number(e)),UT=e=>e.endsWith(`%`)&&VT(e.slice(0,-1)),WT=e=>FT.test(e),GT=()=>!0,KT=e=>IT.test(e)&&!LT.test(e),qT=()=>!1,JT=e=>RT.test(e),YT=e=>zT.test(e),XT=e=>!Z(e)&&!Q(e),ZT=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),QT=e=>pE(e,_E,qT),Z=e=>MT.test(e),$T=e=>pE(e,vE,KT),eE=e=>pE(e,yE,VT),tE=e=>pE(e,xE,GT),nE=e=>pE(e,bE,qT),rE=e=>pE(e,hE,qT),iE=e=>pE(e,gE,YT),aE=e=>pE(e,SE,JT),Q=e=>NT.test(e),oE=e=>mE(e,vE),sE=e=>mE(e,bE),cE=e=>mE(e,hE),lE=e=>mE(e,_E),uE=e=>mE(e,gE),dE=e=>mE(e,SE,!0),fE=e=>mE(e,xE,!0),pE=(e,t,n)=>{let r=MT.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},mE=(e,t,n=!1)=>{let r=NT.exec(e);return r?r[1]?t(r[1]):n:!1},hE=e=>e===`position`||e===`percentage`,gE=e=>e===`image`||e===`url`,_E=e=>e===`length`||e===`size`||e===`bg-size`,vE=e=>e===`length`,yE=e=>e===`number`,bE=e=>e===`family-name`,xE=e=>e===`number`||e===`weight`,SE=e=>e===`shadow`,CE=kT(()=>{let e=jT(`color`),t=jT(`font`),n=jT(`text`),r=jT(`font-weight`),i=jT(`tracking`),a=jT(`leading`),o=jT(`breakpoint`),s=jT(`container`),c=jT(`spacing`),l=jT(`radius`),u=jT(`shadow`),d=jT(`inset-shadow`),f=jT(`text-shadow`),p=jT(`drop-shadow`),m=jT(`blur`),h=jT(`perspective`),g=jT(`aspect`),_=jT(`ease`),v=jT(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Q,Z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Q,Z,c],T=()=>[BT,`full`,`auto`,...w()],ee=()=>[HT,`none`,`subgrid`,Q,Z],te=()=>[`auto`,{span:[`full`,HT,Q,Z]},HT,Q,Z],ne=()=>[HT,`auto`,Q,Z],E=()=>[`auto`,`min`,`max`,`fr`,Q,Z],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ie=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ae=()=>[`auto`,...w()],oe=()=>[BT,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],se=()=>[BT,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[BT,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[e,Q,Z],le=()=>[...b(),cE,rE,{position:[Q,Z]}],ue=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],de=()=>[`auto`,`cover`,`contain`,lE,QT,{size:[Q,Z]}],fe=()=>[UT,oE,$T],pe=()=>[``,`none`,`full`,l,Q,Z],me=()=>[``,VT,oE,$T],he=()=>[`solid`,`dashed`,`dotted`,`double`],ge=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],_e=()=>[VT,UT,cE,rE],ve=()=>[``,`none`,m,Q,Z],ye=()=>[`none`,VT,Q,Z],be=()=>[`none`,VT,Q,Z],xe=()=>[VT,Q,Z],Se=()=>[BT,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[WT],breakpoint:[WT],color:[GT],container:[WT],"drop-shadow":[WT],ease:[`in`,`out`,`in-out`],font:[XT],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[WT],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[WT],shadow:[WT],spacing:[`px`,VT],text:[WT],"text-shadow":[WT],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,BT,Z,Q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Q,Z]}],"container-named":[ZT],columns:[{columns:[VT,Z,Q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[HT,`auto`,Q,Z]}],basis:[{basis:[BT,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[VT,BT,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,VT,Q,Z]}],shrink:[{shrink:[``,VT,Q,Z]}],order:[{order:[HT,`first`,`last`,`none`,Q,Z]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...ie(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ie()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...ie(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ie(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ie()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mbs:[{mbs:ae()}],mbe:[{mbe:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:oe()}],"inline-size":[{inline:[`auto`,...se()]}],"min-inline-size":[{"min-inline":[`auto`,...se()]}],"max-inline-size":[{"max-inline":[`none`,...se()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[s,`screen`,...oe()]}],"min-w":[{"min-w":[s,`screen`,`none`,...oe()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...oe()]}],h:[{h:[`screen`,`lh`,...oe()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...oe()]}],"max-h":[{"max-h":[`screen`,`lh`,...oe()]}],"font-size":[{text:[`base`,n,oE,$T]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,fE,tE]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,UT,Z]}],"font-family":[{font:[sE,nE,t]}],"font-features":[{"font-features":[Z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Q,Z]}],"line-clamp":[{"line-clamp":[VT,`none`,Q,eE]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Q,Z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Q,Z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...he(),`wavy`]}],"text-decoration-thickness":[{decoration:[VT,`from-font`,`auto`,Q,$T]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[VT,`auto`,Q,Z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[HT,Q,Z]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Q,Z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Q,Z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:de()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},HT,Q,Z],radial:[``,Q,Z],conic:[HT,Q,Z]},uE,iE]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":me()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...he(),`hidden`,`none`]}],"divide-style":[{divide:[...he(),`hidden`,`none`]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...he(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[VT,Q,Z]}],"outline-w":[{outline:[``,VT,oE,$T]}],"outline-color":[{outline:D()}],shadow:[{shadow:[``,`none`,u,dE,aE]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":[`none`,d,dE,aE]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:me()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[VT,$T]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":[`none`,f,dE,aE]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[VT,Q,Z]}],"mix-blend":[{"mix-blend":[...ge(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[VT]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Q,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[VT]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Q,Z]}],filter:[{filter:[``,`none`,Q,Z]}],blur:[{blur:ve()}],brightness:[{brightness:[VT,Q,Z]}],contrast:[{contrast:[VT,Q,Z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,dE,aE]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:[``,VT,Q,Z]}],"hue-rotate":[{"hue-rotate":[VT,Q,Z]}],invert:[{invert:[``,VT,Q,Z]}],saturate:[{saturate:[VT,Q,Z]}],sepia:[{sepia:[``,VT,Q,Z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Q,Z]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[VT,Q,Z]}],"backdrop-contrast":[{"backdrop-contrast":[VT,Q,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,VT,Q,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[VT,Q,Z]}],"backdrop-invert":[{"backdrop-invert":[``,VT,Q,Z]}],"backdrop-opacity":[{"backdrop-opacity":[VT,Q,Z]}],"backdrop-saturate":[{"backdrop-saturate":[VT,Q,Z]}],"backdrop-sepia":[{"backdrop-sepia":[``,VT,Q,Z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Q,Z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[VT,`initial`,Q,Z]}],ease:[{ease:[`linear`,`initial`,_,Q,Z]}],delay:[{delay:[VT,Q,Z]}],animate:[{animate:[`none`,v,Q,Z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Q,Z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":[`scale-3d`],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Q,Z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":[`translate-none`],zoom:[{zoom:[HT,Q,Z]}],accent:[{accent:D()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Q,Z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Q,Z]}],fill:[{fill:[`none`,...D()]}],"stroke-w":[{stroke:[VT,oE,$T,eE]}],stroke:[{stroke:[`none`,...D()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function $(...e){return CE(Kw(e))}var wE=Yw(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function TE({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?$p:`button`;return(0,Y.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:$(wE({variant:t,size:n,className:e})),...i})}function EE({className:e,type:t,...n}){return(0,Y.jsx)(`input`,{type:t,"data-slot":`input`,className:$(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}function DE({...e}){return(0,Y.jsx)(Z_,{"data-slot":`sheet`,...e})}function OE({...e}){return(0,Y.jsx)(tv,{"data-slot":`sheet-portal`,...e})}function kE({className:e,...t}){return(0,Y.jsx)(rv,{"data-slot":`sheet-overlay`,className:$(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function AE({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,Y.jsxs)(OE,{children:[(0,Y.jsx)(kE,{}),(0,Y.jsxs)(sv,{"data-slot":`sheet-content`,className:$(`fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...i,children:[t,r&&(0,Y.jsxs)(gv,{className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,Y.jsx)(Wp,{className:`size-4`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function jE({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`sheet-header`,className:$(`flex flex-col gap-1.5 p-4`,e),...t})}function ME({className:e,...t}){return(0,Y.jsx)(fv,{"data-slot":`sheet-title`,className:$(`font-semibold text-foreground`,e),...t})}function NE({className:e,...t}){return(0,Y.jsx)(mv,{"data-slot":`sheet-description`,className:$(`text-sm text-muted-foreground`,e),...t})}function PE({delayDuration:e=0,...t}){return(0,Y.jsx)(Iw,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function FE({...e}){return(0,Y.jsx)(Lw,{"data-slot":`tooltip`,...e})}function IE({...e}){return(0,Y.jsx)(Rw,{"data-slot":`tooltip-trigger`,...e})}function LE({className:e,sideOffset:t=0,children:n,...r}){return(0,Y.jsx)(zw,{children:(0,Y.jsxs)(Bw,{"data-slot":`tooltip-content`,sideOffset:t,className:$(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,Y.jsx)(Vw,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var RE=`sidebar_state`,zE=604800,BE=`16rem`,VE=`18rem`,HE=`3rem`,UE=`b`,WE=S.createContext(null);function GE(){let e=S.useContext(WE);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function KE({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=Zw(),[c,l]=S.useState(!1),[u,d]=S.useState(e),f=t??u,p=S.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${RE}=${t}; path=/; max-age=${zE}`},[n,f]),m=S.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);S.useEffect(()=>{let e=e=>{e.key===UE&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=S.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,Y.jsx)(WE.Provider,{value:g,children:(0,Y.jsx)(PE,{delayDuration:0,children:(0,Y.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":BE,"--sidebar-width-icon":HE,...i},className:$(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})})}function qE({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:s,openMobile:c,setOpenMobile:l}=GE();return n===`none`?(0,Y.jsx)(`div`,{"data-slot":`sidebar`,className:$(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):o?(0,Y.jsx)(DE,{open:c,onOpenChange:l,...a,children:(0,Y.jsxs)(AE,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":VE},side:e,children:[(0,Y.jsxs)(jE,{className:`sr-only`,children:[(0,Y.jsx)(ME,{children:`Sidebar`}),(0,Y.jsx)(NE,{children:`Displays the mobile sidebar.`})]}),(0,Y.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,Y.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,Y.jsx)(`div`,{"data-slot":`sidebar-gap`,className:$(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,Y.jsx)(`div`,{"data-slot":`sidebar-container`,className:$(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,Y.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm`,children:i})})]})}function JE({className:e,onClick:t,...n}){let{toggleSidebar:r}=GE();return(0,Y.jsxs)(TE,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon`,className:$(`size-7`,e),onClick:e=>{t?.(e),r()},...n,children:[(0,Y.jsx)(Vp,{}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function YE({className:e,...t}){return(0,Y.jsx)(`main`,{"data-slot":`sidebar-inset`,className:$(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function XE({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:$(`flex flex-col gap-2 p-2`,e),...t})}function ZE({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:$(`flex flex-col gap-2 p-2`,e),...t})}function QE({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:$(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function $E({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:$(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function eD({className:e,asChild:t=!1,...n}){let r=t?$p:`div`;return(0,Y.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:$(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...n})}function tD({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:$(`w-full text-sm`,e),...t})}function nD({className:e,...t}){return(0,Y.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:$(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function rD({className:e,...t}){return(0,Y.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:$(`group/menu-item relative`,e),...t})}var iD=Yw(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function aD({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let s=e?$p:`button`,{isMobile:c,state:l}=GE(),u=(0,Y.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:$(iD({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,Y.jsxs)(FE,{children:[(0,Y.jsx)(IE,{asChild:!0,children:u}),(0,Y.jsx)(LE,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}function oD({className:e,asChild:t=!1,showOnHover:n=!1,...r}){let i=t?$p:`button`;return(0,Y.jsx)(i,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:$(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0`,e),...r})}function sD({className:e,...t}){return(0,Y.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:$(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function cD({className:e,...t}){return(0,Y.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:$(`group/menu-sub-item relative`,e),...t})}function lD({asChild:e=!1,size:t=`md`,isActive:n=!1,className:r,...i}){let a=e?$p:`a`;return(0,Y.jsx)(a,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:$(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i})}function uD(e){return e.length>12?e.slice(0,8)+`…`+e.slice(-4):e}function dD(e){return`/agents/`+encodeURIComponent(e)}function fD(e,t){return dD(e)+`/sessions/`+encodeURIComponent(t)}function pD({session:e,active:t,agentId:n}){let r=e.status===`running`?`bg-emerald-500`:e.status===`New`?`bg-amber-500`:`bg-muted-foreground`;return(0,Y.jsx)(cD,{children:(0,Y.jsx)(lD,{asChild:!0,isActive:t,size:`sm`,children:(0,Y.jsxs)(In,{to:fD(n,e.session),children:[(0,Y.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full `+r}),(0,Y.jsx)(`span`,{children:uD(e.session)}),(0,Y.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground`,children:e.events})]})})})}function mD({agent:e,sessions:t,activeAgentId:n,activeSessionId:r}){let i=wt(),[a,o]=(0,S.useState)(!0);(0,S.useEffect)(()=>{e.id===n&&o(!0)},[e.id,n]);let s=n===e.id&&r!==void 0&&!t.some(e=>e.session===r)?[{session:r,status:`New`,startedAt:Date.now(),events:0},...t]:t;return(0,Y.jsx)(Hw,{open:a,onOpenChange:o,asChild:!0,children:(0,Y.jsxs)(rD,{children:[(0,Y.jsx)(aD,{asChild:!0,isActive:e.id===n,tooltip:e.name,children:(0,Y.jsxs)(In,{to:dD(e.id),children:[(0,Y.jsx)(jp,{}),(0,Y.jsx)(`span`,{children:e.name})]})}),(0,Y.jsx)(Uw,{asChild:!0,children:(0,Y.jsxs)(oD,{className:`data-[state=open]:rotate-90`,children:[(0,Y.jsx)(Pp,{}),(0,Y.jsxs)(`span`,{className:`sr-only`,children:[`Toggle `,e.name,` sessions`]})]})}),(0,Y.jsxs)(oD,{className:`right-7`,showOnHover:!0,onClick:()=>{i(fD(e.id,crypto.randomUUID()))},children:[(0,Y.jsx)(Ip,{}),(0,Y.jsxs)(`span`,{className:`sr-only`,children:[`New `,e.name,` session`]})]}),(0,Y.jsx)(Ww,{children:(0,Y.jsx)(sD,{children:s.length===0?(0,Y.jsx)(cD,{children:(0,Y.jsx)(`span`,{className:`block px-2 py-1 text-xs text-muted-foreground`,children:`No sessions yet`})}):s.map(t=>(0,Y.jsx)(pD,{session:t,active:t.session===r,agentId:e.id},t.session))})})]})})}function hD({connection:e,activeAgentId:t,activeSessionId:n}){let r=e.status===`Running`?e.agents.length+` agent`+(e.agents.length===1?``:`s`):`Agent server unavailable`;return(0,Y.jsxs)(qE,{collapsible:`icon`,children:[(0,Y.jsx)(XE,{children:(0,Y.jsx)(nD,{children:(0,Y.jsx)(rD,{children:(0,Y.jsx)(aD,{size:`lg`,asChild:!0,children:(0,Y.jsxs)(In,{to:`/`,children:[(0,Y.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,Y.jsx)(Rp,{className:`size-4`})}),(0,Y.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,Y.jsx)(`span`,{className:`truncate font-medium`,children:`Nylorun Studio`}),(0,Y.jsx)(`span`,{className:`truncate text-xs`,children:`Agent workspace`})]})]})})})})}),(0,Y.jsx)(QE,{children:(0,Y.jsxs)($E,{children:[(0,Y.jsx)(eD,{children:`Agents`}),(0,Y.jsx)(tD,{children:(0,Y.jsxs)(nD,{children:[e.agents.map(r=>(0,Y.jsx)(mD,{agent:r,sessions:e.sessionsByAgent[r.id]??[],activeAgentId:t,activeSessionId:n},r.id)),e.status===`Running`&&e.agents.length===0?(0,Y.jsx)(rD,{children:(0,Y.jsx)(`span`,{className:`block px-2 py-1 text-sm text-muted-foreground`,children:`No agents exposed`})}):null,e.status===`Connecting`?(0,Y.jsx)(rD,{children:(0,Y.jsxs)(`span`,{className:`flex items-center gap-2 px-2 py-1 text-sm text-muted-foreground`,children:[(0,Y.jsx)(Bp,{className:`size-4 animate-spin`}),`Discovering agents`]})}):null]})})]})}),(0,Y.jsx)(ZE,{children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 text-xs text-muted-foreground`,children:[(0,Y.jsx)(Lp,{className:`size-3.5`}),r]})})]})}var gD=Yw(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function _D({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?$p:`span`;return(0,Y.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:$(gD({variant:t}),e),...r})}function vD(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function yD(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function bD(e){return e/100*window.innerHeight}function xD(e){return e/100*window.innerWidth}function SD(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function CD({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=SD(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=yD(t,i);break;case`em`:r=vD(t,i);break;case`vh`:r=bD(i);break;case`vw`:r=xD(i)}return r}function wD(e){return parseFloat(e.toFixed(3))}function TD({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function ED(e){let{panels:t}=e,n=TD({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=wD(CD({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=wD(CD({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=wD(CD({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=wD(CD({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function DD(e,t=`Assertion error`){if(!e)throw Error(t)}function OD(e,t){return Array.from(t).sort(e===`horizontal`?kD:AD)}function kD(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function AD(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function jD(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function MD(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function ND({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=MD(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return DD(i,`No rect found`),i}var PD;function FD(){return PD===void 0&&(PD=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),PD}function ID(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=OD(n,Array.from(t.children).filter(jD).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,ND({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=FD()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:TD({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var LD=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},RD={cursorFlags:0,state:`inactive`},zD=new LD;function BD(){return RD}function VD(e){return zD.addListener(`change`,e)}function HD(e){let t=RD,n={...RD};n.cursorFlags=e,RD=n,zD.emit(`change`,{prev:t,next:n})}function UD(e){let t=RD;RD=e,zD.emit(`change`,{prev:t,next:e})}var WD=e=>e,GD=()=>{},KD=1,qD=2,JD=4,YD=8,XD=3,ZD=12,QD;function $D(){return QD===void 0&&(QD=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(QD=!0)),QD}function eO({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&$D()){let t=(e&KD)!==0,n=(e&qD)!==0,r=(e&JD)!==0,i=(e&YD)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return $D()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var tO=new WeakMap;function nO(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=tO.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=BD();switch(r.state){case`active`:case`hover`:{let e=eO({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}tO.set(e,{prevStyle:t,styleSheet:n})}var rO=new Map,iO=new LD;function aO(e){rO=new Map(rO),rO.delete(e)}function oO(e,t){for(let[t]of rO)if(t.id===e)return t}function sO(e,t){for(let[t,n]of rO)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function cO(){return rO}function lO(e,t){return iO.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function uO(e,t,n){let r=rO.get(e);rO=new Map(rO),rO.set(e,t),iO.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function dO(e){let t=BD(),n=cO(),r=!1;return t.state===`active`&&(UD({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(nO(e),r=!0,t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=sO(e.group.id,!0);uO(e.group,t,{isUserInteraction:!0})}))),r}function fO(e){e.defaultPrevented||dO(e.currentTarget)}function pO(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=MD(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function mO(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function hO(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:xO(e),b:xO(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();DD(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:bO(yO(n.a)),b:bO(yO(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var gO=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function _O(e){let t=getComputedStyle(SO(e)??e).display;return t===`flex`||t===`inline-flex`}function vO(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||_O(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||gO.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function yO(e){let t=e.length;for(;t--;){let n=e[t];if(DD(n,`Missing node`),vO(n))return n}return null}function bO(e){return e&&Number(getComputedStyle(e).zIndex)||0}function xO(e){let t=[];for(;e;)t.push(e),e=SO(e);return t}function SO(e){let{parentNode:t}=e;return mO(t)?t.host:t}function CO(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function wO({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!jD(n)||n.contains(e)||e.contains(n))return!0;if(hO(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(CO(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function TO(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=ID(r),a=pO(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&wO({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function EO(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function DO(e,t,n=0){return Math.abs(wD(e)-wD(t))<=n}function OO(e,t){return DO(e,t)?0:e>t?1:-1}function kO({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(OO(r,c)<0){if(a){let e=(i+c)/2;r=OO(r,e)<0?i:c}else r=c}return r=Math.min(s,r),r=wD(r),r}function AO({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(DO(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;DD(u!=null,`Invalid first pivot index`),DD(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];DD(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(DD(n!=null,`Previous layout not found for panel index ${t}`),DO(n,i)){let t=o-n;OO(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];DD(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(DD(n!=null,`Previous layout not found for panel index ${t}`),DO(n,o)){let t=n-i;OO(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];DD(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&OO(i,c)<0){if(e>0){let t=c-o,n=t/2;OO(i+e,c)<0&&(e=OO(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;OO(i-e,c)<0&&(e=OO(100+e,n)>0?0:-t)}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];DD(e!=null,`Previous layout not found for panel index ${r}`);let a=kO({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];DD(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=kO({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!DO(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(EO(c,l))return i;{let t=e<0?d:u,r=s[t];DD(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=kO({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!DO(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];DD(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=kO({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(DO(i,s)||(t-=s-i,l[r]=s),DO(t,0))break;e>0?r--:r++}}}if(!DO(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function jO(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||OO(e[n],t[n])!==0)return!1;return!0}function MO({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!DO(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];DD(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];DD(i!=null,`No layout data found for index ${e}`);let o=r[e];DD(o!=null,`No layout data found for index ${e}`);let s=kO({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!DO(a,0))for(let e=0;e<t.length;e++){let n=r[e];DD(n!=null,`No layout data found for index ${e}`);let i=n+a,o=kO({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,DO(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function NO({groupId:e,panelId:t}){let n=()=>{let t=cO();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&DO(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:wD(100-e)}}return AO({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=MO({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});jO(c,u)||uO(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&DO(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=TD({group:t}),o=wD(CD({groupSize:a,panelElement:r,styleProp:e})/a*100);s(o)}}}function PO(e){e.defaultPrevented||TO(e,cO()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=NO({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function FO(e){let t=cO();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function IO({groupId:e}){let t=()=>{let t=cO();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=MO({layout:e,panelConstraints:r});return n?o:(jO(o,c)||uO(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function LO(e,t){let n=FO(e),r=sO(n.id,!0),i=n.separators.find(t=>t.element===e);DD(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);DD(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=IO({groupId:n.id}).getLayout(),c=MO({layout:AO({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});jO(s,c)||uO(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function RO(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=FO(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&LO(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&LO(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&LO(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&LO(t,-5);break;case`End`:e.preventDefault(),LO(t,100);break;case`Enter`:{e.preventDefault();let n=FO(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=sO(n.id,!0),o=n.separators.find(e=>e.element===t);DD(o,`Matching separator not found`);let s=a.get(o);DD(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(DD(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];LO(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=FO(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);DD(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),LO(t,-100)}}function zO(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=cO(),n=TO(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),UD({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}function BO({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=AO({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(jO(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?KD:qD;break;case`vertical`:s|=d<0?JD:YD}}else uO(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&XD:c|=s&XD,t.movementY===0?c|=o&ZD:c|=s&ZD,HD(c),nO(e)}function VO(e){let t=cO(),n=BD();n.state===`active`&&BO({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function HO(e){if(e.defaultPrevented)return;let t=BD(),n=cO();switch(t.state){case`active`:if(e.buttons===0){UD({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=sO(e.group.id,!0);uO(e.group,t,{isUserInteraction:!0})});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}BO({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=TO(e,n);r.length===0?t.state!==`inactive`&&UD({cursorFlags:0,state:`inactive`}):UD({cursorFlags:0,hitRegions:r,state:`hover`}),nO(e.currentTarget);break}}}function UO(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(BD().state){case`hover`:UD({cursorFlags:0,state:`inactive`})}}function WO(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||dO(e.currentTarget)&&e.preventDefault()}function GO(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=wD(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=wD((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function KO(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=TD({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:wD(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function qO(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function JO(e,t){return e.length===t.length&&e.every((e,n)=>qO(e,t[n]))}function YO({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=wD(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=wD((r[e]??0)/a*l);else{let e=wD(l/c.length);for(let t of c)u[t]=e}return u}function XO(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var ZO=new Map;function QO(e){let t=!0;DD(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=TD({group:e});if(t===0)return;let n=sO(e.id);if(!n)return;let r=ED(e),i=n.defaultLayoutDeferred?GO(r):n.layout,a=MO({layout:YO({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&jO(n.layout,a)&&JO(n.derivedPanelConstraints,r)&&n.groupSize===t)continue;uO(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else KO(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{DD(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=TD({group:e}),s=ED(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(XO(e.panels,l)||(l=void 0));let u=MO({layout:e.mutableState.layouts[c]??l??GO(s),panelConstraints:s}),d=e.element.ownerDocument;ZO.set(d,(ZO.get(d)??0)+1);let f=new Map;return ID(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),uO(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{DD(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,RO)}),ZO.get(d)===1&&(d.addEventListener(`contextmenu`,fO,!0),d.addEventListener(`dblclick`,PO,!0),d.addEventListener(`pointerdown`,zO,!0),d.addEventListener(`pointerleave`,VO),d.addEventListener(`pointermove`,HO),d.addEventListener(`pointerout`,UO),d.addEventListener(`pointerup`,WO,!0)),function(){t=!1,ZO.set(d,Math.max(0,(ZO.get(d)??0)-1)),aO(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,RO)}),ZO.get(d)||(d.removeEventListener(`contextmenu`,fO,!0),d.removeEventListener(`dblclick`,PO,!0),d.removeEventListener(`pointerdown`,zO,!0),d.removeEventListener(`pointerleave`,VO),d.removeEventListener(`pointermove`,HO),d.removeEventListener(`pointerout`,UO),d.removeEventListener(`pointerup`,WO,!0)),a.disconnect()}}function $O(){let[e,t]=(0,S.useState)({});return[e,(0,S.useCallback)(()=>t({}),[])]}function ek(e){let t=(0,S.useId)();return`${e??t}`}var tk=typeof window<`u`?S.useLayoutEffect:S.useEffect;function nk(e){let t=(0,S.useRef)(e);return tk(()=>{t.current=e},[e]),(0,S.useCallback)((...e)=>t.current?.(...e),[t])}function rk(...e){return nk(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function ik(e){let t=(0,S.useRef)({...e});return tk(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var ak=(0,S.createContext)(null);function ok(e,t){let n=(0,S.useRef)({getLayout:()=>({}),setLayout:WD});(0,S.useImperativeHandle)(t,()=>n.current,[]),tk(()=>{Object.assign(n.current,IO({groupId:e}))})}function sk({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,S.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=nk(e=>{jO(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=nk((e,t)=>{jO(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),_=ek(s),v=(0,S.useRef)(null),[y,b]=$O(),x=(0,S.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),C=rk(v,a);ok(_,o);let w=nk((e,t)=>{let r=BD(),i=oO(e),a=sO(e);if(a){let e=!1;return r.state===`active`&&(e=r.hitRegions.some(e=>e.group===i)),{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),T=ik({defaultLayout:n,disableCursor:r}),ee=(0,S.useMemo)(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:w,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=OD(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=OD(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=oO(_),i=sO(_);r&&i&&uO(r,{...i,derivedPanelConstraints:ED(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[w,_,b,u,T]),te=(0,S.useRef)(null);return tk(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=T.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!T.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};te.current=r;let a=QO(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=sO(r.id,!0);!o&&s.length>0&&(h(c),g(c,!1));let l=lO(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=DO(t.collapsedSize,i[t.panelId]),a=DO(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=BD().state!==`active`;h(i),o&&g(i,e.isUserInteraction)});return()=>{te.current=null,a(),l()}},[i,_,g,h,u,y,T]),(0,S.useEffect)(()=>{let e=te.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Y.jsx)(ak.Provider,{value:ee,children:(0,Y.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:C,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}sk.displayName=`Group`;function ck(){let e=(0,S.useContext)(ak);return DD(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function lk(e,t){let{id:n}=ck(),r=(0,S.useRef)({collapse:GD,expand:GD,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:GD});(0,S.useImperativeHandle)(t,()=>r.current,[]),tk(()=>{Object.assign(r.current,NO({groupId:n,panelId:e}))})}function uk({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=ek(c),_=ik({disabled:a}),v=(0,S.useRef)(null),y=rk(v,o),{getPanelStyles:b,id:x,orientation:C,registerPanel:w,updatePanelProps:T}=ck(),ee=d!==null,te=nk((e,t,n)=>{d?.(e,c,n)});tk(()=>{let e=v.current;if(e!==null){let t={element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:ee?te:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}};return w(t)}},[s,n,r,i,ee,g,h,l,u,te,w,_]),(0,S.useEffect)(()=>{T(g,{disabled:a})},[a,g,T]),lk(g,f);let ne=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},E=(0,S.useSyncExternalStore)(e=>lO(x,e),ne,ne),re;return re=E?JSON.parse(E):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,Y.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...dk,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...re},children:(0,Y.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:C===`horizontal`?`pan-y`:`pan-x`},children:e})})}uk.displayName=`Panel`;var dk={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function fk({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=MO({layout:AO({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=MO({layout:AO({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function pk({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=ek(a),l=ik({disabled:n,disableDoubleClick:r}),[u,d]=(0,S.useState)({}),[f,p]=(0,S.useState)(`inactive`),[m,h]=(0,S.useState)(!1),g=(0,S.useRef)(null),_=rk(g,i),{disableCursor:v,id:y,orientation:b,registerSeparator:x,updateSeparatorProps:C}=ck(),w=b===`horizontal`?`vertical`:`horizontal`;tk(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=x(t),r=VD(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=lO(y,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(fk({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[y,c,x,l]),(0,S.useEffect)(()=>{C(c,{disabled:n,disableDoubleClick:r})},[n,r,c,C]);let T;n&&!v&&(T=`not-allowed`);let ee;if(n)ee=`disabled`;else switch(f){case`active`:ee=`active`;break;default:ee=m?`focus`:f}return(0,Y.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":w,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":ee,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:T,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}pk.displayName=`Separator`;function mk({className:e,...t}){return(0,Y.jsx)(sk,{"data-slot":`resizable-panel-group`,className:$(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function hk({...e}){return(0,Y.jsx)(uk,{"data-slot":`resizable-panel`,...e})}function gk({withHandle:e,className:t,...n}){return(0,Y.jsx)(pk,{"data-slot":`resizable-handle`,className:$(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,Y.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border`,children:(0,Y.jsx)(zp,{className:`size-2.5`})})})}function _k({className:e,children:t,...n}){return(0,Y.jsxs)(ES,{"data-slot":`scroll-area`,className:$(`relative`,e),...n,children:[(0,Y.jsx)(DS,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,Y.jsx)(vk,{}),(0,Y.jsx)(OS,{})]})}function vk({className:e,orientation:t=`vertical`,...n}){return(0,Y.jsx)(eS,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:$(`flex touch-none p-px transition-colors select-none`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent`,e),...n,children:(0,Y.jsx)(dS,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}function yk({...e}){return(0,Y.jsx)(GS,{"data-slot":`select`,...e})}function bk({...e}){return(0,Y.jsx)(YS,{"data-slot":`select-value`,...e})}function xk({className:e,size:t=`default`,children:n,...r}){return(0,Y.jsxs)(qS,{"data-slot":`select-trigger`,"data-size":t,className:$(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,Y.jsx)(XS,{asChild:!0,children:(0,Y.jsx)(Np,{className:`size-4 opacity-50`})})]})}function Sk({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,Y.jsx)($S,{children:(0,Y.jsxs)(tC,{"data-slot":`select-content`,className:$(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`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`,e),position:n,align:r,...i,children:[(0,Y.jsx)(wk,{}),(0,Y.jsx)(pC,{className:$(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,Y.jsx)(Tk,{})]})})}function Ck({className:e,children:t,...n}){return(0,Y.jsxs)(yC,{"data-slot":`select-item`,className:$(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,Y.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,Y.jsx)(CC,{children:(0,Y.jsx)(Mp,{className:`size-4`})})}),(0,Y.jsx)(xC,{children:t})]})}function wk({className:e,...t}){return(0,Y.jsx)(TC,{"data-slot":`select-scroll-up-button`,className:$(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,Y.jsx)(Fp,{className:`size-4`})})}function Tk({className:e,...t}){return(0,Y.jsx)(DC,{"data-slot":`select-scroll-down-button`,className:$(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,Y.jsx)(Np,{className:`size-4`})})}function Ek({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,Y.jsx)(`table`,{"data-slot":`table`,className:$(`w-full caption-bottom text-sm`,e),...t})})}function Dk({className:e,...t}){return(0,Y.jsx)(`thead`,{"data-slot":`table-header`,className:$(`[&_tr]:border-b`,e),...t})}function Ok({className:e,...t}){return(0,Y.jsx)(`tbody`,{"data-slot":`table-body`,className:$(`[&_tr:last-child]:border-0`,e),...t})}function kk({className:e,...t}){return(0,Y.jsx)(`tr`,{"data-slot":`table-row`,className:$(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function Ak({className:e,...t}){return(0,Y.jsx)(`th`,{"data-slot":`table-head`,className:$(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function jk({className:e,...t}){return(0,Y.jsx)(`td`,{"data-slot":`table-cell`,className:$(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function Mk(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`nylo-studio.config.json must contain an object.`);let n=e.agentServerUrl;if(n===void 0)return Object.freeze({});if(typeof n!=`string`)throw Error(`agentServerUrl must be a string.`);let r;try{r=new URL(n)}catch{throw Error(`agentServerUrl must be an absolute http(s) URL.`)}if(r.protocol!==`http:`&&r.protocol!==`https:`)throw Error(`agentServerUrl must use http or https.`);if(r.username!==``||r.password!==``||r.search!==``||r.hash!==``)throw Error(`agentServerUrl must not contain credentials, a query string, or a fragment.`);if(t===`https:`&&r.protocol===`http:`)throw Error(`An HTTPS Studio cannot connect to an HTTP Agent Server. Serve the Agent Server over HTTPS.`);return Object.freeze({agentServerUrl:r.href.replace(/\/$/u,``)})}async function Nk(e=fetch,t=document.baseURI){let n=new URL(t),r=await e(new URL(`/nylo-studio.config.json`,n.origin));if(!r.ok)throw Error(`Could not load nylo-studio.config.json (${r.status}).`);return Mk(await r.json(),new URL(t).protocol)}function Pk(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function Fk(e,t){return typeof e==`string`&&e!==``?e:t}function Ik(e){if(typeof e==`string`)return e.length>140?`${e.slice(0,137)}…`:e;try{let t=JSON.stringify(e);return t.length>140?`${t.slice(0,137)}…`:t}catch{return`Result is not serializable.`}}function Lk(e){switch(e.type){case`model.requested`:return`Model requested`;case`model.completed`:return`Model completed`;case`model.deferred`:return`Model deferred`;case`model.call`:return`Model response`;case`tool.started`:return`Tool started`;case`tool.completed`:return`Tool completed`;case`tool.deferred`:return`Tool deferred`;case`interaction.required`:return`Approval required`;case`session.run.started`:return`Session input received`;case`final`:return`Final answer`;case`error`:return`Run failed`;default:return e.type.replaceAll(`.`,` `)}}function Rk(e){let t=e.payload;if(e.type.startsWith(`tool.`)){let n=Fk(t.toolName,`tool`);if(e.type===`tool.completed`){let e=Pk(t.attributes);return e.kind===`failed`?`${n}: ${Fk(e.message,Fk(t.code,`failed`))}`:`${n}: ${Ik(e.output??e.kind??t.outcome)}`}return n}return e.type===`interaction.required`?Fk(Pk(t.interaction).prompt,`A response is required before this work can continue.`):e.type===`final`?Ik(t.output):e.type===`error`?Fk(t.message,`The run failed.`):e.type===`model.requested`?Fk(t.requestedModelId,`Preparing a model request.`):e.type===`model.completed`?`Candidate received.`:e.type===`session.run.started`&&t.input_kind===`approve`?t.approved===!0?`Approval granted.`:`Approval denied.`:`Canonical agent event.`}function zk(e,t){return new URL(t,e+`/`).toString()}function Bk(e){return e.length>12?e.slice(0,8)+`…`+e.slice(-4):e}function Vk(e){return e===void 0?`—`:new Date(e).toLocaleString()}function Hk(e){try{return JSON.stringify(e,null,2)}catch{return`Unserializable value`}}function Uk(e,t){return e instanceof TypeError&&e.message===`Failed to fetch`?`Studio could not reach the agent server. Confirm it is running, then retry.`:e instanceof Error?e.message:t}function Wk(e){return`/agents/`+encodeURIComponent(e)}function Gk(e,t){return Wk(e)+`/sessions/`+encodeURIComponent(t)}function Kk(){let[e,t]=(0,S.useState)({status:`Connecting`,agents:[],sessionsByAgent:{}});return(0,S.useEffect)(()=>{let e=!1,n=async()=>{try{let n=await Nk();if(n.agentServerUrl===void 0)throw Error(`No Agent Server URL configured.`);let r=await fetch(zk(n.agentServerUrl,`/v1/agents`),{cache:`no-store`});if(!r.ok)throw Error(`Agent Server returned `+r.status+`.`);let i=await r.json();if(i.protocolVersion!==1||!Array.isArray(i.agents))throw Error(`Unsupported Studio discovery document.`);let a=await Promise.all(i.agents.map(async e=>{let t=await fetch(zk(n.agentServerUrl,e.manifestUrl),{cache:`no-store`});if(!t.ok)throw Error(`Manifest for `+e.id+` returned `+t.status+`.`);let r=await t.json();return{...r,endpoints:{agUi:zk(n.agentServerUrl,r.endpoints.agUi),sessions:zk(n.agentServerUrl,r.endpoints.sessions)}}}));e||t(e=>({status:`Running`,url:n.agentServerUrl,agents:a,sessionsByAgent:e.sessionsByAgent}))}catch{e||t(e=>({...e,status:`Offline`}))}};n();let r=window.setInterval(()=>void n(),2e3);return()=>{e=!0,window.clearInterval(r)}},[]),(0,S.useEffect)(()=>{if(e.status!==`Running`||e.agents.length===0)return;let n=!1,r=async()=>{let r=await Promise.all(e.agents.map(async e=>{try{let t=await fetch(e.endpoints.sessions,{cache:`no-store`});if(!t.ok)return[e.id,void 0];let n=await t.json();return[e.id,[...n.sessions].sort((e,t)=>t.startedAt-e.startedAt)]}catch{return[e.id,void 0]}}));n||t(e=>{let t={...e.sessionsByAgent};for(let[e,n]of r)n!==void 0&&(t[e]=n);return{...e,sessionsByAgent:t}})};r();let i=window.setInterval(()=>void r(),2e3);return()=>{n=!0,window.clearInterval(i)}},[e.status,e.agents]),e}function qk({title:e,detail:t,action:n}){return(0,Y.jsx)(`div`,{className:`grid h-full min-h-52 place-items-center p-8 text-center`,children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h2`,{className:`font-medium`,children:e}),(0,Y.jsx)(`p`,{className:`mt-1 max-w-md text-sm text-muted-foreground`,children:t}),n===void 0?null:(0,Y.jsx)(`div`,{className:`mt-4 flex justify-center`,children:n})]})})}function Jk({values:e}){return e.length===0?(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`None declared`}):(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,Y.jsx)(_D,{variant:`secondary`,children:e},e))})}function Yk({connection:e}){let t=e.status===`Running`,n=t?`bg-emerald-500`:e.status===`Connecting`?`bg-amber-500`:`bg-muted-foreground`;return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:`size-2 rounded-full `+n}),e.status===`Connecting`?(0,Y.jsx)(Bp,{className:`size-3 animate-spin`}):t?(0,Y.jsx)(Ap,{className:`size-3`}):(0,Y.jsx)(Up,{className:`size-3`}),(0,Y.jsx)(`span`,{children:e.status})]})}function Xk({connection:e}){let t=xt(),n=wt(),r=t.pathname.match(/^\/agents\/([^/]+)/u),i=e.agents.find(e=>e.id===decodeURIComponent(r?.[1]??``));return(0,Y.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b px-4`,children:[(0,Y.jsx)(JE,{}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`p`,{className:`truncate text-sm font-medium`,children:i===void 0?`Nylorun Studio`:i.name}),(0,Y.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:i===void 0?`Select an agent and session`:i.id})]}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,Y.jsxs)(TE,{variant:`outline`,size:`sm`,disabled:e.status!==`Running`||i===void 0,onClick:()=>{i!==void 0&&n(Gk(i.id,crypto.randomUUID()))},children:[(0,Y.jsx)(Ip,{className:`size-4`}),`New session`]}),(0,Y.jsx)(Yk,{connection:e})]})]})}function Zk({agent:e,sessionId:t}){let[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(``),[o,s]=(0,S.useState)(),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)();(0,S.useEffect)(()=>{let n=!1,i=async()=>{let i=await fetch(e.endpoints.agUi.replace(/\/$/u,``)+`/sessions/`+encodeURIComponent(t),{cache:`no-store`});i.ok&&!n&&r((await i.json()).messages);let a=await fetch(e.endpoints.sessions.replace(/\/$/u,``)+`/`+encodeURIComponent(t),{cache:`no-store`});a.ok&&!n&&s((await a.json()).pending_interaction)};i();let a=window.setInterval(()=>void i(),1e3);return()=>{n=!0,window.clearInterval(a)}},[e.endpoints.agUi,e.endpoints.sessions,t]);let f=async n=>{if(n.preventDefault(),!i.trim()||c)return;let o=i.trim();a(``),l(!0),d(void 0),r(e=>[...e,{id:crypto.randomUUID(),role:`user`,content:o}]);try{let n=new yp({url:e.endpoints.agUi,threadId:t});n.addMessage({id:crypto.randomUUID(),role:`user`,content:o}),await n.runAgent({runId:crypto.randomUUID()},{onNewMessage:({message:e})=>{let t=e;r(e=>[...e,{id:t.id??crypto.randomUUID(),role:t.role??`assistant`,content:typeof t.content==`string`?t.content:Hk(t.content)}])}})}catch(e){d(Uk(e,`Agent request failed.`))}finally{l(!1)}},p=async n=>{if(o!==void 0){l(!0);try{let r=await fetch(e.endpoints.sessions.replace(/\/$/u,``)+`/`+encodeURIComponent(t),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({interaction:{id:o.id,kind:`approval`,approved:n}})});if(!r.ok)throw Error(`Approval returned `+r.status+`.`);s(void 0)}catch(e){d(Uk(e,`Approval failed.`))}finally{l(!1)}}};return(0,Y.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Y.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center border-b px-4`,children:[(0,Y.jsx)(`h1`,{className:`text-sm font-medium`,children:`Chat`}),(0,Y.jsx)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground`,children:Bk(t)})]}),(0,Y.jsx)(_k,{className:`min-h-0 flex-1`,children:(0,Y.jsxs)(`div`,{className:`space-y-4 p-4`,children:[n.length===0?(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start the conversation to run this session.`}):n.map(e=>(0,Y.jsxs)(`article`,{className:`max-w-3xl rounded-lg px-4 py-3 text-sm `+(e.role===`user`?`ml-auto bg-primary text-primary-foreground`:`bg-muted`),children:[(0,Y.jsx)(`p`,{className:`mb-1 text-xs opacity-70`,children:e.role}),(0,Y.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.content})]},e.id)),o!==void 0&&(0,Y.jsxs)(`section`,{className:`rounded-lg border border-amber-400/50 bg-amber-50 p-4 text-sm`,children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`Approval required`}),(0,Y.jsx)(`p`,{className:`mt-1`,children:o.prompt}),(0,Y.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Y.jsx)(TE,{size:`sm`,onClick:()=>void p(!0),children:`Approve`}),(0,Y.jsx)(TE,{size:`sm`,variant:`outline`,onClick:()=>void p(!1),children:`Deny`})]})]}),u!==void 0&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:u})]})}),(0,Y.jsxs)(`form`,{onSubmit:f,className:`flex shrink-0 gap-2 border-t p-3`,children:[(0,Y.jsx)(EE,{value:i,onChange:e=>a(e.target.value),disabled:c||o!==void 0,placeholder:`Message the agent…`}),(0,Y.jsxs)(TE,{type:`submit`,size:`icon`,disabled:c||o!==void 0||!i.trim(),children:[(0,Y.jsx)(Hp,{className:`size-4`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Send message`})]})]})]})}function Qk({agent:e}){let t=e.harness.manifest.middleware??[],n=Object.entries(e.requirements??{}).filter(([,e])=>e).map(([e])=>e);return(0,Y.jsx)(_k,{className:`min-h-0 flex-1`,children:(0,Y.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h2`,{className:`text-sm font-medium`,children:e.name}),(0,Y.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e.description}),(0,Y.jsx)(`p`,{className:`mt-2 font-mono text-xs text-muted-foreground`,children:e.id})]}),(0,Y.jsxs)(`section`,{className:`rounded-lg border p-4`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Model`}),(0,Y.jsxs)(`dl`,{className:`mt-3 grid gap-3 text-sm`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Provider`}),(0,Y.jsx)(`dd`,{children:e.model.provider})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Model`}),(0,Y.jsx)(`dd`,{children:e.model.id})]})]})]}),(0,Y.jsxs)(`section`,{className:`rounded-lg border p-4`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Capabilities`}),(0,Y.jsx)(`div`,{className:`mt-3`,children:(0,Y.jsx)(Jk,{values:e.capabilities})})]}),(0,Y.jsxs)(`section`,{className:`rounded-lg border p-4`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Harness`}),(0,Y.jsxs)(`dl`,{className:`mt-3 grid gap-3 text-sm`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Package`}),(0,Y.jsxs)(`dd`,{children:[e.harness.name,` `,e.harness.version]})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Middleware`}),(0,Y.jsx)(`dd`,{className:`mt-1`,children:(0,Y.jsx)(Jk,{values:t.map(e=>e.id)})})]})]})]}),(0,Y.jsxs)(`section`,{className:`rounded-lg border p-4`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Requirements`}),(0,Y.jsx)(`div`,{className:`mt-3`,children:(0,Y.jsx)(Jk,{values:n})}),(0,Y.jsxs)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:[`Records: `,e.records?.path??`not reported`]})]})]})})}function $k({events:e,selected:t,onSelect:n}){let[r,i]=(0,S.useState)(`all`),a=(0,S.useMemo)(()=>[...new Set(e.map(e=>e.type))].sort(),[e]),o=r===`all`?e:e.filter(e=>e.type===r);return(0,Y.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Y.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-3 border-b px-4`,children:[(0,Y.jsx)(`h2`,{className:`text-sm font-medium`,children:`Events`}),(0,Y.jsxs)(yk,{value:r,onValueChange:i,children:[(0,Y.jsx)(xk,{size:`sm`,className:`ml-auto w-44`,children:(0,Y.jsx)(bk,{placeholder:`All event types`})}),(0,Y.jsxs)(Sk,{children:[(0,Y.jsx)(Ck,{value:`all`,children:`All event types`}),a.map(e=>(0,Y.jsx)(Ck,{value:e,children:Lk({type:e})},e))]})]})]}),(0,Y.jsx)(_k,{className:`min-h-0 flex-1`,children:(0,Y.jsxs)(Ek,{children:[(0,Y.jsx)(Dk,{className:`sticky top-0 z-10 bg-background`,children:(0,Y.jsxs)(kk,{children:[(0,Y.jsx)(Ak,{className:`w-14`,children:`Seq`}),(0,Y.jsx)(Ak,{className:`w-40`,children:`Time`}),(0,Y.jsx)(Ak,{className:`w-40`,children:`Type`}),(0,Y.jsx)(Ak,{children:`Summary`})]})}),(0,Y.jsx)(Ok,{children:o.length===0?(0,Y.jsx)(kk,{children:(0,Y.jsx)(jk,{colSpan:4,className:`h-28 text-center text-muted-foreground`,children:e.length===0?`Events will appear when the agent runs.`:`No events match this type.`})}):o.map(e=>(0,Y.jsxs)(kk,{"data-state":t?.seq===e.seq?`selected`:void 0,className:`cursor-pointer`,onClick:()=>n(e),children:[(0,Y.jsx)(jk,{className:`font-mono text-xs`,children:e.seq}),(0,Y.jsx)(jk,{className:`text-xs text-muted-foreground`,children:Vk(e.ts)}),(0,Y.jsx)(jk,{children:(0,Y.jsx)(_D,{variant:`secondary`,children:Lk(e)})}),(0,Y.jsx)(jk,{className:`max-w-0 truncate text-xs text-muted-foreground`,children:Rk(e)})]},e.seq))})]})})]})}function eA({event:e,onClose:t}){return(0,Y.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Y.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-3 border-b px-4`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:Lk(e)}),(0,Y.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[`Event `,e.seq]})]}),(0,Y.jsxs)(TE,{className:`ml-auto`,size:`icon`,variant:`ghost`,onClick:t,children:[(0,Y.jsx)(Wp,{className:`size-4`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Close event details`})]})]}),(0,Y.jsx)(_k,{className:`min-h-0 flex-1`,children:(0,Y.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Y.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm`,children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Sequence`}),(0,Y.jsx)(`dd`,{children:e.seq}),(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Timestamp`}),(0,Y.jsx)(`dd`,{children:Vk(e.ts)}),(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Type`}),(0,Y.jsx)(`dd`,{children:e.type})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Canonical event`}),(0,Y.jsx)(`pre`,{className:`mt-2 overflow-auto rounded-md bg-muted p-3 text-xs leading-5`,children:Hk(e)})]})]})})]})}function tA({agent:e,sessionId:t}){let[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(`events`),[o,s]=(0,S.useState)(),[c,l]=(0,S.useState)(!1);(0,S.useEffect)(()=>{let n=!1,i=async()=>{let i=e.endpoints.sessions.replace(/\/$/u,``)+`/`+encodeURIComponent(t)+`/events?after=0&limit=1000`,a=await fetch(i,{cache:`no-store`});if(a.ok&&!n){let e=await a.json();r([...e.events].sort((e,t)=>t.seq-e.seq))}};i();let a=window.setInterval(()=>void i(),1e3);return()=>{n=!0,window.clearInterval(a)}},[e.endpoints.sessions,t]),(0,S.useEffect)(()=>{s(void 0),l(!1),a(`events`)},[t]);let u=e=>{s(e),l(!0)},d=e=>{let t=e;a(t),t===`manifest`&&l(!1)},f=i===`events`&&c&&o!==void 0;return(0,Y.jsxs)(mk,{orientation:`horizontal`,className:`min-h-0 flex-1`,children:[(0,Y.jsx)(hk,{defaultSize:f?38:50,minSize:28,children:(0,Y.jsx)(Zk,{agent:e,sessionId:t})}),(0,Y.jsx)(gk,{withHandle:!0}),(0,Y.jsx)(hk,{defaultSize:f?37:50,minSize:28,children:(0,Y.jsxs)($C,{value:i,onValueChange:d,className:`flex min-h-0 flex-1 flex-col`,children:[(0,Y.jsx)(`div`,{className:`flex h-12 shrink-0 items-end border-b px-4`,children:(0,Y.jsxs)(ew,{className:`flex h-full items-end gap-5`,children:[(0,Y.jsx)(tw,{value:`events`,className:`border-b-2 border-transparent px-0 pb-3 text-sm font-medium text-muted-foreground outline-none transition-colors hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-foreground`,children:`Events`}),(0,Y.jsx)(tw,{value:`manifest`,className:`border-b-2 border-transparent px-0 pb-3 text-sm font-medium text-muted-foreground outline-none transition-colors hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-foreground`,children:`Agent Manifest`})]})}),(0,Y.jsx)(nw,{value:`events`,className:`min-h-0 flex-1 outline-none`,children:(0,Y.jsx)($k,{events:n,selected:o,onSelect:u})}),(0,Y.jsx)(nw,{value:`manifest`,className:`min-h-0 flex-1 outline-none`,children:(0,Y.jsx)(Qk,{agent:e})})]})}),f?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(gk,{withHandle:!0}),(0,Y.jsx)(hk,{defaultSize:25,minSize:20,children:(0,Y.jsx)(eA,{event:o,onClose:()=>{l(!1),s(void 0)}})})]}):null]},f?`details`:`workspace`)}function nA({connection:e}){let{agentId:t=``,sessionId:n}=Et(),r=wt(),i=e.agents.find(e=>e.id===t);return t===``?(0,Y.jsx)(qk,{title:`Choose an agent`,detail:`Select an agent and one of its sessions from the navigation.`}):i===void 0?(0,Y.jsx)(qk,{title:`Agent not found`,detail:`This agent is not currently exposed by the connected agent server.`}):n===void 0?(0,Y.jsx)(qk,{title:`Choose a session`,detail:`Select a saved session from the navigation, or start a new conversation with this agent.`,action:(0,Y.jsxs)(TE,{onClick:()=>r(Gk(i.id,crypto.randomUUID())),children:[(0,Y.jsx)(Ip,{className:`size-4`}),`New session`]})}):(0,Y.jsx)(tA,{agent:i,sessionId:n})}function rA(){let e=Kk(),t=xt().pathname.match(/^\/agents\/([^/]+)(?:\/sessions\/([^/]+))?/u),n=t===null?void 0:decodeURIComponent(t[1]),r=t?.[2];return(0,Y.jsxs)(KE,{children:[(0,Y.jsx)(hD,{connection:e,activeAgentId:n,activeSessionId:r}),(0,Y.jsxs)(YE,{className:`h-svh min-w-0`,children:[(0,Y.jsx)(Xk,{connection:e}),(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,Y.jsxs)(Xt,{children:[(0,Y.jsx)(Jt,{path:`/`,element:(0,Y.jsx)(nA,{connection:e})}),(0,Y.jsx)(Jt,{path:`/agents/:agentId`,element:(0,Y.jsx)(nA,{connection:e})}),(0,Y.jsx)(Jt,{path:`/agents/:agentId/sessions/:sessionId`,element:(0,Y.jsx)(nA,{connection:e})})]})})]})]})}function iA(){return(0,Y.jsx)(Fn,{children:(0,Y.jsx)(rA,{})})}(0,Bi.createRoot)(document.getElementById(`root`)).render((0,Y.jsx)(S.StrictMode,{children:(0,Y.jsx)(iA,{})}));