@agentxjs/portagent 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var sE=Object.defineProperty;var by=e=>{throw TypeError(e)};var oE=(e,t,n)=>t in e?sE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var je=(e,t,n)=>oE(e,typeof t!="symbol"?t+"":t,n),Hd=(e,t,n)=>t.has(e)||by("Cannot "+n);var J=(e,t,n)=>(Hd(e,t,"read from private field"),n?n.call(e):t.get(e)),xr=(e,t,n)=>t.has(e)?by("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ir=(e,t,n,r)=>(Hd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),xt=(e,t,n)=>(Hd(e,t,"access private method"),n);var Sy=(e,t,n,r)=>({set _(o){ir(e,t,o,n)},get _(){return J(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function Rx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wd={exports:{}},la={},qd={exports:{}},Ve={};/**
1
+ var sE=Object.defineProperty;var by=e=>{throw TypeError(e)};var oE=(e,t,n)=>t in e?sE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var wn=(e,t,n)=>oE(e,typeof t!="symbol"?t+"":t,n),Hd=(e,t,n)=>t.has(e)||by("Cannot "+n);var J=(e,t,n)=>(Hd(e,t,"read from private field"),n?n.call(e):t.get(e)),xr=(e,t,n)=>t.has(e)?by("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ir=(e,t,n,r)=>(Hd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),vt=(e,t,n)=>(Hd(e,t,"access private method"),n);var Sy=(e,t,n,r)=>({set _(o){ir(e,t,o,n)},get _(){return J(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function Rx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wd={exports:{}},la={},qd={exports:{}},Fe={};/**
2
2
  * @license React
3
3
  * react.production.min.js
4
4
  *
@@ -6,7 +6,7 @@ var sE=Object.defineProperty;var by=e=>{throw TypeError(e)};var oE=(e,t,n)=>t in
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ky;function aE(){if(ky)return Ve;ky=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function y(j){return j===null||typeof j!="object"?null:(j=m&&j[m]||j["@@iterator"],typeof j=="function"?j:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function C(j,Y,A){this.props=j,this.context=Y,this.refs=S,this.updater=A||v}C.prototype.isReactComponent={},C.prototype.setState=function(j,Y){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,Y,"setState")},C.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function E(){}E.prototype=C.prototype;function P(j,Y,A){this.props=j,this.context=Y,this.refs=S,this.updater=A||v}var T=P.prototype=new E;T.constructor=P,b(T,C.prototype),T.isPureReactComponent=!0;var O=Array.isArray,V=Object.prototype.hasOwnProperty,N={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function H(j,Y,A){var be,Ie={},Se=null,Oe=null;if(Y!=null)for(be in Y.ref!==void 0&&(Oe=Y.ref),Y.key!==void 0&&(Se=""+Y.key),Y)V.call(Y,be)&&!D.hasOwnProperty(be)&&(Ie[be]=Y[be]);var de=arguments.length-2;if(de===1)Ie.children=A;else if(1<de){for(var he=Array(de),Re=0;Re<de;Re++)he[Re]=arguments[Re+2];Ie.children=he}if(j&&j.defaultProps)for(be in de=j.defaultProps,de)Ie[be]===void 0&&(Ie[be]=de[be]);return{$$typeof:e,type:j,key:Se,ref:Oe,props:Ie,_owner:N.current}}function ee(j,Y){return{$$typeof:e,type:j.type,key:Y,ref:j.ref,props:j.props,_owner:j._owner}}function L(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function te(j){var Y={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(A){return Y[A]})}var G=/\/+/g;function X(j,Y){return typeof j=="object"&&j!==null&&j.key!=null?te(""+j.key):Y.toString(36)}function Q(j,Y,A,be,Ie){var Se=typeof j;(Se==="undefined"||Se==="boolean")&&(j=null);var Oe=!1;if(j===null)Oe=!0;else switch(Se){case"string":case"number":Oe=!0;break;case"object":switch(j.$$typeof){case e:case t:Oe=!0}}if(Oe)return Oe=j,Ie=Ie(Oe),j=be===""?"."+X(Oe,0):be,O(Ie)?(A="",j!=null&&(A=j.replace(G,"$&/")+"/"),Q(Ie,Y,A,"",function(Re){return Re})):Ie!=null&&(L(Ie)&&(Ie=ee(Ie,A+(!Ie.key||Oe&&Oe.key===Ie.key?"":(""+Ie.key).replace(G,"$&/")+"/")+j)),Y.push(Ie)),1;if(Oe=0,be=be===""?".":be+":",O(j))for(var de=0;de<j.length;de++){Se=j[de];var he=be+X(Se,de);Oe+=Q(Se,Y,A,he,Ie)}else if(he=y(j),typeof he=="function")for(j=he.call(j),de=0;!(Se=j.next()).done;)Se=Se.value,he=be+X(Se,de++),Oe+=Q(Se,Y,A,he,Ie);else if(Se==="object")throw Y=String(j),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return Oe}function re(j,Y,A){if(j==null)return j;var be=[],Ie=0;return Q(j,be,"","",function(Se){return Y.call(A,Se,Ie++)}),be}function fe(j){if(j._status===-1){var Y=j._result;Y=Y(),Y.then(function(A){(j._status===0||j._status===-1)&&(j._status=1,j._result=A)},function(A){(j._status===0||j._status===-1)&&(j._status=2,j._result=A)}),j._status===-1&&(j._status=0,j._result=Y)}if(j._status===1)return j._result.default;throw j._result}var oe={current:null},U={transition:null},se={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:U,ReactCurrentOwner:N};function _(){throw Error("act(...) is not supported in production builds of React.")}return Ve.Children={map:re,forEach:function(j,Y,A){re(j,function(){Y.apply(this,arguments)},A)},count:function(j){var Y=0;return re(j,function(){Y++}),Y},toArray:function(j){return re(j,function(Y){return Y})||[]},only:function(j){if(!L(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},Ve.Component=C,Ve.Fragment=n,Ve.Profiler=o,Ve.PureComponent=P,Ve.StrictMode=r,Ve.Suspense=d,Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=se,Ve.act=_,Ve.cloneElement=function(j,Y,A){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var be=b({},j.props),Ie=j.key,Se=j.ref,Oe=j._owner;if(Y!=null){if(Y.ref!==void 0&&(Se=Y.ref,Oe=N.current),Y.key!==void 0&&(Ie=""+Y.key),j.type&&j.type.defaultProps)var de=j.type.defaultProps;for(he in Y)V.call(Y,he)&&!D.hasOwnProperty(he)&&(be[he]=Y[he]===void 0&&de!==void 0?de[he]:Y[he])}var he=arguments.length-2;if(he===1)be.children=A;else if(1<he){de=Array(he);for(var Re=0;Re<he;Re++)de[Re]=arguments[Re+2];be.children=de}return{$$typeof:e,type:j.type,key:Ie,ref:Se,props:be,_owner:Oe}},Ve.createContext=function(j){return j={$$typeof:l,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:a,_context:j},j.Consumer=j},Ve.createElement=H,Ve.createFactory=function(j){var Y=H.bind(null,j);return Y.type=j,Y},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(j){return{$$typeof:c,render:j}},Ve.isValidElement=L,Ve.lazy=function(j){return{$$typeof:p,_payload:{_status:-1,_result:j},_init:fe}},Ve.memo=function(j,Y){return{$$typeof:f,type:j,compare:Y===void 0?null:Y}},Ve.startTransition=function(j){var Y=U.transition;U.transition={};try{j()}finally{U.transition=Y}},Ve.unstable_act=_,Ve.useCallback=function(j,Y){return oe.current.useCallback(j,Y)},Ve.useContext=function(j){return oe.current.useContext(j)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(j){return oe.current.useDeferredValue(j)},Ve.useEffect=function(j,Y){return oe.current.useEffect(j,Y)},Ve.useId=function(){return oe.current.useId()},Ve.useImperativeHandle=function(j,Y,A){return oe.current.useImperativeHandle(j,Y,A)},Ve.useInsertionEffect=function(j,Y){return oe.current.useInsertionEffect(j,Y)},Ve.useLayoutEffect=function(j,Y){return oe.current.useLayoutEffect(j,Y)},Ve.useMemo=function(j,Y){return oe.current.useMemo(j,Y)},Ve.useReducer=function(j,Y,A){return oe.current.useReducer(j,Y,A)},Ve.useRef=function(j){return oe.current.useRef(j)},Ve.useState=function(j){return oe.current.useState(j)},Ve.useSyncExternalStore=function(j,Y,A){return oe.current.useSyncExternalStore(j,Y,A)},Ve.useTransition=function(){return oe.current.useTransition()},Ve.version="18.3.1",Ve}var Ey;function $h(){return Ey||(Ey=1,qd.exports=aE()),qd.exports}/**
9
+ */var ky;function aE(){if(ky)return Fe;ky=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function y(j){return j===null||typeof j!="object"?null:(j=m&&j[m]||j["@@iterator"],typeof j=="function"?j:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function C(j,Y,A){this.props=j,this.context=Y,this.refs=S,this.updater=A||v}C.prototype.isReactComponent={},C.prototype.setState=function(j,Y){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,Y,"setState")},C.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function E(){}E.prototype=C.prototype;function P(j,Y,A){this.props=j,this.context=Y,this.refs=S,this.updater=A||v}var T=P.prototype=new E;T.constructor=P,b(T,C.prototype),T.isPureReactComponent=!0;var O=Array.isArray,V=Object.prototype.hasOwnProperty,N={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function H(j,Y,A){var Se,Te={},ke=null,ze=null;if(Y!=null)for(Se in Y.ref!==void 0&&(ze=Y.ref),Y.key!==void 0&&(ke=""+Y.key),Y)V.call(Y,Se)&&!D.hasOwnProperty(Se)&&(Te[Se]=Y[Se]);var de=arguments.length-2;if(de===1)Te.children=A;else if(1<de){for(var he=Array(de),Ne=0;Ne<de;Ne++)he[Ne]=arguments[Ne+2];Te.children=he}if(j&&j.defaultProps)for(Se in de=j.defaultProps,de)Te[Se]===void 0&&(Te[Se]=de[Se]);return{$$typeof:e,type:j,key:ke,ref:ze,props:Te,_owner:N.current}}function ee(j,Y){return{$$typeof:e,type:j.type,key:Y,ref:j.ref,props:j.props,_owner:j._owner}}function L(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function te(j){var Y={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(A){return Y[A]})}var G=/\/+/g;function X(j,Y){return typeof j=="object"&&j!==null&&j.key!=null?te(""+j.key):Y.toString(36)}function Q(j,Y,A,Se,Te){var ke=typeof j;(ke==="undefined"||ke==="boolean")&&(j=null);var ze=!1;if(j===null)ze=!0;else switch(ke){case"string":case"number":ze=!0;break;case"object":switch(j.$$typeof){case e:case t:ze=!0}}if(ze)return ze=j,Te=Te(ze),j=Se===""?"."+X(ze,0):Se,O(Te)?(A="",j!=null&&(A=j.replace(G,"$&/")+"/"),Q(Te,Y,A,"",function(Ne){return Ne})):Te!=null&&(L(Te)&&(Te=ee(Te,A+(!Te.key||ze&&ze.key===Te.key?"":(""+Te.key).replace(G,"$&/")+"/")+j)),Y.push(Te)),1;if(ze=0,Se=Se===""?".":Se+":",O(j))for(var de=0;de<j.length;de++){ke=j[de];var he=Se+X(ke,de);ze+=Q(ke,Y,A,he,Te)}else if(he=y(j),typeof he=="function")for(j=he.call(j),de=0;!(ke=j.next()).done;)ke=ke.value,he=Se+X(ke,de++),ze+=Q(ke,Y,A,he,Te);else if(ke==="object")throw Y=String(j),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return ze}function re(j,Y,A){if(j==null)return j;var Se=[],Te=0;return Q(j,Se,"","",function(ke){return Y.call(A,ke,Te++)}),Se}function fe(j){if(j._status===-1){var Y=j._result;Y=Y(),Y.then(function(A){(j._status===0||j._status===-1)&&(j._status=1,j._result=A)},function(A){(j._status===0||j._status===-1)&&(j._status=2,j._result=A)}),j._status===-1&&(j._status=0,j._result=Y)}if(j._status===1)return j._result.default;throw j._result}var oe={current:null},U={transition:null},se={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:U,ReactCurrentOwner:N};function _(){throw Error("act(...) is not supported in production builds of React.")}return Fe.Children={map:re,forEach:function(j,Y,A){re(j,function(){Y.apply(this,arguments)},A)},count:function(j){var Y=0;return re(j,function(){Y++}),Y},toArray:function(j){return re(j,function(Y){return Y})||[]},only:function(j){if(!L(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},Fe.Component=C,Fe.Fragment=n,Fe.Profiler=o,Fe.PureComponent=P,Fe.StrictMode=r,Fe.Suspense=d,Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=se,Fe.act=_,Fe.cloneElement=function(j,Y,A){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var Se=b({},j.props),Te=j.key,ke=j.ref,ze=j._owner;if(Y!=null){if(Y.ref!==void 0&&(ke=Y.ref,ze=N.current),Y.key!==void 0&&(Te=""+Y.key),j.type&&j.type.defaultProps)var de=j.type.defaultProps;for(he in Y)V.call(Y,he)&&!D.hasOwnProperty(he)&&(Se[he]=Y[he]===void 0&&de!==void 0?de[he]:Y[he])}var he=arguments.length-2;if(he===1)Se.children=A;else if(1<he){de=Array(he);for(var Ne=0;Ne<he;Ne++)de[Ne]=arguments[Ne+2];Se.children=de}return{$$typeof:e,type:j.type,key:Te,ref:ke,props:Se,_owner:ze}},Fe.createContext=function(j){return j={$$typeof:l,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:a,_context:j},j.Consumer=j},Fe.createElement=H,Fe.createFactory=function(j){var Y=H.bind(null,j);return Y.type=j,Y},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(j){return{$$typeof:c,render:j}},Fe.isValidElement=L,Fe.lazy=function(j){return{$$typeof:p,_payload:{_status:-1,_result:j},_init:fe}},Fe.memo=function(j,Y){return{$$typeof:f,type:j,compare:Y===void 0?null:Y}},Fe.startTransition=function(j){var Y=U.transition;U.transition={};try{j()}finally{U.transition=Y}},Fe.unstable_act=_,Fe.useCallback=function(j,Y){return oe.current.useCallback(j,Y)},Fe.useContext=function(j){return oe.current.useContext(j)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(j){return oe.current.useDeferredValue(j)},Fe.useEffect=function(j,Y){return oe.current.useEffect(j,Y)},Fe.useId=function(){return oe.current.useId()},Fe.useImperativeHandle=function(j,Y,A){return oe.current.useImperativeHandle(j,Y,A)},Fe.useInsertionEffect=function(j,Y){return oe.current.useInsertionEffect(j,Y)},Fe.useLayoutEffect=function(j,Y){return oe.current.useLayoutEffect(j,Y)},Fe.useMemo=function(j,Y){return oe.current.useMemo(j,Y)},Fe.useReducer=function(j,Y,A){return oe.current.useReducer(j,Y,A)},Fe.useRef=function(j){return oe.current.useRef(j)},Fe.useState=function(j){return oe.current.useState(j)},Fe.useSyncExternalStore=function(j,Y,A){return oe.current.useSyncExternalStore(j,Y,A)},Fe.useTransition=function(){return oe.current.useTransition()},Fe.version="18.3.1",Fe}var Ey;function $h(){return Ey||(Ey=1,qd.exports=aE()),qd.exports}/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -14,7 +14,7 @@ var sE=Object.defineProperty;var by=e=>{throw TypeError(e)};var oE=(e,t,n)=>t in
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Cy;function lE(){if(Cy)return la;Cy=1;var e=$h(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,f){var p,m={},y=null,v=null;f!==void 0&&(y=""+f),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(v=d.ref);for(p in d)r.call(d,p)&&!a.hasOwnProperty(p)&&(m[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)m[p]===void 0&&(m[p]=d[p]);return{$$typeof:t,type:c,key:y,ref:v,props:m,_owner:o.current}}return la.Fragment=n,la.jsx=l,la.jsxs=l,la}var Iy;function uE(){return Iy||(Iy=1,Wd.exports=lE()),Wd.exports}var w=uE(),I=$h();const wr=Rx(I);var au={},Gd={exports:{}},un={},Kd={exports:{}},Yd={};/**
17
+ */var Cy;function lE(){if(Cy)return la;Cy=1;var e=$h(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,f){var p,m={},y=null,v=null;f!==void 0&&(y=""+f),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(v=d.ref);for(p in d)r.call(d,p)&&!a.hasOwnProperty(p)&&(m[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)m[p]===void 0&&(m[p]=d[p]);return{$$typeof:t,type:c,key:y,ref:v,props:m,_owner:o.current}}return la.Fragment=n,la.jsx=l,la.jsxs=l,la}var Iy;function uE(){return Iy||(Iy=1,Wd.exports=lE()),Wd.exports}var w=uE(),I=$h();const wr=Rx(I);var au={},Gd={exports:{}},ln={},Kd={exports:{}},Yd={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -22,7 +22,7 @@ var sE=Object.defineProperty;var by=e=>{throw TypeError(e)};var oE=(e,t,n)=>t in
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var Ty;function cE(){return Ty||(Ty=1,(function(e){function t(U,se){var _=U.length;U.push(se);e:for(;0<_;){var j=_-1>>>1,Y=U[j];if(0<o(Y,se))U[j]=se,U[_]=Y,_=j;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var se=U[0],_=U.pop();if(_!==se){U[0]=_;e:for(var j=0,Y=U.length,A=Y>>>1;j<A;){var be=2*(j+1)-1,Ie=U[be],Se=be+1,Oe=U[Se];if(0>o(Ie,_))Se<Y&&0>o(Oe,Ie)?(U[j]=Oe,U[Se]=_,j=Se):(U[j]=Ie,U[be]=_,j=be);else if(Se<Y&&0>o(Oe,_))U[j]=Oe,U[Se]=_,j=Se;else break e}}return se}function o(U,se){var _=U.sortIndex-se.sortIndex;return _!==0?_:U.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],p=1,m=null,y=3,v=!1,b=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(U){for(var se=n(f);se!==null;){if(se.callback===null)r(f);else if(se.startTime<=U)r(f),se.sortIndex=se.expirationTime,t(d,se);else break;se=n(f)}}function O(U){if(S=!1,T(U),!b)if(n(d)!==null)b=!0,fe(V);else{var se=n(f);se!==null&&oe(O,se.startTime-U)}}function V(U,se){b=!1,S&&(S=!1,E(H),H=-1),v=!0;var _=y;try{for(T(se),m=n(d);m!==null&&(!(m.expirationTime>se)||U&&!te());){var j=m.callback;if(typeof j=="function"){m.callback=null,y=m.priorityLevel;var Y=j(m.expirationTime<=se);se=e.unstable_now(),typeof Y=="function"?m.callback=Y:m===n(d)&&r(d),T(se)}else r(d);m=n(d)}if(m!==null)var A=!0;else{var be=n(f);be!==null&&oe(O,be.startTime-se),A=!1}return A}finally{m=null,y=_,v=!1}}var N=!1,D=null,H=-1,ee=5,L=-1;function te(){return!(e.unstable_now()-L<ee)}function G(){if(D!==null){var U=e.unstable_now();L=U;var se=!0;try{se=D(!0,U)}finally{se?X():(N=!1,D=null)}}else N=!1}var X;if(typeof P=="function")X=function(){P(G)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,re=Q.port2;Q.port1.onmessage=G,X=function(){re.postMessage(null)}}else X=function(){C(G,0)};function fe(U){D=U,N||(N=!0,X())}function oe(U,se){H=C(function(){U(e.unstable_now())},se)}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(U){U.callback=null},e.unstable_continueExecution=function(){b||v||(b=!0,fe(V))},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(U){switch(y){case 1:case 2:case 3:var se=3;break;default:se=y}var _=y;y=se;try{return U()}finally{y=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,se){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var _=y;y=U;try{return se()}finally{y=_}},e.unstable_scheduleCallback=function(U,se,_){var j=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?j+_:j):_=j,U){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=_+Y,U={id:p++,callback:se,priorityLevel:U,startTime:_,expirationTime:Y,sortIndex:-1},_>j?(U.sortIndex=_,t(f,U),n(d)===null&&U===n(f)&&(S?(E(H),H=-1):S=!0,oe(O,_-j))):(U.sortIndex=Y,t(d,U),b||v||(b=!0,fe(V))),U},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(U){var se=y;return function(){var _=y;y=se;try{return U.apply(this,arguments)}finally{y=_}}}})(Yd)),Yd}var _y;function dE(){return _y||(_y=1,Kd.exports=cE()),Kd.exports}/**
25
+ */var Ty;function cE(){return Ty||(Ty=1,(function(e){function t(U,se){var _=U.length;U.push(se);e:for(;0<_;){var j=_-1>>>1,Y=U[j];if(0<o(Y,se))U[j]=se,U[_]=Y,_=j;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var se=U[0],_=U.pop();if(_!==se){U[0]=_;e:for(var j=0,Y=U.length,A=Y>>>1;j<A;){var Se=2*(j+1)-1,Te=U[Se],ke=Se+1,ze=U[ke];if(0>o(Te,_))ke<Y&&0>o(ze,Te)?(U[j]=ze,U[ke]=_,j=ke):(U[j]=Te,U[Se]=_,j=Se);else if(ke<Y&&0>o(ze,_))U[j]=ze,U[ke]=_,j=ke;else break e}}return se}function o(U,se){var _=U.sortIndex-se.sortIndex;return _!==0?_:U.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],p=1,m=null,y=3,v=!1,b=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(U){for(var se=n(f);se!==null;){if(se.callback===null)r(f);else if(se.startTime<=U)r(f),se.sortIndex=se.expirationTime,t(d,se);else break;se=n(f)}}function O(U){if(S=!1,T(U),!b)if(n(d)!==null)b=!0,fe(V);else{var se=n(f);se!==null&&oe(O,se.startTime-U)}}function V(U,se){b=!1,S&&(S=!1,E(H),H=-1),v=!0;var _=y;try{for(T(se),m=n(d);m!==null&&(!(m.expirationTime>se)||U&&!te());){var j=m.callback;if(typeof j=="function"){m.callback=null,y=m.priorityLevel;var Y=j(m.expirationTime<=se);se=e.unstable_now(),typeof Y=="function"?m.callback=Y:m===n(d)&&r(d),T(se)}else r(d);m=n(d)}if(m!==null)var A=!0;else{var Se=n(f);Se!==null&&oe(O,Se.startTime-se),A=!1}return A}finally{m=null,y=_,v=!1}}var N=!1,D=null,H=-1,ee=5,L=-1;function te(){return!(e.unstable_now()-L<ee)}function G(){if(D!==null){var U=e.unstable_now();L=U;var se=!0;try{se=D(!0,U)}finally{se?X():(N=!1,D=null)}}else N=!1}var X;if(typeof P=="function")X=function(){P(G)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,re=Q.port2;Q.port1.onmessage=G,X=function(){re.postMessage(null)}}else X=function(){C(G,0)};function fe(U){D=U,N||(N=!0,X())}function oe(U,se){H=C(function(){U(e.unstable_now())},se)}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(U){U.callback=null},e.unstable_continueExecution=function(){b||v||(b=!0,fe(V))},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(U){switch(y){case 1:case 2:case 3:var se=3;break;default:se=y}var _=y;y=se;try{return U()}finally{y=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,se){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var _=y;y=U;try{return se()}finally{y=_}},e.unstable_scheduleCallback=function(U,se,_){var j=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?j+_:j):_=j,U){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=_+Y,U={id:p++,callback:se,priorityLevel:U,startTime:_,expirationTime:Y,sortIndex:-1},_>j?(U.sortIndex=_,t(f,U),n(d)===null&&U===n(f)&&(S?(E(H),H=-1):S=!0,oe(O,_-j))):(U.sortIndex=Y,t(d,U),b||v||(b=!0,fe(V))),U},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(U){var se=y;return function(){var _=y;y=se;try{return U.apply(this,arguments)}finally{y=_}}}})(Yd)),Yd}var _y;function dE(){return _y||(_y=1,Kd.exports=cE()),Kd.exports}/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@ var sE=Object.defineProperty;var by=e=>{throw TypeError(e)};var oE=(e,t,n)=>t in
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Py;function fE(){if(Py)return un;Py=1;var e=$h(),t=dE();function n(i){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+i,u=1;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function a(i,s){l(i,s),l(i+"Capture",s)}function l(i,s){for(o[i]=s,i=0;i<s.length;i++)r.add(s[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,p={},m={};function y(i){return d.call(m,i)?!0:d.call(p,i)?!1:f.test(i)?m[i]=!0:(p[i]=!0,!1)}function v(i,s,u,h){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return h?!1:u!==null?!u.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function b(i,s,u,h){if(s===null||typeof s>"u"||v(i,s,u,h))return!0;if(h)return!1;if(u!==null)switch(u.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function S(i,s,u,h,g,x,k){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=h,this.attributeNamespace=g,this.mustUseProperty=u,this.propertyName=i,this.type=s,this.sanitizeURL=x,this.removeEmptyString=k}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new S(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];C[s]=new S(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new S(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new S(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){C[i]=new S(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new S(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new S(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new S(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new S(i,5,!1,i.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function P(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(E,P);C[s]=new S(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(E,P);C[s]=new S(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(E,P);C[s]=new S(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!1,!1)}),C.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!0,!0)});function T(i,s,u,h){var g=C.hasOwnProperty(s)?C[s]:null;(g!==null?g.type!==0:h||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(b(s,u,g,h)&&(u=null),h||g===null?y(s)&&(u===null?i.removeAttribute(s):i.setAttribute(s,""+u)):g.mustUseProperty?i[g.propertyName]=u===null?g.type===3?!1:"":u:(s=g.attributeName,h=g.attributeNamespace,u===null?i.removeAttribute(s):(g=g.type,u=g===3||g===4&&u===!0?"":""+u,h?i.setAttributeNS(h,s,u):i.setAttribute(s,u))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,V=Symbol.for("react.element"),N=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),te=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),oe=Symbol.for("react.offscreen"),U=Symbol.iterator;function se(i){return i===null||typeof i!="object"?null:(i=U&&i[U]||i["@@iterator"],typeof i=="function"?i:null)}var _=Object.assign,j;function Y(i){if(j===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);j=s&&s[1]||""}return`
34
- `+j+i}var A=!1;function be(i,s){if(!i||A)return"";A=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(W){var h=W}Reflect.construct(i,[],s)}else{try{s.call()}catch(W){h=W}i.call(s.prototype)}else{try{throw Error()}catch(W){h=W}i()}}catch(W){if(W&&h&&typeof W.stack=="string"){for(var g=W.stack.split(`
33
+ */var Py;function fE(){if(Py)return ln;Py=1;var e=$h(),t=dE();function n(i){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+i,u=1;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function a(i,s){l(i,s),l(i+"Capture",s)}function l(i,s){for(o[i]=s,i=0;i<s.length;i++)r.add(s[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,p={},m={};function y(i){return d.call(m,i)?!0:d.call(p,i)?!1:f.test(i)?m[i]=!0:(p[i]=!0,!1)}function v(i,s,u,h){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return h?!1:u!==null?!u.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function b(i,s,u,h){if(s===null||typeof s>"u"||v(i,s,u,h))return!0;if(h)return!1;if(u!==null)switch(u.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function S(i,s,u,h,g,x,k){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=h,this.attributeNamespace=g,this.mustUseProperty=u,this.propertyName=i,this.type=s,this.sanitizeURL=x,this.removeEmptyString=k}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new S(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];C[s]=new S(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new S(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new S(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){C[i]=new S(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new S(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new S(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new S(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new S(i,5,!1,i.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function P(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(E,P);C[s]=new S(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(E,P);C[s]=new S(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(E,P);C[s]=new S(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!1,!1)}),C.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){C[i]=new S(i,1,!1,i.toLowerCase(),null,!0,!0)});function T(i,s,u,h){var g=C.hasOwnProperty(s)?C[s]:null;(g!==null?g.type!==0:h||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(b(s,u,g,h)&&(u=null),h||g===null?y(s)&&(u===null?i.removeAttribute(s):i.setAttribute(s,""+u)):g.mustUseProperty?i[g.propertyName]=u===null?g.type===3?!1:"":u:(s=g.attributeName,h=g.attributeNamespace,u===null?i.removeAttribute(s):(g=g.type,u=g===3||g===4&&u===!0?"":""+u,h?i.setAttributeNS(h,s,u):i.setAttribute(s,u))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,V=Symbol.for("react.element"),N=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),te=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),oe=Symbol.for("react.offscreen"),U=Symbol.iterator;function se(i){return i===null||typeof i!="object"?null:(i=U&&i[U]||i["@@iterator"],typeof i=="function"?i:null)}var _=Object.assign,j;function Y(i){if(j===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);j=s&&s[1]||""}return`
34
+ `+j+i}var A=!1;function Se(i,s){if(!i||A)return"";A=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(W){var h=W}Reflect.construct(i,[],s)}else{try{s.call()}catch(W){h=W}i.call(s.prototype)}else{try{throw Error()}catch(W){h=W}i()}}catch(W){if(W&&h&&typeof W.stack=="string"){for(var g=W.stack.split(`
35
35
  `),x=h.stack.split(`
36
36
  `),k=g.length-1,R=x.length-1;1<=k&&0<=R&&g[k]!==x[R];)R--;for(;1<=k&&0<=R;k--,R--)if(g[k]!==x[R]){if(k!==1||R!==1)do if(k--,R--,0>R||g[k]!==x[R]){var M=`
37
- `+g[k].replace(" at new "," at ");return i.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",i.displayName)),M}while(1<=k&&0<=R);break}}}finally{A=!1,Error.prepareStackTrace=u}return(i=i?i.displayName||i.name:"")?Y(i):""}function Ie(i){switch(i.tag){case 5:return Y(i.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return i=be(i.type,!1),i;case 11:return i=be(i.type.render,!1),i;case 1:return i=be(i.type,!0),i;default:return""}}function Se(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case D:return"Fragment";case N:return"Portal";case ee:return"Profiler";case H:return"StrictMode";case X:return"Suspense";case Q:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case te:return(i.displayName||"Context")+".Consumer";case L:return(i._context.displayName||"Context")+".Provider";case G:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case re:return s=i.displayName||null,s!==null?s:Se(i.type)||"Memo";case fe:s=i._payload,i=i._init;try{return Se(i(s))}catch{}}return null}function Oe(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Se(s);case 8:return s===H?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function de(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function he(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Re(i){var s=he(i)?"checked":"value",u=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),h=""+i[s];if(!i.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,x=u.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return g.call(this)},set:function(k){h=""+k,x.call(this,k)}}),Object.defineProperty(i,s,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(k){h=""+k},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Ye(i){i._valueTracker||(i._valueTracker=Re(i))}function Mi(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return i&&(h=he(i)?i.checked?"true":"false":i.value),i=h,i!==u?(s.setValue(i),!0):!1}function Kn(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Yr(i,s){var u=s.checked;return _({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??i._wrapperState.initialChecked})}function Xr(i,s){var u=s.defaultValue==null?"":s.defaultValue,h=s.checked!=null?s.checked:s.defaultChecked;u=de(s.value!=null?s.value:u),i._wrapperState={initialChecked:h,initialValue:u,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Di(i,s){s=s.checked,s!=null&&T(i,"checked",s,!1)}function tn(i,s){Di(i,s);var u=de(s.value),h=s.type;if(u!=null)h==="number"?(u===0&&i.value===""||i.value!=u)&&(i.value=""+u):i.value!==""+u&&(i.value=""+u);else if(h==="submit"||h==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?Qr(i,s.type,u):s.hasOwnProperty("defaultValue")&&Qr(i,s.type,de(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function Li(i,s,u){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var h=s.type;if(!(h!=="submit"&&h!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,u||s===i.value||(i.value=s),i.defaultValue=s}u=i.name,u!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,u!==""&&(i.name=u)}function Qr(i,s,u){(s!=="number"||Kn(i.ownerDocument)!==i)&&(u==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+u&&(i.defaultValue=""+u))}var fr=Array.isArray;function Cn(i,s,u,h){if(i=i.options,s){s={};for(var g=0;g<u.length;g++)s["$"+u[g]]=!0;for(u=0;u<i.length;u++)g=s.hasOwnProperty("$"+i[u].value),i[u].selected!==g&&(i[u].selected=g),g&&h&&(i[u].defaultSelected=!0)}else{for(u=""+de(u),s=null,g=0;g<i.length;g++){if(i[g].value===u){i[g].selected=!0,h&&(i[g].defaultSelected=!0);return}s!==null||i[g].disabled||(s=i[g])}s!==null&&(s.selected=!0)}}function Yn(i,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return _({},s,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Jr(i,s){var u=s.value;if(u==null){if(u=s.children,s=s.defaultValue,u!=null){if(s!=null)throw Error(n(92));if(fr(u)){if(1<u.length)throw Error(n(93));u=u[0]}s=u}s==null&&(s=""),u=s}i._wrapperState={initialValue:de(u)}}function Zr(i,s){var u=de(s.value),h=de(s.defaultValue);u!=null&&(u=""+u,u!==i.value&&(i.value=u),s.defaultValue==null&&i.defaultValue!==u&&(i.defaultValue=u)),h!=null&&(i.defaultValue=""+h)}function ei(i){var s=i.textContent;s===i._wrapperState.initialValue&&s!==""&&s!==null&&(i.value=s)}function K(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ue(i,s){return i==null||i==="http://www.w3.org/1999/xhtml"?K(s):i==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Te,ze=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,u,h,g){MSApp.execUnsafeLocalFunction(function(){return i(s,u,h,g)})}:i})(function(i,s){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=s;else{for(Te=Te||document.createElement("div"),Te.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Te.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function $e(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var kt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},In=["Webkit","ms","Moz","O"];Object.keys(kt).forEach(function(i){In.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),kt[s]=kt[i]})});function zt(i,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||kt.hasOwnProperty(i)&&kt[i]?(""+s).trim():s+"px"}function Ot(i,s){i=i.style;for(var u in s)if(s.hasOwnProperty(u)){var h=u.indexOf("--")===0,g=zt(u,s[u],h);u==="float"&&(u="cssFloat"),h?i.setProperty(u,g):i[u]=g}}var Nt=_({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tt(i,s){if(s){if(Nt[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Yt(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){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 ht=null;function Eo(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ti=null,Tn=null,_r=null;function Co(i){if(i=Go(i)){if(typeof ti!="function")throw Error(n(280));var s=i.stateNode;s&&(s=Sl(s),ti(i.stateNode,i.type,s))}}function tl(i){Tn?_r?_r.push(i):_r=[i]:Tn=i}function nl(){if(Tn){var i=Tn,s=_r;if(_r=Tn=null,Co(i),s)for(i=0;i<s.length;i++)Co(s[i])}}function Io(i,s){return i(s)}function To(){}var ni=!1;function Pr(i,s,u){if(ni)return i(s,u);ni=!0;try{return Io(i,s,u)}finally{ni=!1,(Tn!==null||_r!==null)&&(To(),nl())}}function zi(i,s){var u=i.stateNode;if(u===null)return null;var h=Sl(u);if(h===null)return null;u=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(n(231,s,typeof u));return u}var _n=!1;if(c)try{var Oi={};Object.defineProperty(Oi,"passive",{get:function(){_n=!0}}),window.addEventListener("test",Oi,Oi),window.removeEventListener("test",Oi,Oi)}catch{_n=!1}function Ar(i,s,u,h,g,x,k,R,M){var W=Array.prototype.slice.call(arguments,3);try{s.apply(u,W)}catch(ne){this.onError(ne)}}var ri=!1,vs=null,Rr=!1,Fi=null,rl={onError:function(i){ri=!0,vs=i}};function il(i,s,u,h,g,x,k,R,M){ri=!1,vs=null,Ar.apply(rl,arguments)}function sl(i,s,u,h,g,x,k,R,M){if(il.apply(this,arguments),ri){if(ri){var W=vs;ri=!1,vs=null}else throw Error(n(198));Rr||(Rr=!0,Fi=W)}}function pn(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function _o(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function ol(i){if(pn(i)!==i)throw Error(n(188))}function F(i){var s=i.alternate;if(!s){if(s=pn(i),s===null)throw Error(n(188));return s!==i?null:i}for(var u=i,h=s;;){var g=u.return;if(g===null)break;var x=g.alternate;if(x===null){if(h=g.return,h!==null){u=h;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===u)return ol(g),i;if(x===h)return ol(g),s;x=x.sibling}throw Error(n(188))}if(u.return!==h.return)u=g,h=x;else{for(var k=!1,R=g.child;R;){if(R===u){k=!0,u=g,h=x;break}if(R===h){k=!0,h=g,u=x;break}R=R.sibling}if(!k){for(R=x.child;R;){if(R===u){k=!0,u=x,h=g;break}if(R===h){k=!0,h=x,u=g;break}R=R.sibling}if(!k)throw Error(n(189))}}if(u.alternate!==h)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?i:s}function q(i){return i=F(i),i!==null?ce(i):null}function ce(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var s=ce(i);if(s!==null)return s;i=i.sibling}return null}var xe=t.unstable_scheduleCallback,Xe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,st=t.unstable_requestPaint,Ne=t.unstable_now,mn=t.unstable_getCurrentPriorityLevel,ut=t.unstable_ImmediatePriority,pt=t.unstable_UserBlockingPriority,Xt=t.unstable_NormalPriority,Xn=t.unstable_LowPriority,Tt=t.unstable_IdlePriority,nn=null,jt=null;function xs(i){if(jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(nn,i,void 0,(i.current.flags&128)===128)}catch{}}var _t=Math.clz32?Math.clz32:mc,Vi=Math.log,al=Math.LN2;function mc(i){return i>>>=0,i===0?32:31-(Vi(i)/al|0)|0}var ws=64,Ge=4194304;function Ue(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Nr(i,s){var u=i.pendingLanes;if(u===0)return 0;var h=0,g=i.suspendedLanes,x=i.pingedLanes,k=u&268435455;if(k!==0){var R=k&~g;R!==0?h=Ue(R):(x&=k,x!==0&&(h=Ue(x)))}else k=u&~g,k!==0?h=Ue(k):x!==0&&(h=Ue(x));if(h===0)return 0;if(s!==0&&s!==h&&(s&g)===0&&(g=h&-h,x=s&-s,g>=x||g===16&&(x&4194240)!==0))return s;if((h&4)!==0&&(h|=u&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=h;0<s;)u=31-_t(s),g=1<<u,h|=i[u],s&=~g;return h}function hr(i,s){switch(i){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Po(i,s){for(var u=i.suspendedLanes,h=i.pingedLanes,g=i.expirationTimes,x=i.pendingLanes;0<x;){var k=31-_t(x),R=1<<k,M=g[k];M===-1?((R&u)===0||(R&h)!==0)&&(g[k]=hr(R,s)):M<=s&&(i.expiredLanes|=R),x&=~R}}function Ft(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Pn(){var i=ws;return ws<<=1,(ws&4194240)===0&&(ws=64),i}function An(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Qn(i,s,u){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-_t(s),i[s]=u}function bs(i,s){var u=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var h=i.eventTimes;for(i=i.expirationTimes;0<u;){var g=31-_t(u),x=1<<g;s[g]=0,h[g]=-1,i[g]=-1,u&=~x}}function Bi(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var h=31-_t(u),g=1<<h;g&s|i[h]&s&&(i[h]|=s),u&=~g}}var He=0;function pr(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Ao,ii,Ss,$i,Ui,ks=!1,jr=[],gn=null,si=null,oi=null,Ro=new Map,No=new Map,ai=[],TS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function im(i,s){switch(i){case"focusin":case"focusout":gn=null;break;case"dragenter":case"dragleave":si=null;break;case"mouseover":case"mouseout":oi=null;break;case"pointerover":case"pointerout":Ro.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":No.delete(s.pointerId)}}function jo(i,s,u,h,g,x){return i===null||i.nativeEvent!==x?(i={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:x,targetContainers:[g]},s!==null&&(s=Go(s),s!==null&&ii(s)),i):(i.eventSystemFlags|=h,s=i.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),i)}function _S(i,s,u,h,g){switch(s){case"focusin":return gn=jo(gn,i,s,u,h,g),!0;case"dragenter":return si=jo(si,i,s,u,h,g),!0;case"mouseover":return oi=jo(oi,i,s,u,h,g),!0;case"pointerover":var x=g.pointerId;return Ro.set(x,jo(Ro.get(x)||null,i,s,u,h,g)),!0;case"gotpointercapture":return x=g.pointerId,No.set(x,jo(No.get(x)||null,i,s,u,h,g)),!0}return!1}function sm(i){var s=Hi(i.target);if(s!==null){var u=pn(s);if(u!==null){if(s=u.tag,s===13){if(s=_o(u),s!==null){i.blockedOn=s,Ui(i.priority,function(){Ss(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function ll(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=yc(i.domEventName,i.eventSystemFlags,s[0],i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);ht=h,u.target.dispatchEvent(h),ht=null}else return s=Go(u),s!==null&&ii(s),i.blockedOn=u,!1;s.shift()}return!0}function om(i,s,u){ll(i)&&u.delete(s)}function PS(){ks=!1,gn!==null&&ll(gn)&&(gn=null),si!==null&&ll(si)&&(si=null),oi!==null&&ll(oi)&&(oi=null),Ro.forEach(om),No.forEach(om)}function Mo(i,s){i.blockedOn===s&&(i.blockedOn=null,ks||(ks=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,PS)))}function Do(i){function s(g){return Mo(g,i)}if(0<jr.length){Mo(jr[0],i);for(var u=1;u<jr.length;u++){var h=jr[u];h.blockedOn===i&&(h.blockedOn=null)}}for(gn!==null&&Mo(gn,i),si!==null&&Mo(si,i),oi!==null&&Mo(oi,i),Ro.forEach(s),No.forEach(s),u=0;u<ai.length;u++)h=ai[u],h.blockedOn===i&&(h.blockedOn=null);for(;0<ai.length&&(u=ai[0],u.blockedOn===null);)sm(u),u.blockedOn===null&&ai.shift()}var Es=O.ReactCurrentBatchConfig,ul=!0;function AS(i,s,u,h){var g=He,x=Es.transition;Es.transition=null;try{He=1,gc(i,s,u,h)}finally{He=g,Es.transition=x}}function RS(i,s,u,h){var g=He,x=Es.transition;Es.transition=null;try{He=4,gc(i,s,u,h)}finally{He=g,Es.transition=x}}function gc(i,s,u,h){if(ul){var g=yc(i,s,u,h);if(g===null)Mc(i,s,h,cl,u),im(i,h);else if(_S(g,i,s,u,h))h.stopPropagation();else if(im(i,h),s&4&&-1<TS.indexOf(i)){for(;g!==null;){var x=Go(g);if(x!==null&&Ao(x),x=yc(i,s,u,h),x===null&&Mc(i,s,h,cl,u),x===g)break;g=x}g!==null&&h.stopPropagation()}else Mc(i,s,h,null,u)}}var cl=null;function yc(i,s,u,h){if(cl=null,i=Eo(h),i=Hi(i),i!==null)if(s=pn(i),s===null)i=null;else if(u=s.tag,u===13){if(i=_o(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null);return cl=i,null}function am(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(mn()){case ut:return 1;case pt:return 4;case Xt:case Xn:return 16;case Tt:return 536870912;default:return 16}default:return 16}}var li=null,vc=null,dl=null;function lm(){if(dl)return dl;var i,s=vc,u=s.length,h,g="value"in li?li.value:li.textContent,x=g.length;for(i=0;i<u&&s[i]===g[i];i++);var k=u-i;for(h=1;h<=k&&s[u-h]===g[x-h];h++);return dl=g.slice(i,1<h?1-h:void 0)}function fl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function hl(){return!0}function um(){return!1}function yn(i){function s(u,h,g,x,k){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var R in i)i.hasOwnProperty(R)&&(u=i[R],this[R]=u?u(x):x[R]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?hl:um,this.isPropagationStopped=um,this}return _(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=hl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=hl)},persist:function(){},isPersistent:hl}),s}var Cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xc=yn(Cs),Lo=_({},Cs,{view:0,detail:0}),NS=yn(Lo),wc,bc,zo,pl=_({},Lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==zo&&(zo&&i.type==="mousemove"?(wc=i.screenX-zo.screenX,bc=i.screenY-zo.screenY):bc=wc=0,zo=i),wc)},movementY:function(i){return"movementY"in i?i.movementY:bc}}),cm=yn(pl),jS=_({},pl,{dataTransfer:0}),MS=yn(jS),DS=_({},Lo,{relatedTarget:0}),Sc=yn(DS),LS=_({},Cs,{animationName:0,elapsedTime:0,pseudoElement:0}),zS=yn(LS),OS=_({},Cs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),FS=yn(OS),VS=_({},Cs,{data:0}),dm=yn(VS),BS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$S={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"},US={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HS(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=US[i])?!!s[i]:!1}function kc(){return HS}var WS=_({},Lo,{key:function(i){if(i.key){var s=BS[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=fl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?$S[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kc,charCode:function(i){return i.type==="keypress"?fl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?fl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),qS=yn(WS),GS=_({},pl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fm=yn(GS),KS=_({},Lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kc}),YS=yn(KS),XS=_({},Cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),QS=yn(XS),JS=_({},pl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),ZS=yn(JS),ek=[9,13,27,32],Ec=c&&"CompositionEvent"in window,Oo=null;c&&"documentMode"in document&&(Oo=document.documentMode);var tk=c&&"TextEvent"in window&&!Oo,hm=c&&(!Ec||Oo&&8<Oo&&11>=Oo),pm=" ",mm=!1;function gm(i,s){switch(i){case"keyup":return ek.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ym(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Is=!1;function nk(i,s){switch(i){case"compositionend":return ym(s);case"keypress":return s.which!==32?null:(mm=!0,pm);case"textInput":return i=s.data,i===pm&&mm?null:i;default:return null}}function rk(i,s){if(Is)return i==="compositionend"||!Ec&&gm(i,s)?(i=lm(),dl=vc=li=null,Is=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return hm&&s.locale!=="ko"?null:s.data;default:return null}}var ik={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 vm(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!ik[i.type]:s==="textarea"}function xm(i,s,u,h){tl(h),s=xl(s,"onChange"),0<s.length&&(u=new xc("onChange","change",null,u,h),i.push({event:u,listeners:s}))}var Fo=null,Vo=null;function sk(i){zm(i,0)}function ml(i){var s=Rs(i);if(Mi(s))return i}function ok(i,s){if(i==="change")return s}var wm=!1;if(c){var Cc;if(c){var Ic="oninput"in document;if(!Ic){var bm=document.createElement("div");bm.setAttribute("oninput","return;"),Ic=typeof bm.oninput=="function"}Cc=Ic}else Cc=!1;wm=Cc&&(!document.documentMode||9<document.documentMode)}function Sm(){Fo&&(Fo.detachEvent("onpropertychange",km),Vo=Fo=null)}function km(i){if(i.propertyName==="value"&&ml(Vo)){var s=[];xm(s,Vo,i,Eo(i)),Pr(sk,s)}}function ak(i,s,u){i==="focusin"?(Sm(),Fo=s,Vo=u,Fo.attachEvent("onpropertychange",km)):i==="focusout"&&Sm()}function lk(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ml(Vo)}function uk(i,s){if(i==="click")return ml(s)}function ck(i,s){if(i==="input"||i==="change")return ml(s)}function dk(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Jn=typeof Object.is=="function"?Object.is:dk;function Bo(i,s){if(Jn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var g=u[h];if(!d.call(s,g)||!Jn(i[g],s[g]))return!1}return!0}function Em(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Cm(i,s){var u=Em(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=s&&h>=s)return{node:u,offset:s-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Em(u)}}function Im(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?Im(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Tm(){for(var i=window,s=Kn();s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=Kn(i.document)}return s}function Tc(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function fk(i){var s=Tm(),u=i.focusedElem,h=i.selectionRange;if(s!==u&&u&&u.ownerDocument&&Im(u.ownerDocument.documentElement,u)){if(h!==null&&Tc(u)){if(s=h.start,i=h.end,i===void 0&&(i=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(i,u.value.length);else if(i=(s=u.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var g=u.textContent.length,x=Math.min(h.start,g);h=h.end===void 0?x:Math.min(h.end,g),!i.extend&&x>h&&(g=h,h=x,x=g),g=Cm(u,x);var k=Cm(u,h);g&&k&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==k.node||i.focusOffset!==k.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),i.removeAllRanges(),x>h?(i.addRange(s),i.extend(k.node,k.offset)):(s.setEnd(k.node,k.offset),i.addRange(s)))}}for(s=[],i=u;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<s.length;u++)i=s[u],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var hk=c&&"documentMode"in document&&11>=document.documentMode,Ts=null,_c=null,$o=null,Pc=!1;function _m(i,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Pc||Ts==null||Ts!==Kn(h)||(h=Ts,"selectionStart"in h&&Tc(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),$o&&Bo($o,h)||($o=h,h=xl(_c,"onSelect"),0<h.length&&(s=new xc("onSelect","select",null,s,u),i.push({event:s,listeners:h}),s.target=Ts)))}function gl(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var _s={animationend:gl("Animation","AnimationEnd"),animationiteration:gl("Animation","AnimationIteration"),animationstart:gl("Animation","AnimationStart"),transitionend:gl("Transition","TransitionEnd")},Ac={},Pm={};c&&(Pm=document.createElement("div").style,"AnimationEvent"in window||(delete _s.animationend.animation,delete _s.animationiteration.animation,delete _s.animationstart.animation),"TransitionEvent"in window||delete _s.transitionend.transition);function yl(i){if(Ac[i])return Ac[i];if(!_s[i])return i;var s=_s[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in Pm)return Ac[i]=s[u];return i}var Am=yl("animationend"),Rm=yl("animationiteration"),Nm=yl("animationstart"),jm=yl("transitionend"),Mm=new Map,Dm="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ui(i,s){Mm.set(i,s),a(s,[i])}for(var Rc=0;Rc<Dm.length;Rc++){var Nc=Dm[Rc],pk=Nc.toLowerCase(),mk=Nc[0].toUpperCase()+Nc.slice(1);ui(pk,"on"+mk)}ui(Am,"onAnimationEnd"),ui(Rm,"onAnimationIteration"),ui(Nm,"onAnimationStart"),ui("dblclick","onDoubleClick"),ui("focusin","onFocus"),ui("focusout","onBlur"),ui(jm,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uo="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(" "),gk=new Set("cancel close invalid load scroll toggle".split(" ").concat(Uo));function Lm(i,s,u){var h=i.type||"unknown-event";i.currentTarget=u,sl(h,s,void 0,i),i.currentTarget=null}function zm(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],g=h.event;h=h.listeners;e:{var x=void 0;if(s)for(var k=h.length-1;0<=k;k--){var R=h[k],M=R.instance,W=R.currentTarget;if(R=R.listener,M!==x&&g.isPropagationStopped())break e;Lm(g,R,W),x=M}else for(k=0;k<h.length;k++){if(R=h[k],M=R.instance,W=R.currentTarget,R=R.listener,M!==x&&g.isPropagationStopped())break e;Lm(g,R,W),x=M}}}if(Rr)throw i=Fi,Rr=!1,Fi=null,i}function nt(i,s){var u=s[Vc];u===void 0&&(u=s[Vc]=new Set);var h=i+"__bubble";u.has(h)||(Om(s,i,2,!1),u.add(h))}function jc(i,s,u){var h=0;s&&(h|=4),Om(u,i,h,s)}var vl="_reactListening"+Math.random().toString(36).slice(2);function Ho(i){if(!i[vl]){i[vl]=!0,r.forEach(function(u){u!=="selectionchange"&&(gk.has(u)||jc(u,!1,i),jc(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[vl]||(s[vl]=!0,jc("selectionchange",!1,s))}}function Om(i,s,u,h){switch(am(s)){case 1:var g=AS;break;case 4:g=RS;break;default:g=gc}u=g.bind(null,s,u,i),g=void 0,!_n||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),h?g!==void 0?i.addEventListener(s,u,{capture:!0,passive:g}):i.addEventListener(s,u,!0):g!==void 0?i.addEventListener(s,u,{passive:g}):i.addEventListener(s,u,!1)}function Mc(i,s,u,h,g){var x=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var k=h.tag;if(k===3||k===4){var R=h.stateNode.containerInfo;if(R===g||R.nodeType===8&&R.parentNode===g)break;if(k===4)for(k=h.return;k!==null;){var M=k.tag;if((M===3||M===4)&&(M=k.stateNode.containerInfo,M===g||M.nodeType===8&&M.parentNode===g))return;k=k.return}for(;R!==null;){if(k=Hi(R),k===null)return;if(M=k.tag,M===5||M===6){h=x=k;continue e}R=R.parentNode}}h=h.return}Pr(function(){var W=x,ne=Eo(u),ie=[];e:{var Z=Mm.get(i);if(Z!==void 0){var pe=xc,ye=i;switch(i){case"keypress":if(fl(u)===0)break e;case"keydown":case"keyup":pe=qS;break;case"focusin":ye="focus",pe=Sc;break;case"focusout":ye="blur",pe=Sc;break;case"beforeblur":case"afterblur":pe=Sc;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=MS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=YS;break;case Am:case Rm:case Nm:pe=zS;break;case jm:pe=QS;break;case"scroll":pe=NS;break;case"wheel":pe=ZS;break;case"copy":case"cut":case"paste":pe=FS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=fm}var ve=(s&4)!==0,yt=!ve&&i==="scroll",B=ve?Z!==null?Z+"Capture":null:Z;ve=[];for(var z=W,$;z!==null;){$=z;var le=$.stateNode;if($.tag===5&&le!==null&&($=le,B!==null&&(le=zi(z,B),le!=null&&ve.push(Wo(z,le,$)))),yt)break;z=z.return}0<ve.length&&(Z=new pe(Z,ye,null,u,ne),ie.push({event:Z,listeners:ve}))}}if((s&7)===0){e:{if(Z=i==="mouseover"||i==="pointerover",pe=i==="mouseout"||i==="pointerout",Z&&u!==ht&&(ye=u.relatedTarget||u.fromElement)&&(Hi(ye)||ye[Mr]))break e;if((pe||Z)&&(Z=ne.window===ne?ne:(Z=ne.ownerDocument)?Z.defaultView||Z.parentWindow:window,pe?(ye=u.relatedTarget||u.toElement,pe=W,ye=ye?Hi(ye):null,ye!==null&&(yt=pn(ye),ye!==yt||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(pe=null,ye=W),pe!==ye)){if(ve=cm,le="onMouseLeave",B="onMouseEnter",z="mouse",(i==="pointerout"||i==="pointerover")&&(ve=fm,le="onPointerLeave",B="onPointerEnter",z="pointer"),yt=pe==null?Z:Rs(pe),$=ye==null?Z:Rs(ye),Z=new ve(le,z+"leave",pe,u,ne),Z.target=yt,Z.relatedTarget=$,le=null,Hi(ne)===W&&(ve=new ve(B,z+"enter",ye,u,ne),ve.target=$,ve.relatedTarget=yt,le=ve),yt=le,pe&&ye)t:{for(ve=pe,B=ye,z=0,$=ve;$;$=Ps($))z++;for($=0,le=B;le;le=Ps(le))$++;for(;0<z-$;)ve=Ps(ve),z--;for(;0<$-z;)B=Ps(B),$--;for(;z--;){if(ve===B||B!==null&&ve===B.alternate)break t;ve=Ps(ve),B=Ps(B)}ve=null}else ve=null;pe!==null&&Fm(ie,Z,pe,ve,!1),ye!==null&&yt!==null&&Fm(ie,yt,ye,ve,!0)}}e:{if(Z=W?Rs(W):window,pe=Z.nodeName&&Z.nodeName.toLowerCase(),pe==="select"||pe==="input"&&Z.type==="file")var we=ok;else if(vm(Z))if(wm)we=ck;else{we=lk;var ke=ak}else(pe=Z.nodeName)&&pe.toLowerCase()==="input"&&(Z.type==="checkbox"||Z.type==="radio")&&(we=uk);if(we&&(we=we(i,W))){xm(ie,we,u,ne);break e}ke&&ke(i,Z,W),i==="focusout"&&(ke=Z._wrapperState)&&ke.controlled&&Z.type==="number"&&Qr(Z,"number",Z.value)}switch(ke=W?Rs(W):window,i){case"focusin":(vm(ke)||ke.contentEditable==="true")&&(Ts=ke,_c=W,$o=null);break;case"focusout":$o=_c=Ts=null;break;case"mousedown":Pc=!0;break;case"contextmenu":case"mouseup":case"dragend":Pc=!1,_m(ie,u,ne);break;case"selectionchange":if(hk)break;case"keydown":case"keyup":_m(ie,u,ne)}var Ee;if(Ec)e:{switch(i){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else Is?gm(i,u)&&(Pe="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Pe="onCompositionStart");Pe&&(hm&&u.locale!=="ko"&&(Is||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&Is&&(Ee=lm()):(li=ne,vc="value"in li?li.value:li.textContent,Is=!0)),ke=xl(W,Pe),0<ke.length&&(Pe=new dm(Pe,i,null,u,ne),ie.push({event:Pe,listeners:ke}),Ee?Pe.data=Ee:(Ee=ym(u),Ee!==null&&(Pe.data=Ee)))),(Ee=tk?nk(i,u):rk(i,u))&&(W=xl(W,"onBeforeInput"),0<W.length&&(ne=new dm("onBeforeInput","beforeinput",null,u,ne),ie.push({event:ne,listeners:W}),ne.data=Ee))}zm(ie,s)})}function Wo(i,s,u){return{instance:i,listener:s,currentTarget:u}}function xl(i,s){for(var u=s+"Capture",h=[];i!==null;){var g=i,x=g.stateNode;g.tag===5&&x!==null&&(g=x,x=zi(i,u),x!=null&&h.unshift(Wo(i,x,g)),x=zi(i,s),x!=null&&h.push(Wo(i,x,g))),i=i.return}return h}function Ps(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function Fm(i,s,u,h,g){for(var x=s._reactName,k=[];u!==null&&u!==h;){var R=u,M=R.alternate,W=R.stateNode;if(M!==null&&M===h)break;R.tag===5&&W!==null&&(R=W,g?(M=zi(u,x),M!=null&&k.unshift(Wo(u,M,R))):g||(M=zi(u,x),M!=null&&k.push(Wo(u,M,R)))),u=u.return}k.length!==0&&i.push({event:s,listeners:k})}var yk=/\r\n?/g,vk=/\u0000|\uFFFD/g;function Vm(i){return(typeof i=="string"?i:""+i).replace(yk,`
38
- `).replace(vk,"")}function wl(i,s,u){if(s=Vm(s),Vm(i)!==s&&u)throw Error(n(425))}function bl(){}var Dc=null,Lc=null;function zc(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Oc=typeof setTimeout=="function"?setTimeout:void 0,xk=typeof clearTimeout=="function"?clearTimeout:void 0,Bm=typeof Promise=="function"?Promise:void 0,wk=typeof queueMicrotask=="function"?queueMicrotask:typeof Bm<"u"?function(i){return Bm.resolve(null).then(i).catch(bk)}:Oc;function bk(i){setTimeout(function(){throw i})}function Fc(i,s){var u=s,h=0;do{var g=u.nextSibling;if(i.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(h===0){i.removeChild(g),Do(s);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=g}while(u);Do(s)}function ci(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return i}function $m(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"){if(s===0)return i;s--}else u==="/$"&&s++}i=i.previousSibling}return null}var As=Math.random().toString(36).slice(2),mr="__reactFiber$"+As,qo="__reactProps$"+As,Mr="__reactContainer$"+As,Vc="__reactEvents$"+As,Sk="__reactListeners$"+As,kk="__reactHandles$"+As;function Hi(i){var s=i[mr];if(s)return s;for(var u=i.parentNode;u;){if(s=u[Mr]||u[mr]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=$m(i);i!==null;){if(u=i[mr])return u;i=$m(i)}return s}i=u,u=i.parentNode}return null}function Go(i){return i=i[mr]||i[Mr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Rs(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Sl(i){return i[qo]||null}var Bc=[],Ns=-1;function di(i){return{current:i}}function rt(i){0>Ns||(i.current=Bc[Ns],Bc[Ns]=null,Ns--)}function Ze(i,s){Ns++,Bc[Ns]=i.current,i.current=s}var fi={},Vt=di(fi),rn=di(!1),Wi=fi;function js(i,s){var u=i.type.contextTypes;if(!u)return fi;var h=i.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===s)return h.__reactInternalMemoizedMaskedChildContext;var g={},x;for(x in u)g[x]=s[x];return h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=g),g}function sn(i){return i=i.childContextTypes,i!=null}function kl(){rt(rn),rt(Vt)}function Um(i,s,u){if(Vt.current!==fi)throw Error(n(168));Ze(Vt,s),Ze(rn,u)}function Hm(i,s,u){var h=i.stateNode;if(s=s.childContextTypes,typeof h.getChildContext!="function")return u;h=h.getChildContext();for(var g in h)if(!(g in s))throw Error(n(108,Oe(i)||"Unknown",g));return _({},u,h)}function El(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||fi,Wi=Vt.current,Ze(Vt,i),Ze(rn,rn.current),!0}function Wm(i,s,u){var h=i.stateNode;if(!h)throw Error(n(169));u?(i=Hm(i,s,Wi),h.__reactInternalMemoizedMergedChildContext=i,rt(rn),rt(Vt),Ze(Vt,i)):rt(rn),Ze(rn,u)}var Dr=null,Cl=!1,$c=!1;function qm(i){Dr===null?Dr=[i]:Dr.push(i)}function Ek(i){Cl=!0,qm(i)}function hi(){if(!$c&&Dr!==null){$c=!0;var i=0,s=He;try{var u=Dr;for(He=1;i<u.length;i++){var h=u[i];do h=h(!0);while(h!==null)}Dr=null,Cl=!1}catch(g){throw Dr!==null&&(Dr=Dr.slice(i+1)),xe(ut,hi),g}finally{He=s,$c=!1}}return null}var Ms=[],Ds=0,Il=null,Tl=0,Rn=[],Nn=0,qi=null,Lr=1,zr="";function Gi(i,s){Ms[Ds++]=Tl,Ms[Ds++]=Il,Il=i,Tl=s}function Gm(i,s,u){Rn[Nn++]=Lr,Rn[Nn++]=zr,Rn[Nn++]=qi,qi=i;var h=Lr;i=zr;var g=32-_t(h)-1;h&=~(1<<g),u+=1;var x=32-_t(s)+g;if(30<x){var k=g-g%5;x=(h&(1<<k)-1).toString(32),h>>=k,g-=k,Lr=1<<32-_t(s)+g|u<<g|h,zr=x+i}else Lr=1<<x|u<<g|h,zr=i}function Uc(i){i.return!==null&&(Gi(i,1),Gm(i,1,0))}function Hc(i){for(;i===Il;)Il=Ms[--Ds],Ms[Ds]=null,Tl=Ms[--Ds],Ms[Ds]=null;for(;i===qi;)qi=Rn[--Nn],Rn[Nn]=null,zr=Rn[--Nn],Rn[Nn]=null,Lr=Rn[--Nn],Rn[Nn]=null}var vn=null,xn=null,ot=!1,Zn=null;function Km(i,s){var u=Ln(5,null,null,0);u.elementType="DELETED",u.stateNode=s,u.return=i,s=i.deletions,s===null?(i.deletions=[u],i.flags|=16):s.push(u)}function Ym(i,s){switch(i.tag){case 5:var u=i.type;return s=s.nodeType!==1||u.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(i.stateNode=s,vn=i,xn=ci(s.firstChild),!0):!1;case 6:return s=i.pendingProps===""||s.nodeType!==3?null:s,s!==null?(i.stateNode=s,vn=i,xn=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(u=qi!==null?{id:Lr,overflow:zr}:null,i.memoizedState={dehydrated:s,treeContext:u,retryLane:1073741824},u=Ln(18,null,null,0),u.stateNode=s,u.return=i,i.child=u,vn=i,xn=null,!0):!1;default:return!1}}function Wc(i){return(i.mode&1)!==0&&(i.flags&128)===0}function qc(i){if(ot){var s=xn;if(s){var u=s;if(!Ym(i,s)){if(Wc(i))throw Error(n(418));s=ci(u.nextSibling);var h=vn;s&&Ym(i,s)?Km(h,u):(i.flags=i.flags&-4097|2,ot=!1,vn=i)}}else{if(Wc(i))throw Error(n(418));i.flags=i.flags&-4097|2,ot=!1,vn=i}}}function Xm(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;vn=i}function _l(i){if(i!==vn)return!1;if(!ot)return Xm(i),ot=!0,!1;var s;if((s=i.tag!==3)&&!(s=i.tag!==5)&&(s=i.type,s=s!=="head"&&s!=="body"&&!zc(i.type,i.memoizedProps)),s&&(s=xn)){if(Wc(i))throw Qm(),Error(n(418));for(;s;)Km(i,s),s=ci(s.nextSibling)}if(Xm(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"){if(s===0){xn=ci(i.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}i=i.nextSibling}xn=null}}else xn=vn?ci(i.stateNode.nextSibling):null;return!0}function Qm(){for(var i=xn;i;)i=ci(i.nextSibling)}function Ls(){xn=vn=null,ot=!1}function Gc(i){Zn===null?Zn=[i]:Zn.push(i)}var Ck=O.ReactCurrentBatchConfig;function Ko(i,s,u){if(i=u.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var h=u.stateNode}if(!h)throw Error(n(147,i));var g=h,x=""+i;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===x?s.ref:(s=function(k){var R=g.refs;k===null?delete R[x]:R[x]=k},s._stringRef=x,s)}if(typeof i!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,i))}return i}function Pl(i,s){throw i=Object.prototype.toString.call(s),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i))}function Jm(i){var s=i._init;return s(i._payload)}function Zm(i){function s(B,z){if(i){var $=B.deletions;$===null?(B.deletions=[z],B.flags|=16):$.push(z)}}function u(B,z){if(!i)return null;for(;z!==null;)s(B,z),z=z.sibling;return null}function h(B,z){for(B=new Map;z!==null;)z.key!==null?B.set(z.key,z):B.set(z.index,z),z=z.sibling;return B}function g(B,z){return B=bi(B,z),B.index=0,B.sibling=null,B}function x(B,z,$){return B.index=$,i?($=B.alternate,$!==null?($=$.index,$<z?(B.flags|=2,z):$):(B.flags|=2,z)):(B.flags|=1048576,z)}function k(B){return i&&B.alternate===null&&(B.flags|=2),B}function R(B,z,$,le){return z===null||z.tag!==6?(z=Od($,B.mode,le),z.return=B,z):(z=g(z,$),z.return=B,z)}function M(B,z,$,le){var we=$.type;return we===D?ne(B,z,$.props.children,le,$.key):z!==null&&(z.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&Jm(we)===z.type)?(le=g(z,$.props),le.ref=Ko(B,z,$),le.return=B,le):(le=Zl($.type,$.key,$.props,null,B.mode,le),le.ref=Ko(B,z,$),le.return=B,le)}function W(B,z,$,le){return z===null||z.tag!==4||z.stateNode.containerInfo!==$.containerInfo||z.stateNode.implementation!==$.implementation?(z=Fd($,B.mode,le),z.return=B,z):(z=g(z,$.children||[]),z.return=B,z)}function ne(B,z,$,le,we){return z===null||z.tag!==7?(z=ts($,B.mode,le,we),z.return=B,z):(z=g(z,$),z.return=B,z)}function ie(B,z,$){if(typeof z=="string"&&z!==""||typeof z=="number")return z=Od(""+z,B.mode,$),z.return=B,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case V:return $=Zl(z.type,z.key,z.props,null,B.mode,$),$.ref=Ko(B,null,z),$.return=B,$;case N:return z=Fd(z,B.mode,$),z.return=B,z;case fe:var le=z._init;return ie(B,le(z._payload),$)}if(fr(z)||se(z))return z=ts(z,B.mode,$,null),z.return=B,z;Pl(B,z)}return null}function Z(B,z,$,le){var we=z!==null?z.key:null;if(typeof $=="string"&&$!==""||typeof $=="number")return we!==null?null:R(B,z,""+$,le);if(typeof $=="object"&&$!==null){switch($.$$typeof){case V:return $.key===we?M(B,z,$,le):null;case N:return $.key===we?W(B,z,$,le):null;case fe:return we=$._init,Z(B,z,we($._payload),le)}if(fr($)||se($))return we!==null?null:ne(B,z,$,le,null);Pl(B,$)}return null}function pe(B,z,$,le,we){if(typeof le=="string"&&le!==""||typeof le=="number")return B=B.get($)||null,R(z,B,""+le,we);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case V:return B=B.get(le.key===null?$:le.key)||null,M(z,B,le,we);case N:return B=B.get(le.key===null?$:le.key)||null,W(z,B,le,we);case fe:var ke=le._init;return pe(B,z,$,ke(le._payload),we)}if(fr(le)||se(le))return B=B.get($)||null,ne(z,B,le,we,null);Pl(z,le)}return null}function ye(B,z,$,le){for(var we=null,ke=null,Ee=z,Pe=z=0,Rt=null;Ee!==null&&Pe<$.length;Pe++){Ee.index>Pe?(Rt=Ee,Ee=null):Rt=Ee.sibling;var Ke=Z(B,Ee,$[Pe],le);if(Ke===null){Ee===null&&(Ee=Rt);break}i&&Ee&&Ke.alternate===null&&s(B,Ee),z=x(Ke,z,Pe),ke===null?we=Ke:ke.sibling=Ke,ke=Ke,Ee=Rt}if(Pe===$.length)return u(B,Ee),ot&&Gi(B,Pe),we;if(Ee===null){for(;Pe<$.length;Pe++)Ee=ie(B,$[Pe],le),Ee!==null&&(z=x(Ee,z,Pe),ke===null?we=Ee:ke.sibling=Ee,ke=Ee);return ot&&Gi(B,Pe),we}for(Ee=h(B,Ee);Pe<$.length;Pe++)Rt=pe(Ee,B,Pe,$[Pe],le),Rt!==null&&(i&&Rt.alternate!==null&&Ee.delete(Rt.key===null?Pe:Rt.key),z=x(Rt,z,Pe),ke===null?we=Rt:ke.sibling=Rt,ke=Rt);return i&&Ee.forEach(function(Si){return s(B,Si)}),ot&&Gi(B,Pe),we}function ve(B,z,$,le){var we=se($);if(typeof we!="function")throw Error(n(150));if($=we.call($),$==null)throw Error(n(151));for(var ke=we=null,Ee=z,Pe=z=0,Rt=null,Ke=$.next();Ee!==null&&!Ke.done;Pe++,Ke=$.next()){Ee.index>Pe?(Rt=Ee,Ee=null):Rt=Ee.sibling;var Si=Z(B,Ee,Ke.value,le);if(Si===null){Ee===null&&(Ee=Rt);break}i&&Ee&&Si.alternate===null&&s(B,Ee),z=x(Si,z,Pe),ke===null?we=Si:ke.sibling=Si,ke=Si,Ee=Rt}if(Ke.done)return u(B,Ee),ot&&Gi(B,Pe),we;if(Ee===null){for(;!Ke.done;Pe++,Ke=$.next())Ke=ie(B,Ke.value,le),Ke!==null&&(z=x(Ke,z,Pe),ke===null?we=Ke:ke.sibling=Ke,ke=Ke);return ot&&Gi(B,Pe),we}for(Ee=h(B,Ee);!Ke.done;Pe++,Ke=$.next())Ke=pe(Ee,B,Pe,Ke.value,le),Ke!==null&&(i&&Ke.alternate!==null&&Ee.delete(Ke.key===null?Pe:Ke.key),z=x(Ke,z,Pe),ke===null?we=Ke:ke.sibling=Ke,ke=Ke);return i&&Ee.forEach(function(iE){return s(B,iE)}),ot&&Gi(B,Pe),we}function yt(B,z,$,le){if(typeof $=="object"&&$!==null&&$.type===D&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case V:e:{for(var we=$.key,ke=z;ke!==null;){if(ke.key===we){if(we=$.type,we===D){if(ke.tag===7){u(B,ke.sibling),z=g(ke,$.props.children),z.return=B,B=z;break e}}else if(ke.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&Jm(we)===ke.type){u(B,ke.sibling),z=g(ke,$.props),z.ref=Ko(B,ke,$),z.return=B,B=z;break e}u(B,ke);break}else s(B,ke);ke=ke.sibling}$.type===D?(z=ts($.props.children,B.mode,le,$.key),z.return=B,B=z):(le=Zl($.type,$.key,$.props,null,B.mode,le),le.ref=Ko(B,z,$),le.return=B,B=le)}return k(B);case N:e:{for(ke=$.key;z!==null;){if(z.key===ke)if(z.tag===4&&z.stateNode.containerInfo===$.containerInfo&&z.stateNode.implementation===$.implementation){u(B,z.sibling),z=g(z,$.children||[]),z.return=B,B=z;break e}else{u(B,z);break}else s(B,z);z=z.sibling}z=Fd($,B.mode,le),z.return=B,B=z}return k(B);case fe:return ke=$._init,yt(B,z,ke($._payload),le)}if(fr($))return ye(B,z,$,le);if(se($))return ve(B,z,$,le);Pl(B,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,z!==null&&z.tag===6?(u(B,z.sibling),z=g(z,$),z.return=B,B=z):(u(B,z),z=Od($,B.mode,le),z.return=B,B=z),k(B)):u(B,z)}return yt}var zs=Zm(!0),eg=Zm(!1),Al=di(null),Rl=null,Os=null,Kc=null;function Yc(){Kc=Os=Rl=null}function Xc(i){var s=Al.current;rt(Al),i._currentValue=s}function Qc(i,s,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),i===u)break;i=i.return}}function Fs(i,s){Rl=i,Kc=Os=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&s)!==0&&(on=!0),i.firstContext=null)}function jn(i){var s=i._currentValue;if(Kc!==i)if(i={context:i,memoizedValue:s,next:null},Os===null){if(Rl===null)throw Error(n(308));Os=i,Rl.dependencies={lanes:0,firstContext:i}}else Os=Os.next=i;return s}var Ki=null;function Jc(i){Ki===null?Ki=[i]:Ki.push(i)}function tg(i,s,u,h){var g=s.interleaved;return g===null?(u.next=u,Jc(s)):(u.next=g.next,g.next=u),s.interleaved=u,Or(i,h)}function Or(i,s){i.lanes|=s;var u=i.alternate;for(u!==null&&(u.lanes|=s),u=i,i=i.return;i!==null;)i.childLanes|=s,u=i.alternate,u!==null&&(u.childLanes|=s),u=i,i=i.return;return u.tag===3?u.stateNode:null}var pi=!1;function Zc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ng(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Fr(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function mi(i,s,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(qe&2)!==0){var g=h.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),h.pending=s,Or(i,u)}return g=h.interleaved,g===null?(s.next=s,Jc(h)):(s.next=g.next,g.next=s),h.interleaved=s,Or(i,u)}function Nl(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,Bi(i,u)}}function rg(i,s){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var k={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};x===null?g=x=k:x=x.next=k,u=u.next}while(u!==null);x===null?g=x=s:x=x.next=s}else g=x=s;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:h.shared,effects:h.effects},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}function jl(i,s,u,h){var g=i.updateQueue;pi=!1;var x=g.firstBaseUpdate,k=g.lastBaseUpdate,R=g.shared.pending;if(R!==null){g.shared.pending=null;var M=R,W=M.next;M.next=null,k===null?x=W:k.next=W,k=M;var ne=i.alternate;ne!==null&&(ne=ne.updateQueue,R=ne.lastBaseUpdate,R!==k&&(R===null?ne.firstBaseUpdate=W:R.next=W,ne.lastBaseUpdate=M))}if(x!==null){var ie=g.baseState;k=0,ne=W=M=null,R=x;do{var Z=R.lane,pe=R.eventTime;if((h&Z)===Z){ne!==null&&(ne=ne.next={eventTime:pe,lane:0,tag:R.tag,payload:R.payload,callback:R.callback,next:null});e:{var ye=i,ve=R;switch(Z=s,pe=u,ve.tag){case 1:if(ye=ve.payload,typeof ye=="function"){ie=ye.call(pe,ie,Z);break e}ie=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ve.payload,Z=typeof ye=="function"?ye.call(pe,ie,Z):ye,Z==null)break e;ie=_({},ie,Z);break e;case 2:pi=!0}}R.callback!==null&&R.lane!==0&&(i.flags|=64,Z=g.effects,Z===null?g.effects=[R]:Z.push(R))}else pe={eventTime:pe,lane:Z,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ne===null?(W=ne=pe,M=ie):ne=ne.next=pe,k|=Z;if(R=R.next,R===null){if(R=g.shared.pending,R===null)break;Z=R,R=Z.next,Z.next=null,g.lastBaseUpdate=Z,g.shared.pending=null}}while(!0);if(ne===null&&(M=ie),g.baseState=M,g.firstBaseUpdate=W,g.lastBaseUpdate=ne,s=g.shared.interleaved,s!==null){g=s;do k|=g.lane,g=g.next;while(g!==s)}else x===null&&(g.shared.lanes=0);Qi|=k,i.lanes=k,i.memoizedState=ie}}function ig(i,s,u){if(i=s.effects,s.effects=null,i!==null)for(s=0;s<i.length;s++){var h=i[s],g=h.callback;if(g!==null){if(h.callback=null,h=u,typeof g!="function")throw Error(n(191,g));g.call(h)}}}var Yo={},gr=di(Yo),Xo=di(Yo),Qo=di(Yo);function Yi(i){if(i===Yo)throw Error(n(174));return i}function ed(i,s){switch(Ze(Qo,s),Ze(Xo,i),Ze(gr,Yo),i=s.nodeType,i){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:ue(null,"");break;default:i=i===8?s.parentNode:s,s=i.namespaceURI||null,i=i.tagName,s=ue(s,i)}rt(gr),Ze(gr,s)}function Vs(){rt(gr),rt(Xo),rt(Qo)}function sg(i){Yi(Qo.current);var s=Yi(gr.current),u=ue(s,i.type);s!==u&&(Ze(Xo,i),Ze(gr,u))}function td(i){Xo.current===i&&(rt(gr),rt(Xo))}var ct=di(0);function Ml(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var nd=[];function rd(){for(var i=0;i<nd.length;i++)nd[i]._workInProgressVersionPrimary=null;nd.length=0}var Dl=O.ReactCurrentDispatcher,id=O.ReactCurrentBatchConfig,Xi=0,dt=null,Et=null,Pt=null,Ll=!1,Jo=!1,Zo=0,Ik=0;function Bt(){throw Error(n(321))}function sd(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Jn(i[u],s[u]))return!1;return!0}function od(i,s,u,h,g,x){if(Xi=x,dt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Dl.current=i===null||i.memoizedState===null?Ak:Rk,i=u(h,g),Jo){x=0;do{if(Jo=!1,Zo=0,25<=x)throw Error(n(301));x+=1,Pt=Et=null,s.updateQueue=null,Dl.current=Nk,i=u(h,g)}while(Jo)}if(Dl.current=Fl,s=Et!==null&&Et.next!==null,Xi=0,Pt=Et=dt=null,Ll=!1,s)throw Error(n(300));return i}function ad(){var i=Zo!==0;return Zo=0,i}function yr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?dt.memoizedState=Pt=i:Pt=Pt.next=i,Pt}function Mn(){if(Et===null){var i=dt.alternate;i=i!==null?i.memoizedState:null}else i=Et.next;var s=Pt===null?dt.memoizedState:Pt.next;if(s!==null)Pt=s,Et=i;else{if(i===null)throw Error(n(310));Et=i,i={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},Pt===null?dt.memoizedState=Pt=i:Pt=Pt.next=i}return Pt}function ea(i,s){return typeof s=="function"?s(i):s}function ld(i){var s=Mn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=i;var h=Et,g=h.baseQueue,x=u.pending;if(x!==null){if(g!==null){var k=g.next;g.next=x.next,x.next=k}h.baseQueue=g=x,u.pending=null}if(g!==null){x=g.next,h=h.baseState;var R=k=null,M=null,W=x;do{var ne=W.lane;if((Xi&ne)===ne)M!==null&&(M=M.next={lane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),h=W.hasEagerState?W.eagerState:i(h,W.action);else{var ie={lane:ne,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null};M===null?(R=M=ie,k=h):M=M.next=ie,dt.lanes|=ne,Qi|=ne}W=W.next}while(W!==null&&W!==x);M===null?k=h:M.next=R,Jn(h,s.memoizedState)||(on=!0),s.memoizedState=h,s.baseState=k,s.baseQueue=M,u.lastRenderedState=h}if(i=u.interleaved,i!==null){g=i;do x=g.lane,dt.lanes|=x,Qi|=x,g=g.next;while(g!==i)}else g===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function ud(i){var s=Mn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=i;var h=u.dispatch,g=u.pending,x=s.memoizedState;if(g!==null){u.pending=null;var k=g=g.next;do x=i(x,k.action),k=k.next;while(k!==g);Jn(x,s.memoizedState)||(on=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,h]}function og(){}function ag(i,s){var u=dt,h=Mn(),g=s(),x=!Jn(h.memoizedState,g);if(x&&(h.memoizedState=g,on=!0),h=h.queue,cd(cg.bind(null,u,h,i),[i]),h.getSnapshot!==s||x||Pt!==null&&Pt.memoizedState.tag&1){if(u.flags|=2048,ta(9,ug.bind(null,u,h,g,s),void 0,null),At===null)throw Error(n(349));(Xi&30)!==0||lg(u,s,g)}return g}function lg(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=dt.updateQueue,s===null?(s={lastEffect:null,stores:null},dt.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function ug(i,s,u,h){s.value=u,s.getSnapshot=h,dg(s)&&fg(i)}function cg(i,s,u){return u(function(){dg(s)&&fg(i)})}function dg(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Jn(i,u)}catch{return!0}}function fg(i){var s=Or(i,1);s!==null&&rr(s,i,1,-1)}function hg(i){var s=yr();return typeof i=="function"&&(i=i()),s.memoizedState=s.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:i},s.queue=i,i=i.dispatch=Pk.bind(null,dt,i),[s.memoizedState,i]}function ta(i,s,u,h){return i={tag:i,create:s,destroy:u,deps:h,next:null},s=dt.updateQueue,s===null?(s={lastEffect:null,stores:null},dt.updateQueue=s,s.lastEffect=i.next=i):(u=s.lastEffect,u===null?s.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,s.lastEffect=i)),i}function pg(){return Mn().memoizedState}function zl(i,s,u,h){var g=yr();dt.flags|=i,g.memoizedState=ta(1|s,u,void 0,h===void 0?null:h)}function Ol(i,s,u,h){var g=Mn();h=h===void 0?null:h;var x=void 0;if(Et!==null){var k=Et.memoizedState;if(x=k.destroy,h!==null&&sd(h,k.deps)){g.memoizedState=ta(s,u,x,h);return}}dt.flags|=i,g.memoizedState=ta(1|s,u,x,h)}function mg(i,s){return zl(8390656,8,i,s)}function cd(i,s){return Ol(2048,8,i,s)}function gg(i,s){return Ol(4,2,i,s)}function yg(i,s){return Ol(4,4,i,s)}function vg(i,s){if(typeof s=="function")return i=i(),s(i),function(){s(null)};if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function xg(i,s,u){return u=u!=null?u.concat([i]):null,Ol(4,4,vg.bind(null,s,i),u)}function dd(){}function wg(i,s){var u=Mn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&sd(s,h[1])?h[0]:(u.memoizedState=[i,s],i)}function bg(i,s){var u=Mn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&sd(s,h[1])?h[0]:(i=i(),u.memoizedState=[i,s],i)}function Sg(i,s,u){return(Xi&21)===0?(i.baseState&&(i.baseState=!1,on=!0),i.memoizedState=u):(Jn(u,s)||(u=Pn(),dt.lanes|=u,Qi|=u,i.baseState=!0),s)}function Tk(i,s){var u=He;He=u!==0&&4>u?u:4,i(!0);var h=id.transition;id.transition={};try{i(!1),s()}finally{He=u,id.transition=h}}function kg(){return Mn().memoizedState}function _k(i,s,u){var h=xi(i);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},Eg(i))Cg(s,u);else if(u=tg(i,s,u,h),u!==null){var g=Jt();rr(u,i,h,g),Ig(u,s,h)}}function Pk(i,s,u){var h=xi(i),g={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(Eg(i))Cg(s,g);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var k=s.lastRenderedState,R=x(k,u);if(g.hasEagerState=!0,g.eagerState=R,Jn(R,k)){var M=s.interleaved;M===null?(g.next=g,Jc(s)):(g.next=M.next,M.next=g),s.interleaved=g;return}}catch{}finally{}u=tg(i,s,g,h),u!==null&&(g=Jt(),rr(u,i,h,g),Ig(u,s,h))}}function Eg(i){var s=i.alternate;return i===dt||s!==null&&s===dt}function Cg(i,s){Jo=Ll=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function Ig(i,s,u){if((u&4194240)!==0){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,Bi(i,u)}}var Fl={readContext:jn,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useInsertionEffect:Bt,useLayoutEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useMutableSource:Bt,useSyncExternalStore:Bt,useId:Bt,unstable_isNewReconciler:!1},Ak={readContext:jn,useCallback:function(i,s){return yr().memoizedState=[i,s===void 0?null:s],i},useContext:jn,useEffect:mg,useImperativeHandle:function(i,s,u){return u=u!=null?u.concat([i]):null,zl(4194308,4,vg.bind(null,s,i),u)},useLayoutEffect:function(i,s){return zl(4194308,4,i,s)},useInsertionEffect:function(i,s){return zl(4,2,i,s)},useMemo:function(i,s){var u=yr();return s=s===void 0?null:s,i=i(),u.memoizedState=[i,s],i},useReducer:function(i,s,u){var h=yr();return s=u!==void 0?u(s):s,h.memoizedState=h.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},h.queue=i,i=i.dispatch=_k.bind(null,dt,i),[h.memoizedState,i]},useRef:function(i){var s=yr();return i={current:i},s.memoizedState=i},useState:hg,useDebugValue:dd,useDeferredValue:function(i){return yr().memoizedState=i},useTransition:function(){var i=hg(!1),s=i[0];return i=Tk.bind(null,i[1]),yr().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,u){var h=dt,g=yr();if(ot){if(u===void 0)throw Error(n(407));u=u()}else{if(u=s(),At===null)throw Error(n(349));(Xi&30)!==0||lg(h,s,u)}g.memoizedState=u;var x={value:u,getSnapshot:s};return g.queue=x,mg(cg.bind(null,h,x,i),[i]),h.flags|=2048,ta(9,ug.bind(null,h,x,u,s),void 0,null),u},useId:function(){var i=yr(),s=At.identifierPrefix;if(ot){var u=zr,h=Lr;u=(h&~(1<<32-_t(h)-1)).toString(32)+u,s=":"+s+"R"+u,u=Zo++,0<u&&(s+="H"+u.toString(32)),s+=":"}else u=Ik++,s=":"+s+"r"+u.toString(32)+":";return i.memoizedState=s},unstable_isNewReconciler:!1},Rk={readContext:jn,useCallback:wg,useContext:jn,useEffect:cd,useImperativeHandle:xg,useInsertionEffect:gg,useLayoutEffect:yg,useMemo:bg,useReducer:ld,useRef:pg,useState:function(){return ld(ea)},useDebugValue:dd,useDeferredValue:function(i){var s=Mn();return Sg(s,Et.memoizedState,i)},useTransition:function(){var i=ld(ea)[0],s=Mn().memoizedState;return[i,s]},useMutableSource:og,useSyncExternalStore:ag,useId:kg,unstable_isNewReconciler:!1},Nk={readContext:jn,useCallback:wg,useContext:jn,useEffect:cd,useImperativeHandle:xg,useInsertionEffect:gg,useLayoutEffect:yg,useMemo:bg,useReducer:ud,useRef:pg,useState:function(){return ud(ea)},useDebugValue:dd,useDeferredValue:function(i){var s=Mn();return Et===null?s.memoizedState=i:Sg(s,Et.memoizedState,i)},useTransition:function(){var i=ud(ea)[0],s=Mn().memoizedState;return[i,s]},useMutableSource:og,useSyncExternalStore:ag,useId:kg,unstable_isNewReconciler:!1};function er(i,s){if(i&&i.defaultProps){s=_({},s),i=i.defaultProps;for(var u in i)s[u]===void 0&&(s[u]=i[u]);return s}return s}function fd(i,s,u,h){s=i.memoizedState,u=u(h,s),u=u==null?s:_({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Vl={isMounted:function(i){return(i=i._reactInternals)?pn(i)===i:!1},enqueueSetState:function(i,s,u){i=i._reactInternals;var h=Jt(),g=xi(i),x=Fr(h,g);x.payload=s,u!=null&&(x.callback=u),s=mi(i,x,g),s!==null&&(rr(s,i,g,h),Nl(s,i,g))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var h=Jt(),g=xi(i),x=Fr(h,g);x.tag=1,x.payload=s,u!=null&&(x.callback=u),s=mi(i,x,g),s!==null&&(rr(s,i,g,h),Nl(s,i,g))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=Jt(),h=xi(i),g=Fr(u,h);g.tag=2,s!=null&&(g.callback=s),s=mi(i,g,h),s!==null&&(rr(s,i,h,u),Nl(s,i,h))}};function Tg(i,s,u,h,g,x,k){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,x,k):s.prototype&&s.prototype.isPureReactComponent?!Bo(u,h)||!Bo(g,x):!0}function _g(i,s,u){var h=!1,g=fi,x=s.contextType;return typeof x=="object"&&x!==null?x=jn(x):(g=sn(s)?Wi:Vt.current,h=s.contextTypes,x=(h=h!=null)?js(i,g):fi),s=new s(u,x),i.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Vl,i.stateNode=s,s._reactInternals=i,h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=x),s}function Pg(i,s,u,h){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==i&&Vl.enqueueReplaceState(s,s.state,null)}function hd(i,s,u,h){var g=i.stateNode;g.props=u,g.state=i.memoizedState,g.refs={},Zc(i);var x=s.contextType;typeof x=="object"&&x!==null?g.context=jn(x):(x=sn(s)?Wi:Vt.current,g.context=js(i,x)),g.state=i.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(fd(i,s,x,u),g.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(s=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),s!==g.state&&Vl.enqueueReplaceState(g,g.state,null),jl(i,u,g,h),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function Bs(i,s){try{var u="",h=s;do u+=Ie(h),h=h.return;while(h);var g=u}catch(x){g=`
37
+ `+g[k].replace(" at new "," at ");return i.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",i.displayName)),M}while(1<=k&&0<=R);break}}}finally{A=!1,Error.prepareStackTrace=u}return(i=i?i.displayName||i.name:"")?Y(i):""}function Te(i){switch(i.tag){case 5:return Y(i.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return i=Se(i.type,!1),i;case 11:return i=Se(i.type.render,!1),i;case 1:return i=Se(i.type,!0),i;default:return""}}function ke(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case D:return"Fragment";case N:return"Portal";case ee:return"Profiler";case H:return"StrictMode";case X:return"Suspense";case Q:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case te:return(i.displayName||"Context")+".Consumer";case L:return(i._context.displayName||"Context")+".Provider";case G:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case re:return s=i.displayName||null,s!==null?s:ke(i.type)||"Memo";case fe:s=i._payload,i=i._init;try{return ke(i(s))}catch{}}return null}function ze(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ke(s);case 8:return s===H?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function de(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function he(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ne(i){var s=he(i)?"checked":"value",u=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),h=""+i[s];if(!i.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,x=u.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return g.call(this)},set:function(k){h=""+k,x.call(this,k)}}),Object.defineProperty(i,s,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(k){h=""+k},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Ke(i){i._valueTracker||(i._valueTracker=Ne(i))}function Mi(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return i&&(h=he(i)?i.checked?"true":"false":i.value),i=h,i!==u?(s.setValue(i),!0):!1}function Kn(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Yr(i,s){var u=s.checked;return _({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??i._wrapperState.initialChecked})}function Xr(i,s){var u=s.defaultValue==null?"":s.defaultValue,h=s.checked!=null?s.checked:s.defaultChecked;u=de(s.value!=null?s.value:u),i._wrapperState={initialChecked:h,initialValue:u,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Di(i,s){s=s.checked,s!=null&&T(i,"checked",s,!1)}function en(i,s){Di(i,s);var u=de(s.value),h=s.type;if(u!=null)h==="number"?(u===0&&i.value===""||i.value!=u)&&(i.value=""+u):i.value!==""+u&&(i.value=""+u);else if(h==="submit"||h==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?Qr(i,s.type,u):s.hasOwnProperty("defaultValue")&&Qr(i,s.type,de(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function Li(i,s,u){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var h=s.type;if(!(h!=="submit"&&h!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,u||s===i.value||(i.value=s),i.defaultValue=s}u=i.name,u!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,u!==""&&(i.name=u)}function Qr(i,s,u){(s!=="number"||Kn(i.ownerDocument)!==i)&&(u==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+u&&(i.defaultValue=""+u))}var fr=Array.isArray;function Cn(i,s,u,h){if(i=i.options,s){s={};for(var g=0;g<u.length;g++)s["$"+u[g]]=!0;for(u=0;u<i.length;u++)g=s.hasOwnProperty("$"+i[u].value),i[u].selected!==g&&(i[u].selected=g),g&&h&&(i[u].defaultSelected=!0)}else{for(u=""+de(u),s=null,g=0;g<i.length;g++){if(i[g].value===u){i[g].selected=!0,h&&(i[g].defaultSelected=!0);return}s!==null||i[g].disabled||(s=i[g])}s!==null&&(s.selected=!0)}}function Yn(i,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return _({},s,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Jr(i,s){var u=s.value;if(u==null){if(u=s.children,s=s.defaultValue,u!=null){if(s!=null)throw Error(n(92));if(fr(u)){if(1<u.length)throw Error(n(93));u=u[0]}s=u}s==null&&(s=""),u=s}i._wrapperState={initialValue:de(u)}}function Zr(i,s){var u=de(s.value),h=de(s.defaultValue);u!=null&&(u=""+u,u!==i.value&&(i.value=u),s.defaultValue==null&&i.defaultValue!==u&&(i.defaultValue=u)),h!=null&&(i.defaultValue=""+h)}function ei(i){var s=i.textContent;s===i._wrapperState.initialValue&&s!==""&&s!==null&&(i.value=s)}function K(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ue(i,s){return i==null||i==="http://www.w3.org/1999/xhtml"?K(s):i==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var _e,Le=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,u,h,g){MSApp.execUnsafeLocalFunction(function(){return i(s,u,h,g)})}:i})(function(i,s){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=s;else{for(_e=_e||document.createElement("div"),_e.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=_e.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function Be(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var St={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},In=["Webkit","ms","Moz","O"];Object.keys(St).forEach(function(i){In.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),St[s]=St[i]})});function Lt(i,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||St.hasOwnProperty(i)&&St[i]?(""+s).trim():s+"px"}function zt(i,s){i=i.style;for(var u in s)if(s.hasOwnProperty(u)){var h=u.indexOf("--")===0,g=Lt(u,s[u],h);u==="float"&&(u="cssFloat"),h?i.setProperty(u,g):i[u]=g}}var Rt=_({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function et(i,s){if(s){if(Rt[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Kt(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){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 ft=null;function Eo(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ti=null,Tn=null,_r=null;function Co(i){if(i=Go(i)){if(typeof ti!="function")throw Error(n(280));var s=i.stateNode;s&&(s=Sl(s),ti(i.stateNode,i.type,s))}}function tl(i){Tn?_r?_r.push(i):_r=[i]:Tn=i}function nl(){if(Tn){var i=Tn,s=_r;if(_r=Tn=null,Co(i),s)for(i=0;i<s.length;i++)Co(s[i])}}function Io(i,s){return i(s)}function To(){}var ni=!1;function Pr(i,s,u){if(ni)return i(s,u);ni=!0;try{return Io(i,s,u)}finally{ni=!1,(Tn!==null||_r!==null)&&(To(),nl())}}function zi(i,s){var u=i.stateNode;if(u===null)return null;var h=Sl(u);if(h===null)return null;u=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(n(231,s,typeof u));return u}var _n=!1;if(c)try{var Oi={};Object.defineProperty(Oi,"passive",{get:function(){_n=!0}}),window.addEventListener("test",Oi,Oi),window.removeEventListener("test",Oi,Oi)}catch{_n=!1}function Ar(i,s,u,h,g,x,k,R,M){var W=Array.prototype.slice.call(arguments,3);try{s.apply(u,W)}catch(ne){this.onError(ne)}}var ri=!1,vs=null,Rr=!1,Fi=null,rl={onError:function(i){ri=!0,vs=i}};function il(i,s,u,h,g,x,k,R,M){ri=!1,vs=null,Ar.apply(rl,arguments)}function sl(i,s,u,h,g,x,k,R,M){if(il.apply(this,arguments),ri){if(ri){var W=vs;ri=!1,vs=null}else throw Error(n(198));Rr||(Rr=!0,Fi=W)}}function hn(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function _o(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function ol(i){if(hn(i)!==i)throw Error(n(188))}function F(i){var s=i.alternate;if(!s){if(s=hn(i),s===null)throw Error(n(188));return s!==i?null:i}for(var u=i,h=s;;){var g=u.return;if(g===null)break;var x=g.alternate;if(x===null){if(h=g.return,h!==null){u=h;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===u)return ol(g),i;if(x===h)return ol(g),s;x=x.sibling}throw Error(n(188))}if(u.return!==h.return)u=g,h=x;else{for(var k=!1,R=g.child;R;){if(R===u){k=!0,u=g,h=x;break}if(R===h){k=!0,h=g,u=x;break}R=R.sibling}if(!k){for(R=x.child;R;){if(R===u){k=!0,u=x,h=g;break}if(R===h){k=!0,h=x,u=g;break}R=R.sibling}if(!k)throw Error(n(189))}}if(u.alternate!==h)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?i:s}function q(i){return i=F(i),i!==null?ce(i):null}function ce(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var s=ce(i);if(s!==null)return s;i=i.sibling}return null}var we=t.unstable_scheduleCallback,Ye=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,it=t.unstable_requestPaint,je=t.unstable_now,pn=t.unstable_getCurrentPriorityLevel,lt=t.unstable_ImmediatePriority,ht=t.unstable_UserBlockingPriority,Yt=t.unstable_NormalPriority,Xn=t.unstable_LowPriority,It=t.unstable_IdlePriority,tn=null,Nt=null;function xs(i){if(Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(tn,i,void 0,(i.current.flags&128)===128)}catch{}}var Tt=Math.clz32?Math.clz32:mc,Vi=Math.log,al=Math.LN2;function mc(i){return i>>>=0,i===0?32:31-(Vi(i)/al|0)|0}var ws=64,qe=4194304;function $e(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Nr(i,s){var u=i.pendingLanes;if(u===0)return 0;var h=0,g=i.suspendedLanes,x=i.pingedLanes,k=u&268435455;if(k!==0){var R=k&~g;R!==0?h=$e(R):(x&=k,x!==0&&(h=$e(x)))}else k=u&~g,k!==0?h=$e(k):x!==0&&(h=$e(x));if(h===0)return 0;if(s!==0&&s!==h&&(s&g)===0&&(g=h&-h,x=s&-s,g>=x||g===16&&(x&4194240)!==0))return s;if((h&4)!==0&&(h|=u&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=h;0<s;)u=31-Tt(s),g=1<<u,h|=i[u],s&=~g;return h}function hr(i,s){switch(i){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Po(i,s){for(var u=i.suspendedLanes,h=i.pingedLanes,g=i.expirationTimes,x=i.pendingLanes;0<x;){var k=31-Tt(x),R=1<<k,M=g[k];M===-1?((R&u)===0||(R&h)!==0)&&(g[k]=hr(R,s)):M<=s&&(i.expiredLanes|=R),x&=~R}}function Ot(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Pn(){var i=ws;return ws<<=1,(ws&4194240)===0&&(ws=64),i}function An(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Qn(i,s,u){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-Tt(s),i[s]=u}function bs(i,s){var u=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var h=i.eventTimes;for(i=i.expirationTimes;0<u;){var g=31-Tt(u),x=1<<g;s[g]=0,h[g]=-1,i[g]=-1,u&=~x}}function Bi(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var h=31-Tt(u),g=1<<h;g&s|i[h]&s&&(i[h]|=s),u&=~g}}var Ue=0;function pr(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Ao,ii,Ss,$i,Ui,ks=!1,jr=[],mn=null,si=null,oi=null,Ro=new Map,No=new Map,ai=[],TS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function im(i,s){switch(i){case"focusin":case"focusout":mn=null;break;case"dragenter":case"dragleave":si=null;break;case"mouseover":case"mouseout":oi=null;break;case"pointerover":case"pointerout":Ro.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":No.delete(s.pointerId)}}function jo(i,s,u,h,g,x){return i===null||i.nativeEvent!==x?(i={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:x,targetContainers:[g]},s!==null&&(s=Go(s),s!==null&&ii(s)),i):(i.eventSystemFlags|=h,s=i.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),i)}function _S(i,s,u,h,g){switch(s){case"focusin":return mn=jo(mn,i,s,u,h,g),!0;case"dragenter":return si=jo(si,i,s,u,h,g),!0;case"mouseover":return oi=jo(oi,i,s,u,h,g),!0;case"pointerover":var x=g.pointerId;return Ro.set(x,jo(Ro.get(x)||null,i,s,u,h,g)),!0;case"gotpointercapture":return x=g.pointerId,No.set(x,jo(No.get(x)||null,i,s,u,h,g)),!0}return!1}function sm(i){var s=Hi(i.target);if(s!==null){var u=hn(s);if(u!==null){if(s=u.tag,s===13){if(s=_o(u),s!==null){i.blockedOn=s,Ui(i.priority,function(){Ss(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function ll(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=yc(i.domEventName,i.eventSystemFlags,s[0],i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);ft=h,u.target.dispatchEvent(h),ft=null}else return s=Go(u),s!==null&&ii(s),i.blockedOn=u,!1;s.shift()}return!0}function om(i,s,u){ll(i)&&u.delete(s)}function PS(){ks=!1,mn!==null&&ll(mn)&&(mn=null),si!==null&&ll(si)&&(si=null),oi!==null&&ll(oi)&&(oi=null),Ro.forEach(om),No.forEach(om)}function Mo(i,s){i.blockedOn===s&&(i.blockedOn=null,ks||(ks=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,PS)))}function Do(i){function s(g){return Mo(g,i)}if(0<jr.length){Mo(jr[0],i);for(var u=1;u<jr.length;u++){var h=jr[u];h.blockedOn===i&&(h.blockedOn=null)}}for(mn!==null&&Mo(mn,i),si!==null&&Mo(si,i),oi!==null&&Mo(oi,i),Ro.forEach(s),No.forEach(s),u=0;u<ai.length;u++)h=ai[u],h.blockedOn===i&&(h.blockedOn=null);for(;0<ai.length&&(u=ai[0],u.blockedOn===null);)sm(u),u.blockedOn===null&&ai.shift()}var Es=O.ReactCurrentBatchConfig,ul=!0;function AS(i,s,u,h){var g=Ue,x=Es.transition;Es.transition=null;try{Ue=1,gc(i,s,u,h)}finally{Ue=g,Es.transition=x}}function RS(i,s,u,h){var g=Ue,x=Es.transition;Es.transition=null;try{Ue=4,gc(i,s,u,h)}finally{Ue=g,Es.transition=x}}function gc(i,s,u,h){if(ul){var g=yc(i,s,u,h);if(g===null)Mc(i,s,h,cl,u),im(i,h);else if(_S(g,i,s,u,h))h.stopPropagation();else if(im(i,h),s&4&&-1<TS.indexOf(i)){for(;g!==null;){var x=Go(g);if(x!==null&&Ao(x),x=yc(i,s,u,h),x===null&&Mc(i,s,h,cl,u),x===g)break;g=x}g!==null&&h.stopPropagation()}else Mc(i,s,h,null,u)}}var cl=null;function yc(i,s,u,h){if(cl=null,i=Eo(h),i=Hi(i),i!==null)if(s=hn(i),s===null)i=null;else if(u=s.tag,u===13){if(i=_o(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null);return cl=i,null}function am(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pn()){case lt:return 1;case ht:return 4;case Yt:case Xn:return 16;case It:return 536870912;default:return 16}default:return 16}}var li=null,vc=null,dl=null;function lm(){if(dl)return dl;var i,s=vc,u=s.length,h,g="value"in li?li.value:li.textContent,x=g.length;for(i=0;i<u&&s[i]===g[i];i++);var k=u-i;for(h=1;h<=k&&s[u-h]===g[x-h];h++);return dl=g.slice(i,1<h?1-h:void 0)}function fl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function hl(){return!0}function um(){return!1}function gn(i){function s(u,h,g,x,k){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var R in i)i.hasOwnProperty(R)&&(u=i[R],this[R]=u?u(x):x[R]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?hl:um,this.isPropagationStopped=um,this}return _(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=hl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=hl)},persist:function(){},isPersistent:hl}),s}var Cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xc=gn(Cs),Lo=_({},Cs,{view:0,detail:0}),NS=gn(Lo),wc,bc,zo,pl=_({},Lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==zo&&(zo&&i.type==="mousemove"?(wc=i.screenX-zo.screenX,bc=i.screenY-zo.screenY):bc=wc=0,zo=i),wc)},movementY:function(i){return"movementY"in i?i.movementY:bc}}),cm=gn(pl),jS=_({},pl,{dataTransfer:0}),MS=gn(jS),DS=_({},Lo,{relatedTarget:0}),Sc=gn(DS),LS=_({},Cs,{animationName:0,elapsedTime:0,pseudoElement:0}),zS=gn(LS),OS=_({},Cs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),FS=gn(OS),VS=_({},Cs,{data:0}),dm=gn(VS),BS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$S={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"},US={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HS(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=US[i])?!!s[i]:!1}function kc(){return HS}var WS=_({},Lo,{key:function(i){if(i.key){var s=BS[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=fl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?$S[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kc,charCode:function(i){return i.type==="keypress"?fl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?fl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),qS=gn(WS),GS=_({},pl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fm=gn(GS),KS=_({},Lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kc}),YS=gn(KS),XS=_({},Cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),QS=gn(XS),JS=_({},pl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),ZS=gn(JS),ek=[9,13,27,32],Ec=c&&"CompositionEvent"in window,Oo=null;c&&"documentMode"in document&&(Oo=document.documentMode);var tk=c&&"TextEvent"in window&&!Oo,hm=c&&(!Ec||Oo&&8<Oo&&11>=Oo),pm=" ",mm=!1;function gm(i,s){switch(i){case"keyup":return ek.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ym(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Is=!1;function nk(i,s){switch(i){case"compositionend":return ym(s);case"keypress":return s.which!==32?null:(mm=!0,pm);case"textInput":return i=s.data,i===pm&&mm?null:i;default:return null}}function rk(i,s){if(Is)return i==="compositionend"||!Ec&&gm(i,s)?(i=lm(),dl=vc=li=null,Is=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return hm&&s.locale!=="ko"?null:s.data;default:return null}}var ik={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 vm(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!ik[i.type]:s==="textarea"}function xm(i,s,u,h){tl(h),s=xl(s,"onChange"),0<s.length&&(u=new xc("onChange","change",null,u,h),i.push({event:u,listeners:s}))}var Fo=null,Vo=null;function sk(i){zm(i,0)}function ml(i){var s=Rs(i);if(Mi(s))return i}function ok(i,s){if(i==="change")return s}var wm=!1;if(c){var Cc;if(c){var Ic="oninput"in document;if(!Ic){var bm=document.createElement("div");bm.setAttribute("oninput","return;"),Ic=typeof bm.oninput=="function"}Cc=Ic}else Cc=!1;wm=Cc&&(!document.documentMode||9<document.documentMode)}function Sm(){Fo&&(Fo.detachEvent("onpropertychange",km),Vo=Fo=null)}function km(i){if(i.propertyName==="value"&&ml(Vo)){var s=[];xm(s,Vo,i,Eo(i)),Pr(sk,s)}}function ak(i,s,u){i==="focusin"?(Sm(),Fo=s,Vo=u,Fo.attachEvent("onpropertychange",km)):i==="focusout"&&Sm()}function lk(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ml(Vo)}function uk(i,s){if(i==="click")return ml(s)}function ck(i,s){if(i==="input"||i==="change")return ml(s)}function dk(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Jn=typeof Object.is=="function"?Object.is:dk;function Bo(i,s){if(Jn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var g=u[h];if(!d.call(s,g)||!Jn(i[g],s[g]))return!1}return!0}function Em(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Cm(i,s){var u=Em(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=s&&h>=s)return{node:u,offset:s-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Em(u)}}function Im(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?Im(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Tm(){for(var i=window,s=Kn();s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=Kn(i.document)}return s}function Tc(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function fk(i){var s=Tm(),u=i.focusedElem,h=i.selectionRange;if(s!==u&&u&&u.ownerDocument&&Im(u.ownerDocument.documentElement,u)){if(h!==null&&Tc(u)){if(s=h.start,i=h.end,i===void 0&&(i=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(i,u.value.length);else if(i=(s=u.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var g=u.textContent.length,x=Math.min(h.start,g);h=h.end===void 0?x:Math.min(h.end,g),!i.extend&&x>h&&(g=h,h=x,x=g),g=Cm(u,x);var k=Cm(u,h);g&&k&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==k.node||i.focusOffset!==k.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),i.removeAllRanges(),x>h?(i.addRange(s),i.extend(k.node,k.offset)):(s.setEnd(k.node,k.offset),i.addRange(s)))}}for(s=[],i=u;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<s.length;u++)i=s[u],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var hk=c&&"documentMode"in document&&11>=document.documentMode,Ts=null,_c=null,$o=null,Pc=!1;function _m(i,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Pc||Ts==null||Ts!==Kn(h)||(h=Ts,"selectionStart"in h&&Tc(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),$o&&Bo($o,h)||($o=h,h=xl(_c,"onSelect"),0<h.length&&(s=new xc("onSelect","select",null,s,u),i.push({event:s,listeners:h}),s.target=Ts)))}function gl(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var _s={animationend:gl("Animation","AnimationEnd"),animationiteration:gl("Animation","AnimationIteration"),animationstart:gl("Animation","AnimationStart"),transitionend:gl("Transition","TransitionEnd")},Ac={},Pm={};c&&(Pm=document.createElement("div").style,"AnimationEvent"in window||(delete _s.animationend.animation,delete _s.animationiteration.animation,delete _s.animationstart.animation),"TransitionEvent"in window||delete _s.transitionend.transition);function yl(i){if(Ac[i])return Ac[i];if(!_s[i])return i;var s=_s[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in Pm)return Ac[i]=s[u];return i}var Am=yl("animationend"),Rm=yl("animationiteration"),Nm=yl("animationstart"),jm=yl("transitionend"),Mm=new Map,Dm="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ui(i,s){Mm.set(i,s),a(s,[i])}for(var Rc=0;Rc<Dm.length;Rc++){var Nc=Dm[Rc],pk=Nc.toLowerCase(),mk=Nc[0].toUpperCase()+Nc.slice(1);ui(pk,"on"+mk)}ui(Am,"onAnimationEnd"),ui(Rm,"onAnimationIteration"),ui(Nm,"onAnimationStart"),ui("dblclick","onDoubleClick"),ui("focusin","onFocus"),ui("focusout","onBlur"),ui(jm,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uo="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(" "),gk=new Set("cancel close invalid load scroll toggle".split(" ").concat(Uo));function Lm(i,s,u){var h=i.type||"unknown-event";i.currentTarget=u,sl(h,s,void 0,i),i.currentTarget=null}function zm(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],g=h.event;h=h.listeners;e:{var x=void 0;if(s)for(var k=h.length-1;0<=k;k--){var R=h[k],M=R.instance,W=R.currentTarget;if(R=R.listener,M!==x&&g.isPropagationStopped())break e;Lm(g,R,W),x=M}else for(k=0;k<h.length;k++){if(R=h[k],M=R.instance,W=R.currentTarget,R=R.listener,M!==x&&g.isPropagationStopped())break e;Lm(g,R,W),x=M}}}if(Rr)throw i=Fi,Rr=!1,Fi=null,i}function tt(i,s){var u=s[Vc];u===void 0&&(u=s[Vc]=new Set);var h=i+"__bubble";u.has(h)||(Om(s,i,2,!1),u.add(h))}function jc(i,s,u){var h=0;s&&(h|=4),Om(u,i,h,s)}var vl="_reactListening"+Math.random().toString(36).slice(2);function Ho(i){if(!i[vl]){i[vl]=!0,r.forEach(function(u){u!=="selectionchange"&&(gk.has(u)||jc(u,!1,i),jc(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[vl]||(s[vl]=!0,jc("selectionchange",!1,s))}}function Om(i,s,u,h){switch(am(s)){case 1:var g=AS;break;case 4:g=RS;break;default:g=gc}u=g.bind(null,s,u,i),g=void 0,!_n||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),h?g!==void 0?i.addEventListener(s,u,{capture:!0,passive:g}):i.addEventListener(s,u,!0):g!==void 0?i.addEventListener(s,u,{passive:g}):i.addEventListener(s,u,!1)}function Mc(i,s,u,h,g){var x=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var k=h.tag;if(k===3||k===4){var R=h.stateNode.containerInfo;if(R===g||R.nodeType===8&&R.parentNode===g)break;if(k===4)for(k=h.return;k!==null;){var M=k.tag;if((M===3||M===4)&&(M=k.stateNode.containerInfo,M===g||M.nodeType===8&&M.parentNode===g))return;k=k.return}for(;R!==null;){if(k=Hi(R),k===null)return;if(M=k.tag,M===5||M===6){h=x=k;continue e}R=R.parentNode}}h=h.return}Pr(function(){var W=x,ne=Eo(u),ie=[];e:{var Z=Mm.get(i);if(Z!==void 0){var pe=xc,ve=i;switch(i){case"keypress":if(fl(u)===0)break e;case"keydown":case"keyup":pe=qS;break;case"focusin":ve="focus",pe=Sc;break;case"focusout":ve="blur",pe=Sc;break;case"beforeblur":case"afterblur":pe=Sc;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=MS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=YS;break;case Am:case Rm:case Nm:pe=zS;break;case jm:pe=QS;break;case"scroll":pe=NS;break;case"wheel":pe=ZS;break;case"copy":case"cut":case"paste":pe=FS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=fm}var xe=(s&4)!==0,gt=!xe&&i==="scroll",B=xe?Z!==null?Z+"Capture":null:Z;xe=[];for(var z=W,$;z!==null;){$=z;var le=$.stateNode;if($.tag===5&&le!==null&&($=le,B!==null&&(le=zi(z,B),le!=null&&xe.push(Wo(z,le,$)))),gt)break;z=z.return}0<xe.length&&(Z=new pe(Z,ve,null,u,ne),ie.push({event:Z,listeners:xe}))}}if((s&7)===0){e:{if(Z=i==="mouseover"||i==="pointerover",pe=i==="mouseout"||i==="pointerout",Z&&u!==ft&&(ve=u.relatedTarget||u.fromElement)&&(Hi(ve)||ve[Mr]))break e;if((pe||Z)&&(Z=ne.window===ne?ne:(Z=ne.ownerDocument)?Z.defaultView||Z.parentWindow:window,pe?(ve=u.relatedTarget||u.toElement,pe=W,ve=ve?Hi(ve):null,ve!==null&&(gt=hn(ve),ve!==gt||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(pe=null,ve=W),pe!==ve)){if(xe=cm,le="onMouseLeave",B="onMouseEnter",z="mouse",(i==="pointerout"||i==="pointerover")&&(xe=fm,le="onPointerLeave",B="onPointerEnter",z="pointer"),gt=pe==null?Z:Rs(pe),$=ve==null?Z:Rs(ve),Z=new xe(le,z+"leave",pe,u,ne),Z.target=gt,Z.relatedTarget=$,le=null,Hi(ne)===W&&(xe=new xe(B,z+"enter",ve,u,ne),xe.target=$,xe.relatedTarget=gt,le=xe),gt=le,pe&&ve)t:{for(xe=pe,B=ve,z=0,$=xe;$;$=Ps($))z++;for($=0,le=B;le;le=Ps(le))$++;for(;0<z-$;)xe=Ps(xe),z--;for(;0<$-z;)B=Ps(B),$--;for(;z--;){if(xe===B||B!==null&&xe===B.alternate)break t;xe=Ps(xe),B=Ps(B)}xe=null}else xe=null;pe!==null&&Fm(ie,Z,pe,xe,!1),ve!==null&&gt!==null&&Fm(ie,gt,ve,xe,!0)}}e:{if(Z=W?Rs(W):window,pe=Z.nodeName&&Z.nodeName.toLowerCase(),pe==="select"||pe==="input"&&Z.type==="file")var be=ok;else if(vm(Z))if(wm)be=ck;else{be=lk;var Ee=ak}else(pe=Z.nodeName)&&pe.toLowerCase()==="input"&&(Z.type==="checkbox"||Z.type==="radio")&&(be=uk);if(be&&(be=be(i,W))){xm(ie,be,u,ne);break e}Ee&&Ee(i,Z,W),i==="focusout"&&(Ee=Z._wrapperState)&&Ee.controlled&&Z.type==="number"&&Qr(Z,"number",Z.value)}switch(Ee=W?Rs(W):window,i){case"focusin":(vm(Ee)||Ee.contentEditable==="true")&&(Ts=Ee,_c=W,$o=null);break;case"focusout":$o=_c=Ts=null;break;case"mousedown":Pc=!0;break;case"contextmenu":case"mouseup":case"dragend":Pc=!1,_m(ie,u,ne);break;case"selectionchange":if(hk)break;case"keydown":case"keyup":_m(ie,u,ne)}var Ce;if(Ec)e:{switch(i){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else Is?gm(i,u)&&(Ae="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Ae="onCompositionStart");Ae&&(hm&&u.locale!=="ko"&&(Is||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Is&&(Ce=lm()):(li=ne,vc="value"in li?li.value:li.textContent,Is=!0)),Ee=xl(W,Ae),0<Ee.length&&(Ae=new dm(Ae,i,null,u,ne),ie.push({event:Ae,listeners:Ee}),Ce?Ae.data=Ce:(Ce=ym(u),Ce!==null&&(Ae.data=Ce)))),(Ce=tk?nk(i,u):rk(i,u))&&(W=xl(W,"onBeforeInput"),0<W.length&&(ne=new dm("onBeforeInput","beforeinput",null,u,ne),ie.push({event:ne,listeners:W}),ne.data=Ce))}zm(ie,s)})}function Wo(i,s,u){return{instance:i,listener:s,currentTarget:u}}function xl(i,s){for(var u=s+"Capture",h=[];i!==null;){var g=i,x=g.stateNode;g.tag===5&&x!==null&&(g=x,x=zi(i,u),x!=null&&h.unshift(Wo(i,x,g)),x=zi(i,s),x!=null&&h.push(Wo(i,x,g))),i=i.return}return h}function Ps(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function Fm(i,s,u,h,g){for(var x=s._reactName,k=[];u!==null&&u!==h;){var R=u,M=R.alternate,W=R.stateNode;if(M!==null&&M===h)break;R.tag===5&&W!==null&&(R=W,g?(M=zi(u,x),M!=null&&k.unshift(Wo(u,M,R))):g||(M=zi(u,x),M!=null&&k.push(Wo(u,M,R)))),u=u.return}k.length!==0&&i.push({event:s,listeners:k})}var yk=/\r\n?/g,vk=/\u0000|\uFFFD/g;function Vm(i){return(typeof i=="string"?i:""+i).replace(yk,`
38
+ `).replace(vk,"")}function wl(i,s,u){if(s=Vm(s),Vm(i)!==s&&u)throw Error(n(425))}function bl(){}var Dc=null,Lc=null;function zc(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Oc=typeof setTimeout=="function"?setTimeout:void 0,xk=typeof clearTimeout=="function"?clearTimeout:void 0,Bm=typeof Promise=="function"?Promise:void 0,wk=typeof queueMicrotask=="function"?queueMicrotask:typeof Bm<"u"?function(i){return Bm.resolve(null).then(i).catch(bk)}:Oc;function bk(i){setTimeout(function(){throw i})}function Fc(i,s){var u=s,h=0;do{var g=u.nextSibling;if(i.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(h===0){i.removeChild(g),Do(s);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=g}while(u);Do(s)}function ci(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return i}function $m(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"){if(s===0)return i;s--}else u==="/$"&&s++}i=i.previousSibling}return null}var As=Math.random().toString(36).slice(2),mr="__reactFiber$"+As,qo="__reactProps$"+As,Mr="__reactContainer$"+As,Vc="__reactEvents$"+As,Sk="__reactListeners$"+As,kk="__reactHandles$"+As;function Hi(i){var s=i[mr];if(s)return s;for(var u=i.parentNode;u;){if(s=u[Mr]||u[mr]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=$m(i);i!==null;){if(u=i[mr])return u;i=$m(i)}return s}i=u,u=i.parentNode}return null}function Go(i){return i=i[mr]||i[Mr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Rs(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Sl(i){return i[qo]||null}var Bc=[],Ns=-1;function di(i){return{current:i}}function nt(i){0>Ns||(i.current=Bc[Ns],Bc[Ns]=null,Ns--)}function Je(i,s){Ns++,Bc[Ns]=i.current,i.current=s}var fi={},Ft=di(fi),nn=di(!1),Wi=fi;function js(i,s){var u=i.type.contextTypes;if(!u)return fi;var h=i.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===s)return h.__reactInternalMemoizedMaskedChildContext;var g={},x;for(x in u)g[x]=s[x];return h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=g),g}function rn(i){return i=i.childContextTypes,i!=null}function kl(){nt(nn),nt(Ft)}function Um(i,s,u){if(Ft.current!==fi)throw Error(n(168));Je(Ft,s),Je(nn,u)}function Hm(i,s,u){var h=i.stateNode;if(s=s.childContextTypes,typeof h.getChildContext!="function")return u;h=h.getChildContext();for(var g in h)if(!(g in s))throw Error(n(108,ze(i)||"Unknown",g));return _({},u,h)}function El(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||fi,Wi=Ft.current,Je(Ft,i),Je(nn,nn.current),!0}function Wm(i,s,u){var h=i.stateNode;if(!h)throw Error(n(169));u?(i=Hm(i,s,Wi),h.__reactInternalMemoizedMergedChildContext=i,nt(nn),nt(Ft),Je(Ft,i)):nt(nn),Je(nn,u)}var Dr=null,Cl=!1,$c=!1;function qm(i){Dr===null?Dr=[i]:Dr.push(i)}function Ek(i){Cl=!0,qm(i)}function hi(){if(!$c&&Dr!==null){$c=!0;var i=0,s=Ue;try{var u=Dr;for(Ue=1;i<u.length;i++){var h=u[i];do h=h(!0);while(h!==null)}Dr=null,Cl=!1}catch(g){throw Dr!==null&&(Dr=Dr.slice(i+1)),we(lt,hi),g}finally{Ue=s,$c=!1}}return null}var Ms=[],Ds=0,Il=null,Tl=0,Rn=[],Nn=0,qi=null,Lr=1,zr="";function Gi(i,s){Ms[Ds++]=Tl,Ms[Ds++]=Il,Il=i,Tl=s}function Gm(i,s,u){Rn[Nn++]=Lr,Rn[Nn++]=zr,Rn[Nn++]=qi,qi=i;var h=Lr;i=zr;var g=32-Tt(h)-1;h&=~(1<<g),u+=1;var x=32-Tt(s)+g;if(30<x){var k=g-g%5;x=(h&(1<<k)-1).toString(32),h>>=k,g-=k,Lr=1<<32-Tt(s)+g|u<<g|h,zr=x+i}else Lr=1<<x|u<<g|h,zr=i}function Uc(i){i.return!==null&&(Gi(i,1),Gm(i,1,0))}function Hc(i){for(;i===Il;)Il=Ms[--Ds],Ms[Ds]=null,Tl=Ms[--Ds],Ms[Ds]=null;for(;i===qi;)qi=Rn[--Nn],Rn[Nn]=null,zr=Rn[--Nn],Rn[Nn]=null,Lr=Rn[--Nn],Rn[Nn]=null}var yn=null,vn=null,st=!1,Zn=null;function Km(i,s){var u=Ln(5,null,null,0);u.elementType="DELETED",u.stateNode=s,u.return=i,s=i.deletions,s===null?(i.deletions=[u],i.flags|=16):s.push(u)}function Ym(i,s){switch(i.tag){case 5:var u=i.type;return s=s.nodeType!==1||u.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(i.stateNode=s,yn=i,vn=ci(s.firstChild),!0):!1;case 6:return s=i.pendingProps===""||s.nodeType!==3?null:s,s!==null?(i.stateNode=s,yn=i,vn=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(u=qi!==null?{id:Lr,overflow:zr}:null,i.memoizedState={dehydrated:s,treeContext:u,retryLane:1073741824},u=Ln(18,null,null,0),u.stateNode=s,u.return=i,i.child=u,yn=i,vn=null,!0):!1;default:return!1}}function Wc(i){return(i.mode&1)!==0&&(i.flags&128)===0}function qc(i){if(st){var s=vn;if(s){var u=s;if(!Ym(i,s)){if(Wc(i))throw Error(n(418));s=ci(u.nextSibling);var h=yn;s&&Ym(i,s)?Km(h,u):(i.flags=i.flags&-4097|2,st=!1,yn=i)}}else{if(Wc(i))throw Error(n(418));i.flags=i.flags&-4097|2,st=!1,yn=i}}}function Xm(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;yn=i}function _l(i){if(i!==yn)return!1;if(!st)return Xm(i),st=!0,!1;var s;if((s=i.tag!==3)&&!(s=i.tag!==5)&&(s=i.type,s=s!=="head"&&s!=="body"&&!zc(i.type,i.memoizedProps)),s&&(s=vn)){if(Wc(i))throw Qm(),Error(n(418));for(;s;)Km(i,s),s=ci(s.nextSibling)}if(Xm(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"){if(s===0){vn=ci(i.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}i=i.nextSibling}vn=null}}else vn=yn?ci(i.stateNode.nextSibling):null;return!0}function Qm(){for(var i=vn;i;)i=ci(i.nextSibling)}function Ls(){vn=yn=null,st=!1}function Gc(i){Zn===null?Zn=[i]:Zn.push(i)}var Ck=O.ReactCurrentBatchConfig;function Ko(i,s,u){if(i=u.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var h=u.stateNode}if(!h)throw Error(n(147,i));var g=h,x=""+i;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===x?s.ref:(s=function(k){var R=g.refs;k===null?delete R[x]:R[x]=k},s._stringRef=x,s)}if(typeof i!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,i))}return i}function Pl(i,s){throw i=Object.prototype.toString.call(s),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i))}function Jm(i){var s=i._init;return s(i._payload)}function Zm(i){function s(B,z){if(i){var $=B.deletions;$===null?(B.deletions=[z],B.flags|=16):$.push(z)}}function u(B,z){if(!i)return null;for(;z!==null;)s(B,z),z=z.sibling;return null}function h(B,z){for(B=new Map;z!==null;)z.key!==null?B.set(z.key,z):B.set(z.index,z),z=z.sibling;return B}function g(B,z){return B=bi(B,z),B.index=0,B.sibling=null,B}function x(B,z,$){return B.index=$,i?($=B.alternate,$!==null?($=$.index,$<z?(B.flags|=2,z):$):(B.flags|=2,z)):(B.flags|=1048576,z)}function k(B){return i&&B.alternate===null&&(B.flags|=2),B}function R(B,z,$,le){return z===null||z.tag!==6?(z=Od($,B.mode,le),z.return=B,z):(z=g(z,$),z.return=B,z)}function M(B,z,$,le){var be=$.type;return be===D?ne(B,z,$.props.children,le,$.key):z!==null&&(z.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===fe&&Jm(be)===z.type)?(le=g(z,$.props),le.ref=Ko(B,z,$),le.return=B,le):(le=Zl($.type,$.key,$.props,null,B.mode,le),le.ref=Ko(B,z,$),le.return=B,le)}function W(B,z,$,le){return z===null||z.tag!==4||z.stateNode.containerInfo!==$.containerInfo||z.stateNode.implementation!==$.implementation?(z=Fd($,B.mode,le),z.return=B,z):(z=g(z,$.children||[]),z.return=B,z)}function ne(B,z,$,le,be){return z===null||z.tag!==7?(z=ts($,B.mode,le,be),z.return=B,z):(z=g(z,$),z.return=B,z)}function ie(B,z,$){if(typeof z=="string"&&z!==""||typeof z=="number")return z=Od(""+z,B.mode,$),z.return=B,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case V:return $=Zl(z.type,z.key,z.props,null,B.mode,$),$.ref=Ko(B,null,z),$.return=B,$;case N:return z=Fd(z,B.mode,$),z.return=B,z;case fe:var le=z._init;return ie(B,le(z._payload),$)}if(fr(z)||se(z))return z=ts(z,B.mode,$,null),z.return=B,z;Pl(B,z)}return null}function Z(B,z,$,le){var be=z!==null?z.key:null;if(typeof $=="string"&&$!==""||typeof $=="number")return be!==null?null:R(B,z,""+$,le);if(typeof $=="object"&&$!==null){switch($.$$typeof){case V:return $.key===be?M(B,z,$,le):null;case N:return $.key===be?W(B,z,$,le):null;case fe:return be=$._init,Z(B,z,be($._payload),le)}if(fr($)||se($))return be!==null?null:ne(B,z,$,le,null);Pl(B,$)}return null}function pe(B,z,$,le,be){if(typeof le=="string"&&le!==""||typeof le=="number")return B=B.get($)||null,R(z,B,""+le,be);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case V:return B=B.get(le.key===null?$:le.key)||null,M(z,B,le,be);case N:return B=B.get(le.key===null?$:le.key)||null,W(z,B,le,be);case fe:var Ee=le._init;return pe(B,z,$,Ee(le._payload),be)}if(fr(le)||se(le))return B=B.get($)||null,ne(z,B,le,be,null);Pl(z,le)}return null}function ve(B,z,$,le){for(var be=null,Ee=null,Ce=z,Ae=z=0,At=null;Ce!==null&&Ae<$.length;Ae++){Ce.index>Ae?(At=Ce,Ce=null):At=Ce.sibling;var Ge=Z(B,Ce,$[Ae],le);if(Ge===null){Ce===null&&(Ce=At);break}i&&Ce&&Ge.alternate===null&&s(B,Ce),z=x(Ge,z,Ae),Ee===null?be=Ge:Ee.sibling=Ge,Ee=Ge,Ce=At}if(Ae===$.length)return u(B,Ce),st&&Gi(B,Ae),be;if(Ce===null){for(;Ae<$.length;Ae++)Ce=ie(B,$[Ae],le),Ce!==null&&(z=x(Ce,z,Ae),Ee===null?be=Ce:Ee.sibling=Ce,Ee=Ce);return st&&Gi(B,Ae),be}for(Ce=h(B,Ce);Ae<$.length;Ae++)At=pe(Ce,B,Ae,$[Ae],le),At!==null&&(i&&At.alternate!==null&&Ce.delete(At.key===null?Ae:At.key),z=x(At,z,Ae),Ee===null?be=At:Ee.sibling=At,Ee=At);return i&&Ce.forEach(function(Si){return s(B,Si)}),st&&Gi(B,Ae),be}function xe(B,z,$,le){var be=se($);if(typeof be!="function")throw Error(n(150));if($=be.call($),$==null)throw Error(n(151));for(var Ee=be=null,Ce=z,Ae=z=0,At=null,Ge=$.next();Ce!==null&&!Ge.done;Ae++,Ge=$.next()){Ce.index>Ae?(At=Ce,Ce=null):At=Ce.sibling;var Si=Z(B,Ce,Ge.value,le);if(Si===null){Ce===null&&(Ce=At);break}i&&Ce&&Si.alternate===null&&s(B,Ce),z=x(Si,z,Ae),Ee===null?be=Si:Ee.sibling=Si,Ee=Si,Ce=At}if(Ge.done)return u(B,Ce),st&&Gi(B,Ae),be;if(Ce===null){for(;!Ge.done;Ae++,Ge=$.next())Ge=ie(B,Ge.value,le),Ge!==null&&(z=x(Ge,z,Ae),Ee===null?be=Ge:Ee.sibling=Ge,Ee=Ge);return st&&Gi(B,Ae),be}for(Ce=h(B,Ce);!Ge.done;Ae++,Ge=$.next())Ge=pe(Ce,B,Ae,Ge.value,le),Ge!==null&&(i&&Ge.alternate!==null&&Ce.delete(Ge.key===null?Ae:Ge.key),z=x(Ge,z,Ae),Ee===null?be=Ge:Ee.sibling=Ge,Ee=Ge);return i&&Ce.forEach(function(iE){return s(B,iE)}),st&&Gi(B,Ae),be}function gt(B,z,$,le){if(typeof $=="object"&&$!==null&&$.type===D&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case V:e:{for(var be=$.key,Ee=z;Ee!==null;){if(Ee.key===be){if(be=$.type,be===D){if(Ee.tag===7){u(B,Ee.sibling),z=g(Ee,$.props.children),z.return=B,B=z;break e}}else if(Ee.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===fe&&Jm(be)===Ee.type){u(B,Ee.sibling),z=g(Ee,$.props),z.ref=Ko(B,Ee,$),z.return=B,B=z;break e}u(B,Ee);break}else s(B,Ee);Ee=Ee.sibling}$.type===D?(z=ts($.props.children,B.mode,le,$.key),z.return=B,B=z):(le=Zl($.type,$.key,$.props,null,B.mode,le),le.ref=Ko(B,z,$),le.return=B,B=le)}return k(B);case N:e:{for(Ee=$.key;z!==null;){if(z.key===Ee)if(z.tag===4&&z.stateNode.containerInfo===$.containerInfo&&z.stateNode.implementation===$.implementation){u(B,z.sibling),z=g(z,$.children||[]),z.return=B,B=z;break e}else{u(B,z);break}else s(B,z);z=z.sibling}z=Fd($,B.mode,le),z.return=B,B=z}return k(B);case fe:return Ee=$._init,gt(B,z,Ee($._payload),le)}if(fr($))return ve(B,z,$,le);if(se($))return xe(B,z,$,le);Pl(B,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,z!==null&&z.tag===6?(u(B,z.sibling),z=g(z,$),z.return=B,B=z):(u(B,z),z=Od($,B.mode,le),z.return=B,B=z),k(B)):u(B,z)}return gt}var zs=Zm(!0),eg=Zm(!1),Al=di(null),Rl=null,Os=null,Kc=null;function Yc(){Kc=Os=Rl=null}function Xc(i){var s=Al.current;nt(Al),i._currentValue=s}function Qc(i,s,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),i===u)break;i=i.return}}function Fs(i,s){Rl=i,Kc=Os=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&s)!==0&&(sn=!0),i.firstContext=null)}function jn(i){var s=i._currentValue;if(Kc!==i)if(i={context:i,memoizedValue:s,next:null},Os===null){if(Rl===null)throw Error(n(308));Os=i,Rl.dependencies={lanes:0,firstContext:i}}else Os=Os.next=i;return s}var Ki=null;function Jc(i){Ki===null?Ki=[i]:Ki.push(i)}function tg(i,s,u,h){var g=s.interleaved;return g===null?(u.next=u,Jc(s)):(u.next=g.next,g.next=u),s.interleaved=u,Or(i,h)}function Or(i,s){i.lanes|=s;var u=i.alternate;for(u!==null&&(u.lanes|=s),u=i,i=i.return;i!==null;)i.childLanes|=s,u=i.alternate,u!==null&&(u.childLanes|=s),u=i,i=i.return;return u.tag===3?u.stateNode:null}var pi=!1;function Zc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ng(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Fr(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function mi(i,s,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(We&2)!==0){var g=h.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),h.pending=s,Or(i,u)}return g=h.interleaved,g===null?(s.next=s,Jc(h)):(s.next=g.next,g.next=s),h.interleaved=s,Or(i,u)}function Nl(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,Bi(i,u)}}function rg(i,s){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var k={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};x===null?g=x=k:x=x.next=k,u=u.next}while(u!==null);x===null?g=x=s:x=x.next=s}else g=x=s;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:h.shared,effects:h.effects},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}function jl(i,s,u,h){var g=i.updateQueue;pi=!1;var x=g.firstBaseUpdate,k=g.lastBaseUpdate,R=g.shared.pending;if(R!==null){g.shared.pending=null;var M=R,W=M.next;M.next=null,k===null?x=W:k.next=W,k=M;var ne=i.alternate;ne!==null&&(ne=ne.updateQueue,R=ne.lastBaseUpdate,R!==k&&(R===null?ne.firstBaseUpdate=W:R.next=W,ne.lastBaseUpdate=M))}if(x!==null){var ie=g.baseState;k=0,ne=W=M=null,R=x;do{var Z=R.lane,pe=R.eventTime;if((h&Z)===Z){ne!==null&&(ne=ne.next={eventTime:pe,lane:0,tag:R.tag,payload:R.payload,callback:R.callback,next:null});e:{var ve=i,xe=R;switch(Z=s,pe=u,xe.tag){case 1:if(ve=xe.payload,typeof ve=="function"){ie=ve.call(pe,ie,Z);break e}ie=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=xe.payload,Z=typeof ve=="function"?ve.call(pe,ie,Z):ve,Z==null)break e;ie=_({},ie,Z);break e;case 2:pi=!0}}R.callback!==null&&R.lane!==0&&(i.flags|=64,Z=g.effects,Z===null?g.effects=[R]:Z.push(R))}else pe={eventTime:pe,lane:Z,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ne===null?(W=ne=pe,M=ie):ne=ne.next=pe,k|=Z;if(R=R.next,R===null){if(R=g.shared.pending,R===null)break;Z=R,R=Z.next,Z.next=null,g.lastBaseUpdate=Z,g.shared.pending=null}}while(!0);if(ne===null&&(M=ie),g.baseState=M,g.firstBaseUpdate=W,g.lastBaseUpdate=ne,s=g.shared.interleaved,s!==null){g=s;do k|=g.lane,g=g.next;while(g!==s)}else x===null&&(g.shared.lanes=0);Qi|=k,i.lanes=k,i.memoizedState=ie}}function ig(i,s,u){if(i=s.effects,s.effects=null,i!==null)for(s=0;s<i.length;s++){var h=i[s],g=h.callback;if(g!==null){if(h.callback=null,h=u,typeof g!="function")throw Error(n(191,g));g.call(h)}}}var Yo={},gr=di(Yo),Xo=di(Yo),Qo=di(Yo);function Yi(i){if(i===Yo)throw Error(n(174));return i}function ed(i,s){switch(Je(Qo,s),Je(Xo,i),Je(gr,Yo),i=s.nodeType,i){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:ue(null,"");break;default:i=i===8?s.parentNode:s,s=i.namespaceURI||null,i=i.tagName,s=ue(s,i)}nt(gr),Je(gr,s)}function Vs(){nt(gr),nt(Xo),nt(Qo)}function sg(i){Yi(Qo.current);var s=Yi(gr.current),u=ue(s,i.type);s!==u&&(Je(Xo,i),Je(gr,u))}function td(i){Xo.current===i&&(nt(gr),nt(Xo))}var ut=di(0);function Ml(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var nd=[];function rd(){for(var i=0;i<nd.length;i++)nd[i]._workInProgressVersionPrimary=null;nd.length=0}var Dl=O.ReactCurrentDispatcher,id=O.ReactCurrentBatchConfig,Xi=0,ct=null,kt=null,_t=null,Ll=!1,Jo=!1,Zo=0,Ik=0;function Vt(){throw Error(n(321))}function sd(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Jn(i[u],s[u]))return!1;return!0}function od(i,s,u,h,g,x){if(Xi=x,ct=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Dl.current=i===null||i.memoizedState===null?Ak:Rk,i=u(h,g),Jo){x=0;do{if(Jo=!1,Zo=0,25<=x)throw Error(n(301));x+=1,_t=kt=null,s.updateQueue=null,Dl.current=Nk,i=u(h,g)}while(Jo)}if(Dl.current=Fl,s=kt!==null&&kt.next!==null,Xi=0,_t=kt=ct=null,Ll=!1,s)throw Error(n(300));return i}function ad(){var i=Zo!==0;return Zo=0,i}function yr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?ct.memoizedState=_t=i:_t=_t.next=i,_t}function Mn(){if(kt===null){var i=ct.alternate;i=i!==null?i.memoizedState:null}else i=kt.next;var s=_t===null?ct.memoizedState:_t.next;if(s!==null)_t=s,kt=i;else{if(i===null)throw Error(n(310));kt=i,i={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},_t===null?ct.memoizedState=_t=i:_t=_t.next=i}return _t}function ea(i,s){return typeof s=="function"?s(i):s}function ld(i){var s=Mn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=i;var h=kt,g=h.baseQueue,x=u.pending;if(x!==null){if(g!==null){var k=g.next;g.next=x.next,x.next=k}h.baseQueue=g=x,u.pending=null}if(g!==null){x=g.next,h=h.baseState;var R=k=null,M=null,W=x;do{var ne=W.lane;if((Xi&ne)===ne)M!==null&&(M=M.next={lane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),h=W.hasEagerState?W.eagerState:i(h,W.action);else{var ie={lane:ne,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null};M===null?(R=M=ie,k=h):M=M.next=ie,ct.lanes|=ne,Qi|=ne}W=W.next}while(W!==null&&W!==x);M===null?k=h:M.next=R,Jn(h,s.memoizedState)||(sn=!0),s.memoizedState=h,s.baseState=k,s.baseQueue=M,u.lastRenderedState=h}if(i=u.interleaved,i!==null){g=i;do x=g.lane,ct.lanes|=x,Qi|=x,g=g.next;while(g!==i)}else g===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function ud(i){var s=Mn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=i;var h=u.dispatch,g=u.pending,x=s.memoizedState;if(g!==null){u.pending=null;var k=g=g.next;do x=i(x,k.action),k=k.next;while(k!==g);Jn(x,s.memoizedState)||(sn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,h]}function og(){}function ag(i,s){var u=ct,h=Mn(),g=s(),x=!Jn(h.memoizedState,g);if(x&&(h.memoizedState=g,sn=!0),h=h.queue,cd(cg.bind(null,u,h,i),[i]),h.getSnapshot!==s||x||_t!==null&&_t.memoizedState.tag&1){if(u.flags|=2048,ta(9,ug.bind(null,u,h,g,s),void 0,null),Pt===null)throw Error(n(349));(Xi&30)!==0||lg(u,s,g)}return g}function lg(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=ct.updateQueue,s===null?(s={lastEffect:null,stores:null},ct.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function ug(i,s,u,h){s.value=u,s.getSnapshot=h,dg(s)&&fg(i)}function cg(i,s,u){return u(function(){dg(s)&&fg(i)})}function dg(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Jn(i,u)}catch{return!0}}function fg(i){var s=Or(i,1);s!==null&&rr(s,i,1,-1)}function hg(i){var s=yr();return typeof i=="function"&&(i=i()),s.memoizedState=s.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:i},s.queue=i,i=i.dispatch=Pk.bind(null,ct,i),[s.memoizedState,i]}function ta(i,s,u,h){return i={tag:i,create:s,destroy:u,deps:h,next:null},s=ct.updateQueue,s===null?(s={lastEffect:null,stores:null},ct.updateQueue=s,s.lastEffect=i.next=i):(u=s.lastEffect,u===null?s.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,s.lastEffect=i)),i}function pg(){return Mn().memoizedState}function zl(i,s,u,h){var g=yr();ct.flags|=i,g.memoizedState=ta(1|s,u,void 0,h===void 0?null:h)}function Ol(i,s,u,h){var g=Mn();h=h===void 0?null:h;var x=void 0;if(kt!==null){var k=kt.memoizedState;if(x=k.destroy,h!==null&&sd(h,k.deps)){g.memoizedState=ta(s,u,x,h);return}}ct.flags|=i,g.memoizedState=ta(1|s,u,x,h)}function mg(i,s){return zl(8390656,8,i,s)}function cd(i,s){return Ol(2048,8,i,s)}function gg(i,s){return Ol(4,2,i,s)}function yg(i,s){return Ol(4,4,i,s)}function vg(i,s){if(typeof s=="function")return i=i(),s(i),function(){s(null)};if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function xg(i,s,u){return u=u!=null?u.concat([i]):null,Ol(4,4,vg.bind(null,s,i),u)}function dd(){}function wg(i,s){var u=Mn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&sd(s,h[1])?h[0]:(u.memoizedState=[i,s],i)}function bg(i,s){var u=Mn();s=s===void 0?null:s;var h=u.memoizedState;return h!==null&&s!==null&&sd(s,h[1])?h[0]:(i=i(),u.memoizedState=[i,s],i)}function Sg(i,s,u){return(Xi&21)===0?(i.baseState&&(i.baseState=!1,sn=!0),i.memoizedState=u):(Jn(u,s)||(u=Pn(),ct.lanes|=u,Qi|=u,i.baseState=!0),s)}function Tk(i,s){var u=Ue;Ue=u!==0&&4>u?u:4,i(!0);var h=id.transition;id.transition={};try{i(!1),s()}finally{Ue=u,id.transition=h}}function kg(){return Mn().memoizedState}function _k(i,s,u){var h=xi(i);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},Eg(i))Cg(s,u);else if(u=tg(i,s,u,h),u!==null){var g=Qt();rr(u,i,h,g),Ig(u,s,h)}}function Pk(i,s,u){var h=xi(i),g={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(Eg(i))Cg(s,g);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var k=s.lastRenderedState,R=x(k,u);if(g.hasEagerState=!0,g.eagerState=R,Jn(R,k)){var M=s.interleaved;M===null?(g.next=g,Jc(s)):(g.next=M.next,M.next=g),s.interleaved=g;return}}catch{}finally{}u=tg(i,s,g,h),u!==null&&(g=Qt(),rr(u,i,h,g),Ig(u,s,h))}}function Eg(i){var s=i.alternate;return i===ct||s!==null&&s===ct}function Cg(i,s){Jo=Ll=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function Ig(i,s,u){if((u&4194240)!==0){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,Bi(i,u)}}var Fl={readContext:jn,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},Ak={readContext:jn,useCallback:function(i,s){return yr().memoizedState=[i,s===void 0?null:s],i},useContext:jn,useEffect:mg,useImperativeHandle:function(i,s,u){return u=u!=null?u.concat([i]):null,zl(4194308,4,vg.bind(null,s,i),u)},useLayoutEffect:function(i,s){return zl(4194308,4,i,s)},useInsertionEffect:function(i,s){return zl(4,2,i,s)},useMemo:function(i,s){var u=yr();return s=s===void 0?null:s,i=i(),u.memoizedState=[i,s],i},useReducer:function(i,s,u){var h=yr();return s=u!==void 0?u(s):s,h.memoizedState=h.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},h.queue=i,i=i.dispatch=_k.bind(null,ct,i),[h.memoizedState,i]},useRef:function(i){var s=yr();return i={current:i},s.memoizedState=i},useState:hg,useDebugValue:dd,useDeferredValue:function(i){return yr().memoizedState=i},useTransition:function(){var i=hg(!1),s=i[0];return i=Tk.bind(null,i[1]),yr().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,u){var h=ct,g=yr();if(st){if(u===void 0)throw Error(n(407));u=u()}else{if(u=s(),Pt===null)throw Error(n(349));(Xi&30)!==0||lg(h,s,u)}g.memoizedState=u;var x={value:u,getSnapshot:s};return g.queue=x,mg(cg.bind(null,h,x,i),[i]),h.flags|=2048,ta(9,ug.bind(null,h,x,u,s),void 0,null),u},useId:function(){var i=yr(),s=Pt.identifierPrefix;if(st){var u=zr,h=Lr;u=(h&~(1<<32-Tt(h)-1)).toString(32)+u,s=":"+s+"R"+u,u=Zo++,0<u&&(s+="H"+u.toString(32)),s+=":"}else u=Ik++,s=":"+s+"r"+u.toString(32)+":";return i.memoizedState=s},unstable_isNewReconciler:!1},Rk={readContext:jn,useCallback:wg,useContext:jn,useEffect:cd,useImperativeHandle:xg,useInsertionEffect:gg,useLayoutEffect:yg,useMemo:bg,useReducer:ld,useRef:pg,useState:function(){return ld(ea)},useDebugValue:dd,useDeferredValue:function(i){var s=Mn();return Sg(s,kt.memoizedState,i)},useTransition:function(){var i=ld(ea)[0],s=Mn().memoizedState;return[i,s]},useMutableSource:og,useSyncExternalStore:ag,useId:kg,unstable_isNewReconciler:!1},Nk={readContext:jn,useCallback:wg,useContext:jn,useEffect:cd,useImperativeHandle:xg,useInsertionEffect:gg,useLayoutEffect:yg,useMemo:bg,useReducer:ud,useRef:pg,useState:function(){return ud(ea)},useDebugValue:dd,useDeferredValue:function(i){var s=Mn();return kt===null?s.memoizedState=i:Sg(s,kt.memoizedState,i)},useTransition:function(){var i=ud(ea)[0],s=Mn().memoizedState;return[i,s]},useMutableSource:og,useSyncExternalStore:ag,useId:kg,unstable_isNewReconciler:!1};function er(i,s){if(i&&i.defaultProps){s=_({},s),i=i.defaultProps;for(var u in i)s[u]===void 0&&(s[u]=i[u]);return s}return s}function fd(i,s,u,h){s=i.memoizedState,u=u(h,s),u=u==null?s:_({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Vl={isMounted:function(i){return(i=i._reactInternals)?hn(i)===i:!1},enqueueSetState:function(i,s,u){i=i._reactInternals;var h=Qt(),g=xi(i),x=Fr(h,g);x.payload=s,u!=null&&(x.callback=u),s=mi(i,x,g),s!==null&&(rr(s,i,g,h),Nl(s,i,g))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var h=Qt(),g=xi(i),x=Fr(h,g);x.tag=1,x.payload=s,u!=null&&(x.callback=u),s=mi(i,x,g),s!==null&&(rr(s,i,g,h),Nl(s,i,g))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=Qt(),h=xi(i),g=Fr(u,h);g.tag=2,s!=null&&(g.callback=s),s=mi(i,g,h),s!==null&&(rr(s,i,h,u),Nl(s,i,h))}};function Tg(i,s,u,h,g,x,k){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,x,k):s.prototype&&s.prototype.isPureReactComponent?!Bo(u,h)||!Bo(g,x):!0}function _g(i,s,u){var h=!1,g=fi,x=s.contextType;return typeof x=="object"&&x!==null?x=jn(x):(g=rn(s)?Wi:Ft.current,h=s.contextTypes,x=(h=h!=null)?js(i,g):fi),s=new s(u,x),i.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Vl,i.stateNode=s,s._reactInternals=i,h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=x),s}function Pg(i,s,u,h){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==i&&Vl.enqueueReplaceState(s,s.state,null)}function hd(i,s,u,h){var g=i.stateNode;g.props=u,g.state=i.memoizedState,g.refs={},Zc(i);var x=s.contextType;typeof x=="object"&&x!==null?g.context=jn(x):(x=rn(s)?Wi:Ft.current,g.context=js(i,x)),g.state=i.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(fd(i,s,x,u),g.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(s=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),s!==g.state&&Vl.enqueueReplaceState(g,g.state,null),jl(i,u,g,h),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function Bs(i,s){try{var u="",h=s;do u+=Te(h),h=h.return;while(h);var g=u}catch(x){g=`
39
39
  Error generating stack: `+x.message+`
40
- `+x.stack}return{value:i,source:s,stack:g,digest:null}}function pd(i,s,u){return{value:i,source:null,stack:u??null,digest:s??null}}function md(i,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var jk=typeof WeakMap=="function"?WeakMap:Map;function Ag(i,s,u){u=Fr(-1,u),u.tag=3,u.payload={element:null};var h=s.value;return u.callback=function(){Gl||(Gl=!0,Ad=h),md(i,s)},u}function Rg(i,s,u){u=Fr(-1,u),u.tag=3;var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var g=s.value;u.payload=function(){return h(g)},u.callback=function(){md(i,s)}}var x=i.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){md(i,s),typeof h!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})}),u}function Ng(i,s,u){var h=i.pingCache;if(h===null){h=i.pingCache=new jk;var g=new Set;h.set(s,g)}else g=h.get(s),g===void 0&&(g=new Set,h.set(s,g));g.has(u)||(g.add(u),i=Gk.bind(null,i,s,u),s.then(i,i))}function jg(i){do{var s;if((s=i.tag===13)&&(s=i.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return i;i=i.return}while(i!==null);return null}function Mg(i,s,u,h,g){return(i.mode&1)===0?(i===s?i.flags|=65536:(i.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(s=Fr(-1,1),s.tag=2,mi(u,s,1))),u.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var Mk=O.ReactCurrentOwner,on=!1;function Qt(i,s,u,h){s.child=i===null?eg(s,null,u,h):zs(s,i.child,u,h)}function Dg(i,s,u,h,g){u=u.render;var x=s.ref;return Fs(s,g),h=od(i,s,u,h,x,g),u=ad(),i!==null&&!on?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Vr(i,s,g)):(ot&&u&&Uc(s),s.flags|=1,Qt(i,s,h,g),s.child)}function Lg(i,s,u,h,g){if(i===null){var x=u.type;return typeof x=="function"&&!zd(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=x,zg(i,s,x,h,g)):(i=Zl(u.type,null,h,s,s.mode,g),i.ref=s.ref,i.return=s,s.child=i)}if(x=i.child,(i.lanes&g)===0){var k=x.memoizedProps;if(u=u.compare,u=u!==null?u:Bo,u(k,h)&&i.ref===s.ref)return Vr(i,s,g)}return s.flags|=1,i=bi(x,h),i.ref=s.ref,i.return=s,s.child=i}function zg(i,s,u,h,g){if(i!==null){var x=i.memoizedProps;if(Bo(x,h)&&i.ref===s.ref)if(on=!1,s.pendingProps=h=x,(i.lanes&g)!==0)(i.flags&131072)!==0&&(on=!0);else return s.lanes=i.lanes,Vr(i,s,g)}return gd(i,s,u,h,g)}function Og(i,s,u){var h=s.pendingProps,g=h.children,x=i!==null?i.memoizedState:null;if(h.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(Us,wn),wn|=u;else{if((u&1073741824)===0)return i=x!==null?x.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:i,cachePool:null,transitions:null},s.updateQueue=null,Ze(Us,wn),wn|=i,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=x!==null?x.baseLanes:u,Ze(Us,wn),wn|=h}else x!==null?(h=x.baseLanes|u,s.memoizedState=null):h=u,Ze(Us,wn),wn|=h;return Qt(i,s,g,u),s.child}function Fg(i,s){var u=s.ref;(i===null&&u!==null||i!==null&&i.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function gd(i,s,u,h,g){var x=sn(u)?Wi:Vt.current;return x=js(s,x),Fs(s,g),u=od(i,s,u,h,x,g),h=ad(),i!==null&&!on?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Vr(i,s,g)):(ot&&h&&Uc(s),s.flags|=1,Qt(i,s,u,g),s.child)}function Vg(i,s,u,h,g){if(sn(u)){var x=!0;El(s)}else x=!1;if(Fs(s,g),s.stateNode===null)$l(i,s),_g(s,u,h),hd(s,u,h,g),h=!0;else if(i===null){var k=s.stateNode,R=s.memoizedProps;k.props=R;var M=k.context,W=u.contextType;typeof W=="object"&&W!==null?W=jn(W):(W=sn(u)?Wi:Vt.current,W=js(s,W));var ne=u.getDerivedStateFromProps,ie=typeof ne=="function"||typeof k.getSnapshotBeforeUpdate=="function";ie||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(R!==h||M!==W)&&Pg(s,k,h,W),pi=!1;var Z=s.memoizedState;k.state=Z,jl(s,h,k,g),M=s.memoizedState,R!==h||Z!==M||rn.current||pi?(typeof ne=="function"&&(fd(s,u,ne,h),M=s.memoizedState),(R=pi||Tg(s,u,R,h,Z,M,W))?(ie||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(s.flags|=4194308)):(typeof k.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=M),k.props=h,k.state=M,k.context=W,h=R):(typeof k.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{k=s.stateNode,ng(i,s),R=s.memoizedProps,W=s.type===s.elementType?R:er(s.type,R),k.props=W,ie=s.pendingProps,Z=k.context,M=u.contextType,typeof M=="object"&&M!==null?M=jn(M):(M=sn(u)?Wi:Vt.current,M=js(s,M));var pe=u.getDerivedStateFromProps;(ne=typeof pe=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(R!==ie||Z!==M)&&Pg(s,k,h,M),pi=!1,Z=s.memoizedState,k.state=Z,jl(s,h,k,g);var ye=s.memoizedState;R!==ie||Z!==ye||rn.current||pi?(typeof pe=="function"&&(fd(s,u,pe,h),ye=s.memoizedState),(W=pi||Tg(s,u,W,h,Z,ye,M)||!1)?(ne||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(h,ye,M),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(h,ye,M)),typeof k.componentDidUpdate=="function"&&(s.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof k.componentDidUpdate!="function"||R===i.memoizedProps&&Z===i.memoizedState||(s.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&Z===i.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=ye),k.props=h,k.state=ye,k.context=M,h=W):(typeof k.componentDidUpdate!="function"||R===i.memoizedProps&&Z===i.memoizedState||(s.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&Z===i.memoizedState||(s.flags|=1024),h=!1)}return yd(i,s,u,h,x,g)}function yd(i,s,u,h,g,x){Fg(i,s);var k=(s.flags&128)!==0;if(!h&&!k)return g&&Wm(s,u,!1),Vr(i,s,x);h=s.stateNode,Mk.current=s;var R=k&&typeof u.getDerivedStateFromError!="function"?null:h.render();return s.flags|=1,i!==null&&k?(s.child=zs(s,i.child,null,x),s.child=zs(s,null,R,x)):Qt(i,s,R,x),s.memoizedState=h.state,g&&Wm(s,u,!0),s.child}function Bg(i){var s=i.stateNode;s.pendingContext?Um(i,s.pendingContext,s.pendingContext!==s.context):s.context&&Um(i,s.context,!1),ed(i,s.containerInfo)}function $g(i,s,u,h,g){return Ls(),Gc(g),s.flags|=256,Qt(i,s,u,h),s.child}var vd={dehydrated:null,treeContext:null,retryLane:0};function xd(i){return{baseLanes:i,cachePool:null,transitions:null}}function Ug(i,s,u){var h=s.pendingProps,g=ct.current,x=!1,k=(s.flags&128)!==0,R;if((R=k)||(R=i!==null&&i.memoizedState===null?!1:(g&2)!==0),R?(x=!0,s.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),Ze(ct,g&1),i===null)return qc(s),i=s.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((s.mode&1)===0?s.lanes=1:i.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(k=h.children,i=h.fallback,x?(h=s.mode,x=s.child,k={mode:"hidden",children:k},(h&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=k):x=eu(k,h,0,null),i=ts(i,h,u,null),x.return=s,i.return=s,x.sibling=i,s.child=x,s.child.memoizedState=xd(u),s.memoizedState=vd,i):wd(s,k));if(g=i.memoizedState,g!==null&&(R=g.dehydrated,R!==null))return Dk(i,s,k,h,R,g,u);if(x){x=h.fallback,k=s.mode,g=i.child,R=g.sibling;var M={mode:"hidden",children:h.children};return(k&1)===0&&s.child!==g?(h=s.child,h.childLanes=0,h.pendingProps=M,s.deletions=null):(h=bi(g,M),h.subtreeFlags=g.subtreeFlags&14680064),R!==null?x=bi(R,x):(x=ts(x,k,u,null),x.flags|=2),x.return=s,h.return=s,h.sibling=x,s.child=h,h=x,x=s.child,k=i.child.memoizedState,k=k===null?xd(u):{baseLanes:k.baseLanes|u,cachePool:null,transitions:k.transitions},x.memoizedState=k,x.childLanes=i.childLanes&~u,s.memoizedState=vd,h}return x=i.child,i=x.sibling,h=bi(x,{mode:"visible",children:h.children}),(s.mode&1)===0&&(h.lanes=u),h.return=s,h.sibling=null,i!==null&&(u=s.deletions,u===null?(s.deletions=[i],s.flags|=16):u.push(i)),s.child=h,s.memoizedState=null,h}function wd(i,s){return s=eu({mode:"visible",children:s},i.mode,0,null),s.return=i,i.child=s}function Bl(i,s,u,h){return h!==null&&Gc(h),zs(s,i.child,null,u),i=wd(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Dk(i,s,u,h,g,x,k){if(u)return s.flags&256?(s.flags&=-257,h=pd(Error(n(422))),Bl(i,s,k,h)):s.memoizedState!==null?(s.child=i.child,s.flags|=128,null):(x=h.fallback,g=s.mode,h=eu({mode:"visible",children:h.children},g,0,null),x=ts(x,g,k,null),x.flags|=2,h.return=s,x.return=s,h.sibling=x,s.child=h,(s.mode&1)!==0&&zs(s,i.child,null,k),s.child.memoizedState=xd(k),s.memoizedState=vd,x);if((s.mode&1)===0)return Bl(i,s,k,null);if(g.data==="$!"){if(h=g.nextSibling&&g.nextSibling.dataset,h)var R=h.dgst;return h=R,x=Error(n(419)),h=pd(x,h,void 0),Bl(i,s,k,h)}if(R=(k&i.childLanes)!==0,on||R){if(h=At,h!==null){switch(k&-k){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(h.suspendedLanes|k))!==0?0:g,g!==0&&g!==x.retryLane&&(x.retryLane=g,Or(i,g),rr(h,i,g,-1))}return Ld(),h=pd(Error(n(421))),Bl(i,s,k,h)}return g.data==="$?"?(s.flags|=128,s.child=i.child,s=Kk.bind(null,i),g._reactRetry=s,null):(i=x.treeContext,xn=ci(g.nextSibling),vn=s,ot=!0,Zn=null,i!==null&&(Rn[Nn++]=Lr,Rn[Nn++]=zr,Rn[Nn++]=qi,Lr=i.id,zr=i.overflow,qi=s),s=wd(s,h.children),s.flags|=4096,s)}function Hg(i,s,u){i.lanes|=s;var h=i.alternate;h!==null&&(h.lanes|=s),Qc(i.return,s,u)}function bd(i,s,u,h,g){var x=i.memoizedState;x===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=h,x.tail=u,x.tailMode=g)}function Wg(i,s,u){var h=s.pendingProps,g=h.revealOrder,x=h.tail;if(Qt(i,s,h.children,u),h=ct.current,(h&2)!==0)h=h&1|2,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Hg(i,u,s);else if(i.tag===19)Hg(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}if(Ze(ct,h),(s.mode&1)===0)s.memoizedState=null;else switch(g){case"forwards":for(u=s.child,g=null;u!==null;)i=u.alternate,i!==null&&Ml(i)===null&&(g=u),u=u.sibling;u=g,u===null?(g=s.child,s.child=null):(g=u.sibling,u.sibling=null),bd(s,!1,g,u,x);break;case"backwards":for(u=null,g=s.child,s.child=null;g!==null;){if(i=g.alternate,i!==null&&Ml(i)===null){s.child=g;break}i=g.sibling,g.sibling=u,u=g,g=i}bd(s,!0,u,null,x);break;case"together":bd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function $l(i,s){(s.mode&1)===0&&i!==null&&(i.alternate=null,s.alternate=null,s.flags|=2)}function Vr(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),Qi|=s.lanes,(u&s.childLanes)===0)return null;if(i!==null&&s.child!==i.child)throw Error(n(153));if(s.child!==null){for(i=s.child,u=bi(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=bi(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function Lk(i,s,u){switch(s.tag){case 3:Bg(s),Ls();break;case 5:sg(s);break;case 1:sn(s.type)&&El(s);break;case 4:ed(s,s.stateNode.containerInfo);break;case 10:var h=s.type._context,g=s.memoizedProps.value;Ze(Al,h._currentValue),h._currentValue=g;break;case 13:if(h=s.memoizedState,h!==null)return h.dehydrated!==null?(Ze(ct,ct.current&1),s.flags|=128,null):(u&s.child.childLanes)!==0?Ug(i,s,u):(Ze(ct,ct.current&1),i=Vr(i,s,u),i!==null?i.sibling:null);Ze(ct,ct.current&1);break;case 19:if(h=(u&s.childLanes)!==0,(i.flags&128)!==0){if(h)return Wg(i,s,u);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Ze(ct,ct.current),h)break;return null;case 22:case 23:return s.lanes=0,Og(i,s,u)}return Vr(i,s,u)}var qg,Sd,Gg,Kg;qg=function(i,s){for(var u=s.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},Sd=function(){},Gg=function(i,s,u,h){var g=i.memoizedProps;if(g!==h){i=s.stateNode,Yi(gr.current);var x=null;switch(u){case"input":g=Yr(i,g),h=Yr(i,h),x=[];break;case"select":g=_({},g,{value:void 0}),h=_({},h,{value:void 0}),x=[];break;case"textarea":g=Yn(i,g),h=Yn(i,h),x=[];break;default:typeof g.onClick!="function"&&typeof h.onClick=="function"&&(i.onclick=bl)}tt(u,h);var k;u=null;for(W in g)if(!h.hasOwnProperty(W)&&g.hasOwnProperty(W)&&g[W]!=null)if(W==="style"){var R=g[W];for(k in R)R.hasOwnProperty(k)&&(u||(u={}),u[k]="")}else W!=="dangerouslySetInnerHTML"&&W!=="children"&&W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&W!=="autoFocus"&&(o.hasOwnProperty(W)?x||(x=[]):(x=x||[]).push(W,null));for(W in h){var M=h[W];if(R=g!=null?g[W]:void 0,h.hasOwnProperty(W)&&M!==R&&(M!=null||R!=null))if(W==="style")if(R){for(k in R)!R.hasOwnProperty(k)||M&&M.hasOwnProperty(k)||(u||(u={}),u[k]="");for(k in M)M.hasOwnProperty(k)&&R[k]!==M[k]&&(u||(u={}),u[k]=M[k])}else u||(x||(x=[]),x.push(W,u)),u=M;else W==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,R=R?R.__html:void 0,M!=null&&R!==M&&(x=x||[]).push(W,M)):W==="children"?typeof M!="string"&&typeof M!="number"||(x=x||[]).push(W,""+M):W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&(o.hasOwnProperty(W)?(M!=null&&W==="onScroll"&&nt("scroll",i),x||R===M||(x=[])):(x=x||[]).push(W,M))}u&&(x=x||[]).push("style",u);var W=x;(s.updateQueue=W)&&(s.flags|=4)}},Kg=function(i,s,u,h){u!==h&&(s.flags|=4)};function na(i,s){if(!ot)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function $t(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(s)for(var g=i.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags&14680064,h|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=h,i.childLanes=u,s}function zk(i,s,u){var h=s.pendingProps;switch(Hc(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $t(s),null;case 1:return sn(s.type)&&kl(),$t(s),null;case 3:return h=s.stateNode,Vs(),rt(rn),rt(Vt),rd(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(_l(s)?s.flags|=4:i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Zn!==null&&(jd(Zn),Zn=null))),Sd(i,s),$t(s),null;case 5:td(s);var g=Yi(Qo.current);if(u=s.type,i!==null&&s.stateNode!=null)Gg(i,s,u,h,g),i.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!h){if(s.stateNode===null)throw Error(n(166));return $t(s),null}if(i=Yi(gr.current),_l(s)){h=s.stateNode,u=s.type;var x=s.memoizedProps;switch(h[mr]=s,h[qo]=x,i=(s.mode&1)!==0,u){case"dialog":nt("cancel",h),nt("close",h);break;case"iframe":case"object":case"embed":nt("load",h);break;case"video":case"audio":for(g=0;g<Uo.length;g++)nt(Uo[g],h);break;case"source":nt("error",h);break;case"img":case"image":case"link":nt("error",h),nt("load",h);break;case"details":nt("toggle",h);break;case"input":Xr(h,x),nt("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!x.multiple},nt("invalid",h);break;case"textarea":Jr(h,x),nt("invalid",h)}tt(u,x),g=null;for(var k in x)if(x.hasOwnProperty(k)){var R=x[k];k==="children"?typeof R=="string"?h.textContent!==R&&(x.suppressHydrationWarning!==!0&&wl(h.textContent,R,i),g=["children",R]):typeof R=="number"&&h.textContent!==""+R&&(x.suppressHydrationWarning!==!0&&wl(h.textContent,R,i),g=["children",""+R]):o.hasOwnProperty(k)&&R!=null&&k==="onScroll"&&nt("scroll",h)}switch(u){case"input":Ye(h),Li(h,x,!0);break;case"textarea":Ye(h),ei(h);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(h.onclick=bl)}h=g,s.updateQueue=h,h!==null&&(s.flags|=4)}else{k=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=K(u)),i==="http://www.w3.org/1999/xhtml"?u==="script"?(i=k.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof h.is=="string"?i=k.createElement(u,{is:h.is}):(i=k.createElement(u),u==="select"&&(k=i,h.multiple?k.multiple=!0:h.size&&(k.size=h.size))):i=k.createElementNS(i,u),i[mr]=s,i[qo]=h,qg(i,s,!1,!1),s.stateNode=i;e:{switch(k=Yt(u,h),u){case"dialog":nt("cancel",i),nt("close",i),g=h;break;case"iframe":case"object":case"embed":nt("load",i),g=h;break;case"video":case"audio":for(g=0;g<Uo.length;g++)nt(Uo[g],i);g=h;break;case"source":nt("error",i),g=h;break;case"img":case"image":case"link":nt("error",i),nt("load",i),g=h;break;case"details":nt("toggle",i),g=h;break;case"input":Xr(i,h),g=Yr(i,h),nt("invalid",i);break;case"option":g=h;break;case"select":i._wrapperState={wasMultiple:!!h.multiple},g=_({},h,{value:void 0}),nt("invalid",i);break;case"textarea":Jr(i,h),g=Yn(i,h),nt("invalid",i);break;default:g=h}tt(u,g),R=g;for(x in R)if(R.hasOwnProperty(x)){var M=R[x];x==="style"?Ot(i,M):x==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,M!=null&&ze(i,M)):x==="children"?typeof M=="string"?(u!=="textarea"||M!=="")&&$e(i,M):typeof M=="number"&&$e(i,""+M):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(o.hasOwnProperty(x)?M!=null&&x==="onScroll"&&nt("scroll",i):M!=null&&T(i,x,M,k))}switch(u){case"input":Ye(i),Li(i,h,!1);break;case"textarea":Ye(i),ei(i);break;case"option":h.value!=null&&i.setAttribute("value",""+de(h.value));break;case"select":i.multiple=!!h.multiple,x=h.value,x!=null?Cn(i,!!h.multiple,x,!1):h.defaultValue!=null&&Cn(i,!!h.multiple,h.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=bl)}switch(u){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return $t(s),null;case 6:if(i&&s.stateNode!=null)Kg(i,s,i.memoizedProps,h);else{if(typeof h!="string"&&s.stateNode===null)throw Error(n(166));if(u=Yi(Qo.current),Yi(gr.current),_l(s)){if(h=s.stateNode,u=s.memoizedProps,h[mr]=s,(x=h.nodeValue!==u)&&(i=vn,i!==null))switch(i.tag){case 3:wl(h.nodeValue,u,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&wl(h.nodeValue,u,(i.mode&1)!==0)}x&&(s.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[mr]=s,s.stateNode=h}return $t(s),null;case 13:if(rt(ct),h=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(ot&&xn!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Qm(),Ls(),s.flags|=98560,x=!1;else if(x=_l(s),h!==null&&h.dehydrated!==null){if(i===null){if(!x)throw Error(n(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[mr]=s}else Ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;$t(s),x=!1}else Zn!==null&&(jd(Zn),Zn=null),x=!0;if(!x)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=u,s):(h=h!==null,h!==(i!==null&&i.memoizedState!==null)&&h&&(s.child.flags|=8192,(s.mode&1)!==0&&(i===null||(ct.current&1)!==0?Ct===0&&(Ct=3):Ld())),s.updateQueue!==null&&(s.flags|=4),$t(s),null);case 4:return Vs(),Sd(i,s),i===null&&Ho(s.stateNode.containerInfo),$t(s),null;case 10:return Xc(s.type._context),$t(s),null;case 17:return sn(s.type)&&kl(),$t(s),null;case 19:if(rt(ct),x=s.memoizedState,x===null)return $t(s),null;if(h=(s.flags&128)!==0,k=x.rendering,k===null)if(h)na(x,!1);else{if(Ct!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(k=Ml(i),k!==null){for(s.flags|=128,na(x,!1),h=k.updateQueue,h!==null&&(s.updateQueue=h,s.flags|=4),s.subtreeFlags=0,h=u,u=s.child;u!==null;)x=u,i=h,x.flags&=14680066,k=x.alternate,k===null?(x.childLanes=0,x.lanes=i,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=k.childLanes,x.lanes=k.lanes,x.child=k.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=k.memoizedProps,x.memoizedState=k.memoizedState,x.updateQueue=k.updateQueue,x.type=k.type,i=k.dependencies,x.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),u=u.sibling;return Ze(ct,ct.current&1|2),s.child}i=i.sibling}x.tail!==null&&Ne()>Hs&&(s.flags|=128,h=!0,na(x,!1),s.lanes=4194304)}else{if(!h)if(i=Ml(k),i!==null){if(s.flags|=128,h=!0,u=i.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),na(x,!0),x.tail===null&&x.tailMode==="hidden"&&!k.alternate&&!ot)return $t(s),null}else 2*Ne()-x.renderingStartTime>Hs&&u!==1073741824&&(s.flags|=128,h=!0,na(x,!1),s.lanes=4194304);x.isBackwards?(k.sibling=s.child,s.child=k):(u=x.last,u!==null?u.sibling=k:s.child=k,x.last=k)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=Ne(),s.sibling=null,u=ct.current,Ze(ct,h?u&1|2:u&1),s):($t(s),null);case 22:case 23:return Dd(),h=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==h&&(s.flags|=8192),h&&(s.mode&1)!==0?(wn&1073741824)!==0&&($t(s),s.subtreeFlags&6&&(s.flags|=8192)):$t(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function Ok(i,s){switch(Hc(s),s.tag){case 1:return sn(s.type)&&kl(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Vs(),rt(rn),rt(Vt),rd(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 5:return td(s),null;case 13:if(rt(ct),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return rt(ct),null;case 4:return Vs(),null;case 10:return Xc(s.type._context),null;case 22:case 23:return Dd(),null;case 24:return null;default:return null}}var Ul=!1,Ut=!1,Fk=typeof WeakSet=="function"?WeakSet:Set,ge=null;function $s(i,s){var u=i.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(h){mt(i,s,h)}else u.current=null}function kd(i,s,u){try{u()}catch(h){mt(i,s,h)}}var Yg=!1;function Vk(i,s){if(Dc=ul,i=Tm(),Tc(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var k=0,R=-1,M=-1,W=0,ne=0,ie=i,Z=null;t:for(;;){for(var pe;ie!==u||g!==0&&ie.nodeType!==3||(R=k+g),ie!==x||h!==0&&ie.nodeType!==3||(M=k+h),ie.nodeType===3&&(k+=ie.nodeValue.length),(pe=ie.firstChild)!==null;)Z=ie,ie=pe;for(;;){if(ie===i)break t;if(Z===u&&++W===g&&(R=k),Z===x&&++ne===h&&(M=k),(pe=ie.nextSibling)!==null)break;ie=Z,Z=ie.parentNode}ie=pe}u=R===-1||M===-1?null:{start:R,end:M}}else u=null}u=u||{start:0,end:0}}else u=null;for(Lc={focusedElem:i,selectionRange:u},ul=!1,ge=s;ge!==null;)if(s=ge,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,ge=i;else for(;ge!==null;){s=ge;try{var ye=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var ve=ye.memoizedProps,yt=ye.memoizedState,B=s.stateNode,z=B.getSnapshotBeforeUpdate(s.elementType===s.type?ve:er(s.type,ve),yt);B.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var $=s.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(le){mt(s,s.return,le)}if(i=s.sibling,i!==null){i.return=s.return,ge=i;break}ge=s.return}return ye=Yg,Yg=!1,ye}function ra(i,s,u){var h=s.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var g=h=h.next;do{if((g.tag&i)===i){var x=g.destroy;g.destroy=void 0,x!==void 0&&kd(s,u,x)}g=g.next}while(g!==h)}}function Hl(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&i)===i){var h=u.create;u.destroy=h()}u=u.next}while(u!==s)}}function Ed(i){var s=i.ref;if(s!==null){var u=i.stateNode;switch(i.tag){case 5:i=u;break;default:i=u}typeof s=="function"?s(i):s.current=i}}function Xg(i){var s=i.alternate;s!==null&&(i.alternate=null,Xg(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[mr],delete s[qo],delete s[Vc],delete s[Sk],delete s[kk])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Qg(i){return i.tag===5||i.tag===3||i.tag===4}function Jg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Qg(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Cd(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?u.nodeType===8?u.parentNode.insertBefore(i,s):u.insertBefore(i,s):(u.nodeType===8?(s=u.parentNode,s.insertBefore(i,u)):(s=u,s.appendChild(i)),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=bl));else if(h!==4&&(i=i.child,i!==null))for(Cd(i,s,u),i=i.sibling;i!==null;)Cd(i,s,u),i=i.sibling}function Id(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(h!==4&&(i=i.child,i!==null))for(Id(i,s,u),i=i.sibling;i!==null;)Id(i,s,u),i=i.sibling}var Mt=null,tr=!1;function gi(i,s,u){for(u=u.child;u!==null;)Zg(i,s,u),u=u.sibling}function Zg(i,s,u){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(nn,u)}catch{}switch(u.tag){case 5:Ut||$s(u,s);case 6:var h=Mt,g=tr;Mt=null,gi(i,s,u),Mt=h,tr=g,Mt!==null&&(tr?(i=Mt,u=u.stateNode,i.nodeType===8?i.parentNode.removeChild(u):i.removeChild(u)):Mt.removeChild(u.stateNode));break;case 18:Mt!==null&&(tr?(i=Mt,u=u.stateNode,i.nodeType===8?Fc(i.parentNode,u):i.nodeType===1&&Fc(i,u),Do(i)):Fc(Mt,u.stateNode));break;case 4:h=Mt,g=tr,Mt=u.stateNode.containerInfo,tr=!0,gi(i,s,u),Mt=h,tr=g;break;case 0:case 11:case 14:case 15:if(!Ut&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){g=h=h.next;do{var x=g,k=x.destroy;x=x.tag,k!==void 0&&((x&2)!==0||(x&4)!==0)&&kd(u,s,k),g=g.next}while(g!==h)}gi(i,s,u);break;case 1:if(!Ut&&($s(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(R){mt(u,s,R)}gi(i,s,u);break;case 21:gi(i,s,u);break;case 22:u.mode&1?(Ut=(h=Ut)||u.memoizedState!==null,gi(i,s,u),Ut=h):gi(i,s,u);break;default:gi(i,s,u)}}function ey(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var u=i.stateNode;u===null&&(u=i.stateNode=new Fk),s.forEach(function(h){var g=Yk.bind(null,i,h);u.has(h)||(u.add(h),h.then(g,g))})}}function nr(i,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];try{var x=i,k=s,R=k;e:for(;R!==null;){switch(R.tag){case 5:Mt=R.stateNode,tr=!1;break e;case 3:Mt=R.stateNode.containerInfo,tr=!0;break e;case 4:Mt=R.stateNode.containerInfo,tr=!0;break e}R=R.return}if(Mt===null)throw Error(n(160));Zg(x,k,g),Mt=null,tr=!1;var M=g.alternate;M!==null&&(M.return=null),g.return=null}catch(W){mt(g,s,W)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)ty(s,i),s=s.sibling}function ty(i,s){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(nr(s,i),vr(i),h&4){try{ra(3,i,i.return),Hl(3,i)}catch(ve){mt(i,i.return,ve)}try{ra(5,i,i.return)}catch(ve){mt(i,i.return,ve)}}break;case 1:nr(s,i),vr(i),h&512&&u!==null&&$s(u,u.return);break;case 5:if(nr(s,i),vr(i),h&512&&u!==null&&$s(u,u.return),i.flags&32){var g=i.stateNode;try{$e(g,"")}catch(ve){mt(i,i.return,ve)}}if(h&4&&(g=i.stateNode,g!=null)){var x=i.memoizedProps,k=u!==null?u.memoizedProps:x,R=i.type,M=i.updateQueue;if(i.updateQueue=null,M!==null)try{R==="input"&&x.type==="radio"&&x.name!=null&&Di(g,x),Yt(R,k);var W=Yt(R,x);for(k=0;k<M.length;k+=2){var ne=M[k],ie=M[k+1];ne==="style"?Ot(g,ie):ne==="dangerouslySetInnerHTML"?ze(g,ie):ne==="children"?$e(g,ie):T(g,ne,ie,W)}switch(R){case"input":tn(g,x);break;case"textarea":Zr(g,x);break;case"select":var Z=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!x.multiple;var pe=x.value;pe!=null?Cn(g,!!x.multiple,pe,!1):Z!==!!x.multiple&&(x.defaultValue!=null?Cn(g,!!x.multiple,x.defaultValue,!0):Cn(g,!!x.multiple,x.multiple?[]:"",!1))}g[qo]=x}catch(ve){mt(i,i.return,ve)}}break;case 6:if(nr(s,i),vr(i),h&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,x=i.memoizedProps;try{g.nodeValue=x}catch(ve){mt(i,i.return,ve)}}break;case 3:if(nr(s,i),vr(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Do(s.containerInfo)}catch(ve){mt(i,i.return,ve)}break;case 4:nr(s,i),vr(i);break;case 13:nr(s,i),vr(i),g=i.child,g.flags&8192&&(x=g.memoizedState!==null,g.stateNode.isHidden=x,!x||g.alternate!==null&&g.alternate.memoizedState!==null||(Pd=Ne())),h&4&&ey(i);break;case 22:if(ne=u!==null&&u.memoizedState!==null,i.mode&1?(Ut=(W=Ut)||ne,nr(s,i),Ut=W):nr(s,i),vr(i),h&8192){if(W=i.memoizedState!==null,(i.stateNode.isHidden=W)&&!ne&&(i.mode&1)!==0)for(ge=i,ne=i.child;ne!==null;){for(ie=ge=ne;ge!==null;){switch(Z=ge,pe=Z.child,Z.tag){case 0:case 11:case 14:case 15:ra(4,Z,Z.return);break;case 1:$s(Z,Z.return);var ye=Z.stateNode;if(typeof ye.componentWillUnmount=="function"){h=Z,u=Z.return;try{s=h,ye.props=s.memoizedProps,ye.state=s.memoizedState,ye.componentWillUnmount()}catch(ve){mt(h,u,ve)}}break;case 5:$s(Z,Z.return);break;case 22:if(Z.memoizedState!==null){iy(ie);continue}}pe!==null?(pe.return=Z,ge=pe):iy(ie)}ne=ne.sibling}e:for(ne=null,ie=i;;){if(ie.tag===5){if(ne===null){ne=ie;try{g=ie.stateNode,W?(x=g.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(R=ie.stateNode,M=ie.memoizedProps.style,k=M!=null&&M.hasOwnProperty("display")?M.display:null,R.style.display=zt("display",k))}catch(ve){mt(i,i.return,ve)}}}else if(ie.tag===6){if(ne===null)try{ie.stateNode.nodeValue=W?"":ie.memoizedProps}catch(ve){mt(i,i.return,ve)}}else if((ie.tag!==22&&ie.tag!==23||ie.memoizedState===null||ie===i)&&ie.child!==null){ie.child.return=ie,ie=ie.child;continue}if(ie===i)break e;for(;ie.sibling===null;){if(ie.return===null||ie.return===i)break e;ne===ie&&(ne=null),ie=ie.return}ne===ie&&(ne=null),ie.sibling.return=ie.return,ie=ie.sibling}}break;case 19:nr(s,i),vr(i),h&4&&ey(i);break;case 21:break;default:nr(s,i),vr(i)}}function vr(i){var s=i.flags;if(s&2){try{e:{for(var u=i.return;u!==null;){if(Qg(u)){var h=u;break e}u=u.return}throw Error(n(160))}switch(h.tag){case 5:var g=h.stateNode;h.flags&32&&($e(g,""),h.flags&=-33);var x=Jg(i);Id(i,x,g);break;case 3:case 4:var k=h.stateNode.containerInfo,R=Jg(i);Cd(i,R,k);break;default:throw Error(n(161))}}catch(M){mt(i,i.return,M)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Bk(i,s,u){ge=i,ny(i)}function ny(i,s,u){for(var h=(i.mode&1)!==0;ge!==null;){var g=ge,x=g.child;if(g.tag===22&&h){var k=g.memoizedState!==null||Ul;if(!k){var R=g.alternate,M=R!==null&&R.memoizedState!==null||Ut;R=Ul;var W=Ut;if(Ul=k,(Ut=M)&&!W)for(ge=g;ge!==null;)k=ge,M=k.child,k.tag===22&&k.memoizedState!==null?sy(g):M!==null?(M.return=k,ge=M):sy(g);for(;x!==null;)ge=x,ny(x),x=x.sibling;ge=g,Ul=R,Ut=W}ry(i)}else(g.subtreeFlags&8772)!==0&&x!==null?(x.return=g,ge=x):ry(i)}}function ry(i){for(;ge!==null;){var s=ge;if((s.flags&8772)!==0){var u=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:Ut||Hl(5,s);break;case 1:var h=s.stateNode;if(s.flags&4&&!Ut)if(u===null)h.componentDidMount();else{var g=s.elementType===s.type?u.memoizedProps:er(s.type,u.memoizedProps);h.componentDidUpdate(g,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var x=s.updateQueue;x!==null&&ig(s,x,h);break;case 3:var k=s.updateQueue;if(k!==null){if(u=null,s.child!==null)switch(s.child.tag){case 5:u=s.child.stateNode;break;case 1:u=s.child.stateNode}ig(s,k,u)}break;case 5:var R=s.stateNode;if(u===null&&s.flags&4){u=R;var M=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":M.autoFocus&&u.focus();break;case"img":M.src&&(u.src=M.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var W=s.alternate;if(W!==null){var ne=W.memoizedState;if(ne!==null){var ie=ne.dehydrated;ie!==null&&Do(ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Ut||s.flags&512&&Ed(s)}catch(Z){mt(s,s.return,Z)}}if(s===i){ge=null;break}if(u=s.sibling,u!==null){u.return=s.return,ge=u;break}ge=s.return}}function iy(i){for(;ge!==null;){var s=ge;if(s===i){ge=null;break}var u=s.sibling;if(u!==null){u.return=s.return,ge=u;break}ge=s.return}}function sy(i){for(;ge!==null;){var s=ge;try{switch(s.tag){case 0:case 11:case 15:var u=s.return;try{Hl(4,s)}catch(M){mt(s,u,M)}break;case 1:var h=s.stateNode;if(typeof h.componentDidMount=="function"){var g=s.return;try{h.componentDidMount()}catch(M){mt(s,g,M)}}var x=s.return;try{Ed(s)}catch(M){mt(s,x,M)}break;case 5:var k=s.return;try{Ed(s)}catch(M){mt(s,k,M)}}}catch(M){mt(s,s.return,M)}if(s===i){ge=null;break}var R=s.sibling;if(R!==null){R.return=s.return,ge=R;break}ge=s.return}}var $k=Math.ceil,Wl=O.ReactCurrentDispatcher,Td=O.ReactCurrentOwner,Dn=O.ReactCurrentBatchConfig,qe=0,At=null,vt=null,Dt=0,wn=0,Us=di(0),Ct=0,ia=null,Qi=0,ql=0,_d=0,sa=null,an=null,Pd=0,Hs=1/0,Br=null,Gl=!1,Ad=null,yi=null,Kl=!1,vi=null,Yl=0,oa=0,Rd=null,Xl=-1,Ql=0;function Jt(){return(qe&6)!==0?Ne():Xl!==-1?Xl:Xl=Ne()}function xi(i){return(i.mode&1)===0?1:(qe&2)!==0&&Dt!==0?Dt&-Dt:Ck.transition!==null?(Ql===0&&(Ql=Pn()),Ql):(i=He,i!==0||(i=window.event,i=i===void 0?16:am(i.type)),i)}function rr(i,s,u,h){if(50<oa)throw oa=0,Rd=null,Error(n(185));Qn(i,u,h),((qe&2)===0||i!==At)&&(i===At&&((qe&2)===0&&(ql|=u),Ct===4&&wi(i,Dt)),ln(i,h),u===1&&qe===0&&(s.mode&1)===0&&(Hs=Ne()+500,Cl&&hi()))}function ln(i,s){var u=i.callbackNode;Po(i,s);var h=Nr(i,i===At?Dt:0);if(h===0)u!==null&&Xe(u),i.callbackNode=null,i.callbackPriority=0;else if(s=h&-h,i.callbackPriority!==s){if(u!=null&&Xe(u),s===1)i.tag===0?Ek(ay.bind(null,i)):qm(ay.bind(null,i)),wk(function(){(qe&6)===0&&hi()}),u=null;else{switch(pr(h)){case 1:u=ut;break;case 4:u=pt;break;case 16:u=Xt;break;case 536870912:u=Tt;break;default:u=Xt}u=my(u,oy.bind(null,i))}i.callbackPriority=s,i.callbackNode=u}}function oy(i,s){if(Xl=-1,Ql=0,(qe&6)!==0)throw Error(n(327));var u=i.callbackNode;if(Ws()&&i.callbackNode!==u)return null;var h=Nr(i,i===At?Dt:0);if(h===0)return null;if((h&30)!==0||(h&i.expiredLanes)!==0||s)s=Jl(i,h);else{s=h;var g=qe;qe|=2;var x=uy();(At!==i||Dt!==s)&&(Br=null,Hs=Ne()+500,Zi(i,s));do try{Wk();break}catch(R){ly(i,R)}while(!0);Yc(),Wl.current=x,qe=g,vt!==null?s=0:(At=null,Dt=0,s=Ct)}if(s!==0){if(s===2&&(g=Ft(i),g!==0&&(h=g,s=Nd(i,g))),s===1)throw u=ia,Zi(i,0),wi(i,h),ln(i,Ne()),u;if(s===6)wi(i,h);else{if(g=i.current.alternate,(h&30)===0&&!Uk(g)&&(s=Jl(i,h),s===2&&(x=Ft(i),x!==0&&(h=x,s=Nd(i,x))),s===1))throw u=ia,Zi(i,0),wi(i,h),ln(i,Ne()),u;switch(i.finishedWork=g,i.finishedLanes=h,s){case 0:case 1:throw Error(n(345));case 2:es(i,an,Br);break;case 3:if(wi(i,h),(h&130023424)===h&&(s=Pd+500-Ne(),10<s)){if(Nr(i,0)!==0)break;if(g=i.suspendedLanes,(g&h)!==h){Jt(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Oc(es.bind(null,i,an,Br),s);break}es(i,an,Br);break;case 4:if(wi(i,h),(h&4194240)===h)break;for(s=i.eventTimes,g=-1;0<h;){var k=31-_t(h);x=1<<k,k=s[k],k>g&&(g=k),h&=~x}if(h=g,h=Ne()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*$k(h/1960))-h,10<h){i.timeoutHandle=Oc(es.bind(null,i,an,Br),h);break}es(i,an,Br);break;case 5:es(i,an,Br);break;default:throw Error(n(329))}}}return ln(i,Ne()),i.callbackNode===u?oy.bind(null,i):null}function Nd(i,s){var u=sa;return i.current.memoizedState.isDehydrated&&(Zi(i,s).flags|=256),i=Jl(i,s),i!==2&&(s=an,an=u,s!==null&&jd(s)),i}function jd(i){an===null?an=i:an.push.apply(an,i)}function Uk(i){for(var s=i;;){if(s.flags&16384){var u=s.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var h=0;h<u.length;h++){var g=u[h],x=g.getSnapshot;g=g.value;try{if(!Jn(x(),g))return!1}catch{return!1}}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function wi(i,s){for(s&=~_d,s&=~ql,i.suspendedLanes|=s,i.pingedLanes&=~s,i=i.expirationTimes;0<s;){var u=31-_t(s),h=1<<u;i[u]=-1,s&=~h}}function ay(i){if((qe&6)!==0)throw Error(n(327));Ws();var s=Nr(i,0);if((s&1)===0)return ln(i,Ne()),null;var u=Jl(i,s);if(i.tag!==0&&u===2){var h=Ft(i);h!==0&&(s=h,u=Nd(i,h))}if(u===1)throw u=ia,Zi(i,0),wi(i,s),ln(i,Ne()),u;if(u===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=s,es(i,an,Br),ln(i,Ne()),null}function Md(i,s){var u=qe;qe|=1;try{return i(s)}finally{qe=u,qe===0&&(Hs=Ne()+500,Cl&&hi())}}function Ji(i){vi!==null&&vi.tag===0&&(qe&6)===0&&Ws();var s=qe;qe|=1;var u=Dn.transition,h=He;try{if(Dn.transition=null,He=1,i)return i()}finally{He=h,Dn.transition=u,qe=s,(qe&6)===0&&hi()}}function Dd(){wn=Us.current,rt(Us)}function Zi(i,s){i.finishedWork=null,i.finishedLanes=0;var u=i.timeoutHandle;if(u!==-1&&(i.timeoutHandle=-1,xk(u)),vt!==null)for(u=vt.return;u!==null;){var h=u;switch(Hc(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&kl();break;case 3:Vs(),rt(rn),rt(Vt),rd();break;case 5:td(h);break;case 4:Vs();break;case 13:rt(ct);break;case 19:rt(ct);break;case 10:Xc(h.type._context);break;case 22:case 23:Dd()}u=u.return}if(At=i,vt=i=bi(i.current,null),Dt=wn=s,Ct=0,ia=null,_d=ql=Qi=0,an=sa=null,Ki!==null){for(s=0;s<Ki.length;s++)if(u=Ki[s],h=u.interleaved,h!==null){u.interleaved=null;var g=h.next,x=u.pending;if(x!==null){var k=x.next;x.next=g,h.next=k}u.pending=h}Ki=null}return i}function ly(i,s){do{var u=vt;try{if(Yc(),Dl.current=Fl,Ll){for(var h=dt.memoizedState;h!==null;){var g=h.queue;g!==null&&(g.pending=null),h=h.next}Ll=!1}if(Xi=0,Pt=Et=dt=null,Jo=!1,Zo=0,Td.current=null,u===null||u.return===null){Ct=1,ia=s,vt=null;break}e:{var x=i,k=u.return,R=u,M=s;if(s=Dt,R.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){var W=M,ne=R,ie=ne.tag;if((ne.mode&1)===0&&(ie===0||ie===11||ie===15)){var Z=ne.alternate;Z?(ne.updateQueue=Z.updateQueue,ne.memoizedState=Z.memoizedState,ne.lanes=Z.lanes):(ne.updateQueue=null,ne.memoizedState=null)}var pe=jg(k);if(pe!==null){pe.flags&=-257,Mg(pe,k,R,x,s),pe.mode&1&&Ng(x,W,s),s=pe,M=W;var ye=s.updateQueue;if(ye===null){var ve=new Set;ve.add(M),s.updateQueue=ve}else ye.add(M);break e}else{if((s&1)===0){Ng(x,W,s),Ld();break e}M=Error(n(426))}}else if(ot&&R.mode&1){var yt=jg(k);if(yt!==null){(yt.flags&65536)===0&&(yt.flags|=256),Mg(yt,k,R,x,s),Gc(Bs(M,R));break e}}x=M=Bs(M,R),Ct!==4&&(Ct=2),sa===null?sa=[x]:sa.push(x),x=k;do{switch(x.tag){case 3:x.flags|=65536,s&=-s,x.lanes|=s;var B=Ag(x,M,s);rg(x,B);break e;case 1:R=M;var z=x.type,$=x.stateNode;if((x.flags&128)===0&&(typeof z.getDerivedStateFromError=="function"||$!==null&&typeof $.componentDidCatch=="function"&&(yi===null||!yi.has($)))){x.flags|=65536,s&=-s,x.lanes|=s;var le=Rg(x,R,s);rg(x,le);break e}}x=x.return}while(x!==null)}dy(u)}catch(we){s=we,vt===u&&u!==null&&(vt=u=u.return);continue}break}while(!0)}function uy(){var i=Wl.current;return Wl.current=Fl,i===null?Fl:i}function Ld(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),At===null||(Qi&268435455)===0&&(ql&268435455)===0||wi(At,Dt)}function Jl(i,s){var u=qe;qe|=2;var h=uy();(At!==i||Dt!==s)&&(Br=null,Zi(i,s));do try{Hk();break}catch(g){ly(i,g)}while(!0);if(Yc(),qe=u,Wl.current=h,vt!==null)throw Error(n(261));return At=null,Dt=0,Ct}function Hk(){for(;vt!==null;)cy(vt)}function Wk(){for(;vt!==null&&!Fe();)cy(vt)}function cy(i){var s=py(i.alternate,i,wn);i.memoizedProps=i.pendingProps,s===null?dy(i):vt=s,Td.current=null}function dy(i){var s=i;do{var u=s.alternate;if(i=s.return,(s.flags&32768)===0){if(u=zk(u,s,wn),u!==null){vt=u;return}}else{if(u=Ok(u,s),u!==null){u.flags&=32767,vt=u;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Ct=6,vt=null;return}}if(s=s.sibling,s!==null){vt=s;return}vt=s=i}while(s!==null);Ct===0&&(Ct=5)}function es(i,s,u){var h=He,g=Dn.transition;try{Dn.transition=null,He=1,qk(i,s,u,h)}finally{Dn.transition=g,He=h}return null}function qk(i,s,u,h){do Ws();while(vi!==null);if((qe&6)!==0)throw Error(n(327));u=i.finishedWork;var g=i.finishedLanes;if(u===null)return null;if(i.finishedWork=null,i.finishedLanes=0,u===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var x=u.lanes|u.childLanes;if(bs(i,x),i===At&&(vt=At=null,Dt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Kl||(Kl=!0,my(Xt,function(){return Ws(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=Dn.transition,Dn.transition=null;var k=He;He=1;var R=qe;qe|=4,Td.current=null,Vk(i,u),ty(u,i),fk(Lc),ul=!!Dc,Lc=Dc=null,i.current=u,Bk(u),st(),qe=R,He=k,Dn.transition=x}else i.current=u;if(Kl&&(Kl=!1,vi=i,Yl=g),x=i.pendingLanes,x===0&&(yi=null),xs(u.stateNode),ln(i,Ne()),s!==null)for(h=i.onRecoverableError,u=0;u<s.length;u++)g=s[u],h(g.value,{componentStack:g.stack,digest:g.digest});if(Gl)throw Gl=!1,i=Ad,Ad=null,i;return(Yl&1)!==0&&i.tag!==0&&Ws(),x=i.pendingLanes,(x&1)!==0?i===Rd?oa++:(oa=0,Rd=i):oa=0,hi(),null}function Ws(){if(vi!==null){var i=pr(Yl),s=Dn.transition,u=He;try{if(Dn.transition=null,He=16>i?16:i,vi===null)var h=!1;else{if(i=vi,vi=null,Yl=0,(qe&6)!==0)throw Error(n(331));var g=qe;for(qe|=4,ge=i.current;ge!==null;){var x=ge,k=x.child;if((ge.flags&16)!==0){var R=x.deletions;if(R!==null){for(var M=0;M<R.length;M++){var W=R[M];for(ge=W;ge!==null;){var ne=ge;switch(ne.tag){case 0:case 11:case 15:ra(8,ne,x)}var ie=ne.child;if(ie!==null)ie.return=ne,ge=ie;else for(;ge!==null;){ne=ge;var Z=ne.sibling,pe=ne.return;if(Xg(ne),ne===W){ge=null;break}if(Z!==null){Z.return=pe,ge=Z;break}ge=pe}}}var ye=x.alternate;if(ye!==null){var ve=ye.child;if(ve!==null){ye.child=null;do{var yt=ve.sibling;ve.sibling=null,ve=yt}while(ve!==null)}}ge=x}}if((x.subtreeFlags&2064)!==0&&k!==null)k.return=x,ge=k;else e:for(;ge!==null;){if(x=ge,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:ra(9,x,x.return)}var B=x.sibling;if(B!==null){B.return=x.return,ge=B;break e}ge=x.return}}var z=i.current;for(ge=z;ge!==null;){k=ge;var $=k.child;if((k.subtreeFlags&2064)!==0&&$!==null)$.return=k,ge=$;else e:for(k=z;ge!==null;){if(R=ge,(R.flags&2048)!==0)try{switch(R.tag){case 0:case 11:case 15:Hl(9,R)}}catch(we){mt(R,R.return,we)}if(R===k){ge=null;break e}var le=R.sibling;if(le!==null){le.return=R.return,ge=le;break e}ge=R.return}}if(qe=g,hi(),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(nn,i)}catch{}h=!0}return h}finally{He=u,Dn.transition=s}}return!1}function fy(i,s,u){s=Bs(u,s),s=Ag(i,s,1),i=mi(i,s,1),s=Jt(),i!==null&&(Qn(i,1,s),ln(i,s))}function mt(i,s,u){if(i.tag===3)fy(i,i,u);else for(;s!==null;){if(s.tag===3){fy(s,i,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(yi===null||!yi.has(h))){i=Bs(u,i),i=Rg(s,i,1),s=mi(s,i,1),i=Jt(),s!==null&&(Qn(s,1,i),ln(s,i));break}}s=s.return}}function Gk(i,s,u){var h=i.pingCache;h!==null&&h.delete(s),s=Jt(),i.pingedLanes|=i.suspendedLanes&u,At===i&&(Dt&u)===u&&(Ct===4||Ct===3&&(Dt&130023424)===Dt&&500>Ne()-Pd?Zi(i,0):_d|=u),ln(i,s)}function hy(i,s){s===0&&((i.mode&1)===0?s=1:(s=Ge,Ge<<=1,(Ge&130023424)===0&&(Ge=4194304)));var u=Jt();i=Or(i,s),i!==null&&(Qn(i,s,u),ln(i,u))}function Kk(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),hy(i,u)}function Yk(i,s){var u=0;switch(i.tag){case 13:var h=i.stateNode,g=i.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=i.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(s),hy(i,u)}var py;py=function(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps||rn.current)on=!0;else{if((i.lanes&u)===0&&(s.flags&128)===0)return on=!1,Lk(i,s,u);on=(i.flags&131072)!==0}else on=!1,ot&&(s.flags&1048576)!==0&&Gm(s,Tl,s.index);switch(s.lanes=0,s.tag){case 2:var h=s.type;$l(i,s),i=s.pendingProps;var g=js(s,Vt.current);Fs(s,u),g=od(null,s,h,i,g,u);var x=ad();return s.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,sn(h)?(x=!0,El(s)):x=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Zc(s),g.updater=Vl,s.stateNode=g,g._reactInternals=s,hd(s,h,i,u),s=yd(null,s,h,!0,x,u)):(s.tag=0,ot&&x&&Uc(s),Qt(null,s,g,u),s=s.child),s;case 16:h=s.elementType;e:{switch($l(i,s),i=s.pendingProps,g=h._init,h=g(h._payload),s.type=h,g=s.tag=Qk(h),i=er(h,i),g){case 0:s=gd(null,s,h,i,u);break e;case 1:s=Vg(null,s,h,i,u);break e;case 11:s=Dg(null,s,h,i,u);break e;case 14:s=Lg(null,s,h,er(h.type,i),u);break e}throw Error(n(306,h,""))}return s;case 0:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:er(h,g),gd(i,s,h,g,u);case 1:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:er(h,g),Vg(i,s,h,g,u);case 3:e:{if(Bg(s),i===null)throw Error(n(387));h=s.pendingProps,x=s.memoizedState,g=x.element,ng(i,s),jl(s,h,null,u);var k=s.memoizedState;if(h=k.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){g=Bs(Error(n(423)),s),s=$g(i,s,h,u,g);break e}else if(h!==g){g=Bs(Error(n(424)),s),s=$g(i,s,h,u,g);break e}else for(xn=ci(s.stateNode.containerInfo.firstChild),vn=s,ot=!0,Zn=null,u=eg(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ls(),h===g){s=Vr(i,s,u);break e}Qt(i,s,h,u)}s=s.child}return s;case 5:return sg(s),i===null&&qc(s),h=s.type,g=s.pendingProps,x=i!==null?i.memoizedProps:null,k=g.children,zc(h,g)?k=null:x!==null&&zc(h,x)&&(s.flags|=32),Fg(i,s),Qt(i,s,k,u),s.child;case 6:return i===null&&qc(s),null;case 13:return Ug(i,s,u);case 4:return ed(s,s.stateNode.containerInfo),h=s.pendingProps,i===null?s.child=zs(s,null,h,u):Qt(i,s,h,u),s.child;case 11:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:er(h,g),Dg(i,s,h,g,u);case 7:return Qt(i,s,s.pendingProps,u),s.child;case 8:return Qt(i,s,s.pendingProps.children,u),s.child;case 12:return Qt(i,s,s.pendingProps.children,u),s.child;case 10:e:{if(h=s.type._context,g=s.pendingProps,x=s.memoizedProps,k=g.value,Ze(Al,h._currentValue),h._currentValue=k,x!==null)if(Jn(x.value,k)){if(x.children===g.children&&!rn.current){s=Vr(i,s,u);break e}}else for(x=s.child,x!==null&&(x.return=s);x!==null;){var R=x.dependencies;if(R!==null){k=x.child;for(var M=R.firstContext;M!==null;){if(M.context===h){if(x.tag===1){M=Fr(-1,u&-u),M.tag=2;var W=x.updateQueue;if(W!==null){W=W.shared;var ne=W.pending;ne===null?M.next=M:(M.next=ne.next,ne.next=M),W.pending=M}}x.lanes|=u,M=x.alternate,M!==null&&(M.lanes|=u),Qc(x.return,u,s),R.lanes|=u;break}M=M.next}}else if(x.tag===10)k=x.type===s.type?null:x.child;else if(x.tag===18){if(k=x.return,k===null)throw Error(n(341));k.lanes|=u,R=k.alternate,R!==null&&(R.lanes|=u),Qc(k,u,s),k=x.sibling}else k=x.child;if(k!==null)k.return=x;else for(k=x;k!==null;){if(k===s){k=null;break}if(x=k.sibling,x!==null){x.return=k.return,k=x;break}k=k.return}x=k}Qt(i,s,g.children,u),s=s.child}return s;case 9:return g=s.type,h=s.pendingProps.children,Fs(s,u),g=jn(g),h=h(g),s.flags|=1,Qt(i,s,h,u),s.child;case 14:return h=s.type,g=er(h,s.pendingProps),g=er(h.type,g),Lg(i,s,h,g,u);case 15:return zg(i,s,s.type,s.pendingProps,u);case 17:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:er(h,g),$l(i,s),s.tag=1,sn(h)?(i=!0,El(s)):i=!1,Fs(s,u),_g(s,h,g),hd(s,h,g,u),yd(null,s,h,!0,i,u);case 19:return Wg(i,s,u);case 22:return Og(i,s,u)}throw Error(n(156,s.tag))};function my(i,s){return xe(i,s)}function Xk(i,s,u,h){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(i,s,u,h){return new Xk(i,s,u,h)}function zd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Qk(i){if(typeof i=="function")return zd(i)?1:0;if(i!=null){if(i=i.$$typeof,i===G)return 11;if(i===re)return 14}return 2}function bi(i,s){var u=i.alternate;return u===null?(u=Ln(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&14680064,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u}function Zl(i,s,u,h,g,x){var k=2;if(h=i,typeof i=="function")zd(i)&&(k=1);else if(typeof i=="string")k=5;else e:switch(i){case D:return ts(u.children,g,x,s);case H:k=8,g|=8;break;case ee:return i=Ln(12,u,s,g|2),i.elementType=ee,i.lanes=x,i;case X:return i=Ln(13,u,s,g),i.elementType=X,i.lanes=x,i;case Q:return i=Ln(19,u,s,g),i.elementType=Q,i.lanes=x,i;case oe:return eu(u,g,x,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case L:k=10;break e;case te:k=9;break e;case G:k=11;break e;case re:k=14;break e;case fe:k=16,h=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return s=Ln(k,u,s,g),s.elementType=i,s.type=h,s.lanes=x,s}function ts(i,s,u,h){return i=Ln(7,i,h,s),i.lanes=u,i}function eu(i,s,u,h){return i=Ln(22,i,h,s),i.elementType=oe,i.lanes=u,i.stateNode={isHidden:!1},i}function Od(i,s,u){return i=Ln(6,i,null,s),i.lanes=u,i}function Fd(i,s,u){return s=Ln(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function Jk(i,s,u,h,g){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=An(0),this.expirationTimes=An(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=An(0),this.identifierPrefix=h,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Vd(i,s,u,h,g,x,k,R,M){return i=new Jk(i,s,u,R,M),s===1?(s=1,x===!0&&(s|=8)):s=0,x=Ln(3,null,null,s),i.current=x,x.stateNode=i,x.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zc(x),i}function Zk(i,s,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:h==null?null:""+h,children:i,containerInfo:s,implementation:u}}function gy(i){if(!i)return fi;i=i._reactInternals;e:{if(pn(i)!==i||i.tag!==1)throw Error(n(170));var s=i;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(sn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(i.tag===1){var u=i.type;if(sn(u))return Hm(i,u,s)}return s}function yy(i,s,u,h,g,x,k,R,M){return i=Vd(u,h,!0,i,g,x,k,R,M),i.context=gy(null),u=i.current,h=Jt(),g=xi(u),x=Fr(h,g),x.callback=s??null,mi(u,x,g),i.current.lanes=g,Qn(i,g,h),ln(i,h),i}function tu(i,s,u,h){var g=s.current,x=Jt(),k=xi(g);return u=gy(u),s.context===null?s.context=u:s.pendingContext=u,s=Fr(x,k),s.payload={element:i},h=h===void 0?null:h,h!==null&&(s.callback=h),i=mi(g,s,k),i!==null&&(rr(i,g,k,x),Nl(i,g,k)),k}function nu(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function vy(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Bd(i,s){vy(i,s),(i=i.alternate)&&vy(i,s)}function eE(){return null}var xy=typeof reportError=="function"?reportError:function(i){console.error(i)};function $d(i){this._internalRoot=i}ru.prototype.render=$d.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(n(409));tu(i,s,null,null)},ru.prototype.unmount=$d.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;Ji(function(){tu(null,i,null,null)}),s[Mr]=null}};function ru(i){this._internalRoot=i}ru.prototype.unstable_scheduleHydration=function(i){if(i){var s=$i();i={blockedOn:null,target:i,priority:s};for(var u=0;u<ai.length&&s!==0&&s<ai[u].priority;u++);ai.splice(u,0,i),u===0&&sm(i)}};function Ud(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function iu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function wy(){}function tE(i,s,u,h,g){if(g){if(typeof h=="function"){var x=h;h=function(){var W=nu(k);x.call(W)}}var k=yy(s,h,i,0,null,!1,!1,"",wy);return i._reactRootContainer=k,i[Mr]=k.current,Ho(i.nodeType===8?i.parentNode:i),Ji(),k}for(;g=i.lastChild;)i.removeChild(g);if(typeof h=="function"){var R=h;h=function(){var W=nu(M);R.call(W)}}var M=Vd(i,0,!1,null,null,!1,!1,"",wy);return i._reactRootContainer=M,i[Mr]=M.current,Ho(i.nodeType===8?i.parentNode:i),Ji(function(){tu(s,M,u,h)}),M}function su(i,s,u,h,g){var x=u._reactRootContainer;if(x){var k=x;if(typeof g=="function"){var R=g;g=function(){var M=nu(k);R.call(M)}}tu(s,k,i,g)}else k=tE(u,s,i,g,h);return nu(k)}Ao=function(i){switch(i.tag){case 3:var s=i.stateNode;if(s.current.memoizedState.isDehydrated){var u=Ue(s.pendingLanes);u!==0&&(Bi(s,u|1),ln(s,Ne()),(qe&6)===0&&(Hs=Ne()+500,hi()))}break;case 13:Ji(function(){var h=Or(i,1);if(h!==null){var g=Jt();rr(h,i,1,g)}}),Bd(i,1)}},ii=function(i){if(i.tag===13){var s=Or(i,134217728);if(s!==null){var u=Jt();rr(s,i,134217728,u)}Bd(i,134217728)}},Ss=function(i){if(i.tag===13){var s=xi(i),u=Or(i,s);if(u!==null){var h=Jt();rr(u,i,s,h)}Bd(i,s)}},$i=function(){return He},Ui=function(i,s){var u=He;try{return He=i,s()}finally{He=u}},ti=function(i,s,u){switch(s){case"input":if(tn(i,u),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==i&&h.form===i.form){var g=Sl(h);if(!g)throw Error(n(90));Mi(h),tn(h,g)}}}break;case"textarea":Zr(i,u);break;case"select":s=u.value,s!=null&&Cn(i,!!u.multiple,s,!1)}},Io=Md,To=Ji;var nE={usingClientEntryPoint:!1,Events:[Go,Rs,Sl,tl,nl,Md]},aa={findFiberByHostInstance:Hi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},rE={bundleType:aa.bundleType,version:aa.version,rendererPackageName:aa.rendererPackageName,rendererConfig:aa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=q(i),i===null?null:i.stateNode},findFiberByHostInstance:aa.findFiberByHostInstance||eE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ou.isDisabled&&ou.supportsFiber)try{nn=ou.inject(rE),jt=ou}catch{}}return un.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nE,un.createPortal=function(i,s){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ud(s))throw Error(n(200));return Zk(i,s,null,u)},un.createRoot=function(i,s){if(!Ud(i))throw Error(n(299));var u=!1,h="",g=xy;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=Vd(i,1,!1,null,null,u,!1,h,g),i[Mr]=s.current,Ho(i.nodeType===8?i.parentNode:i),new $d(s)},un.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=q(s),i=i===null?null:i.stateNode,i},un.flushSync=function(i){return Ji(i)},un.hydrate=function(i,s,u){if(!iu(s))throw Error(n(200));return su(null,i,s,!0,u)},un.hydrateRoot=function(i,s,u){if(!Ud(i))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,g=!1,x="",k=xy;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(k=u.onRecoverableError)),s=yy(s,null,i,1,u??null,g,!1,x,k),i[Mr]=s.current,Ho(i),h)for(i=0;i<h.length;i++)u=h[i],g=u._getVersion,g=g(u._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[u,g]:s.mutableSourceEagerHydrationData.push(u,g);return new ru(s)},un.render=function(i,s,u){if(!iu(s))throw Error(n(200));return su(null,i,s,!1,u)},un.unmountComponentAtNode=function(i){if(!iu(i))throw Error(n(40));return i._reactRootContainer?(Ji(function(){su(null,null,i,!1,function(){i._reactRootContainer=null,i[Mr]=null})}),!0):!1},un.unstable_batchedUpdates=Md,un.unstable_renderSubtreeIntoContainer=function(i,s,u,h){if(!iu(u))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return su(i,s,u,!1,h)},un.version="18.3.1-next-f1338f8080-20240426",un}var Ay;function Nx(){if(Ay)return Gd.exports;Ay=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gd.exports=fE(),Gd.exports}var Ry;function hE(){if(Ry)return au;Ry=1;var e=Nx();return au.createRoot=e.createRoot,au.hydrateRoot=e.hydrateRoot,au}var pE=hE();const mE=Rx(pE);/**
40
+ `+x.stack}return{value:i,source:s,stack:g,digest:null}}function pd(i,s,u){return{value:i,source:null,stack:u??null,digest:s??null}}function md(i,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var jk=typeof WeakMap=="function"?WeakMap:Map;function Ag(i,s,u){u=Fr(-1,u),u.tag=3,u.payload={element:null};var h=s.value;return u.callback=function(){Gl||(Gl=!0,Ad=h),md(i,s)},u}function Rg(i,s,u){u=Fr(-1,u),u.tag=3;var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var g=s.value;u.payload=function(){return h(g)},u.callback=function(){md(i,s)}}var x=i.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){md(i,s),typeof h!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})}),u}function Ng(i,s,u){var h=i.pingCache;if(h===null){h=i.pingCache=new jk;var g=new Set;h.set(s,g)}else g=h.get(s),g===void 0&&(g=new Set,h.set(s,g));g.has(u)||(g.add(u),i=Gk.bind(null,i,s,u),s.then(i,i))}function jg(i){do{var s;if((s=i.tag===13)&&(s=i.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return i;i=i.return}while(i!==null);return null}function Mg(i,s,u,h,g){return(i.mode&1)===0?(i===s?i.flags|=65536:(i.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(s=Fr(-1,1),s.tag=2,mi(u,s,1))),u.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var Mk=O.ReactCurrentOwner,sn=!1;function Xt(i,s,u,h){s.child=i===null?eg(s,null,u,h):zs(s,i.child,u,h)}function Dg(i,s,u,h,g){u=u.render;var x=s.ref;return Fs(s,g),h=od(i,s,u,h,x,g),u=ad(),i!==null&&!sn?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Vr(i,s,g)):(st&&u&&Uc(s),s.flags|=1,Xt(i,s,h,g),s.child)}function Lg(i,s,u,h,g){if(i===null){var x=u.type;return typeof x=="function"&&!zd(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=x,zg(i,s,x,h,g)):(i=Zl(u.type,null,h,s,s.mode,g),i.ref=s.ref,i.return=s,s.child=i)}if(x=i.child,(i.lanes&g)===0){var k=x.memoizedProps;if(u=u.compare,u=u!==null?u:Bo,u(k,h)&&i.ref===s.ref)return Vr(i,s,g)}return s.flags|=1,i=bi(x,h),i.ref=s.ref,i.return=s,s.child=i}function zg(i,s,u,h,g){if(i!==null){var x=i.memoizedProps;if(Bo(x,h)&&i.ref===s.ref)if(sn=!1,s.pendingProps=h=x,(i.lanes&g)!==0)(i.flags&131072)!==0&&(sn=!0);else return s.lanes=i.lanes,Vr(i,s,g)}return gd(i,s,u,h,g)}function Og(i,s,u){var h=s.pendingProps,g=h.children,x=i!==null?i.memoizedState:null;if(h.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(Us,xn),xn|=u;else{if((u&1073741824)===0)return i=x!==null?x.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:i,cachePool:null,transitions:null},s.updateQueue=null,Je(Us,xn),xn|=i,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=x!==null?x.baseLanes:u,Je(Us,xn),xn|=h}else x!==null?(h=x.baseLanes|u,s.memoizedState=null):h=u,Je(Us,xn),xn|=h;return Xt(i,s,g,u),s.child}function Fg(i,s){var u=s.ref;(i===null&&u!==null||i!==null&&i.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function gd(i,s,u,h,g){var x=rn(u)?Wi:Ft.current;return x=js(s,x),Fs(s,g),u=od(i,s,u,h,x,g),h=ad(),i!==null&&!sn?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Vr(i,s,g)):(st&&h&&Uc(s),s.flags|=1,Xt(i,s,u,g),s.child)}function Vg(i,s,u,h,g){if(rn(u)){var x=!0;El(s)}else x=!1;if(Fs(s,g),s.stateNode===null)$l(i,s),_g(s,u,h),hd(s,u,h,g),h=!0;else if(i===null){var k=s.stateNode,R=s.memoizedProps;k.props=R;var M=k.context,W=u.contextType;typeof W=="object"&&W!==null?W=jn(W):(W=rn(u)?Wi:Ft.current,W=js(s,W));var ne=u.getDerivedStateFromProps,ie=typeof ne=="function"||typeof k.getSnapshotBeforeUpdate=="function";ie||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(R!==h||M!==W)&&Pg(s,k,h,W),pi=!1;var Z=s.memoizedState;k.state=Z,jl(s,h,k,g),M=s.memoizedState,R!==h||Z!==M||nn.current||pi?(typeof ne=="function"&&(fd(s,u,ne,h),M=s.memoizedState),(R=pi||Tg(s,u,R,h,Z,M,W))?(ie||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(s.flags|=4194308)):(typeof k.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=M),k.props=h,k.state=M,k.context=W,h=R):(typeof k.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{k=s.stateNode,ng(i,s),R=s.memoizedProps,W=s.type===s.elementType?R:er(s.type,R),k.props=W,ie=s.pendingProps,Z=k.context,M=u.contextType,typeof M=="object"&&M!==null?M=jn(M):(M=rn(u)?Wi:Ft.current,M=js(s,M));var pe=u.getDerivedStateFromProps;(ne=typeof pe=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(R!==ie||Z!==M)&&Pg(s,k,h,M),pi=!1,Z=s.memoizedState,k.state=Z,jl(s,h,k,g);var ve=s.memoizedState;R!==ie||Z!==ve||nn.current||pi?(typeof pe=="function"&&(fd(s,u,pe,h),ve=s.memoizedState),(W=pi||Tg(s,u,W,h,Z,ve,M)||!1)?(ne||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(h,ve,M),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(h,ve,M)),typeof k.componentDidUpdate=="function"&&(s.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof k.componentDidUpdate!="function"||R===i.memoizedProps&&Z===i.memoizedState||(s.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&Z===i.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=ve),k.props=h,k.state=ve,k.context=M,h=W):(typeof k.componentDidUpdate!="function"||R===i.memoizedProps&&Z===i.memoizedState||(s.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&Z===i.memoizedState||(s.flags|=1024),h=!1)}return yd(i,s,u,h,x,g)}function yd(i,s,u,h,g,x){Fg(i,s);var k=(s.flags&128)!==0;if(!h&&!k)return g&&Wm(s,u,!1),Vr(i,s,x);h=s.stateNode,Mk.current=s;var R=k&&typeof u.getDerivedStateFromError!="function"?null:h.render();return s.flags|=1,i!==null&&k?(s.child=zs(s,i.child,null,x),s.child=zs(s,null,R,x)):Xt(i,s,R,x),s.memoizedState=h.state,g&&Wm(s,u,!0),s.child}function Bg(i){var s=i.stateNode;s.pendingContext?Um(i,s.pendingContext,s.pendingContext!==s.context):s.context&&Um(i,s.context,!1),ed(i,s.containerInfo)}function $g(i,s,u,h,g){return Ls(),Gc(g),s.flags|=256,Xt(i,s,u,h),s.child}var vd={dehydrated:null,treeContext:null,retryLane:0};function xd(i){return{baseLanes:i,cachePool:null,transitions:null}}function Ug(i,s,u){var h=s.pendingProps,g=ut.current,x=!1,k=(s.flags&128)!==0,R;if((R=k)||(R=i!==null&&i.memoizedState===null?!1:(g&2)!==0),R?(x=!0,s.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),Je(ut,g&1),i===null)return qc(s),i=s.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((s.mode&1)===0?s.lanes=1:i.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(k=h.children,i=h.fallback,x?(h=s.mode,x=s.child,k={mode:"hidden",children:k},(h&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=k):x=eu(k,h,0,null),i=ts(i,h,u,null),x.return=s,i.return=s,x.sibling=i,s.child=x,s.child.memoizedState=xd(u),s.memoizedState=vd,i):wd(s,k));if(g=i.memoizedState,g!==null&&(R=g.dehydrated,R!==null))return Dk(i,s,k,h,R,g,u);if(x){x=h.fallback,k=s.mode,g=i.child,R=g.sibling;var M={mode:"hidden",children:h.children};return(k&1)===0&&s.child!==g?(h=s.child,h.childLanes=0,h.pendingProps=M,s.deletions=null):(h=bi(g,M),h.subtreeFlags=g.subtreeFlags&14680064),R!==null?x=bi(R,x):(x=ts(x,k,u,null),x.flags|=2),x.return=s,h.return=s,h.sibling=x,s.child=h,h=x,x=s.child,k=i.child.memoizedState,k=k===null?xd(u):{baseLanes:k.baseLanes|u,cachePool:null,transitions:k.transitions},x.memoizedState=k,x.childLanes=i.childLanes&~u,s.memoizedState=vd,h}return x=i.child,i=x.sibling,h=bi(x,{mode:"visible",children:h.children}),(s.mode&1)===0&&(h.lanes=u),h.return=s,h.sibling=null,i!==null&&(u=s.deletions,u===null?(s.deletions=[i],s.flags|=16):u.push(i)),s.child=h,s.memoizedState=null,h}function wd(i,s){return s=eu({mode:"visible",children:s},i.mode,0,null),s.return=i,i.child=s}function Bl(i,s,u,h){return h!==null&&Gc(h),zs(s,i.child,null,u),i=wd(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Dk(i,s,u,h,g,x,k){if(u)return s.flags&256?(s.flags&=-257,h=pd(Error(n(422))),Bl(i,s,k,h)):s.memoizedState!==null?(s.child=i.child,s.flags|=128,null):(x=h.fallback,g=s.mode,h=eu({mode:"visible",children:h.children},g,0,null),x=ts(x,g,k,null),x.flags|=2,h.return=s,x.return=s,h.sibling=x,s.child=h,(s.mode&1)!==0&&zs(s,i.child,null,k),s.child.memoizedState=xd(k),s.memoizedState=vd,x);if((s.mode&1)===0)return Bl(i,s,k,null);if(g.data==="$!"){if(h=g.nextSibling&&g.nextSibling.dataset,h)var R=h.dgst;return h=R,x=Error(n(419)),h=pd(x,h,void 0),Bl(i,s,k,h)}if(R=(k&i.childLanes)!==0,sn||R){if(h=Pt,h!==null){switch(k&-k){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(h.suspendedLanes|k))!==0?0:g,g!==0&&g!==x.retryLane&&(x.retryLane=g,Or(i,g),rr(h,i,g,-1))}return Ld(),h=pd(Error(n(421))),Bl(i,s,k,h)}return g.data==="$?"?(s.flags|=128,s.child=i.child,s=Kk.bind(null,i),g._reactRetry=s,null):(i=x.treeContext,vn=ci(g.nextSibling),yn=s,st=!0,Zn=null,i!==null&&(Rn[Nn++]=Lr,Rn[Nn++]=zr,Rn[Nn++]=qi,Lr=i.id,zr=i.overflow,qi=s),s=wd(s,h.children),s.flags|=4096,s)}function Hg(i,s,u){i.lanes|=s;var h=i.alternate;h!==null&&(h.lanes|=s),Qc(i.return,s,u)}function bd(i,s,u,h,g){var x=i.memoizedState;x===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=h,x.tail=u,x.tailMode=g)}function Wg(i,s,u){var h=s.pendingProps,g=h.revealOrder,x=h.tail;if(Xt(i,s,h.children,u),h=ut.current,(h&2)!==0)h=h&1|2,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Hg(i,u,s);else if(i.tag===19)Hg(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}if(Je(ut,h),(s.mode&1)===0)s.memoizedState=null;else switch(g){case"forwards":for(u=s.child,g=null;u!==null;)i=u.alternate,i!==null&&Ml(i)===null&&(g=u),u=u.sibling;u=g,u===null?(g=s.child,s.child=null):(g=u.sibling,u.sibling=null),bd(s,!1,g,u,x);break;case"backwards":for(u=null,g=s.child,s.child=null;g!==null;){if(i=g.alternate,i!==null&&Ml(i)===null){s.child=g;break}i=g.sibling,g.sibling=u,u=g,g=i}bd(s,!0,u,null,x);break;case"together":bd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function $l(i,s){(s.mode&1)===0&&i!==null&&(i.alternate=null,s.alternate=null,s.flags|=2)}function Vr(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),Qi|=s.lanes,(u&s.childLanes)===0)return null;if(i!==null&&s.child!==i.child)throw Error(n(153));if(s.child!==null){for(i=s.child,u=bi(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=bi(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function Lk(i,s,u){switch(s.tag){case 3:Bg(s),Ls();break;case 5:sg(s);break;case 1:rn(s.type)&&El(s);break;case 4:ed(s,s.stateNode.containerInfo);break;case 10:var h=s.type._context,g=s.memoizedProps.value;Je(Al,h._currentValue),h._currentValue=g;break;case 13:if(h=s.memoizedState,h!==null)return h.dehydrated!==null?(Je(ut,ut.current&1),s.flags|=128,null):(u&s.child.childLanes)!==0?Ug(i,s,u):(Je(ut,ut.current&1),i=Vr(i,s,u),i!==null?i.sibling:null);Je(ut,ut.current&1);break;case 19:if(h=(u&s.childLanes)!==0,(i.flags&128)!==0){if(h)return Wg(i,s,u);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Je(ut,ut.current),h)break;return null;case 22:case 23:return s.lanes=0,Og(i,s,u)}return Vr(i,s,u)}var qg,Sd,Gg,Kg;qg=function(i,s){for(var u=s.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},Sd=function(){},Gg=function(i,s,u,h){var g=i.memoizedProps;if(g!==h){i=s.stateNode,Yi(gr.current);var x=null;switch(u){case"input":g=Yr(i,g),h=Yr(i,h),x=[];break;case"select":g=_({},g,{value:void 0}),h=_({},h,{value:void 0}),x=[];break;case"textarea":g=Yn(i,g),h=Yn(i,h),x=[];break;default:typeof g.onClick!="function"&&typeof h.onClick=="function"&&(i.onclick=bl)}et(u,h);var k;u=null;for(W in g)if(!h.hasOwnProperty(W)&&g.hasOwnProperty(W)&&g[W]!=null)if(W==="style"){var R=g[W];for(k in R)R.hasOwnProperty(k)&&(u||(u={}),u[k]="")}else W!=="dangerouslySetInnerHTML"&&W!=="children"&&W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&W!=="autoFocus"&&(o.hasOwnProperty(W)?x||(x=[]):(x=x||[]).push(W,null));for(W in h){var M=h[W];if(R=g!=null?g[W]:void 0,h.hasOwnProperty(W)&&M!==R&&(M!=null||R!=null))if(W==="style")if(R){for(k in R)!R.hasOwnProperty(k)||M&&M.hasOwnProperty(k)||(u||(u={}),u[k]="");for(k in M)M.hasOwnProperty(k)&&R[k]!==M[k]&&(u||(u={}),u[k]=M[k])}else u||(x||(x=[]),x.push(W,u)),u=M;else W==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,R=R?R.__html:void 0,M!=null&&R!==M&&(x=x||[]).push(W,M)):W==="children"?typeof M!="string"&&typeof M!="number"||(x=x||[]).push(W,""+M):W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&(o.hasOwnProperty(W)?(M!=null&&W==="onScroll"&&tt("scroll",i),x||R===M||(x=[])):(x=x||[]).push(W,M))}u&&(x=x||[]).push("style",u);var W=x;(s.updateQueue=W)&&(s.flags|=4)}},Kg=function(i,s,u,h){u!==h&&(s.flags|=4)};function na(i,s){if(!st)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function Bt(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(s)for(var g=i.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags&14680064,h|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=h,i.childLanes=u,s}function zk(i,s,u){var h=s.pendingProps;switch(Hc(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(s),null;case 1:return rn(s.type)&&kl(),Bt(s),null;case 3:return h=s.stateNode,Vs(),nt(nn),nt(Ft),rd(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(_l(s)?s.flags|=4:i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Zn!==null&&(jd(Zn),Zn=null))),Sd(i,s),Bt(s),null;case 5:td(s);var g=Yi(Qo.current);if(u=s.type,i!==null&&s.stateNode!=null)Gg(i,s,u,h,g),i.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!h){if(s.stateNode===null)throw Error(n(166));return Bt(s),null}if(i=Yi(gr.current),_l(s)){h=s.stateNode,u=s.type;var x=s.memoizedProps;switch(h[mr]=s,h[qo]=x,i=(s.mode&1)!==0,u){case"dialog":tt("cancel",h),tt("close",h);break;case"iframe":case"object":case"embed":tt("load",h);break;case"video":case"audio":for(g=0;g<Uo.length;g++)tt(Uo[g],h);break;case"source":tt("error",h);break;case"img":case"image":case"link":tt("error",h),tt("load",h);break;case"details":tt("toggle",h);break;case"input":Xr(h,x),tt("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!x.multiple},tt("invalid",h);break;case"textarea":Jr(h,x),tt("invalid",h)}et(u,x),g=null;for(var k in x)if(x.hasOwnProperty(k)){var R=x[k];k==="children"?typeof R=="string"?h.textContent!==R&&(x.suppressHydrationWarning!==!0&&wl(h.textContent,R,i),g=["children",R]):typeof R=="number"&&h.textContent!==""+R&&(x.suppressHydrationWarning!==!0&&wl(h.textContent,R,i),g=["children",""+R]):o.hasOwnProperty(k)&&R!=null&&k==="onScroll"&&tt("scroll",h)}switch(u){case"input":Ke(h),Li(h,x,!0);break;case"textarea":Ke(h),ei(h);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(h.onclick=bl)}h=g,s.updateQueue=h,h!==null&&(s.flags|=4)}else{k=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=K(u)),i==="http://www.w3.org/1999/xhtml"?u==="script"?(i=k.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof h.is=="string"?i=k.createElement(u,{is:h.is}):(i=k.createElement(u),u==="select"&&(k=i,h.multiple?k.multiple=!0:h.size&&(k.size=h.size))):i=k.createElementNS(i,u),i[mr]=s,i[qo]=h,qg(i,s,!1,!1),s.stateNode=i;e:{switch(k=Kt(u,h),u){case"dialog":tt("cancel",i),tt("close",i),g=h;break;case"iframe":case"object":case"embed":tt("load",i),g=h;break;case"video":case"audio":for(g=0;g<Uo.length;g++)tt(Uo[g],i);g=h;break;case"source":tt("error",i),g=h;break;case"img":case"image":case"link":tt("error",i),tt("load",i),g=h;break;case"details":tt("toggle",i),g=h;break;case"input":Xr(i,h),g=Yr(i,h),tt("invalid",i);break;case"option":g=h;break;case"select":i._wrapperState={wasMultiple:!!h.multiple},g=_({},h,{value:void 0}),tt("invalid",i);break;case"textarea":Jr(i,h),g=Yn(i,h),tt("invalid",i);break;default:g=h}et(u,g),R=g;for(x in R)if(R.hasOwnProperty(x)){var M=R[x];x==="style"?zt(i,M):x==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,M!=null&&Le(i,M)):x==="children"?typeof M=="string"?(u!=="textarea"||M!=="")&&Be(i,M):typeof M=="number"&&Be(i,""+M):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(o.hasOwnProperty(x)?M!=null&&x==="onScroll"&&tt("scroll",i):M!=null&&T(i,x,M,k))}switch(u){case"input":Ke(i),Li(i,h,!1);break;case"textarea":Ke(i),ei(i);break;case"option":h.value!=null&&i.setAttribute("value",""+de(h.value));break;case"select":i.multiple=!!h.multiple,x=h.value,x!=null?Cn(i,!!h.multiple,x,!1):h.defaultValue!=null&&Cn(i,!!h.multiple,h.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=bl)}switch(u){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return Bt(s),null;case 6:if(i&&s.stateNode!=null)Kg(i,s,i.memoizedProps,h);else{if(typeof h!="string"&&s.stateNode===null)throw Error(n(166));if(u=Yi(Qo.current),Yi(gr.current),_l(s)){if(h=s.stateNode,u=s.memoizedProps,h[mr]=s,(x=h.nodeValue!==u)&&(i=yn,i!==null))switch(i.tag){case 3:wl(h.nodeValue,u,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&wl(h.nodeValue,u,(i.mode&1)!==0)}x&&(s.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[mr]=s,s.stateNode=h}return Bt(s),null;case 13:if(nt(ut),h=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(st&&vn!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Qm(),Ls(),s.flags|=98560,x=!1;else if(x=_l(s),h!==null&&h.dehydrated!==null){if(i===null){if(!x)throw Error(n(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[mr]=s}else Ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Bt(s),x=!1}else Zn!==null&&(jd(Zn),Zn=null),x=!0;if(!x)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=u,s):(h=h!==null,h!==(i!==null&&i.memoizedState!==null)&&h&&(s.child.flags|=8192,(s.mode&1)!==0&&(i===null||(ut.current&1)!==0?Et===0&&(Et=3):Ld())),s.updateQueue!==null&&(s.flags|=4),Bt(s),null);case 4:return Vs(),Sd(i,s),i===null&&Ho(s.stateNode.containerInfo),Bt(s),null;case 10:return Xc(s.type._context),Bt(s),null;case 17:return rn(s.type)&&kl(),Bt(s),null;case 19:if(nt(ut),x=s.memoizedState,x===null)return Bt(s),null;if(h=(s.flags&128)!==0,k=x.rendering,k===null)if(h)na(x,!1);else{if(Et!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(k=Ml(i),k!==null){for(s.flags|=128,na(x,!1),h=k.updateQueue,h!==null&&(s.updateQueue=h,s.flags|=4),s.subtreeFlags=0,h=u,u=s.child;u!==null;)x=u,i=h,x.flags&=14680066,k=x.alternate,k===null?(x.childLanes=0,x.lanes=i,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=k.childLanes,x.lanes=k.lanes,x.child=k.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=k.memoizedProps,x.memoizedState=k.memoizedState,x.updateQueue=k.updateQueue,x.type=k.type,i=k.dependencies,x.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),u=u.sibling;return Je(ut,ut.current&1|2),s.child}i=i.sibling}x.tail!==null&&je()>Hs&&(s.flags|=128,h=!0,na(x,!1),s.lanes=4194304)}else{if(!h)if(i=Ml(k),i!==null){if(s.flags|=128,h=!0,u=i.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),na(x,!0),x.tail===null&&x.tailMode==="hidden"&&!k.alternate&&!st)return Bt(s),null}else 2*je()-x.renderingStartTime>Hs&&u!==1073741824&&(s.flags|=128,h=!0,na(x,!1),s.lanes=4194304);x.isBackwards?(k.sibling=s.child,s.child=k):(u=x.last,u!==null?u.sibling=k:s.child=k,x.last=k)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=je(),s.sibling=null,u=ut.current,Je(ut,h?u&1|2:u&1),s):(Bt(s),null);case 22:case 23:return Dd(),h=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==h&&(s.flags|=8192),h&&(s.mode&1)!==0?(xn&1073741824)!==0&&(Bt(s),s.subtreeFlags&6&&(s.flags|=8192)):Bt(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function Ok(i,s){switch(Hc(s),s.tag){case 1:return rn(s.type)&&kl(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Vs(),nt(nn),nt(Ft),rd(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 5:return td(s),null;case 13:if(nt(ut),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return nt(ut),null;case 4:return Vs(),null;case 10:return Xc(s.type._context),null;case 22:case 23:return Dd(),null;case 24:return null;default:return null}}var Ul=!1,$t=!1,Fk=typeof WeakSet=="function"?WeakSet:Set,ye=null;function $s(i,s){var u=i.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(h){pt(i,s,h)}else u.current=null}function kd(i,s,u){try{u()}catch(h){pt(i,s,h)}}var Yg=!1;function Vk(i,s){if(Dc=ul,i=Tm(),Tc(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var k=0,R=-1,M=-1,W=0,ne=0,ie=i,Z=null;t:for(;;){for(var pe;ie!==u||g!==0&&ie.nodeType!==3||(R=k+g),ie!==x||h!==0&&ie.nodeType!==3||(M=k+h),ie.nodeType===3&&(k+=ie.nodeValue.length),(pe=ie.firstChild)!==null;)Z=ie,ie=pe;for(;;){if(ie===i)break t;if(Z===u&&++W===g&&(R=k),Z===x&&++ne===h&&(M=k),(pe=ie.nextSibling)!==null)break;ie=Z,Z=ie.parentNode}ie=pe}u=R===-1||M===-1?null:{start:R,end:M}}else u=null}u=u||{start:0,end:0}}else u=null;for(Lc={focusedElem:i,selectionRange:u},ul=!1,ye=s;ye!==null;)if(s=ye,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,ye=i;else for(;ye!==null;){s=ye;try{var ve=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var xe=ve.memoizedProps,gt=ve.memoizedState,B=s.stateNode,z=B.getSnapshotBeforeUpdate(s.elementType===s.type?xe:er(s.type,xe),gt);B.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var $=s.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(le){pt(s,s.return,le)}if(i=s.sibling,i!==null){i.return=s.return,ye=i;break}ye=s.return}return ve=Yg,Yg=!1,ve}function ra(i,s,u){var h=s.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var g=h=h.next;do{if((g.tag&i)===i){var x=g.destroy;g.destroy=void 0,x!==void 0&&kd(s,u,x)}g=g.next}while(g!==h)}}function Hl(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&i)===i){var h=u.create;u.destroy=h()}u=u.next}while(u!==s)}}function Ed(i){var s=i.ref;if(s!==null){var u=i.stateNode;switch(i.tag){case 5:i=u;break;default:i=u}typeof s=="function"?s(i):s.current=i}}function Xg(i){var s=i.alternate;s!==null&&(i.alternate=null,Xg(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[mr],delete s[qo],delete s[Vc],delete s[Sk],delete s[kk])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Qg(i){return i.tag===5||i.tag===3||i.tag===4}function Jg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Qg(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Cd(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?u.nodeType===8?u.parentNode.insertBefore(i,s):u.insertBefore(i,s):(u.nodeType===8?(s=u.parentNode,s.insertBefore(i,u)):(s=u,s.appendChild(i)),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=bl));else if(h!==4&&(i=i.child,i!==null))for(Cd(i,s,u),i=i.sibling;i!==null;)Cd(i,s,u),i=i.sibling}function Id(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(h!==4&&(i=i.child,i!==null))for(Id(i,s,u),i=i.sibling;i!==null;)Id(i,s,u),i=i.sibling}var jt=null,tr=!1;function gi(i,s,u){for(u=u.child;u!==null;)Zg(i,s,u),u=u.sibling}function Zg(i,s,u){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(tn,u)}catch{}switch(u.tag){case 5:$t||$s(u,s);case 6:var h=jt,g=tr;jt=null,gi(i,s,u),jt=h,tr=g,jt!==null&&(tr?(i=jt,u=u.stateNode,i.nodeType===8?i.parentNode.removeChild(u):i.removeChild(u)):jt.removeChild(u.stateNode));break;case 18:jt!==null&&(tr?(i=jt,u=u.stateNode,i.nodeType===8?Fc(i.parentNode,u):i.nodeType===1&&Fc(i,u),Do(i)):Fc(jt,u.stateNode));break;case 4:h=jt,g=tr,jt=u.stateNode.containerInfo,tr=!0,gi(i,s,u),jt=h,tr=g;break;case 0:case 11:case 14:case 15:if(!$t&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){g=h=h.next;do{var x=g,k=x.destroy;x=x.tag,k!==void 0&&((x&2)!==0||(x&4)!==0)&&kd(u,s,k),g=g.next}while(g!==h)}gi(i,s,u);break;case 1:if(!$t&&($s(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(R){pt(u,s,R)}gi(i,s,u);break;case 21:gi(i,s,u);break;case 22:u.mode&1?($t=(h=$t)||u.memoizedState!==null,gi(i,s,u),$t=h):gi(i,s,u);break;default:gi(i,s,u)}}function ey(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var u=i.stateNode;u===null&&(u=i.stateNode=new Fk),s.forEach(function(h){var g=Yk.bind(null,i,h);u.has(h)||(u.add(h),h.then(g,g))})}}function nr(i,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];try{var x=i,k=s,R=k;e:for(;R!==null;){switch(R.tag){case 5:jt=R.stateNode,tr=!1;break e;case 3:jt=R.stateNode.containerInfo,tr=!0;break e;case 4:jt=R.stateNode.containerInfo,tr=!0;break e}R=R.return}if(jt===null)throw Error(n(160));Zg(x,k,g),jt=null,tr=!1;var M=g.alternate;M!==null&&(M.return=null),g.return=null}catch(W){pt(g,s,W)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)ty(s,i),s=s.sibling}function ty(i,s){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(nr(s,i),vr(i),h&4){try{ra(3,i,i.return),Hl(3,i)}catch(xe){pt(i,i.return,xe)}try{ra(5,i,i.return)}catch(xe){pt(i,i.return,xe)}}break;case 1:nr(s,i),vr(i),h&512&&u!==null&&$s(u,u.return);break;case 5:if(nr(s,i),vr(i),h&512&&u!==null&&$s(u,u.return),i.flags&32){var g=i.stateNode;try{Be(g,"")}catch(xe){pt(i,i.return,xe)}}if(h&4&&(g=i.stateNode,g!=null)){var x=i.memoizedProps,k=u!==null?u.memoizedProps:x,R=i.type,M=i.updateQueue;if(i.updateQueue=null,M!==null)try{R==="input"&&x.type==="radio"&&x.name!=null&&Di(g,x),Kt(R,k);var W=Kt(R,x);for(k=0;k<M.length;k+=2){var ne=M[k],ie=M[k+1];ne==="style"?zt(g,ie):ne==="dangerouslySetInnerHTML"?Le(g,ie):ne==="children"?Be(g,ie):T(g,ne,ie,W)}switch(R){case"input":en(g,x);break;case"textarea":Zr(g,x);break;case"select":var Z=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!x.multiple;var pe=x.value;pe!=null?Cn(g,!!x.multiple,pe,!1):Z!==!!x.multiple&&(x.defaultValue!=null?Cn(g,!!x.multiple,x.defaultValue,!0):Cn(g,!!x.multiple,x.multiple?[]:"",!1))}g[qo]=x}catch(xe){pt(i,i.return,xe)}}break;case 6:if(nr(s,i),vr(i),h&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,x=i.memoizedProps;try{g.nodeValue=x}catch(xe){pt(i,i.return,xe)}}break;case 3:if(nr(s,i),vr(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Do(s.containerInfo)}catch(xe){pt(i,i.return,xe)}break;case 4:nr(s,i),vr(i);break;case 13:nr(s,i),vr(i),g=i.child,g.flags&8192&&(x=g.memoizedState!==null,g.stateNode.isHidden=x,!x||g.alternate!==null&&g.alternate.memoizedState!==null||(Pd=je())),h&4&&ey(i);break;case 22:if(ne=u!==null&&u.memoizedState!==null,i.mode&1?($t=(W=$t)||ne,nr(s,i),$t=W):nr(s,i),vr(i),h&8192){if(W=i.memoizedState!==null,(i.stateNode.isHidden=W)&&!ne&&(i.mode&1)!==0)for(ye=i,ne=i.child;ne!==null;){for(ie=ye=ne;ye!==null;){switch(Z=ye,pe=Z.child,Z.tag){case 0:case 11:case 14:case 15:ra(4,Z,Z.return);break;case 1:$s(Z,Z.return);var ve=Z.stateNode;if(typeof ve.componentWillUnmount=="function"){h=Z,u=Z.return;try{s=h,ve.props=s.memoizedProps,ve.state=s.memoizedState,ve.componentWillUnmount()}catch(xe){pt(h,u,xe)}}break;case 5:$s(Z,Z.return);break;case 22:if(Z.memoizedState!==null){iy(ie);continue}}pe!==null?(pe.return=Z,ye=pe):iy(ie)}ne=ne.sibling}e:for(ne=null,ie=i;;){if(ie.tag===5){if(ne===null){ne=ie;try{g=ie.stateNode,W?(x=g.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(R=ie.stateNode,M=ie.memoizedProps.style,k=M!=null&&M.hasOwnProperty("display")?M.display:null,R.style.display=Lt("display",k))}catch(xe){pt(i,i.return,xe)}}}else if(ie.tag===6){if(ne===null)try{ie.stateNode.nodeValue=W?"":ie.memoizedProps}catch(xe){pt(i,i.return,xe)}}else if((ie.tag!==22&&ie.tag!==23||ie.memoizedState===null||ie===i)&&ie.child!==null){ie.child.return=ie,ie=ie.child;continue}if(ie===i)break e;for(;ie.sibling===null;){if(ie.return===null||ie.return===i)break e;ne===ie&&(ne=null),ie=ie.return}ne===ie&&(ne=null),ie.sibling.return=ie.return,ie=ie.sibling}}break;case 19:nr(s,i),vr(i),h&4&&ey(i);break;case 21:break;default:nr(s,i),vr(i)}}function vr(i){var s=i.flags;if(s&2){try{e:{for(var u=i.return;u!==null;){if(Qg(u)){var h=u;break e}u=u.return}throw Error(n(160))}switch(h.tag){case 5:var g=h.stateNode;h.flags&32&&(Be(g,""),h.flags&=-33);var x=Jg(i);Id(i,x,g);break;case 3:case 4:var k=h.stateNode.containerInfo,R=Jg(i);Cd(i,R,k);break;default:throw Error(n(161))}}catch(M){pt(i,i.return,M)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Bk(i,s,u){ye=i,ny(i)}function ny(i,s,u){for(var h=(i.mode&1)!==0;ye!==null;){var g=ye,x=g.child;if(g.tag===22&&h){var k=g.memoizedState!==null||Ul;if(!k){var R=g.alternate,M=R!==null&&R.memoizedState!==null||$t;R=Ul;var W=$t;if(Ul=k,($t=M)&&!W)for(ye=g;ye!==null;)k=ye,M=k.child,k.tag===22&&k.memoizedState!==null?sy(g):M!==null?(M.return=k,ye=M):sy(g);for(;x!==null;)ye=x,ny(x),x=x.sibling;ye=g,Ul=R,$t=W}ry(i)}else(g.subtreeFlags&8772)!==0&&x!==null?(x.return=g,ye=x):ry(i)}}function ry(i){for(;ye!==null;){var s=ye;if((s.flags&8772)!==0){var u=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:$t||Hl(5,s);break;case 1:var h=s.stateNode;if(s.flags&4&&!$t)if(u===null)h.componentDidMount();else{var g=s.elementType===s.type?u.memoizedProps:er(s.type,u.memoizedProps);h.componentDidUpdate(g,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var x=s.updateQueue;x!==null&&ig(s,x,h);break;case 3:var k=s.updateQueue;if(k!==null){if(u=null,s.child!==null)switch(s.child.tag){case 5:u=s.child.stateNode;break;case 1:u=s.child.stateNode}ig(s,k,u)}break;case 5:var R=s.stateNode;if(u===null&&s.flags&4){u=R;var M=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":M.autoFocus&&u.focus();break;case"img":M.src&&(u.src=M.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var W=s.alternate;if(W!==null){var ne=W.memoizedState;if(ne!==null){var ie=ne.dehydrated;ie!==null&&Do(ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}$t||s.flags&512&&Ed(s)}catch(Z){pt(s,s.return,Z)}}if(s===i){ye=null;break}if(u=s.sibling,u!==null){u.return=s.return,ye=u;break}ye=s.return}}function iy(i){for(;ye!==null;){var s=ye;if(s===i){ye=null;break}var u=s.sibling;if(u!==null){u.return=s.return,ye=u;break}ye=s.return}}function sy(i){for(;ye!==null;){var s=ye;try{switch(s.tag){case 0:case 11:case 15:var u=s.return;try{Hl(4,s)}catch(M){pt(s,u,M)}break;case 1:var h=s.stateNode;if(typeof h.componentDidMount=="function"){var g=s.return;try{h.componentDidMount()}catch(M){pt(s,g,M)}}var x=s.return;try{Ed(s)}catch(M){pt(s,x,M)}break;case 5:var k=s.return;try{Ed(s)}catch(M){pt(s,k,M)}}}catch(M){pt(s,s.return,M)}if(s===i){ye=null;break}var R=s.sibling;if(R!==null){R.return=s.return,ye=R;break}ye=s.return}}var $k=Math.ceil,Wl=O.ReactCurrentDispatcher,Td=O.ReactCurrentOwner,Dn=O.ReactCurrentBatchConfig,We=0,Pt=null,yt=null,Mt=0,xn=0,Us=di(0),Et=0,ia=null,Qi=0,ql=0,_d=0,sa=null,on=null,Pd=0,Hs=1/0,Br=null,Gl=!1,Ad=null,yi=null,Kl=!1,vi=null,Yl=0,oa=0,Rd=null,Xl=-1,Ql=0;function Qt(){return(We&6)!==0?je():Xl!==-1?Xl:Xl=je()}function xi(i){return(i.mode&1)===0?1:(We&2)!==0&&Mt!==0?Mt&-Mt:Ck.transition!==null?(Ql===0&&(Ql=Pn()),Ql):(i=Ue,i!==0||(i=window.event,i=i===void 0?16:am(i.type)),i)}function rr(i,s,u,h){if(50<oa)throw oa=0,Rd=null,Error(n(185));Qn(i,u,h),((We&2)===0||i!==Pt)&&(i===Pt&&((We&2)===0&&(ql|=u),Et===4&&wi(i,Mt)),an(i,h),u===1&&We===0&&(s.mode&1)===0&&(Hs=je()+500,Cl&&hi()))}function an(i,s){var u=i.callbackNode;Po(i,s);var h=Nr(i,i===Pt?Mt:0);if(h===0)u!==null&&Ye(u),i.callbackNode=null,i.callbackPriority=0;else if(s=h&-h,i.callbackPriority!==s){if(u!=null&&Ye(u),s===1)i.tag===0?Ek(ay.bind(null,i)):qm(ay.bind(null,i)),wk(function(){(We&6)===0&&hi()}),u=null;else{switch(pr(h)){case 1:u=lt;break;case 4:u=ht;break;case 16:u=Yt;break;case 536870912:u=It;break;default:u=Yt}u=my(u,oy.bind(null,i))}i.callbackPriority=s,i.callbackNode=u}}function oy(i,s){if(Xl=-1,Ql=0,(We&6)!==0)throw Error(n(327));var u=i.callbackNode;if(Ws()&&i.callbackNode!==u)return null;var h=Nr(i,i===Pt?Mt:0);if(h===0)return null;if((h&30)!==0||(h&i.expiredLanes)!==0||s)s=Jl(i,h);else{s=h;var g=We;We|=2;var x=uy();(Pt!==i||Mt!==s)&&(Br=null,Hs=je()+500,Zi(i,s));do try{Wk();break}catch(R){ly(i,R)}while(!0);Yc(),Wl.current=x,We=g,yt!==null?s=0:(Pt=null,Mt=0,s=Et)}if(s!==0){if(s===2&&(g=Ot(i),g!==0&&(h=g,s=Nd(i,g))),s===1)throw u=ia,Zi(i,0),wi(i,h),an(i,je()),u;if(s===6)wi(i,h);else{if(g=i.current.alternate,(h&30)===0&&!Uk(g)&&(s=Jl(i,h),s===2&&(x=Ot(i),x!==0&&(h=x,s=Nd(i,x))),s===1))throw u=ia,Zi(i,0),wi(i,h),an(i,je()),u;switch(i.finishedWork=g,i.finishedLanes=h,s){case 0:case 1:throw Error(n(345));case 2:es(i,on,Br);break;case 3:if(wi(i,h),(h&130023424)===h&&(s=Pd+500-je(),10<s)){if(Nr(i,0)!==0)break;if(g=i.suspendedLanes,(g&h)!==h){Qt(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Oc(es.bind(null,i,on,Br),s);break}es(i,on,Br);break;case 4:if(wi(i,h),(h&4194240)===h)break;for(s=i.eventTimes,g=-1;0<h;){var k=31-Tt(h);x=1<<k,k=s[k],k>g&&(g=k),h&=~x}if(h=g,h=je()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*$k(h/1960))-h,10<h){i.timeoutHandle=Oc(es.bind(null,i,on,Br),h);break}es(i,on,Br);break;case 5:es(i,on,Br);break;default:throw Error(n(329))}}}return an(i,je()),i.callbackNode===u?oy.bind(null,i):null}function Nd(i,s){var u=sa;return i.current.memoizedState.isDehydrated&&(Zi(i,s).flags|=256),i=Jl(i,s),i!==2&&(s=on,on=u,s!==null&&jd(s)),i}function jd(i){on===null?on=i:on.push.apply(on,i)}function Uk(i){for(var s=i;;){if(s.flags&16384){var u=s.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var h=0;h<u.length;h++){var g=u[h],x=g.getSnapshot;g=g.value;try{if(!Jn(x(),g))return!1}catch{return!1}}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function wi(i,s){for(s&=~_d,s&=~ql,i.suspendedLanes|=s,i.pingedLanes&=~s,i=i.expirationTimes;0<s;){var u=31-Tt(s),h=1<<u;i[u]=-1,s&=~h}}function ay(i){if((We&6)!==0)throw Error(n(327));Ws();var s=Nr(i,0);if((s&1)===0)return an(i,je()),null;var u=Jl(i,s);if(i.tag!==0&&u===2){var h=Ot(i);h!==0&&(s=h,u=Nd(i,h))}if(u===1)throw u=ia,Zi(i,0),wi(i,s),an(i,je()),u;if(u===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=s,es(i,on,Br),an(i,je()),null}function Md(i,s){var u=We;We|=1;try{return i(s)}finally{We=u,We===0&&(Hs=je()+500,Cl&&hi())}}function Ji(i){vi!==null&&vi.tag===0&&(We&6)===0&&Ws();var s=We;We|=1;var u=Dn.transition,h=Ue;try{if(Dn.transition=null,Ue=1,i)return i()}finally{Ue=h,Dn.transition=u,We=s,(We&6)===0&&hi()}}function Dd(){xn=Us.current,nt(Us)}function Zi(i,s){i.finishedWork=null,i.finishedLanes=0;var u=i.timeoutHandle;if(u!==-1&&(i.timeoutHandle=-1,xk(u)),yt!==null)for(u=yt.return;u!==null;){var h=u;switch(Hc(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&kl();break;case 3:Vs(),nt(nn),nt(Ft),rd();break;case 5:td(h);break;case 4:Vs();break;case 13:nt(ut);break;case 19:nt(ut);break;case 10:Xc(h.type._context);break;case 22:case 23:Dd()}u=u.return}if(Pt=i,yt=i=bi(i.current,null),Mt=xn=s,Et=0,ia=null,_d=ql=Qi=0,on=sa=null,Ki!==null){for(s=0;s<Ki.length;s++)if(u=Ki[s],h=u.interleaved,h!==null){u.interleaved=null;var g=h.next,x=u.pending;if(x!==null){var k=x.next;x.next=g,h.next=k}u.pending=h}Ki=null}return i}function ly(i,s){do{var u=yt;try{if(Yc(),Dl.current=Fl,Ll){for(var h=ct.memoizedState;h!==null;){var g=h.queue;g!==null&&(g.pending=null),h=h.next}Ll=!1}if(Xi=0,_t=kt=ct=null,Jo=!1,Zo=0,Td.current=null,u===null||u.return===null){Et=1,ia=s,yt=null;break}e:{var x=i,k=u.return,R=u,M=s;if(s=Mt,R.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){var W=M,ne=R,ie=ne.tag;if((ne.mode&1)===0&&(ie===0||ie===11||ie===15)){var Z=ne.alternate;Z?(ne.updateQueue=Z.updateQueue,ne.memoizedState=Z.memoizedState,ne.lanes=Z.lanes):(ne.updateQueue=null,ne.memoizedState=null)}var pe=jg(k);if(pe!==null){pe.flags&=-257,Mg(pe,k,R,x,s),pe.mode&1&&Ng(x,W,s),s=pe,M=W;var ve=s.updateQueue;if(ve===null){var xe=new Set;xe.add(M),s.updateQueue=xe}else ve.add(M);break e}else{if((s&1)===0){Ng(x,W,s),Ld();break e}M=Error(n(426))}}else if(st&&R.mode&1){var gt=jg(k);if(gt!==null){(gt.flags&65536)===0&&(gt.flags|=256),Mg(gt,k,R,x,s),Gc(Bs(M,R));break e}}x=M=Bs(M,R),Et!==4&&(Et=2),sa===null?sa=[x]:sa.push(x),x=k;do{switch(x.tag){case 3:x.flags|=65536,s&=-s,x.lanes|=s;var B=Ag(x,M,s);rg(x,B);break e;case 1:R=M;var z=x.type,$=x.stateNode;if((x.flags&128)===0&&(typeof z.getDerivedStateFromError=="function"||$!==null&&typeof $.componentDidCatch=="function"&&(yi===null||!yi.has($)))){x.flags|=65536,s&=-s,x.lanes|=s;var le=Rg(x,R,s);rg(x,le);break e}}x=x.return}while(x!==null)}dy(u)}catch(be){s=be,yt===u&&u!==null&&(yt=u=u.return);continue}break}while(!0)}function uy(){var i=Wl.current;return Wl.current=Fl,i===null?Fl:i}function Ld(){(Et===0||Et===3||Et===2)&&(Et=4),Pt===null||(Qi&268435455)===0&&(ql&268435455)===0||wi(Pt,Mt)}function Jl(i,s){var u=We;We|=2;var h=uy();(Pt!==i||Mt!==s)&&(Br=null,Zi(i,s));do try{Hk();break}catch(g){ly(i,g)}while(!0);if(Yc(),We=u,Wl.current=h,yt!==null)throw Error(n(261));return Pt=null,Mt=0,Et}function Hk(){for(;yt!==null;)cy(yt)}function Wk(){for(;yt!==null&&!Oe();)cy(yt)}function cy(i){var s=py(i.alternate,i,xn);i.memoizedProps=i.pendingProps,s===null?dy(i):yt=s,Td.current=null}function dy(i){var s=i;do{var u=s.alternate;if(i=s.return,(s.flags&32768)===0){if(u=zk(u,s,xn),u!==null){yt=u;return}}else{if(u=Ok(u,s),u!==null){u.flags&=32767,yt=u;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Et=6,yt=null;return}}if(s=s.sibling,s!==null){yt=s;return}yt=s=i}while(s!==null);Et===0&&(Et=5)}function es(i,s,u){var h=Ue,g=Dn.transition;try{Dn.transition=null,Ue=1,qk(i,s,u,h)}finally{Dn.transition=g,Ue=h}return null}function qk(i,s,u,h){do Ws();while(vi!==null);if((We&6)!==0)throw Error(n(327));u=i.finishedWork;var g=i.finishedLanes;if(u===null)return null;if(i.finishedWork=null,i.finishedLanes=0,u===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var x=u.lanes|u.childLanes;if(bs(i,x),i===Pt&&(yt=Pt=null,Mt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Kl||(Kl=!0,my(Yt,function(){return Ws(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=Dn.transition,Dn.transition=null;var k=Ue;Ue=1;var R=We;We|=4,Td.current=null,Vk(i,u),ty(u,i),fk(Lc),ul=!!Dc,Lc=Dc=null,i.current=u,Bk(u),it(),We=R,Ue=k,Dn.transition=x}else i.current=u;if(Kl&&(Kl=!1,vi=i,Yl=g),x=i.pendingLanes,x===0&&(yi=null),xs(u.stateNode),an(i,je()),s!==null)for(h=i.onRecoverableError,u=0;u<s.length;u++)g=s[u],h(g.value,{componentStack:g.stack,digest:g.digest});if(Gl)throw Gl=!1,i=Ad,Ad=null,i;return(Yl&1)!==0&&i.tag!==0&&Ws(),x=i.pendingLanes,(x&1)!==0?i===Rd?oa++:(oa=0,Rd=i):oa=0,hi(),null}function Ws(){if(vi!==null){var i=pr(Yl),s=Dn.transition,u=Ue;try{if(Dn.transition=null,Ue=16>i?16:i,vi===null)var h=!1;else{if(i=vi,vi=null,Yl=0,(We&6)!==0)throw Error(n(331));var g=We;for(We|=4,ye=i.current;ye!==null;){var x=ye,k=x.child;if((ye.flags&16)!==0){var R=x.deletions;if(R!==null){for(var M=0;M<R.length;M++){var W=R[M];for(ye=W;ye!==null;){var ne=ye;switch(ne.tag){case 0:case 11:case 15:ra(8,ne,x)}var ie=ne.child;if(ie!==null)ie.return=ne,ye=ie;else for(;ye!==null;){ne=ye;var Z=ne.sibling,pe=ne.return;if(Xg(ne),ne===W){ye=null;break}if(Z!==null){Z.return=pe,ye=Z;break}ye=pe}}}var ve=x.alternate;if(ve!==null){var xe=ve.child;if(xe!==null){ve.child=null;do{var gt=xe.sibling;xe.sibling=null,xe=gt}while(xe!==null)}}ye=x}}if((x.subtreeFlags&2064)!==0&&k!==null)k.return=x,ye=k;else e:for(;ye!==null;){if(x=ye,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:ra(9,x,x.return)}var B=x.sibling;if(B!==null){B.return=x.return,ye=B;break e}ye=x.return}}var z=i.current;for(ye=z;ye!==null;){k=ye;var $=k.child;if((k.subtreeFlags&2064)!==0&&$!==null)$.return=k,ye=$;else e:for(k=z;ye!==null;){if(R=ye,(R.flags&2048)!==0)try{switch(R.tag){case 0:case 11:case 15:Hl(9,R)}}catch(be){pt(R,R.return,be)}if(R===k){ye=null;break e}var le=R.sibling;if(le!==null){le.return=R.return,ye=le;break e}ye=R.return}}if(We=g,hi(),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(tn,i)}catch{}h=!0}return h}finally{Ue=u,Dn.transition=s}}return!1}function fy(i,s,u){s=Bs(u,s),s=Ag(i,s,1),i=mi(i,s,1),s=Qt(),i!==null&&(Qn(i,1,s),an(i,s))}function pt(i,s,u){if(i.tag===3)fy(i,i,u);else for(;s!==null;){if(s.tag===3){fy(s,i,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(yi===null||!yi.has(h))){i=Bs(u,i),i=Rg(s,i,1),s=mi(s,i,1),i=Qt(),s!==null&&(Qn(s,1,i),an(s,i));break}}s=s.return}}function Gk(i,s,u){var h=i.pingCache;h!==null&&h.delete(s),s=Qt(),i.pingedLanes|=i.suspendedLanes&u,Pt===i&&(Mt&u)===u&&(Et===4||Et===3&&(Mt&130023424)===Mt&&500>je()-Pd?Zi(i,0):_d|=u),an(i,s)}function hy(i,s){s===0&&((i.mode&1)===0?s=1:(s=qe,qe<<=1,(qe&130023424)===0&&(qe=4194304)));var u=Qt();i=Or(i,s),i!==null&&(Qn(i,s,u),an(i,u))}function Kk(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),hy(i,u)}function Yk(i,s){var u=0;switch(i.tag){case 13:var h=i.stateNode,g=i.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=i.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(s),hy(i,u)}var py;py=function(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps||nn.current)sn=!0;else{if((i.lanes&u)===0&&(s.flags&128)===0)return sn=!1,Lk(i,s,u);sn=(i.flags&131072)!==0}else sn=!1,st&&(s.flags&1048576)!==0&&Gm(s,Tl,s.index);switch(s.lanes=0,s.tag){case 2:var h=s.type;$l(i,s),i=s.pendingProps;var g=js(s,Ft.current);Fs(s,u),g=od(null,s,h,i,g,u);var x=ad();return s.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,rn(h)?(x=!0,El(s)):x=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Zc(s),g.updater=Vl,s.stateNode=g,g._reactInternals=s,hd(s,h,i,u),s=yd(null,s,h,!0,x,u)):(s.tag=0,st&&x&&Uc(s),Xt(null,s,g,u),s=s.child),s;case 16:h=s.elementType;e:{switch($l(i,s),i=s.pendingProps,g=h._init,h=g(h._payload),s.type=h,g=s.tag=Qk(h),i=er(h,i),g){case 0:s=gd(null,s,h,i,u);break e;case 1:s=Vg(null,s,h,i,u);break e;case 11:s=Dg(null,s,h,i,u);break e;case 14:s=Lg(null,s,h,er(h.type,i),u);break e}throw Error(n(306,h,""))}return s;case 0:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:er(h,g),gd(i,s,h,g,u);case 1:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:er(h,g),Vg(i,s,h,g,u);case 3:e:{if(Bg(s),i===null)throw Error(n(387));h=s.pendingProps,x=s.memoizedState,g=x.element,ng(i,s),jl(s,h,null,u);var k=s.memoizedState;if(h=k.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){g=Bs(Error(n(423)),s),s=$g(i,s,h,u,g);break e}else if(h!==g){g=Bs(Error(n(424)),s),s=$g(i,s,h,u,g);break e}else for(vn=ci(s.stateNode.containerInfo.firstChild),yn=s,st=!0,Zn=null,u=eg(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ls(),h===g){s=Vr(i,s,u);break e}Xt(i,s,h,u)}s=s.child}return s;case 5:return sg(s),i===null&&qc(s),h=s.type,g=s.pendingProps,x=i!==null?i.memoizedProps:null,k=g.children,zc(h,g)?k=null:x!==null&&zc(h,x)&&(s.flags|=32),Fg(i,s),Xt(i,s,k,u),s.child;case 6:return i===null&&qc(s),null;case 13:return Ug(i,s,u);case 4:return ed(s,s.stateNode.containerInfo),h=s.pendingProps,i===null?s.child=zs(s,null,h,u):Xt(i,s,h,u),s.child;case 11:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:er(h,g),Dg(i,s,h,g,u);case 7:return Xt(i,s,s.pendingProps,u),s.child;case 8:return Xt(i,s,s.pendingProps.children,u),s.child;case 12:return Xt(i,s,s.pendingProps.children,u),s.child;case 10:e:{if(h=s.type._context,g=s.pendingProps,x=s.memoizedProps,k=g.value,Je(Al,h._currentValue),h._currentValue=k,x!==null)if(Jn(x.value,k)){if(x.children===g.children&&!nn.current){s=Vr(i,s,u);break e}}else for(x=s.child,x!==null&&(x.return=s);x!==null;){var R=x.dependencies;if(R!==null){k=x.child;for(var M=R.firstContext;M!==null;){if(M.context===h){if(x.tag===1){M=Fr(-1,u&-u),M.tag=2;var W=x.updateQueue;if(W!==null){W=W.shared;var ne=W.pending;ne===null?M.next=M:(M.next=ne.next,ne.next=M),W.pending=M}}x.lanes|=u,M=x.alternate,M!==null&&(M.lanes|=u),Qc(x.return,u,s),R.lanes|=u;break}M=M.next}}else if(x.tag===10)k=x.type===s.type?null:x.child;else if(x.tag===18){if(k=x.return,k===null)throw Error(n(341));k.lanes|=u,R=k.alternate,R!==null&&(R.lanes|=u),Qc(k,u,s),k=x.sibling}else k=x.child;if(k!==null)k.return=x;else for(k=x;k!==null;){if(k===s){k=null;break}if(x=k.sibling,x!==null){x.return=k.return,k=x;break}k=k.return}x=k}Xt(i,s,g.children,u),s=s.child}return s;case 9:return g=s.type,h=s.pendingProps.children,Fs(s,u),g=jn(g),h=h(g),s.flags|=1,Xt(i,s,h,u),s.child;case 14:return h=s.type,g=er(h,s.pendingProps),g=er(h.type,g),Lg(i,s,h,g,u);case 15:return zg(i,s,s.type,s.pendingProps,u);case 17:return h=s.type,g=s.pendingProps,g=s.elementType===h?g:er(h,g),$l(i,s),s.tag=1,rn(h)?(i=!0,El(s)):i=!1,Fs(s,u),_g(s,h,g),hd(s,h,g,u),yd(null,s,h,!0,i,u);case 19:return Wg(i,s,u);case 22:return Og(i,s,u)}throw Error(n(156,s.tag))};function my(i,s){return we(i,s)}function Xk(i,s,u,h){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(i,s,u,h){return new Xk(i,s,u,h)}function zd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Qk(i){if(typeof i=="function")return zd(i)?1:0;if(i!=null){if(i=i.$$typeof,i===G)return 11;if(i===re)return 14}return 2}function bi(i,s){var u=i.alternate;return u===null?(u=Ln(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&14680064,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u}function Zl(i,s,u,h,g,x){var k=2;if(h=i,typeof i=="function")zd(i)&&(k=1);else if(typeof i=="string")k=5;else e:switch(i){case D:return ts(u.children,g,x,s);case H:k=8,g|=8;break;case ee:return i=Ln(12,u,s,g|2),i.elementType=ee,i.lanes=x,i;case X:return i=Ln(13,u,s,g),i.elementType=X,i.lanes=x,i;case Q:return i=Ln(19,u,s,g),i.elementType=Q,i.lanes=x,i;case oe:return eu(u,g,x,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case L:k=10;break e;case te:k=9;break e;case G:k=11;break e;case re:k=14;break e;case fe:k=16,h=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return s=Ln(k,u,s,g),s.elementType=i,s.type=h,s.lanes=x,s}function ts(i,s,u,h){return i=Ln(7,i,h,s),i.lanes=u,i}function eu(i,s,u,h){return i=Ln(22,i,h,s),i.elementType=oe,i.lanes=u,i.stateNode={isHidden:!1},i}function Od(i,s,u){return i=Ln(6,i,null,s),i.lanes=u,i}function Fd(i,s,u){return s=Ln(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function Jk(i,s,u,h,g){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=An(0),this.expirationTimes=An(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=An(0),this.identifierPrefix=h,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Vd(i,s,u,h,g,x,k,R,M){return i=new Jk(i,s,u,R,M),s===1?(s=1,x===!0&&(s|=8)):s=0,x=Ln(3,null,null,s),i.current=x,x.stateNode=i,x.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zc(x),i}function Zk(i,s,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:h==null?null:""+h,children:i,containerInfo:s,implementation:u}}function gy(i){if(!i)return fi;i=i._reactInternals;e:{if(hn(i)!==i||i.tag!==1)throw Error(n(170));var s=i;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(rn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(i.tag===1){var u=i.type;if(rn(u))return Hm(i,u,s)}return s}function yy(i,s,u,h,g,x,k,R,M){return i=Vd(u,h,!0,i,g,x,k,R,M),i.context=gy(null),u=i.current,h=Qt(),g=xi(u),x=Fr(h,g),x.callback=s??null,mi(u,x,g),i.current.lanes=g,Qn(i,g,h),an(i,h),i}function tu(i,s,u,h){var g=s.current,x=Qt(),k=xi(g);return u=gy(u),s.context===null?s.context=u:s.pendingContext=u,s=Fr(x,k),s.payload={element:i},h=h===void 0?null:h,h!==null&&(s.callback=h),i=mi(g,s,k),i!==null&&(rr(i,g,k,x),Nl(i,g,k)),k}function nu(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function vy(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Bd(i,s){vy(i,s),(i=i.alternate)&&vy(i,s)}function eE(){return null}var xy=typeof reportError=="function"?reportError:function(i){console.error(i)};function $d(i){this._internalRoot=i}ru.prototype.render=$d.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(n(409));tu(i,s,null,null)},ru.prototype.unmount=$d.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;Ji(function(){tu(null,i,null,null)}),s[Mr]=null}};function ru(i){this._internalRoot=i}ru.prototype.unstable_scheduleHydration=function(i){if(i){var s=$i();i={blockedOn:null,target:i,priority:s};for(var u=0;u<ai.length&&s!==0&&s<ai[u].priority;u++);ai.splice(u,0,i),u===0&&sm(i)}};function Ud(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function iu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function wy(){}function tE(i,s,u,h,g){if(g){if(typeof h=="function"){var x=h;h=function(){var W=nu(k);x.call(W)}}var k=yy(s,h,i,0,null,!1,!1,"",wy);return i._reactRootContainer=k,i[Mr]=k.current,Ho(i.nodeType===8?i.parentNode:i),Ji(),k}for(;g=i.lastChild;)i.removeChild(g);if(typeof h=="function"){var R=h;h=function(){var W=nu(M);R.call(W)}}var M=Vd(i,0,!1,null,null,!1,!1,"",wy);return i._reactRootContainer=M,i[Mr]=M.current,Ho(i.nodeType===8?i.parentNode:i),Ji(function(){tu(s,M,u,h)}),M}function su(i,s,u,h,g){var x=u._reactRootContainer;if(x){var k=x;if(typeof g=="function"){var R=g;g=function(){var M=nu(k);R.call(M)}}tu(s,k,i,g)}else k=tE(u,s,i,g,h);return nu(k)}Ao=function(i){switch(i.tag){case 3:var s=i.stateNode;if(s.current.memoizedState.isDehydrated){var u=$e(s.pendingLanes);u!==0&&(Bi(s,u|1),an(s,je()),(We&6)===0&&(Hs=je()+500,hi()))}break;case 13:Ji(function(){var h=Or(i,1);if(h!==null){var g=Qt();rr(h,i,1,g)}}),Bd(i,1)}},ii=function(i){if(i.tag===13){var s=Or(i,134217728);if(s!==null){var u=Qt();rr(s,i,134217728,u)}Bd(i,134217728)}},Ss=function(i){if(i.tag===13){var s=xi(i),u=Or(i,s);if(u!==null){var h=Qt();rr(u,i,s,h)}Bd(i,s)}},$i=function(){return Ue},Ui=function(i,s){var u=Ue;try{return Ue=i,s()}finally{Ue=u}},ti=function(i,s,u){switch(s){case"input":if(en(i,u),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==i&&h.form===i.form){var g=Sl(h);if(!g)throw Error(n(90));Mi(h),en(h,g)}}}break;case"textarea":Zr(i,u);break;case"select":s=u.value,s!=null&&Cn(i,!!u.multiple,s,!1)}},Io=Md,To=Ji;var nE={usingClientEntryPoint:!1,Events:[Go,Rs,Sl,tl,nl,Md]},aa={findFiberByHostInstance:Hi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},rE={bundleType:aa.bundleType,version:aa.version,rendererPackageName:aa.rendererPackageName,rendererConfig:aa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=q(i),i===null?null:i.stateNode},findFiberByHostInstance:aa.findFiberByHostInstance||eE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ou.isDisabled&&ou.supportsFiber)try{tn=ou.inject(rE),Nt=ou}catch{}}return ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nE,ln.createPortal=function(i,s){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ud(s))throw Error(n(200));return Zk(i,s,null,u)},ln.createRoot=function(i,s){if(!Ud(i))throw Error(n(299));var u=!1,h="",g=xy;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=Vd(i,1,!1,null,null,u,!1,h,g),i[Mr]=s.current,Ho(i.nodeType===8?i.parentNode:i),new $d(s)},ln.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=q(s),i=i===null?null:i.stateNode,i},ln.flushSync=function(i){return Ji(i)},ln.hydrate=function(i,s,u){if(!iu(s))throw Error(n(200));return su(null,i,s,!0,u)},ln.hydrateRoot=function(i,s,u){if(!Ud(i))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,g=!1,x="",k=xy;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(k=u.onRecoverableError)),s=yy(s,null,i,1,u??null,g,!1,x,k),i[Mr]=s.current,Ho(i),h)for(i=0;i<h.length;i++)u=h[i],g=u._getVersion,g=g(u._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[u,g]:s.mutableSourceEagerHydrationData.push(u,g);return new ru(s)},ln.render=function(i,s,u){if(!iu(s))throw Error(n(200));return su(null,i,s,!1,u)},ln.unmountComponentAtNode=function(i){if(!iu(i))throw Error(n(40));return i._reactRootContainer?(Ji(function(){su(null,null,i,!1,function(){i._reactRootContainer=null,i[Mr]=null})}),!0):!1},ln.unstable_batchedUpdates=Md,ln.unstable_renderSubtreeIntoContainer=function(i,s,u,h){if(!iu(u))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return su(i,s,u,!1,h)},ln.version="18.3.1-next-f1338f8080-20240426",ln}var Ay;function Nx(){if(Ay)return Gd.exports;Ay=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gd.exports=fE(),Gd.exports}var Ry;function hE(){if(Ry)return au;Ry=1;var e=Nx();return au.createRoot=e.createRoot,au.hydrateRoot=e.hydrateRoot,au}var pE=hE();const mE=Rx(pE);/**
41
41
  * react-router v7.9.6
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -46,11 +46,11 @@ Error generating stack: `+x.message+`
46
46
  * LICENSE.md file in the root directory of this source tree.
47
47
  *
48
48
  * @license MIT
49
- */var Ny="popstate";function gE(e={}){function t(r,o){let{pathname:a,search:l,hash:c}=r.location;return Uf("",{pathname:a,search:l,hash:c},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:ja(o)}return vE(t,n,null,e)}function lt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yE(){return Math.random().toString(36).substring(2,10)}function jy(e,t){return{usr:e.state,key:e.key,idx:t}}function Uf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?po(t):t,state:n,key:t&&t.key||r||yE()}}function ja({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 po(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 vE(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:a=!1}=r,l=o.history,c="POP",d=null,f=p();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function p(){return(l.state||{idx:null}).idx}function m(){c="POP";let C=p(),E=C==null?null:C-f;f=C,d&&d({action:c,location:S.location,delta:E})}function y(C,E){c="PUSH";let P=Uf(S.location,C,E);f=p()+1;let T=jy(P,f),O=S.createHref(P);try{l.pushState(T,"",O)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;o.location.assign(O)}a&&d&&d({action:c,location:S.location,delta:1})}function v(C,E){c="REPLACE";let P=Uf(S.location,C,E);f=p();let T=jy(P,f),O=S.createHref(P);l.replaceState(T,"",O),a&&d&&d({action:c,location:S.location,delta:0})}function b(C){return xE(C)}let S={get action(){return c},get location(){return e(o,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(Ny,m),d=C,()=>{o.removeEventListener(Ny,m),d=null}},createHref(C){return t(o,C)},createURL:b,encodeLocation(C){let E=b(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:v,go(C){return l.go(C)}};return S}function xE(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),lt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ja(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function jx(e,t,n="/"){return wE(e,t,n,!1)}function wE(e,t,n,r){let o=typeof t=="string"?po(t):t,a=Wr(o.pathname||"/",n);if(a==null)return null;let l=Mx(e);bE(l);let c=null;for(let d=0;c==null&&d<l.length;++d){let f=NE(a);c=AE(l[d],f,r)}return c}function Mx(e,t=[],n=[],r="",o=!1){let a=(l,c,d=o,f)=>{let p={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&d)return;lt(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let m=Hr([r,p.relativePath]),y=n.concat(p);l.children&&l.children.length>0&&(lt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),Mx(l.children,t,y,m,d)),!(l.path==null&&!l.index)&&t.push({path:m,score:_E(m,l.index),routesMeta:y})};return e.forEach((l,c)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))a(l,c);else for(let f of Dx(l.path))a(l,c,!0,f)}),t}function Dx(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return o?[a,""]:[a];let l=Dx(r.join("/")),c=[];return c.push(...l.map(d=>d===""?a:[a,d].join("/"))),o&&c.push(...l),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function bE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:PE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var SE=/^:[\w-]+$/,kE=3,EE=2,CE=1,IE=10,TE=-2,My=e=>e==="*";function _E(e,t){let n=e.split("/"),r=n.length;return n.some(My)&&(r+=TE),t&&(r+=EE),n.filter(o=>!My(o)).reduce((o,a)=>o+(SE.test(a)?kE:a===""?CE:IE),r)}function PE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function AE(e,t,n=!1){let{routesMeta:r}=e,o={},a="/",l=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",m=zu({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},p),y=d.route;if(!m&&f&&n&&!r[r.length-1].route.index&&(m=zu({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!m)return null;Object.assign(o,m.params),l.push({params:o,pathname:Hr([a,m.pathname]),pathnameBase:zE(Hr([a,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(a=Hr([a,m.pathnameBase]))}return l}function zu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=RE(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],l=a.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:r.reduce((f,{paramName:p,isOptional:m},y)=>{if(p==="*"){let b=c[y]||"";l=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const v=c[y];return m&&!v?f[p]=void 0:f[p]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:l,pattern:e}}function RE(e,t=!1,n=!0){Gn(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function NE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gn(!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 Wr(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)||"/"}var jE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ME=e=>jE.test(e);function DE(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?po(e):e,a;if(n)if(ME(n))a=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),Gn(!1,`Pathnames cannot have embedded double slashes - normalizing ${l} -> ${n}`)}n.startsWith("/")?a=Dy(n.substring(1),"/"):a=Dy(n,t)}else a=t;return{pathname:a,search:OE(r),hash:FE(o)}}function Dy(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Xd(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 LE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Uh(e){let t=LE(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Hh(e,t,n,r=!1){let o;typeof e=="string"?o=po(e):(o={...e},lt(!o.pathname||!o.pathname.includes("?"),Xd("?","pathname","search",o)),lt(!o.pathname||!o.pathname.includes("#"),Xd("#","pathname","hash",o)),lt(!o.search||!o.search.includes("#"),Xd("#","search","hash",o)));let a=e===""||o.pathname==="",l=a?"/":o.pathname,c;if(l==null)c=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),m-=1;o.pathname=y.join("/")}c=m>=0?t[m]:"/"}let d=DE(o,c),f=l&&l!=="/"&&l.endsWith("/"),p=(a||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||p)&&(d.pathname+="/"),d}var Hr=e=>e.join("/").replace(/\/\/+/g,"/"),zE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),OE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,FE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function VE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Lx=["POST","PUT","PATCH","DELETE"];new Set(Lx);var BE=["GET",...Lx];new Set(BE);var mo=I.createContext(null);mo.displayName="DataRouter";var Ju=I.createContext(null);Ju.displayName="DataRouterState";I.createContext(!1);var zx=I.createContext({isTransitioning:!1});zx.displayName="ViewTransition";var $E=I.createContext(new Map);$E.displayName="Fetchers";var UE=I.createContext(null);UE.displayName="Await";var dr=I.createContext(null);dr.displayName="Navigation";var Ha=I.createContext(null);Ha.displayName="Location";var Ir=I.createContext({outlet:null,matches:[],isDataRoute:!1});Ir.displayName="Route";var Wh=I.createContext(null);Wh.displayName="RouteError";function HE(e,{relative:t}={}){lt(go(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=I.useContext(dr),{hash:o,pathname:a,search:l}=Wa(e,{relative:t}),c=a;return n!=="/"&&(c=a==="/"?n:Hr([n,a])),r.createHref({pathname:c,search:l,hash:o})}function go(){return I.useContext(Ha)!=null}function Ri(){return lt(go(),"useLocation() may be used only in the context of a <Router> component."),I.useContext(Ha).location}var Ox="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Fx(e){I.useContext(dr).static||I.useLayoutEffect(e)}function Zu(){let{isDataRoute:e}=I.useContext(Ir);return e?rC():WE()}function WE(){lt(go(),"useNavigate() may be used only in the context of a <Router> component.");let e=I.useContext(mo),{basename:t,navigator:n}=I.useContext(dr),{matches:r}=I.useContext(Ir),{pathname:o}=Ri(),a=JSON.stringify(Uh(r)),l=I.useRef(!1);return Fx(()=>{l.current=!0}),I.useCallback((d,f={})=>{if(Gn(l.current,Ox),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Hh(d,JSON.parse(a),o,f.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Hr([t,p.pathname])),(f.replace?n.replace:n.push)(p,f.state,f)},[t,n,a,o,e])}I.createContext(null);function Wa(e,{relative:t}={}){let{matches:n}=I.useContext(Ir),{pathname:r}=Ri(),o=JSON.stringify(Uh(n));return I.useMemo(()=>Hh(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function qE(e,t){return Vx(e,t)}function Vx(e,t,n,r,o){var P;lt(go(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=I.useContext(dr),{matches:l}=I.useContext(Ir),c=l[l.length-1],d=c?c.params:{},f=c?c.pathname:"/",p=c?c.pathnameBase:"/",m=c&&c.route;{let T=m&&m.path||"";Bx(f,!m||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${T}">) 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.
49
+ */var Ny="popstate";function gE(e={}){function t(r,o){let{pathname:a,search:l,hash:c}=r.location;return Uf("",{pathname:a,search:l,hash:c},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:ja(o)}return vE(t,n,null,e)}function at(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yE(){return Math.random().toString(36).substring(2,10)}function jy(e,t){return{usr:e.state,key:e.key,idx:t}}function Uf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?po(t):t,state:n,key:t&&t.key||r||yE()}}function ja({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 po(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 vE(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:a=!1}=r,l=o.history,c="POP",d=null,f=p();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function p(){return(l.state||{idx:null}).idx}function m(){c="POP";let C=p(),E=C==null?null:C-f;f=C,d&&d({action:c,location:S.location,delta:E})}function y(C,E){c="PUSH";let P=Uf(S.location,C,E);f=p()+1;let T=jy(P,f),O=S.createHref(P);try{l.pushState(T,"",O)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;o.location.assign(O)}a&&d&&d({action:c,location:S.location,delta:1})}function v(C,E){c="REPLACE";let P=Uf(S.location,C,E);f=p();let T=jy(P,f),O=S.createHref(P);l.replaceState(T,"",O),a&&d&&d({action:c,location:S.location,delta:0})}function b(C){return xE(C)}let S={get action(){return c},get location(){return e(o,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(Ny,m),d=C,()=>{o.removeEventListener(Ny,m),d=null}},createHref(C){return t(o,C)},createURL:b,encodeLocation(C){let E=b(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:v,go(C){return l.go(C)}};return S}function xE(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),at(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ja(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function jx(e,t,n="/"){return wE(e,t,n,!1)}function wE(e,t,n,r){let o=typeof t=="string"?po(t):t,a=Wr(o.pathname||"/",n);if(a==null)return null;let l=Mx(e);bE(l);let c=null;for(let d=0;c==null&&d<l.length;++d){let f=NE(a);c=AE(l[d],f,r)}return c}function Mx(e,t=[],n=[],r="",o=!1){let a=(l,c,d=o,f)=>{let p={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&d)return;at(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let m=Hr([r,p.relativePath]),y=n.concat(p);l.children&&l.children.length>0&&(at(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),Mx(l.children,t,y,m,d)),!(l.path==null&&!l.index)&&t.push({path:m,score:_E(m,l.index),routesMeta:y})};return e.forEach((l,c)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))a(l,c);else for(let f of Dx(l.path))a(l,c,!0,f)}),t}function Dx(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return o?[a,""]:[a];let l=Dx(r.join("/")),c=[];return c.push(...l.map(d=>d===""?a:[a,d].join("/"))),o&&c.push(...l),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function bE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:PE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var SE=/^:[\w-]+$/,kE=3,EE=2,CE=1,IE=10,TE=-2,My=e=>e==="*";function _E(e,t){let n=e.split("/"),r=n.length;return n.some(My)&&(r+=TE),t&&(r+=EE),n.filter(o=>!My(o)).reduce((o,a)=>o+(SE.test(a)?kE:a===""?CE:IE),r)}function PE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function AE(e,t,n=!1){let{routesMeta:r}=e,o={},a="/",l=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",m=zu({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},p),y=d.route;if(!m&&f&&n&&!r[r.length-1].route.index&&(m=zu({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!m)return null;Object.assign(o,m.params),l.push({params:o,pathname:Hr([a,m.pathname]),pathnameBase:zE(Hr([a,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(a=Hr([a,m.pathnameBase]))}return l}function zu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=RE(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],l=a.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:r.reduce((f,{paramName:p,isOptional:m},y)=>{if(p==="*"){let b=c[y]||"";l=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const v=c[y];return m&&!v?f[p]=void 0:f[p]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:l,pattern:e}}function RE(e,t=!1,n=!0){Gn(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function NE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gn(!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 Wr(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)||"/"}var jE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ME=e=>jE.test(e);function DE(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?po(e):e,a;if(n)if(ME(n))a=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),Gn(!1,`Pathnames cannot have embedded double slashes - normalizing ${l} -> ${n}`)}n.startsWith("/")?a=Dy(n.substring(1),"/"):a=Dy(n,t)}else a=t;return{pathname:a,search:OE(r),hash:FE(o)}}function Dy(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Xd(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 LE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Uh(e){let t=LE(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Hh(e,t,n,r=!1){let o;typeof e=="string"?o=po(e):(o={...e},at(!o.pathname||!o.pathname.includes("?"),Xd("?","pathname","search",o)),at(!o.pathname||!o.pathname.includes("#"),Xd("#","pathname","hash",o)),at(!o.search||!o.search.includes("#"),Xd("#","search","hash",o)));let a=e===""||o.pathname==="",l=a?"/":o.pathname,c;if(l==null)c=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),m-=1;o.pathname=y.join("/")}c=m>=0?t[m]:"/"}let d=DE(o,c),f=l&&l!=="/"&&l.endsWith("/"),p=(a||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||p)&&(d.pathname+="/"),d}var Hr=e=>e.join("/").replace(/\/\/+/g,"/"),zE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),OE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,FE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function VE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Lx=["POST","PUT","PATCH","DELETE"];new Set(Lx);var BE=["GET",...Lx];new Set(BE);var mo=I.createContext(null);mo.displayName="DataRouter";var Ju=I.createContext(null);Ju.displayName="DataRouterState";I.createContext(!1);var zx=I.createContext({isTransitioning:!1});zx.displayName="ViewTransition";var $E=I.createContext(new Map);$E.displayName="Fetchers";var UE=I.createContext(null);UE.displayName="Await";var dr=I.createContext(null);dr.displayName="Navigation";var Ha=I.createContext(null);Ha.displayName="Location";var Ir=I.createContext({outlet:null,matches:[],isDataRoute:!1});Ir.displayName="Route";var Wh=I.createContext(null);Wh.displayName="RouteError";function HE(e,{relative:t}={}){at(go(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=I.useContext(dr),{hash:o,pathname:a,search:l}=Wa(e,{relative:t}),c=a;return n!=="/"&&(c=a==="/"?n:Hr([n,a])),r.createHref({pathname:c,search:l,hash:o})}function go(){return I.useContext(Ha)!=null}function Ri(){return at(go(),"useLocation() may be used only in the context of a <Router> component."),I.useContext(Ha).location}var Ox="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Fx(e){I.useContext(dr).static||I.useLayoutEffect(e)}function Zu(){let{isDataRoute:e}=I.useContext(Ir);return e?rC():WE()}function WE(){at(go(),"useNavigate() may be used only in the context of a <Router> component.");let e=I.useContext(mo),{basename:t,navigator:n}=I.useContext(dr),{matches:r}=I.useContext(Ir),{pathname:o}=Ri(),a=JSON.stringify(Uh(r)),l=I.useRef(!1);return Fx(()=>{l.current=!0}),I.useCallback((d,f={})=>{if(Gn(l.current,Ox),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Hh(d,JSON.parse(a),o,f.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Hr([t,p.pathname])),(f.replace?n.replace:n.push)(p,f.state,f)},[t,n,a,o,e])}I.createContext(null);function Wa(e,{relative:t}={}){let{matches:n}=I.useContext(Ir),{pathname:r}=Ri(),o=JSON.stringify(Uh(n));return I.useMemo(()=>Hh(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function qE(e,t){return Vx(e,t)}function Vx(e,t,n,r,o){var P;at(go(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=I.useContext(dr),{matches:l}=I.useContext(Ir),c=l[l.length-1],d=c?c.params:{},f=c?c.pathname:"/",p=c?c.pathnameBase:"/",m=c&&c.route;{let T=m&&m.path||"";Bx(f,!m||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
50
 
51
- Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let y=Ri(),v;if(t){let T=typeof t=="string"?po(t):t;lt(p==="/"||((P=T.pathname)==null?void 0:P.startsWith(p)),`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 "${p}" but pathname "${T.pathname}" was given in the \`location\` prop.`),v=T}else v=y;let b=v.pathname||"/",S=b;if(p!=="/"){let T=p.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(T.length).join("/")}let C=jx(e,{pathname:S});Gn(m||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Gn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 E=QE(C&&C.map(T=>Object.assign({},T,{params:Object.assign({},d,T.params),pathname:Hr([p,a.encodeLocation?a.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?p:Hr([p,a.encodeLocation?a.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),l,n,r,o);return t&&E?I.createElement(Ha.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},E):E}function GE(){let e=nC(),t=VE(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)",o={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=I.createElement(I.Fragment,null,I.createElement("p",null,"💿 Hey developer 👋"),I.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",I.createElement("code",{style:a},"ErrorBoundary")," or"," ",I.createElement("code",{style:a},"errorElement")," prop on your route.")),I.createElement(I.Fragment,null,I.createElement("h2",null,"Unexpected Application Error!"),I.createElement("h3",{style:{fontStyle:"italic"}},t),n?I.createElement("pre",{style:o},n):null,l)}var KE=I.createElement(GE,null),YE=class extends I.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?e.error:t.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(){return this.state.error!==void 0?I.createElement(Ir.Provider,{value:this.props.routeContext},I.createElement(Wh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function XE({routeContext:e,match:t,children:n}){let r=I.useContext(mo);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),I.createElement(Ir.Provider,{value:e},n)}function QE(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=n==null?void 0:n.errors;if(l!=null){let p=a.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);lt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let c=!1,d=-1;if(n)for(let p=0;p<a.length;p++){let m=a[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=p),m.route.id){let{loaderData:y,errors:v}=n,b=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||b){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}let f=n&&r?(p,m)=>{var y,v;r(p,{location:n.location,params:((v=(y=n.matches)==null?void 0:y[0])==null?void 0:v.params)??{},errorInfo:m})}:void 0;return a.reduceRight((p,m,y)=>{let v,b=!1,S=null,C=null;n&&(v=l&&m.route.id?l[m.route.id]:void 0,S=m.route.errorElement||KE,c&&(d<0&&y===0?(Bx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,C=null):d===y&&(b=!0,C=m.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,y+1)),P=()=>{let T;return v?T=S:b?T=C:m.route.Component?T=I.createElement(m.route.Component,null):m.route.element?T=m.route.element:T=p,I.createElement(XE,{match:m,routeContext:{outlet:p,matches:E,isDataRoute:n!=null},children:T})};return n&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?I.createElement(YE,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:P(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:f}):P()},null)}function qh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function JE(e){let t=I.useContext(mo);return lt(t,qh(e)),t}function ZE(e){let t=I.useContext(Ju);return lt(t,qh(e)),t}function eC(e){let t=I.useContext(Ir);return lt(t,qh(e)),t}function Gh(e){let t=eC(e),n=t.matches[t.matches.length-1];return lt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function tC(){return Gh("useRouteId")}function nC(){var r;let e=I.useContext(Wh),t=ZE("useRouteError"),n=Gh("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function rC(){let{router:e}=JE("useNavigate"),t=Gh("useNavigate"),n=I.useRef(!1);return Fx(()=>{n.current=!0}),I.useCallback(async(o,a={})=>{Gn(n.current,Ox),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...a}))},[e,t])}var Ly={};function Bx(e,t,n){!t&&!Ly[e]&&(Ly[e]=!0,Gn(!1,n))}I.memo(iC);function iC({routes:e,future:t,state:n,unstable_onError:r}){return Vx(e,void 0,n,r,t)}function Hf({to:e,replace:t,state:n,relative:r}){lt(go(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=I.useContext(dr);Gn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=I.useContext(Ir),{pathname:l}=Ri(),c=Zu(),d=Hh(e,Uh(a),l,r==="path"),f=JSON.stringify(d);return I.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function Js(e){lt(!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 sC({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:a=!1}){lt(!go(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=I.useMemo(()=>({basename:l,navigator:o,static:a,future:{}}),[l,o,a]);typeof n=="string"&&(n=po(n));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:y="default"}=n,v=I.useMemo(()=>{let b=Wr(d,l);return b==null?null:{location:{pathname:b,search:f,hash:p,state:m,key:y},navigationType:r}},[l,d,f,p,m,y,r]);return Gn(v!=null,`<Router basename="${l}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:I.createElement(dr.Provider,{value:c},I.createElement(Ha.Provider,{children:t,value:v}))}function oC({children:e,location:t}){return qE(Wf(e),t)}function Wf(e,t=[]){let n=[];return I.Children.forEach(e,(r,o)=>{if(!I.isValidElement(r))return;let a=[...t,o];if(r.type===I.Fragment){n.push.apply(n,Wf(r.props.children,a));return}lt(r.type===Js,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),lt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Wf(r.props.children,a)),n.push(l)}),n}var Tu="get",_u="application/x-www-form-urlencoded";function ec(e){return e!=null&&typeof e.tagName=="string"}function aC(e){return ec(e)&&e.tagName.toLowerCase()==="button"}function lC(e){return ec(e)&&e.tagName.toLowerCase()==="form"}function uC(e){return ec(e)&&e.tagName.toLowerCase()==="input"}function cC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dC(e,t){return e.button===0&&(!t||t==="_self")&&!cC(e)}var lu=null;function fC(){if(lu===null)try{new FormData(document.createElement("form"),0),lu=!1}catch{lu=!0}return lu}var hC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qd(e){return e!=null&&!hC.has(e)?(Gn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_u}"`),null):e}function pC(e,t){let n,r,o,a,l;if(lC(e)){let c=e.getAttribute("action");r=c?Wr(c,t):null,n=e.getAttribute("method")||Tu,o=Qd(e.getAttribute("enctype"))||_u,a=new FormData(e)}else if(aC(e)||uC(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||c.getAttribute("action");if(r=d?Wr(d,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Tu,o=Qd(e.getAttribute("formenctype"))||Qd(c.getAttribute("enctype"))||_u,a=new FormData(c,e),!fC()){let{name:f,type:p,value:m}=e;if(p==="image"){let y=f?`${f}.`:"";a.append(`${y}x`,"0"),a.append(`${y}y`,"0")}else f&&a.append(f,m)}}else{if(ec(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Tu,r=null,o=_u,l=e}return a&&o==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Kh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mC(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&Wr(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function gC(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function yC(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 vC(e,t,n){let r=await Promise.all(e.map(async o=>{let a=t.routes[o.route.id];if(a){let l=await gC(a,n);return l.links?l.links():[]}return[]}));return SC(r.flat(1).filter(yC).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function zy(e,t,n,r,o,a){let l=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,c=(d,f)=>{var p;return n[f].pathname!==d.pathname||((p=n[f].route.path)==null?void 0:p.endsWith("*"))&&n[f].params["*"]!==d.params["*"]};return a==="assets"?t.filter((d,f)=>l(d,f)||c(d,f)):a==="data"?t.filter((d,f)=>{var m;let p=r.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(l(d,f)||c(d,f))return!0;if(d.route.shouldRevalidate){let y=d.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function xC(e,t,{includeHydrateFallback:n}={}){return wC(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function wC(e){return[...new Set(e)]}function bC(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function SC(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let a=JSON.stringify(bC(o));return n.has(a)||(n.add(a),r.push({key:a,link:o})),r},[])}function $x(){let e=I.useContext(mo);return Kh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function kC(){let e=I.useContext(Ju);return Kh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yh=I.createContext(void 0);Yh.displayName="FrameworkContext";function Ux(){let e=I.useContext(Yh);return Kh(e,"You must render this element inside a <HydratedRouter> element"),e}function EC(e,t){let n=I.useContext(Yh),[r,o]=I.useState(!1),[a,l]=I.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:f,onMouseLeave:p,onTouchStart:m}=t,y=I.useRef(null);I.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=E=>{E.forEach(P=>{l(P.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),I.useEffect(()=>{if(r){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[r]);let v=()=>{o(!0)},b=()=>{o(!1),l(!1)};return n?e!=="intent"?[a,y,{}]:[a,y,{onFocus:ua(c,v),onBlur:ua(d,b),onMouseEnter:ua(f,v),onMouseLeave:ua(p,b),onTouchStart:ua(m,v)}]:[!1,y,{}]}function ua(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function CC({page:e,...t}){let{router:n}=$x(),r=I.useMemo(()=>jx(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?I.createElement(TC,{page:e,matches:r,...t}):null}function IC(e){let{manifest:t,routeModules:n}=Ux(),[r,o]=I.useState([]);return I.useEffect(()=>{let a=!1;return vC(e,t,n).then(l=>{a||o(l)}),()=>{a=!0}},[e,t,n]),r}function TC({page:e,matches:t,...n}){let r=Ri(),{manifest:o,routeModules:a}=Ux(),{basename:l}=$x(),{loaderData:c,matches:d}=kC(),f=I.useMemo(()=>zy(e,t,d,o,r,"data"),[e,t,d,o,r]),p=I.useMemo(()=>zy(e,t,d,o,r,"assets"),[e,t,d,o,r]),m=I.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,S=!1;if(t.forEach(E=>{var T;let P=o.routes[E.route.id];!P||!P.hasLoader||(!f.some(O=>O.route.id===E.route.id)&&E.route.id in c&&((T=a[E.route.id])!=null&&T.shouldRevalidate)||P.hasClientLoader?S=!0:b.add(E.route.id))}),b.size===0)return[];let C=mC(e,l,"data");return S&&b.size>0&&C.searchParams.set("_routes",t.filter(E=>b.has(E.route.id)).map(E=>E.route.id).join(",")),[C.pathname+C.search]},[l,c,r,o,f,t,e,a]),y=I.useMemo(()=>xC(p,o),[p,o]),v=IC(p);return I.createElement(I.Fragment,null,m.map(b=>I.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),y.map(b=>I.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),v.map(({key:b,link:S})=>I.createElement("link",{key:b,nonce:n.nonce,...S})))}function _C(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Hx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Hx&&(window.__reactRouterVersion="7.9.6")}catch{}function PC({basename:e,children:t,window:n}){let r=I.useRef();r.current==null&&(r.current=gE({window:n,v5Compat:!0}));let o=r.current,[a,l]=I.useState({action:o.action,location:o.location}),c=I.useCallback(d=>{I.startTransition(()=>l(d))},[l]);return I.useLayoutEffect(()=>o.listen(c),[o,c]),I.createElement(sC,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o})}var Wx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tc=I.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:a,replace:l,state:c,target:d,to:f,preventScrollReset:p,viewTransition:m,...y},v){let{basename:b}=I.useContext(dr),S=typeof f=="string"&&Wx.test(f),C,E=!1;if(typeof f=="string"&&S&&(C=f,Hx))try{let ee=new URL(window.location.href),L=f.startsWith("//")?new URL(ee.protocol+f):new URL(f),te=Wr(L.pathname,b);L.origin===ee.origin&&te!=null?f=te+L.search+L.hash:E=!0}catch{Gn(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let P=HE(f,{relative:o}),[T,O,V]=EC(r,y),N=jC(f,{replace:l,state:c,target:d,preventScrollReset:p,relative:o,viewTransition:m});function D(ee){t&&t(ee),ee.defaultPrevented||N(ee)}let H=I.createElement("a",{...y,...V,href:C||P,onClick:E||a?t:D,ref:_C(v,O),target:d,"data-discover":!S&&n==="render"?"true":void 0});return T&&!S?I.createElement(I.Fragment,null,H,I.createElement(CC,{page:P})):H});tc.displayName="Link";var AC=I.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:a,to:l,viewTransition:c,children:d,...f},p){let m=Wa(l,{relative:f.relative}),y=Ri(),v=I.useContext(Ju),{navigator:b,basename:S}=I.useContext(dr),C=v!=null&&OC(m)&&c===!0,E=b.encodeLocation?b.encodeLocation(m).pathname:m.pathname,P=y.pathname,T=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(P=P.toLowerCase(),T=T?T.toLowerCase():null,E=E.toLowerCase()),T&&S&&(T=Wr(T,S)||T);const O=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let V=P===E||!o&&P.startsWith(E)&&P.charAt(O)==="/",N=T!=null&&(T===E||!o&&T.startsWith(E)&&T.charAt(E.length)==="/"),D={isActive:V,isPending:N,isTransitioning:C},H=V?t:void 0,ee;typeof r=="function"?ee=r(D):ee=[r,V?"active":null,N?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let L=typeof a=="function"?a(D):a;return I.createElement(tc,{...f,"aria-current":H,className:ee,ref:p,style:L,to:l,viewTransition:c},typeof d=="function"?d(D):d)});AC.displayName="NavLink";var RC=I.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:a,method:l=Tu,action:c,onSubmit:d,relative:f,preventScrollReset:p,viewTransition:m,...y},v)=>{let b=LC(),S=zC(c,{relative:f}),C=l.toLowerCase()==="get"?"get":"post",E=typeof c=="string"&&Wx.test(c),P=T=>{if(d&&d(T),T.defaultPrevented)return;T.preventDefault();let O=T.nativeEvent.submitter,V=(O==null?void 0:O.getAttribute("formmethod"))||l;b(O||T.currentTarget,{fetcherKey:t,method:V,navigate:n,replace:o,state:a,relative:f,preventScrollReset:p,viewTransition:m})};return I.createElement("form",{ref:v,method:C,action:S,onSubmit:r?d:P,...y,"data-discover":!E&&e==="render"?"true":void 0})});RC.displayName="Form";function NC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qx(e){let t=I.useContext(mo);return lt(t,NC(e)),t}function jC(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:a,viewTransition:l}={}){let c=Zu(),d=Ri(),f=Wa(e,{relative:a});return I.useCallback(p=>{if(dC(p,t)){p.preventDefault();let m=n!==void 0?n:ja(d)===ja(f);c(e,{replace:m,state:r,preventScrollReset:o,relative:a,viewTransition:l})}},[d,c,f,n,r,t,e,o,a,l])}var MC=0,DC=()=>`__${String(++MC)}__`;function LC(){let{router:e}=qx("useSubmit"),{basename:t}=I.useContext(dr),n=tC();return I.useCallback(async(r,o={})=>{let{action:a,method:l,encType:c,formData:d,body:f}=pC(r,t);if(o.navigate===!1){let p=o.fetcherKey||DC();await e.fetch(p,n,o.action||a,{preventScrollReset:o.preventScrollReset,formData:d,body:f,formMethod:o.method||l,formEncType:o.encType||c,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:d,body:f,formMethod:o.method||l,formEncType:o.encType||c,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function zC(e,{relative:t}={}){let{basename:n}=I.useContext(dr),r=I.useContext(Ir);lt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),a={...Wa(e||".",{relative:t})},l=Ri();if(e==null){a.search=l.search;let c=new URLSearchParams(a.search),d=c.getAll("index");if(d.some(p=>p==="")){c.delete("index"),d.filter(m=>m).forEach(m=>c.append("index",m));let p=c.toString();a.search=p?`?${p}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Hr([n,a.pathname])),ja(a)}function OC(e,{relative:t}={}){let n=I.useContext(zx);lt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=qx("useViewTransitionState"),o=Wa(e,{relative:t});if(!n.isTransitioning)return!1;let a=Wr(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Wr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return zu(o.pathname,l)!=null||zu(o.pathname,a)!=null}var FC=Nx();const Gx=I.createContext(null),ss="portagent_token",qs="portagent_user";async function VC(e,t){try{const n=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({usernameOrEmail:e,password:t})}),r=await n.json();return n.ok?{token:r.token,user:r.user}:{error:r.error||"Login failed"}}catch{return{error:"Network error"}}}async function BC(e,t,n,r){try{const o=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,email:t,password:n,displayName:r})}),a=await o.json();return o.ok?{token:a.token,user:a.user}:{error:a.error||"Registration failed"}}catch{return{error:"Network error"}}}async function $C(e){try{const t=await fetch("/api/auth/verify",{headers:{Authorization:`Bearer ${e}`}});return t.ok?(await t.json()).user:null}catch{return null}}function UC({children:e}){const[t,n]=I.useState(null),[r,o]=I.useState(null),[a,l]=I.useState(!0);I.useEffect(()=>{const p=localStorage.getItem(ss),m=localStorage.getItem(qs);if(p&&m)try{$C(p).then(y=>{y?(n(p),o(y)):(localStorage.removeItem(ss),localStorage.removeItem(qs)),l(!1)})}catch{localStorage.removeItem(ss),localStorage.removeItem(qs),l(!1)}else l(!1)},[]);const c=I.useCallback(async(p,m)=>{const y=await VC(p,m);return"token"in y?(localStorage.setItem(ss,y.token),localStorage.setItem(qs,JSON.stringify(y.user)),n(y.token),o(y.user),{success:!0}):{success:!1,error:y.error}},[]),d=I.useCallback(async(p,m,y,v)=>{const b=await BC(p,m,y,v);return"token"in b?(localStorage.setItem(ss,b.token),localStorage.setItem(qs,JSON.stringify(b.user)),n(b.token),o(b.user),{success:!0}):{success:!1,error:b.error}},[]),f=I.useCallback(()=>{localStorage.removeItem(ss),localStorage.removeItem(qs),n(null),o(null)},[]);return w.jsx(Gx.Provider,{value:{isAuthenticated:!!t,isLoading:a,token:t,user:r,login:c,register:d,logout:f},children:e})}function nc(){const e=I.useContext(Gx);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function HC(){return localStorage.getItem(ss)}function WC(){const[e,t]=I.useState(""),[n,r]=I.useState(""),[o,a]=I.useState(""),[l,c]=I.useState(!1),{login:d,isAuthenticated:f}=nc(),p=Zu();I.useEffect(()=>{f&&p("/studio",{replace:!0})},[f,p]);const m=async y=>{y.preventDefault(),a(""),c(!0);const v=await d(e,n);v.success?p("/studio",{replace:!0}):(a(v.error||"Login failed"),c(!1))};return w.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:w.jsxs("div",{className:"w-full max-w-md",children:[w.jsxs("div",{className:"text-center mb-8",children:[w.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Portagent"}),w.jsx("p",{className:"text-muted-foreground",children:"AgentX Portal"})]}),w.jsxs("div",{className:"bg-card rounded-lg p-8 shadow-xl border border-border",children:[w.jsxs("form",{onSubmit:m,className:"space-y-6",children:[w.jsxs("div",{children:[w.jsx("label",{htmlFor:"usernameOrEmail",className:"block text-sm font-medium text-foreground mb-2",children:"Username or Email"}),w.jsx("input",{id:"usernameOrEmail",type:"text",value:e,onChange:y=>t(y.target.value),placeholder:"Enter your username or email",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",autoFocus:!0,required:!0})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),w.jsx("input",{id:"password",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"Enter your password",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",required:!0})]}),o&&w.jsx("div",{className:"text-destructive text-sm text-center",children:o}),w.jsx("button",{type:"submit",disabled:l||!e||!n,className:"w-full py-3 px-4 bg-primary hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed text-primary-foreground font-medium rounded-lg transition-colors",children:l?"Signing in...":"Sign In"})]}),w.jsx("div",{className:"mt-6 text-center text-sm text-muted-foreground",children:w.jsxs("p",{children:["Don't have an account?"," ",w.jsx(tc,{to:"/register",className:"text-primary hover:underline",children:"Sign up"})]})})]})]})})}function qC(){const[e,t]=I.useState(""),[n,r]=I.useState(""),[o,a]=I.useState(""),[l,c]=I.useState(""),[d,f]=I.useState(""),[p,m]=I.useState(""),[y,v]=I.useState(!1),{register:b,isAuthenticated:S}=nc(),C=Zu();I.useEffect(()=>{S&&C("/studio",{replace:!0})},[S,C]);const E=async P=>{if(P.preventDefault(),m(""),o!==l){m("Passwords do not match");return}if(o.length<6){m("Password must be at least 6 characters");return}if(e.length<3){m("Username must be at least 3 characters");return}if(!n.includes("@")){m("Invalid email address");return}v(!0);const T=await b(e,n,o,d||void 0);T.success?C("/studio",{replace:!0}):(m(T.error||"Registration failed"),v(!1))};return w.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:w.jsxs("div",{className:"w-full max-w-md",children:[w.jsxs("div",{className:"text-center mb-8",children:[w.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Portagent"}),w.jsx("p",{className:"text-muted-foreground",children:"Create your account"})]}),w.jsxs("div",{className:"bg-card rounded-lg p-8 shadow-xl border border-border",children:[w.jsxs("form",{onSubmit:E,className:"space-y-4",children:[w.jsxs("div",{children:[w.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-2",children:"Username *"}),w.jsx("input",{id:"username",type:"text",value:e,onChange:P=>t(P.target.value),placeholder:"Choose a username",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",autoFocus:!0,required:!0,minLength:3})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-foreground mb-2",children:"Email *"}),w.jsx("input",{id:"email",type:"email",value:n,onChange:P=>r(P.target.value),placeholder:"your@email.com",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",required:!0})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"displayName",className:"block text-sm font-medium text-foreground mb-2",children:"Display Name (optional)"}),w.jsx("input",{id:"displayName",type:"text",value:d,onChange:P=>f(P.target.value),placeholder:"How you want to be called",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-2",children:"Password *"}),w.jsx("input",{id:"password",type:"password",value:o,onChange:P=>a(P.target.value),placeholder:"At least 6 characters",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",required:!0,minLength:6})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-foreground mb-2",children:"Confirm Password *"}),w.jsx("input",{id:"confirmPassword",type:"password",value:l,onChange:P=>c(P.target.value),placeholder:"Re-enter your password",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",required:!0,minLength:6})]}),p&&w.jsx("div",{className:"text-destructive text-sm text-center",children:p}),w.jsx("button",{type:"submit",disabled:y||!e||!n||!o||!l,className:"w-full py-3 px-4 bg-primary hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed text-primary-foreground font-medium rounded-lg transition-colors",children:y?"Creating account...":"Sign Up"})]}),w.jsx("div",{className:"mt-6 text-center text-sm text-muted-foreground",children:w.jsxs("p",{children:["Already have an account?"," ",w.jsx(tc,{to:"/login",className:"text-primary hover:underline",children:"Sign in"})]})})]})]})})}var dn=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT",e))(dn||{}),GC=["agent_initializing","agent_ready","agent_destroyed","conversation_queued","conversation_start","conversation_thinking","conversation_responding","conversation_end","conversation_interrupted","tool_planned","tool_executing","tool_completed","tool_failed","error_occurred"],KC=new Set(GC),YC=["user_message","assistant_message","tool_call_message","tool_result_message"];new Set(YC);var XC=["error"];new Set(XC);var QC=["turn_request","turn_response"];new Set(QC);var Kx=["message_start","message_delta","message_stop","text_content_block_start","text_delta","text_content_block_stop","tool_use_content_block_start","input_json_delta","tool_use_content_block_stop","tool_call","tool_result","interrupted"];new Set(Kx);function JC(e){return"type"in e&&KC.has(e.type)}var ZC=Object.defineProperty,eI=(e,t,n)=>t in e?ZC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ls=(e,t,n)=>eI(e,typeof t!="symbol"?t+"":t,n),Yx=class qf{constructor(t,n={}){ls(this,"name"),ls(this,"level"),ls(this,"colors"),ls(this,"timestamps"),this.name=t,this.level=n.level??dn.INFO,this.colors=n.colors??this.isNodeEnvironment(),this.timestamps=n.timestamps??!0}debug(t,n){this.isDebugEnabled()&&this.log("DEBUG",t,n)}info(t,n){this.isInfoEnabled()&&this.log("INFO",t,n)}warn(t,n){this.isWarnEnabled()&&this.log("WARN",t,n)}error(t,n){this.isErrorEnabled()&&(t instanceof Error?this.log("ERROR",t.message,{...n,stack:t.stack}):this.log("ERROR",t,n))}isDebugEnabled(){return this.level<=dn.DEBUG}isInfoEnabled(){return this.level<=dn.INFO}isWarnEnabled(){return this.level<=dn.WARN}isErrorEnabled(){return this.level<=dn.ERROR}log(t,n,r){const o=[];if(this.timestamps&&o.push(new Date().toISOString()),this.colors){const c=qf.COLORS[t];o.push(`${c}${t.padEnd(5)}${qf.COLORS.RESET}`)}else o.push(t.padEnd(5));o.push(`[${this.name}]`),o.push(n);const a=o.join(" "),l=this.getConsoleMethod(t);r&&Object.keys(r).length>0?l(a,r):l(a)}getConsoleMethod(t){switch(t){case"DEBUG":return console.debug.bind(console);case"INFO":return console.info.bind(console);case"WARN":return console.warn.bind(console);case"ERROR":return console.error.bind(console);default:return console.log.bind(console)}}isNodeEnvironment(){var t;return typeof process<"u"&&((t=process.versions)==null?void 0:t.node)!==void 0}};ls(Yx,"COLORS",{DEBUG:"\x1B[36m",INFO:"\x1B[32m",WARN:"\x1B[33m",ERROR:"\x1B[31m",RESET:"\x1B[0m"});var tI=Yx,ka=null,rc=class{static getLogger(t){const n=typeof t=="string"?t:t.name;if(this.loggers.has(n))return this.loggers.get(n);const r=this.createLazyLogger(n);return this.loggers.set(n,r),r}static configure(t){this.config={...this.config,...t}}static reset(){this.loggers.clear(),this.config={defaultLevel:dn.INFO},ka=null}static createLazyLogger(t){let n=null;const r=()=>(n||(n=this.createLogger(t)),n);return{name:t,level:this.config.defaultLevel||dn.INFO,debug:(o,a)=>r().debug(o,a),info:(o,a)=>r().info(o,a),warn:(o,a)=>r().warn(o,a),error:(o,a)=>r().error(o,a),isDebugEnabled:()=>r().isDebugEnabled(),isInfoEnabled:()=>r().isInfoEnabled(),isWarnEnabled:()=>r().isWarnEnabled(),isErrorEnabled:()=>r().isErrorEnabled()}}static createLogger(t){return ka?ka.getLogger(t):this.config.defaultImplementation?this.config.defaultImplementation(t):new tI(t,{level:this.config.defaultLevel,...this.config.consoleOptions})}};ls(rc,"loggers",new Map);ls(rc,"config",{defaultLevel:dn.INFO});function nI(e){ka=e,rc.reset(),ka=e}function Gt(e){return rc.getLogger(e)}class Gf extends Error{constructor(n,r,o){const a=n.status||n.status===0?n.status:"",l=n.statusText??"",c=`${a} ${l}`.trim(),d=c?`status code ${c}`:"an unknown error";super(`Request failed with ${d}: ${r.method} ${r.url}`);je(this,"response");je(this,"request");je(this,"options");this.name="HTTPError",this.response=n,this.request=r,this.options=o}}class Xx extends Error{constructor(n){let r="Non-error value was thrown";try{typeof n=="string"?r=n:n&&typeof n=="object"&&"message"in n&&typeof n.message=="string"&&(r=n.message)}catch{}super(r);je(this,"name","NonError");je(this,"value");this.value=n}}class Jd extends Error{constructor(n){const r=n!=null&&n.cause?n.cause instanceof Error?n.cause:new Xx(n.cause):void 0;super(n!=null&&n.code?`Forced retry: ${n.code}`:"Forced retry",r?{cause:r}:void 0);je(this,"name","ForceRetryError");je(this,"customDelay");je(this,"code");je(this,"customRequest");this.customDelay=n==null?void 0:n.delay,this.code=n==null?void 0:n.code,this.customRequest=n==null?void 0:n.request}}const Oy=(()=>{let e=!1,t=!1;const n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(n&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return e&&!t})(),rI=typeof globalThis.AbortController=="function",Qx=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",iI=typeof globalThis.ReadableStream=="function",sI=typeof globalThis.FormData=="function",Jx=["get","post","put","patch","head","delete"],oI={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Zd=2147483647,aI=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Zx=Symbol("stop");class ew{constructor(t){je(this,"options");this.options=t}}const lI=e=>new ew(e),uI={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},cI={next:!0},dI={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},fI=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[n,r]of e)t+=aI,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,t+=typeof r=="string"?new TextEncoder().encode(r).length:r.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},tw=(e,t,n)=>{let r,o=0;return e.pipeThrough(new TransformStream({transform(a,l){if(l.enqueue(a),r){o+=r.byteLength;let c=t===0?0:o/t;c>=1&&(c=1-Number.EPSILON),n==null||n({percent:c,totalBytes:Math.max(t,o),transferredBytes:o},r)}r=a},flush(){r&&(o+=r.byteLength,n==null||n({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},r))}}))},hI=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const n=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(tw(e.body,n,t),{status:e.status,statusText:e.statusText,headers:e.headers})},pI=(e,t,n)=>{if(!e.body)return e;const r=fI(n??e.body);return new Request(e,{duplex:"half",body:tw(e.body,r,t)})},as=e=>e!==null&&typeof e=="object",uu=(...e)=>{for(const t of e)if((!as(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return Xh({},...e)},nw=(e={},t={})=>{const n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[a,l]of o.entries())r&&l==="undefined"||l===void 0?n.delete(a):n.set(a,l);return n};function cu(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:Xh(e[n]??[],t[n]??[])}const rw=(e={},t={})=>({beforeRequest:cu(e,t,"beforeRequest"),beforeRetry:cu(e,t,"beforeRetry"),afterResponse:cu(e,t,"afterResponse"),beforeError:cu(e,t,"beforeError")}),mI=(e,t)=>{const n=new URLSearchParams;for(const r of[e,t])if(r!==void 0)if(r instanceof URLSearchParams)for(const[o,a]of r.entries())n.append(o,a);else if(Array.isArray(r))for(const o of r){if(!Array.isArray(o)||o.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(o[0]),String(o[1]))}else if(as(r))for(const[o,a]of Object.entries(r))a!==void 0&&n.append(o,String(a));else{const o=new URLSearchParams(r);for(const[a,l]of o.entries())n.append(a,l)}return n},Xh=(...e)=>{let t={},n={},r={},o;const a=[];for(const l of e)if(Array.isArray(l))Array.isArray(t)||(t=[]),t=[...t,...l];else if(as(l)){for(let[c,d]of Object.entries(l)){if(c==="signal"&&d instanceof globalThis.AbortSignal){a.push(d);continue}if(c==="context"){if(d!=null&&(!as(d)||Array.isArray(d)))throw new TypeError("The `context` option must be an object");t={...t,context:d==null?{}:{...t.context,...d}};continue}if(c==="searchParams"){d==null?o=void 0:o=o===void 0?d:mI(o,d);continue}as(d)&&c in t&&(d=Xh(t[c],d)),t={...t,[c]:d}}as(l.hooks)&&(r=rw(r,l.hooks),t.hooks=r),as(l.headers)&&(n=nw(n,l.headers),t.headers=n)}return o!==void 0&&(t.searchParams=o),a.length>0&&(a.length===1?t.signal=a[0]:Qx?t.signal=AbortSignal.any(a):t.signal=a.at(-1)),t.context===void 0&&(t.context={}),t},gI=e=>Jx.includes(e)?e.toUpperCase():e,yI=["get","put","head","delete","options","trace"],vI=[408,413,429,500,502,503,504],xI=[413,429,503],Fy={limit:2,methods:yI,statusCodes:vI,afterStatusCodes:xI,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},wI=(e={})=>{if(typeof e=="number")return{...Fy,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Fy,...e}};class Kf extends Error{constructor(n){super(`Request timed out: ${n.method} ${n.url}`);je(this,"request");this.name="TimeoutError",this.request=n}}async function bI(e,t,n,r){return new Promise((o,a)=>{const l=setTimeout(()=>{n&&n.abort(),a(new Kf(e))},r.timeout);r.fetch(e,t).then(o).catch(a).then(()=>{clearTimeout(l)})})}async function SI(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(a),r(t.reason)}const a=setTimeout(()=>{t==null||t.removeEventListener("abort",o),n()},e)})}const kI=(e,t)=>{const n={};for(const r in t)Object.hasOwn(t,r)&&!(r in dI)&&!(r in uI)&&(!(r in e)||r in cI)&&(n[r]=t[r]);return n},EI=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;function CI(e){return e instanceof Gf||(e==null?void 0:e.name)===Gf.name}function II(e){return e instanceof Kf||(e==null?void 0:e.name)===Kf.name}var Qu,iw,ur,$n,Ht,me,Ti,Sr,fs,Qe,Pu,sw,Yf,Xf,ow,wa,Au,Qf;const Na=class Na{constructor(t,n={}){xr(this,Qe);je(this,"request");xr(this,ur);xr(this,$n,0);xr(this,Ht);xr(this,me);xr(this,Ti);xr(this,Sr);xr(this,fs);var o,a,l;if(ir(this,Ht,t),ir(this,me,{...n,headers:nw(J(this,Ht).headers,n.headers),hooks:rw({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:gI(n.method??J(this,Ht).method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:wI(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}}),typeof J(this,Ht)!="string"&&!(J(this,Ht)instanceof URL||J(this,Ht)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(J(this,me).prefixUrl&&typeof J(this,Ht)=="string"){if(J(this,Ht).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");J(this,me).prefixUrl.endsWith("/")||(J(this,me).prefixUrl+="/"),ir(this,Ht,J(this,me).prefixUrl+J(this,Ht))}rI&&Qx&&(ir(this,Sr,J(this,me).signal??J(this,Ht).signal),ir(this,ur,new globalThis.AbortController),J(this,me).signal=J(this,Sr)?AbortSignal.any([J(this,Sr),J(this,ur).signal]):J(this,ur).signal),Oy&&(J(this,me).duplex="half"),J(this,me).json!==void 0&&(J(this,me).body=((a=(o=J(this,me)).stringifyJson)==null?void 0:a.call(o,J(this,me).json))??JSON.stringify(J(this,me).json),J(this,me).headers.set("content-type",J(this,me).headers.get("content-type")??"application/json"));const r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(J(this,Ht)instanceof globalThis.Request&&(sI&&J(this,me).body instanceof globalThis.FormData||J(this,me).body instanceof URLSearchParams)&&!r&&J(this,me).headers.delete("content-type"),this.request=new globalThis.Request(J(this,Ht),J(this,me)),EI(J(this,me).searchParams)){const d="?"+(typeof J(this,me).searchParams=="string"?J(this,me).searchParams.replace(/^\?/,""):new URLSearchParams(xt(l=Na,Qu,iw).call(l,J(this,me).searchParams)).toString()),f=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,d);this.request=new globalThis.Request(f,J(this,me))}if(J(this,me).onUploadProgress){if(typeof J(this,me).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Oy)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=xt(this,Qe,Qf).call(this,this.request,J(this,me).body??void 0)}}static create(t,n){var l,c,d;const r=new Na(t,n),o=async()=>{var p,m,y,v,b,S,C;if(typeof J(r,me).timeout=="number"&&J(r,me).timeout>Zd)throw new RangeError(`The \`timeout\` option cannot be greater than ${Zd}`);await Promise.resolve();let f=await xt(p=r,Qe,ow).call(p);for(const E of J(r,me).hooks.afterResponse){const P=xt(m=r,Qe,Yf).call(m,f.clone()),T=await E(r.request,xt(y=r,Qe,wa).call(y),P,{retryCount:J(r,$n)});if(T instanceof globalThis.Response&&(f=T),T instanceof ew)throw await Promise.all([(v=P.body)==null?void 0:v.cancel(),(b=f.body)==null?void 0:b.cancel()]),new Jd(T.options)}if(xt(S=r,Qe,Yf).call(S,f),!f.ok&&(typeof J(r,me).throwHttpErrors=="function"?J(r,me).throwHttpErrors(f.status):J(r,me).throwHttpErrors)){let E=new Gf(f,r.request,xt(C=r,Qe,wa).call(C));for(const P of J(r,me).hooks.beforeError)E=await P(E,{retryCount:J(r,$n)});throw E}if(J(r,me).onDownloadProgress){if(typeof J(r,me).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!iI)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return hI(f.clone(),J(r,me).onDownloadProgress)}return f},a=xt(l=r,Qe,Xf).call(l,o).finally(async()=>{var m,y;const f=J(r,Ti),p=[];f&&!f.bodyUsed&&p.push((m=f.body)==null?void 0:m.cancel()),r.request.bodyUsed||p.push((y=r.request.body)==null?void 0:y.cancel()),await Promise.all(p)});for(const[f,p]of Object.entries(oI))f==="bytes"&&typeof((d=(c=globalThis.Response)==null?void 0:c.prototype)==null?void 0:d.bytes)!="function"||(a[f]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||p);const m=await a;if(f==="json"){if(m.status===204)return"";const y=await m.text();return y===""?"":n.parseJson?n.parseJson(y):JSON.parse(y)}return m[f]()});return a}};Qu=new WeakSet,iw=function(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0)):t},ur=new WeakMap,$n=new WeakMap,Ht=new WeakMap,me=new WeakMap,Ti=new WeakMap,Sr=new WeakMap,fs=new WeakMap,Qe=new WeakSet,Pu=function(){const t=J(this,me).retry.delay(J(this,$n));let n=t;return J(this,me).retry.jitter===!0?n=Math.random()*t:typeof J(this,me).retry.jitter=="function"&&(n=J(this,me).retry.jitter(t),(!Number.isFinite(n)||n<0)&&(n=t)),Math.min(J(this,me).retry.backoffLimit,n)},sw=async function(t){if(Sy(this,$n)._++,J(this,$n)>J(this,me).retry.limit)throw t;const n=t instanceof Error?t:new Xx(t);if(n instanceof Jd)return n.customDelay??xt(this,Qe,Pu).call(this);if(!J(this,me).retry.methods.includes(this.request.method.toLowerCase()))throw t;if(J(this,me).retry.shouldRetry!==void 0){const r=await J(this,me).retry.shouldRetry({error:n,retryCount:J(this,$n)});if(r===!1)throw t;if(r===!0)return xt(this,Qe,Pu).call(this)}if(II(t)&&!J(this,me).retry.retryOnTimeout)throw t;if(CI(t)){if(!J(this,me).retry.statusCodes.includes(t.response.status))throw t;const r=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(r&&J(this,me).retry.afterStatusCodes.includes(t.response.status)){let o=Number(r)*1e3;Number.isNaN(o)?o=Date.parse(r)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now());const a=J(this,me).retry.maxRetryAfter??o;return o<a?o:a}if(t.response.status===413)throw t}return xt(this,Qe,Pu).call(this)},Yf=function(t){return J(this,me).parseJson&&(t.json=async()=>J(this,me).parseJson(await t.text())),t},Xf=async function(t){try{return await t()}catch(n){const r=Math.min(await xt(this,Qe,sw).call(this,n),Zd);if(J(this,$n)<1)throw n;if(await SI(r,J(this,Sr)?{signal:J(this,Sr)}:{}),n instanceof Jd&&n.customRequest){const o=J(this,me).signal?new globalThis.Request(n.customRequest,{signal:J(this,me).signal}):new globalThis.Request(n.customRequest);xt(this,Qe,Au).call(this,o)}for(const o of J(this,me).hooks.beforeRetry){const a=await o({request:this.request,options:xt(this,Qe,wa).call(this),error:n,retryCount:J(this,$n)});if(a instanceof globalThis.Request){xt(this,Qe,Au).call(this,a);break}if(a instanceof globalThis.Response)return a;if(a===Zx)return}return xt(this,Qe,Xf).call(this,t)}},ow=async function(){var n;(n=J(this,ur))!=null&&n.signal.aborted&&(ir(this,ur,new globalThis.AbortController),J(this,me).signal=J(this,Sr)?AbortSignal.any([J(this,Sr),J(this,ur).signal]):J(this,ur).signal,this.request=new globalThis.Request(this.request,{signal:J(this,me).signal}));for(const r of J(this,me).hooks.beforeRequest){const o=await r(this.request,xt(this,Qe,wa).call(this),{retryCount:J(this,$n)});if(o instanceof Response)return o;if(o instanceof globalThis.Request){xt(this,Qe,Au).call(this,o);break}}const t=kI(this.request,J(this,me));return ir(this,Ti,this.request),this.request=J(this,Ti).clone(),J(this,me).timeout===!1?J(this,me).fetch(J(this,Ti),t):bI(J(this,Ti),t,J(this,ur),J(this,me))},wa=function(){if(!J(this,fs)){const{hooks:t,...n}=J(this,me);ir(this,fs,Object.freeze(n))}return J(this,fs)},Au=function(t){ir(this,fs,void 0),this.request=xt(this,Qe,Qf).call(this,t)},Qf=function(t,n){return!J(this,me).onUploadProgress||!t.body?t:pI(t,J(this,me).onUploadProgress,n??J(this,me).body??void 0)},xr(Na,Qu);let Ou=Na;/*! MIT License © Sindre Sorhus */const Jf=e=>{const t=(n,r)=>Ou.create(n,uu(e,r));for(const n of Jx)t[n]=(r,o)=>Ou.create(r,uu(e,o,{method:n}));return t.create=n=>Jf(uu(n)),t.extend=n=>(typeof n=="function"&&(n=n(e??{})),Jf(uu(e,n))),t.stop=Zx,t.retry=lI,t},TI=Jf();var Zf=function(e,t){return Zf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},Zf(e,t)};function qa(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Zf(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function eh(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 new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function th(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,a=[],l;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(c){l={error:c}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return a}function nh(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function kr(e){return typeof e=="function"}function aw(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ef=aw(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
51
+ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let y=Ri(),v;if(t){let T=typeof t=="string"?po(t):t;at(p==="/"||((P=T.pathname)==null?void 0:P.startsWith(p)),`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 "${p}" but pathname "${T.pathname}" was given in the \`location\` prop.`),v=T}else v=y;let b=v.pathname||"/",S=b;if(p!=="/"){let T=p.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(T.length).join("/")}let C=jx(e,{pathname:S});Gn(m||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Gn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 E=QE(C&&C.map(T=>Object.assign({},T,{params:Object.assign({},d,T.params),pathname:Hr([p,a.encodeLocation?a.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?p:Hr([p,a.encodeLocation?a.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),l,n,r,o);return t&&E?I.createElement(Ha.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},E):E}function GE(){let e=nC(),t=VE(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)",o={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=I.createElement(I.Fragment,null,I.createElement("p",null,"💿 Hey developer 👋"),I.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",I.createElement("code",{style:a},"ErrorBoundary")," or"," ",I.createElement("code",{style:a},"errorElement")," prop on your route.")),I.createElement(I.Fragment,null,I.createElement("h2",null,"Unexpected Application Error!"),I.createElement("h3",{style:{fontStyle:"italic"}},t),n?I.createElement("pre",{style:o},n):null,l)}var KE=I.createElement(GE,null),YE=class extends I.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?e.error:t.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(){return this.state.error!==void 0?I.createElement(Ir.Provider,{value:this.props.routeContext},I.createElement(Wh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function XE({routeContext:e,match:t,children:n}){let r=I.useContext(mo);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),I.createElement(Ir.Provider,{value:e},n)}function QE(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=n==null?void 0:n.errors;if(l!=null){let p=a.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);at(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let c=!1,d=-1;if(n)for(let p=0;p<a.length;p++){let m=a[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=p),m.route.id){let{loaderData:y,errors:v}=n,b=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||b){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}let f=n&&r?(p,m)=>{var y,v;r(p,{location:n.location,params:((v=(y=n.matches)==null?void 0:y[0])==null?void 0:v.params)??{},errorInfo:m})}:void 0;return a.reduceRight((p,m,y)=>{let v,b=!1,S=null,C=null;n&&(v=l&&m.route.id?l[m.route.id]:void 0,S=m.route.errorElement||KE,c&&(d<0&&y===0?(Bx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,C=null):d===y&&(b=!0,C=m.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,y+1)),P=()=>{let T;return v?T=S:b?T=C:m.route.Component?T=I.createElement(m.route.Component,null):m.route.element?T=m.route.element:T=p,I.createElement(XE,{match:m,routeContext:{outlet:p,matches:E,isDataRoute:n!=null},children:T})};return n&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?I.createElement(YE,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:P(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:f}):P()},null)}function qh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function JE(e){let t=I.useContext(mo);return at(t,qh(e)),t}function ZE(e){let t=I.useContext(Ju);return at(t,qh(e)),t}function eC(e){let t=I.useContext(Ir);return at(t,qh(e)),t}function Gh(e){let t=eC(e),n=t.matches[t.matches.length-1];return at(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function tC(){return Gh("useRouteId")}function nC(){var r;let e=I.useContext(Wh),t=ZE("useRouteError"),n=Gh("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function rC(){let{router:e}=JE("useNavigate"),t=Gh("useNavigate"),n=I.useRef(!1);return Fx(()=>{n.current=!0}),I.useCallback(async(o,a={})=>{Gn(n.current,Ox),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...a}))},[e,t])}var Ly={};function Bx(e,t,n){!t&&!Ly[e]&&(Ly[e]=!0,Gn(!1,n))}I.memo(iC);function iC({routes:e,future:t,state:n,unstable_onError:r}){return Vx(e,void 0,n,r,t)}function Hf({to:e,replace:t,state:n,relative:r}){at(go(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=I.useContext(dr);Gn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=I.useContext(Ir),{pathname:l}=Ri(),c=Zu(),d=Hh(e,Uh(a),l,r==="path"),f=JSON.stringify(d);return I.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function Js(e){at(!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 sC({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:a=!1}){at(!go(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=I.useMemo(()=>({basename:l,navigator:o,static:a,future:{}}),[l,o,a]);typeof n=="string"&&(n=po(n));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:y="default"}=n,v=I.useMemo(()=>{let b=Wr(d,l);return b==null?null:{location:{pathname:b,search:f,hash:p,state:m,key:y},navigationType:r}},[l,d,f,p,m,y,r]);return Gn(v!=null,`<Router basename="${l}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:I.createElement(dr.Provider,{value:c},I.createElement(Ha.Provider,{children:t,value:v}))}function oC({children:e,location:t}){return qE(Wf(e),t)}function Wf(e,t=[]){let n=[];return I.Children.forEach(e,(r,o)=>{if(!I.isValidElement(r))return;let a=[...t,o];if(r.type===I.Fragment){n.push.apply(n,Wf(r.props.children,a));return}at(r.type===Js,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),at(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Wf(r.props.children,a)),n.push(l)}),n}var Tu="get",_u="application/x-www-form-urlencoded";function ec(e){return e!=null&&typeof e.tagName=="string"}function aC(e){return ec(e)&&e.tagName.toLowerCase()==="button"}function lC(e){return ec(e)&&e.tagName.toLowerCase()==="form"}function uC(e){return ec(e)&&e.tagName.toLowerCase()==="input"}function cC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dC(e,t){return e.button===0&&(!t||t==="_self")&&!cC(e)}var lu=null;function fC(){if(lu===null)try{new FormData(document.createElement("form"),0),lu=!1}catch{lu=!0}return lu}var hC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qd(e){return e!=null&&!hC.has(e)?(Gn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_u}"`),null):e}function pC(e,t){let n,r,o,a,l;if(lC(e)){let c=e.getAttribute("action");r=c?Wr(c,t):null,n=e.getAttribute("method")||Tu,o=Qd(e.getAttribute("enctype"))||_u,a=new FormData(e)}else if(aC(e)||uC(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||c.getAttribute("action");if(r=d?Wr(d,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Tu,o=Qd(e.getAttribute("formenctype"))||Qd(c.getAttribute("enctype"))||_u,a=new FormData(c,e),!fC()){let{name:f,type:p,value:m}=e;if(p==="image"){let y=f?`${f}.`:"";a.append(`${y}x`,"0"),a.append(`${y}y`,"0")}else f&&a.append(f,m)}}else{if(ec(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Tu,r=null,o=_u,l=e}return a&&o==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Kh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mC(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&Wr(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function gC(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function yC(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 vC(e,t,n){let r=await Promise.all(e.map(async o=>{let a=t.routes[o.route.id];if(a){let l=await gC(a,n);return l.links?l.links():[]}return[]}));return SC(r.flat(1).filter(yC).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function zy(e,t,n,r,o,a){let l=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,c=(d,f)=>{var p;return n[f].pathname!==d.pathname||((p=n[f].route.path)==null?void 0:p.endsWith("*"))&&n[f].params["*"]!==d.params["*"]};return a==="assets"?t.filter((d,f)=>l(d,f)||c(d,f)):a==="data"?t.filter((d,f)=>{var m;let p=r.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(l(d,f)||c(d,f))return!0;if(d.route.shouldRevalidate){let y=d.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function xC(e,t,{includeHydrateFallback:n}={}){return wC(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function wC(e){return[...new Set(e)]}function bC(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function SC(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let a=JSON.stringify(bC(o));return n.has(a)||(n.add(a),r.push({key:a,link:o})),r},[])}function $x(){let e=I.useContext(mo);return Kh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function kC(){let e=I.useContext(Ju);return Kh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yh=I.createContext(void 0);Yh.displayName="FrameworkContext";function Ux(){let e=I.useContext(Yh);return Kh(e,"You must render this element inside a <HydratedRouter> element"),e}function EC(e,t){let n=I.useContext(Yh),[r,o]=I.useState(!1),[a,l]=I.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:f,onMouseLeave:p,onTouchStart:m}=t,y=I.useRef(null);I.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=E=>{E.forEach(P=>{l(P.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),I.useEffect(()=>{if(r){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[r]);let v=()=>{o(!0)},b=()=>{o(!1),l(!1)};return n?e!=="intent"?[a,y,{}]:[a,y,{onFocus:ua(c,v),onBlur:ua(d,b),onMouseEnter:ua(f,v),onMouseLeave:ua(p,b),onTouchStart:ua(m,v)}]:[!1,y,{}]}function ua(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function CC({page:e,...t}){let{router:n}=$x(),r=I.useMemo(()=>jx(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?I.createElement(TC,{page:e,matches:r,...t}):null}function IC(e){let{manifest:t,routeModules:n}=Ux(),[r,o]=I.useState([]);return I.useEffect(()=>{let a=!1;return vC(e,t,n).then(l=>{a||o(l)}),()=>{a=!0}},[e,t,n]),r}function TC({page:e,matches:t,...n}){let r=Ri(),{manifest:o,routeModules:a}=Ux(),{basename:l}=$x(),{loaderData:c,matches:d}=kC(),f=I.useMemo(()=>zy(e,t,d,o,r,"data"),[e,t,d,o,r]),p=I.useMemo(()=>zy(e,t,d,o,r,"assets"),[e,t,d,o,r]),m=I.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,S=!1;if(t.forEach(E=>{var T;let P=o.routes[E.route.id];!P||!P.hasLoader||(!f.some(O=>O.route.id===E.route.id)&&E.route.id in c&&((T=a[E.route.id])!=null&&T.shouldRevalidate)||P.hasClientLoader?S=!0:b.add(E.route.id))}),b.size===0)return[];let C=mC(e,l,"data");return S&&b.size>0&&C.searchParams.set("_routes",t.filter(E=>b.has(E.route.id)).map(E=>E.route.id).join(",")),[C.pathname+C.search]},[l,c,r,o,f,t,e,a]),y=I.useMemo(()=>xC(p,o),[p,o]),v=IC(p);return I.createElement(I.Fragment,null,m.map(b=>I.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),y.map(b=>I.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),v.map(({key:b,link:S})=>I.createElement("link",{key:b,nonce:n.nonce,...S})))}function _C(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Hx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Hx&&(window.__reactRouterVersion="7.9.6")}catch{}function PC({basename:e,children:t,window:n}){let r=I.useRef();r.current==null&&(r.current=gE({window:n,v5Compat:!0}));let o=r.current,[a,l]=I.useState({action:o.action,location:o.location}),c=I.useCallback(d=>{I.startTransition(()=>l(d))},[l]);return I.useLayoutEffect(()=>o.listen(c),[o,c]),I.createElement(sC,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o})}var Wx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tc=I.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:a,replace:l,state:c,target:d,to:f,preventScrollReset:p,viewTransition:m,...y},v){let{basename:b}=I.useContext(dr),S=typeof f=="string"&&Wx.test(f),C,E=!1;if(typeof f=="string"&&S&&(C=f,Hx))try{let ee=new URL(window.location.href),L=f.startsWith("//")?new URL(ee.protocol+f):new URL(f),te=Wr(L.pathname,b);L.origin===ee.origin&&te!=null?f=te+L.search+L.hash:E=!0}catch{Gn(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let P=HE(f,{relative:o}),[T,O,V]=EC(r,y),N=jC(f,{replace:l,state:c,target:d,preventScrollReset:p,relative:o,viewTransition:m});function D(ee){t&&t(ee),ee.defaultPrevented||N(ee)}let H=I.createElement("a",{...y,...V,href:C||P,onClick:E||a?t:D,ref:_C(v,O),target:d,"data-discover":!S&&n==="render"?"true":void 0});return T&&!S?I.createElement(I.Fragment,null,H,I.createElement(CC,{page:P})):H});tc.displayName="Link";var AC=I.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:a,to:l,viewTransition:c,children:d,...f},p){let m=Wa(l,{relative:f.relative}),y=Ri(),v=I.useContext(Ju),{navigator:b,basename:S}=I.useContext(dr),C=v!=null&&OC(m)&&c===!0,E=b.encodeLocation?b.encodeLocation(m).pathname:m.pathname,P=y.pathname,T=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(P=P.toLowerCase(),T=T?T.toLowerCase():null,E=E.toLowerCase()),T&&S&&(T=Wr(T,S)||T);const O=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let V=P===E||!o&&P.startsWith(E)&&P.charAt(O)==="/",N=T!=null&&(T===E||!o&&T.startsWith(E)&&T.charAt(E.length)==="/"),D={isActive:V,isPending:N,isTransitioning:C},H=V?t:void 0,ee;typeof r=="function"?ee=r(D):ee=[r,V?"active":null,N?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let L=typeof a=="function"?a(D):a;return I.createElement(tc,{...f,"aria-current":H,className:ee,ref:p,style:L,to:l,viewTransition:c},typeof d=="function"?d(D):d)});AC.displayName="NavLink";var RC=I.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:a,method:l=Tu,action:c,onSubmit:d,relative:f,preventScrollReset:p,viewTransition:m,...y},v)=>{let b=LC(),S=zC(c,{relative:f}),C=l.toLowerCase()==="get"?"get":"post",E=typeof c=="string"&&Wx.test(c),P=T=>{if(d&&d(T),T.defaultPrevented)return;T.preventDefault();let O=T.nativeEvent.submitter,V=(O==null?void 0:O.getAttribute("formmethod"))||l;b(O||T.currentTarget,{fetcherKey:t,method:V,navigate:n,replace:o,state:a,relative:f,preventScrollReset:p,viewTransition:m})};return I.createElement("form",{ref:v,method:C,action:S,onSubmit:r?d:P,...y,"data-discover":!E&&e==="render"?"true":void 0})});RC.displayName="Form";function NC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qx(e){let t=I.useContext(mo);return at(t,NC(e)),t}function jC(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:a,viewTransition:l}={}){let c=Zu(),d=Ri(),f=Wa(e,{relative:a});return I.useCallback(p=>{if(dC(p,t)){p.preventDefault();let m=n!==void 0?n:ja(d)===ja(f);c(e,{replace:m,state:r,preventScrollReset:o,relative:a,viewTransition:l})}},[d,c,f,n,r,t,e,o,a,l])}var MC=0,DC=()=>`__${String(++MC)}__`;function LC(){let{router:e}=qx("useSubmit"),{basename:t}=I.useContext(dr),n=tC();return I.useCallback(async(r,o={})=>{let{action:a,method:l,encType:c,formData:d,body:f}=pC(r,t);if(o.navigate===!1){let p=o.fetcherKey||DC();await e.fetch(p,n,o.action||a,{preventScrollReset:o.preventScrollReset,formData:d,body:f,formMethod:o.method||l,formEncType:o.encType||c,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:d,body:f,formMethod:o.method||l,formEncType:o.encType||c,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function zC(e,{relative:t}={}){let{basename:n}=I.useContext(dr),r=I.useContext(Ir);at(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),a={...Wa(e||".",{relative:t})},l=Ri();if(e==null){a.search=l.search;let c=new URLSearchParams(a.search),d=c.getAll("index");if(d.some(p=>p==="")){c.delete("index"),d.filter(m=>m).forEach(m=>c.append("index",m));let p=c.toString();a.search=p?`?${p}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Hr([n,a.pathname])),ja(a)}function OC(e,{relative:t}={}){let n=I.useContext(zx);at(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=qx("useViewTransitionState"),o=Wa(e,{relative:t});if(!n.isTransitioning)return!1;let a=Wr(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Wr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return zu(o.pathname,l)!=null||zu(o.pathname,a)!=null}var FC=Nx();const Gx=I.createContext(null),ss="portagent_token",qs="portagent_user";async function VC(e,t){try{const n=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({usernameOrEmail:e,password:t})}),r=await n.json();return n.ok?{token:r.token,user:r.user}:{error:r.error||"Login failed"}}catch{return{error:"Network error"}}}async function BC(e,t,n,r){try{const o=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,email:t,password:n,displayName:r})}),a=await o.json();return o.ok?{token:a.token,user:a.user}:{error:a.error||"Registration failed"}}catch{return{error:"Network error"}}}async function $C(e){try{const t=await fetch("/api/auth/verify",{headers:{Authorization:`Bearer ${e}`}});return t.ok?(await t.json()).user:null}catch{return null}}function UC({children:e}){const[t,n]=I.useState(null),[r,o]=I.useState(null),[a,l]=I.useState(!0);I.useEffect(()=>{const p=localStorage.getItem(ss),m=localStorage.getItem(qs);if(p&&m)try{$C(p).then(y=>{y?(n(p),o(y)):(localStorage.removeItem(ss),localStorage.removeItem(qs)),l(!1)})}catch{localStorage.removeItem(ss),localStorage.removeItem(qs),l(!1)}else l(!1)},[]);const c=I.useCallback(async(p,m)=>{const y=await VC(p,m);return"token"in y?(localStorage.setItem(ss,y.token),localStorage.setItem(qs,JSON.stringify(y.user)),n(y.token),o(y.user),{success:!0}):{success:!1,error:y.error}},[]),d=I.useCallback(async(p,m,y,v)=>{const b=await BC(p,m,y,v);return"token"in b?(localStorage.setItem(ss,b.token),localStorage.setItem(qs,JSON.stringify(b.user)),n(b.token),o(b.user),{success:!0}):{success:!1,error:b.error}},[]),f=I.useCallback(()=>{localStorage.removeItem(ss),localStorage.removeItem(qs),n(null),o(null)},[]);return w.jsx(Gx.Provider,{value:{isAuthenticated:!!t,isLoading:a,token:t,user:r,login:c,register:d,logout:f},children:e})}function nc(){const e=I.useContext(Gx);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function HC(){return localStorage.getItem(ss)}function WC(){const[e,t]=I.useState(""),[n,r]=I.useState(""),[o,a]=I.useState(""),[l,c]=I.useState(!1),{login:d,isAuthenticated:f}=nc(),p=Zu();I.useEffect(()=>{f&&p("/studio",{replace:!0})},[f,p]);const m=async y=>{y.preventDefault(),a(""),c(!0);const v=await d(e,n);v.success?p("/studio",{replace:!0}):(a(v.error||"Login failed"),c(!1))};return w.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:w.jsxs("div",{className:"w-full max-w-md",children:[w.jsxs("div",{className:"text-center mb-8",children:[w.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Portagent"}),w.jsx("p",{className:"text-muted-foreground",children:"AgentX Portal"})]}),w.jsxs("div",{className:"bg-card rounded-lg p-8 shadow-xl border border-border",children:[w.jsxs("form",{onSubmit:m,className:"space-y-6",children:[w.jsxs("div",{children:[w.jsx("label",{htmlFor:"usernameOrEmail",className:"block text-sm font-medium text-foreground mb-2",children:"Username or Email"}),w.jsx("input",{id:"usernameOrEmail",type:"text",value:e,onChange:y=>t(y.target.value),placeholder:"Enter your username or email",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",autoFocus:!0,required:!0})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),w.jsx("input",{id:"password",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"Enter your password",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",required:!0})]}),o&&w.jsx("div",{className:"text-destructive text-sm text-center",children:o}),w.jsx("button",{type:"submit",disabled:l||!e||!n,className:"w-full py-3 px-4 bg-primary hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed text-primary-foreground font-medium rounded-lg transition-colors",children:l?"Signing in...":"Sign In"})]}),w.jsx("div",{className:"mt-6 text-center text-sm text-muted-foreground",children:w.jsxs("p",{children:["Don't have an account?"," ",w.jsx(tc,{to:"/register",className:"text-primary hover:underline",children:"Sign up"})]})})]})]})})}function qC(){const[e,t]=I.useState(""),[n,r]=I.useState(""),[o,a]=I.useState(""),[l,c]=I.useState(""),[d,f]=I.useState(""),[p,m]=I.useState(""),[y,v]=I.useState(!1),{register:b,isAuthenticated:S}=nc(),C=Zu();I.useEffect(()=>{S&&C("/studio",{replace:!0})},[S,C]);const E=async P=>{if(P.preventDefault(),m(""),o!==l){m("Passwords do not match");return}if(o.length<6){m("Password must be at least 6 characters");return}if(e.length<3){m("Username must be at least 3 characters");return}if(!n.includes("@")){m("Invalid email address");return}v(!0);const T=await b(e,n,o,d||void 0);T.success?C("/studio",{replace:!0}):(m(T.error||"Registration failed"),v(!1))};return w.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:w.jsxs("div",{className:"w-full max-w-md",children:[w.jsxs("div",{className:"text-center mb-8",children:[w.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Portagent"}),w.jsx("p",{className:"text-muted-foreground",children:"Create your account"})]}),w.jsxs("div",{className:"bg-card rounded-lg p-8 shadow-xl border border-border",children:[w.jsxs("form",{onSubmit:E,className:"space-y-4",children:[w.jsxs("div",{children:[w.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-2",children:"Username *"}),w.jsx("input",{id:"username",type:"text",value:e,onChange:P=>t(P.target.value),placeholder:"Choose a username",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",autoFocus:!0,required:!0,minLength:3})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-foreground mb-2",children:"Email *"}),w.jsx("input",{id:"email",type:"email",value:n,onChange:P=>r(P.target.value),placeholder:"your@email.com",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",required:!0})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"displayName",className:"block text-sm font-medium text-foreground mb-2",children:"Display Name (optional)"}),w.jsx("input",{id:"displayName",type:"text",value:d,onChange:P=>f(P.target.value),placeholder:"How you want to be called",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-2",children:"Password *"}),w.jsx("input",{id:"password",type:"password",value:o,onChange:P=>a(P.target.value),placeholder:"At least 6 characters",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",required:!0,minLength:6})]}),w.jsxs("div",{children:[w.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-foreground mb-2",children:"Confirm Password *"}),w.jsx("input",{id:"confirmPassword",type:"password",value:l,onChange:P=>c(P.target.value),placeholder:"Re-enter your password",className:"w-full px-4 py-3 bg-muted border border-input rounded-lg text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",required:!0,minLength:6})]}),p&&w.jsx("div",{className:"text-destructive text-sm text-center",children:p}),w.jsx("button",{type:"submit",disabled:y||!e||!n||!o||!l,className:"w-full py-3 px-4 bg-primary hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed text-primary-foreground font-medium rounded-lg transition-colors",children:y?"Creating account...":"Sign Up"})]}),w.jsx("div",{className:"mt-6 text-center text-sm text-muted-foreground",children:w.jsxs("p",{children:["Already have an account?"," ",w.jsx(tc,{to:"/login",className:"text-primary hover:underline",children:"Sign in"})]})})]})]})})}var cn=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT",e))(cn||{}),GC=["agent_initializing","agent_ready","agent_destroyed","conversation_queued","conversation_start","conversation_thinking","conversation_responding","conversation_end","conversation_interrupted","tool_planned","tool_executing","tool_completed","tool_failed","error_occurred"],KC=new Set(GC),YC=["user_message","assistant_message","tool_call_message","tool_result_message"];new Set(YC);var XC=["error"];new Set(XC);var QC=["turn_request","turn_response"];new Set(QC);var Kx=["message_start","message_delta","message_stop","text_content_block_start","text_delta","text_content_block_stop","tool_use_content_block_start","input_json_delta","tool_use_content_block_stop","tool_call","tool_result","interrupted"];new Set(Kx);function JC(e){return"type"in e&&KC.has(e.type)}class qf extends Error{constructor(n,r,o){const a=n.status||n.status===0?n.status:"",l=n.statusText??"",c=`${a} ${l}`.trim(),d=c?`status code ${c}`:"an unknown error";super(`Request failed with ${d}: ${r.method} ${r.url}`);wn(this,"response");wn(this,"request");wn(this,"options");this.name="HTTPError",this.response=n,this.request=r,this.options=o}}class Yx extends Error{constructor(n){let r="Non-error value was thrown";try{typeof n=="string"?r=n:n&&typeof n=="object"&&"message"in n&&typeof n.message=="string"&&(r=n.message)}catch{}super(r);wn(this,"name","NonError");wn(this,"value");this.value=n}}class Jd extends Error{constructor(n){const r=n!=null&&n.cause?n.cause instanceof Error?n.cause:new Yx(n.cause):void 0;super(n!=null&&n.code?`Forced retry: ${n.code}`:"Forced retry",r?{cause:r}:void 0);wn(this,"name","ForceRetryError");wn(this,"customDelay");wn(this,"code");wn(this,"customRequest");this.customDelay=n==null?void 0:n.delay,this.code=n==null?void 0:n.code,this.customRequest=n==null?void 0:n.request}}const Oy=(()=>{let e=!1,t=!1;const n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(n&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return e&&!t})(),ZC=typeof globalThis.AbortController=="function",Xx=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",eI=typeof globalThis.ReadableStream=="function",tI=typeof globalThis.FormData=="function",Qx=["get","post","put","patch","head","delete"],nI={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Zd=2147483647,rI=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Jx=Symbol("stop");class Zx{constructor(t){wn(this,"options");this.options=t}}const iI=e=>new Zx(e),sI={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},oI={next:!0},aI={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},lI=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[n,r]of e)t+=rI,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,t+=typeof r=="string"?new TextEncoder().encode(r).length:r.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},ew=(e,t,n)=>{let r,o=0;return e.pipeThrough(new TransformStream({transform(a,l){if(l.enqueue(a),r){o+=r.byteLength;let c=t===0?0:o/t;c>=1&&(c=1-Number.EPSILON),n==null||n({percent:c,totalBytes:Math.max(t,o),transferredBytes:o},r)}r=a},flush(){r&&(o+=r.byteLength,n==null||n({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},r))}}))},uI=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const n=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(ew(e.body,n,t),{status:e.status,statusText:e.statusText,headers:e.headers})},cI=(e,t,n)=>{if(!e.body)return e;const r=lI(n??e.body);return new Request(e,{duplex:"half",body:ew(e.body,r,t)})},as=e=>e!==null&&typeof e=="object",uu=(...e)=>{for(const t of e)if((!as(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return Xh({},...e)},tw=(e={},t={})=>{const n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[a,l]of o.entries())r&&l==="undefined"||l===void 0?n.delete(a):n.set(a,l);return n};function cu(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:Xh(e[n]??[],t[n]??[])}const nw=(e={},t={})=>({beforeRequest:cu(e,t,"beforeRequest"),beforeRetry:cu(e,t,"beforeRetry"),afterResponse:cu(e,t,"afterResponse"),beforeError:cu(e,t,"beforeError")}),dI=(e,t)=>{const n=new URLSearchParams;for(const r of[e,t])if(r!==void 0)if(r instanceof URLSearchParams)for(const[o,a]of r.entries())n.append(o,a);else if(Array.isArray(r))for(const o of r){if(!Array.isArray(o)||o.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(o[0]),String(o[1]))}else if(as(r))for(const[o,a]of Object.entries(r))a!==void 0&&n.append(o,String(a));else{const o=new URLSearchParams(r);for(const[a,l]of o.entries())n.append(a,l)}return n},Xh=(...e)=>{let t={},n={},r={},o;const a=[];for(const l of e)if(Array.isArray(l))Array.isArray(t)||(t=[]),t=[...t,...l];else if(as(l)){for(let[c,d]of Object.entries(l)){if(c==="signal"&&d instanceof globalThis.AbortSignal){a.push(d);continue}if(c==="context"){if(d!=null&&(!as(d)||Array.isArray(d)))throw new TypeError("The `context` option must be an object");t={...t,context:d==null?{}:{...t.context,...d}};continue}if(c==="searchParams"){d==null?o=void 0:o=o===void 0?d:dI(o,d);continue}as(d)&&c in t&&(d=Xh(t[c],d)),t={...t,[c]:d}}as(l.hooks)&&(r=nw(r,l.hooks),t.hooks=r),as(l.headers)&&(n=tw(n,l.headers),t.headers=n)}return o!==void 0&&(t.searchParams=o),a.length>0&&(a.length===1?t.signal=a[0]:Xx?t.signal=AbortSignal.any(a):t.signal=a.at(-1)),t.context===void 0&&(t.context={}),t},fI=e=>Qx.includes(e)?e.toUpperCase():e,hI=["get","put","head","delete","options","trace"],pI=[408,413,429,500,502,503,504],mI=[413,429,503],Fy={limit:2,methods:hI,statusCodes:pI,afterStatusCodes:mI,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},gI=(e={})=>{if(typeof e=="number")return{...Fy,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Fy,...e}};class Gf extends Error{constructor(n){super(`Request timed out: ${n.method} ${n.url}`);wn(this,"request");this.name="TimeoutError",this.request=n}}async function yI(e,t,n,r){return new Promise((o,a)=>{const l=setTimeout(()=>{n&&n.abort(),a(new Gf(e))},r.timeout);r.fetch(e,t).then(o).catch(a).then(()=>{clearTimeout(l)})})}async function vI(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(a),r(t.reason)}const a=setTimeout(()=>{t==null||t.removeEventListener("abort",o),n()},e)})}const xI=(e,t)=>{const n={};for(const r in t)Object.hasOwn(t,r)&&!(r in aI)&&!(r in sI)&&(!(r in e)||r in oI)&&(n[r]=t[r]);return n},wI=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;function bI(e){return e instanceof qf||(e==null?void 0:e.name)===qf.name}function SI(e){return e instanceof Gf||(e==null?void 0:e.name)===Gf.name}var Qu,rw,ur,$n,Ut,ge,Ti,Sr,fs,Xe,Pu,iw,Kf,Yf,sw,wa,Au,Xf;const Na=class Na{constructor(t,n={}){xr(this,Xe);wn(this,"request");xr(this,ur);xr(this,$n,0);xr(this,Ut);xr(this,ge);xr(this,Ti);xr(this,Sr);xr(this,fs);var o,a,l;if(ir(this,Ut,t),ir(this,ge,{...n,headers:tw(J(this,Ut).headers,n.headers),hooks:nw({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:fI(n.method??J(this,Ut).method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:gI(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}}),typeof J(this,Ut)!="string"&&!(J(this,Ut)instanceof URL||J(this,Ut)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(J(this,ge).prefixUrl&&typeof J(this,Ut)=="string"){if(J(this,Ut).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");J(this,ge).prefixUrl.endsWith("/")||(J(this,ge).prefixUrl+="/"),ir(this,Ut,J(this,ge).prefixUrl+J(this,Ut))}ZC&&Xx&&(ir(this,Sr,J(this,ge).signal??J(this,Ut).signal),ir(this,ur,new globalThis.AbortController),J(this,ge).signal=J(this,Sr)?AbortSignal.any([J(this,Sr),J(this,ur).signal]):J(this,ur).signal),Oy&&(J(this,ge).duplex="half"),J(this,ge).json!==void 0&&(J(this,ge).body=((a=(o=J(this,ge)).stringifyJson)==null?void 0:a.call(o,J(this,ge).json))??JSON.stringify(J(this,ge).json),J(this,ge).headers.set("content-type",J(this,ge).headers.get("content-type")??"application/json"));const r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(J(this,Ut)instanceof globalThis.Request&&(tI&&J(this,ge).body instanceof globalThis.FormData||J(this,ge).body instanceof URLSearchParams)&&!r&&J(this,ge).headers.delete("content-type"),this.request=new globalThis.Request(J(this,Ut),J(this,ge)),wI(J(this,ge).searchParams)){const d="?"+(typeof J(this,ge).searchParams=="string"?J(this,ge).searchParams.replace(/^\?/,""):new URLSearchParams(vt(l=Na,Qu,rw).call(l,J(this,ge).searchParams)).toString()),f=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,d);this.request=new globalThis.Request(f,J(this,ge))}if(J(this,ge).onUploadProgress){if(typeof J(this,ge).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Oy)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=vt(this,Xe,Xf).call(this,this.request,J(this,ge).body??void 0)}}static create(t,n){var l,c,d;const r=new Na(t,n),o=async()=>{var p,m,y,v,b,S,C;if(typeof J(r,ge).timeout=="number"&&J(r,ge).timeout>Zd)throw new RangeError(`The \`timeout\` option cannot be greater than ${Zd}`);await Promise.resolve();let f=await vt(p=r,Xe,sw).call(p);for(const E of J(r,ge).hooks.afterResponse){const P=vt(m=r,Xe,Kf).call(m,f.clone()),T=await E(r.request,vt(y=r,Xe,wa).call(y),P,{retryCount:J(r,$n)});if(T instanceof globalThis.Response&&(f=T),T instanceof Zx)throw await Promise.all([(v=P.body)==null?void 0:v.cancel(),(b=f.body)==null?void 0:b.cancel()]),new Jd(T.options)}if(vt(S=r,Xe,Kf).call(S,f),!f.ok&&(typeof J(r,ge).throwHttpErrors=="function"?J(r,ge).throwHttpErrors(f.status):J(r,ge).throwHttpErrors)){let E=new qf(f,r.request,vt(C=r,Xe,wa).call(C));for(const P of J(r,ge).hooks.beforeError)E=await P(E,{retryCount:J(r,$n)});throw E}if(J(r,ge).onDownloadProgress){if(typeof J(r,ge).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!eI)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return uI(f.clone(),J(r,ge).onDownloadProgress)}return f},a=vt(l=r,Xe,Yf).call(l,o).finally(async()=>{var m,y;const f=J(r,Ti),p=[];f&&!f.bodyUsed&&p.push((m=f.body)==null?void 0:m.cancel()),r.request.bodyUsed||p.push((y=r.request.body)==null?void 0:y.cancel()),await Promise.all(p)});for(const[f,p]of Object.entries(nI))f==="bytes"&&typeof((d=(c=globalThis.Response)==null?void 0:c.prototype)==null?void 0:d.bytes)!="function"||(a[f]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||p);const m=await a;if(f==="json"){if(m.status===204)return"";const y=await m.text();return y===""?"":n.parseJson?n.parseJson(y):JSON.parse(y)}return m[f]()});return a}};Qu=new WeakSet,rw=function(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0)):t},ur=new WeakMap,$n=new WeakMap,Ut=new WeakMap,ge=new WeakMap,Ti=new WeakMap,Sr=new WeakMap,fs=new WeakMap,Xe=new WeakSet,Pu=function(){const t=J(this,ge).retry.delay(J(this,$n));let n=t;return J(this,ge).retry.jitter===!0?n=Math.random()*t:typeof J(this,ge).retry.jitter=="function"&&(n=J(this,ge).retry.jitter(t),(!Number.isFinite(n)||n<0)&&(n=t)),Math.min(J(this,ge).retry.backoffLimit,n)},iw=async function(t){if(Sy(this,$n)._++,J(this,$n)>J(this,ge).retry.limit)throw t;const n=t instanceof Error?t:new Yx(t);if(n instanceof Jd)return n.customDelay??vt(this,Xe,Pu).call(this);if(!J(this,ge).retry.methods.includes(this.request.method.toLowerCase()))throw t;if(J(this,ge).retry.shouldRetry!==void 0){const r=await J(this,ge).retry.shouldRetry({error:n,retryCount:J(this,$n)});if(r===!1)throw t;if(r===!0)return vt(this,Xe,Pu).call(this)}if(SI(t)&&!J(this,ge).retry.retryOnTimeout)throw t;if(bI(t)){if(!J(this,ge).retry.statusCodes.includes(t.response.status))throw t;const r=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(r&&J(this,ge).retry.afterStatusCodes.includes(t.response.status)){let o=Number(r)*1e3;Number.isNaN(o)?o=Date.parse(r)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now());const a=J(this,ge).retry.maxRetryAfter??o;return o<a?o:a}if(t.response.status===413)throw t}return vt(this,Xe,Pu).call(this)},Kf=function(t){return J(this,ge).parseJson&&(t.json=async()=>J(this,ge).parseJson(await t.text())),t},Yf=async function(t){try{return await t()}catch(n){const r=Math.min(await vt(this,Xe,iw).call(this,n),Zd);if(J(this,$n)<1)throw n;if(await vI(r,J(this,Sr)?{signal:J(this,Sr)}:{}),n instanceof Jd&&n.customRequest){const o=J(this,ge).signal?new globalThis.Request(n.customRequest,{signal:J(this,ge).signal}):new globalThis.Request(n.customRequest);vt(this,Xe,Au).call(this,o)}for(const o of J(this,ge).hooks.beforeRetry){const a=await o({request:this.request,options:vt(this,Xe,wa).call(this),error:n,retryCount:J(this,$n)});if(a instanceof globalThis.Request){vt(this,Xe,Au).call(this,a);break}if(a instanceof globalThis.Response)return a;if(a===Jx)return}return vt(this,Xe,Yf).call(this,t)}},sw=async function(){var n;(n=J(this,ur))!=null&&n.signal.aborted&&(ir(this,ur,new globalThis.AbortController),J(this,ge).signal=J(this,Sr)?AbortSignal.any([J(this,Sr),J(this,ur).signal]):J(this,ur).signal,this.request=new globalThis.Request(this.request,{signal:J(this,ge).signal}));for(const r of J(this,ge).hooks.beforeRequest){const o=await r(this.request,vt(this,Xe,wa).call(this),{retryCount:J(this,$n)});if(o instanceof Response)return o;if(o instanceof globalThis.Request){vt(this,Xe,Au).call(this,o);break}}const t=xI(this.request,J(this,ge));return ir(this,Ti,this.request),this.request=J(this,Ti).clone(),J(this,ge).timeout===!1?J(this,ge).fetch(J(this,Ti),t):yI(J(this,Ti),t,J(this,ur),J(this,ge))},wa=function(){if(!J(this,fs)){const{hooks:t,...n}=J(this,ge);ir(this,fs,Object.freeze(n))}return J(this,fs)},Au=function(t){ir(this,fs,void 0),this.request=vt(this,Xe,Xf).call(this,t)},Xf=function(t,n){return!J(this,ge).onUploadProgress||!t.body?t:cI(t,J(this,ge).onUploadProgress,n??J(this,ge).body??void 0)},xr(Na,Qu);let Ou=Na;/*! MIT License © Sindre Sorhus */const Qf=e=>{const t=(n,r)=>Ou.create(n,uu(e,r));for(const n of Qx)t[n]=(r,o)=>Ou.create(r,uu(e,o,{method:n}));return t.create=n=>Qf(uu(n)),t.extend=n=>(typeof n=="function"&&(n=n(e??{})),Qf(uu(e,n))),t.stop=Jx,t.retry=iI,t},kI=Qf();var Jf=function(e,t){return Jf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},Jf(e,t)};function qa(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Jf(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Zf(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 new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function eh(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,a=[],l;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(c){l={error:c}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return a}function th(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function kr(e){return typeof e=="function"}function ow(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ef=ow(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
52
52
  `+n.map(function(r,o){return o+1+") "+r.toString()}).join(`
53
- `):"",this.name="UnsubscriptionError",this.errors=n}});function rh(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var ic=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,o,a;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var c=eh(l),d=c.next();!d.done;d=c.next()){var f=d.value;f.remove(this)}}catch(S){t={error:S}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}else l.remove(this);var p=this.initialTeardown;if(kr(p))try{p()}catch(S){a=S instanceof ef?S.errors:[S]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var y=eh(m),v=y.next();!v.done;v=y.next()){var b=v.value;try{Vy(b)}catch(S){a=a??[],S instanceof ef?a=nh(nh([],th(a)),th(S.errors)):a.push(S)}}}catch(S){r={error:S}}finally{try{v&&!v.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}}if(a)throw new ef(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Vy(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&rh(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&rh(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),lw=ic.EMPTY;function uw(e){return e instanceof ic||e&&"closed"in e&&kr(e.remove)&&kr(e.add)&&kr(e.unsubscribe)}function Vy(e){kr(e)?e():e.unsubscribe()}var _I={Promise:void 0},PI={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,nh([e,t],th(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function AI(e){PI.setTimeout(function(){throw e})}function By(){}function Ru(e){e()}var Qh=(function(e){qa(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,uw(n)&&n.add(r)):r.destination=jI,r}return t.create=function(n,r,o){return new ih(n,r,o)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(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(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(ic),RI=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){du(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){du(r)}else du(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){du(n)}},e})(),ih=(function(e){qa(t,e);function t(n,r,o){var a=e.call(this)||this,l;return kr(n)||!n?l={next:n??void 0,error:r??void 0,complete:o??void 0}:l=n,a.destination=new RI(l),a}return t})(Qh);function du(e){AI(e)}function NI(e){throw e}var jI={closed:!0,next:By,error:NI,complete:By},MI=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function DI(e){return e}function LI(e){return e.length===0?DI:e.length===1?e[0]:function(n){return e.reduce(function(r,o){return o(r)},n)}}var sh=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var o=this,a=OI(t)?t:new ih(t,n,r);return Ru(function(){var l=o,c=l.operator,d=l.source;a.add(c?c.call(a,d):d?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=$y(n),new n(function(o,a){var l=new ih({next:function(c){try{t(c)}catch(d){a(d),l.unsubscribe()}},error:a,complete:o});r.subscribe(l)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[MI]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return LI(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=$y(t),new t(function(r,o){var a;n.subscribe(function(l){return a=l},function(l){return o(l)},function(){return r(a)})})},e.create=function(t){return new e(t)},e})();function $y(e){var t;return(t=e??_I.Promise)!==null&&t!==void 0?t:Promise}function zI(e){return e&&kr(e.next)&&kr(e.error)&&kr(e.complete)}function OI(e){return e&&e instanceof Qh||zI(e)&&uw(e)}function FI(e){return kr(e==null?void 0:e.lift)}function cw(e){return function(t){if(FI(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function dw(e,t,n,r,o){return new VI(e,t,n,r,o)}var VI=(function(e){qa(t,e);function t(n,r,o,a,l,c){var d=e.call(this,n)||this;return d.onFinalize=l,d.shouldUnsubscribe=c,d._next=r?function(f){try{r(f)}catch(p){n.error(p)}}:e.prototype._next,d._error=a?function(f){try{a(f)}catch(p){n.error(p)}finally{this.unsubscribe()}}:e.prototype._error,d._complete=o?function(){try{o()}catch(f){n.error(f)}finally{this.unsubscribe()}}:e.prototype._complete,d}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t})(Qh),BI=aw(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),fw=(function(e){qa(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new Uy(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new BI},t.prototype.next=function(n){var r=this;Ru(function(){var o,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var l=eh(r.currentObservers),c=l.next();!c.done;c=l.next()){var d=c.value;d.next(n)}}catch(f){o={error:f}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}}})},t.prototype.error=function(n){var r=this;Ru(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var o=r.observers;o.length;)o.shift().error(n)}})},t.prototype.complete=function(){var n=this;Ru(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,o=this,a=o.hasError,l=o.isStopped,c=o.observers;return a||l?lw:(this.currentObservers=null,c.push(n),new ic(function(){r.currentObservers=null,rh(c,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,o=r.hasError,a=r.thrownError,l=r.isStopped;o?n.error(a):l&&n.complete()},t.prototype.asObservable=function(){var n=new sh;return n.source=this,n},t.create=function(n,r){return new Uy(n,r)},t})(sh),Uy=(function(e){qa(t,e);function t(n,r){var o=e.call(this)||this;return o.destination=n,o.source=r,o}return t.prototype.next=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.next)===null||o===void 0||o.call(r,n)},t.prototype.error=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.error)===null||o===void 0||o.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,o;return(o=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&o!==void 0?o:lw},t})(fw),$I=new sh(function(e){return e.complete()});function tf(e,t){return cw(function(n,r){var o=0;n.subscribe(dw(r,function(a){return e.call(t,a,o++)&&r.next(a)}))})}function Hy(e){return e<=0?function(){return $I}:cw(function(t,n){var r=0;t.subscribe(dw(n,function(o){++r<=e&&(n.next(o),e<=r&&n.complete())}))})}var Wy=Gt("core/AgentStateMachine"),UI=class{constructor(){je(this,"_state","idle");je(this,"handlers",new Set)}get state(){return this._state}process(e){const t=this._state,n=this.mapEventToState(e);n!==null&&t!==n&&(this._state=n,Wy.debug("State transition",{eventType:e.type,from:t,to:n}),this.notifyHandlers({prev:t,current:n}))}onStateChange(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}reset(){this._state,this._state="idle",this.handlers.clear()}mapEventToState(e){switch(e.type){case"agent_initializing":return"initializing";case"agent_ready":return"idle";case"agent_destroyed":return"idle";case"conversation_queued":return"queued";case"conversation_start":return"conversation_active";case"conversation_thinking":return"thinking";case"conversation_responding":return"responding";case"conversation_end":return"idle";case"conversation_interrupted":return"idle";case"tool_planned":return"planning_tool";case"tool_executing":return"awaiting_tool_result";case"tool_completed":return"responding";case"tool_failed":return"responding";case"error_occurred":return"idle";default:return null}}notifyHandlers(e){for(const t of this.handlers)try{t(e)}catch(n){Wy.error("State change handler error",{from:e.prev,to:e.current,error:n})}}},Gs=Gt("core/AgentEventBus"),HI=class{constructor(){je(this,"subject",new fw);je(this,"typeSubscriptions",new Map);je(this,"globalSubscriptions",[]);je(this,"nextId",0);je(this,"isDestroyed",!1);je(this,"producerView",null);je(this,"consumerView",null)}emit(e){if(this.isDestroyed){Gs.warn("Emit called on destroyed EventBus",{eventType:e.type});return}this.subject.next(e)}emitBatch(e){for(const t of e)this.emit(t)}on(e,t,n={}){if(this.isDestroyed)return Gs.warn("Subscribe called on destroyed EventBus"),()=>{};const r=Array.isArray(e)?e:[e],o=[];for(const a of r){const l=this.subscribeToType(a,t,n);o.push(l)}return()=>o.forEach(a=>a())}onAny(e,t={}){return this.isDestroyed?(Gs.warn("Subscribe called on destroyed EventBus"),()=>{}):this.subscribeGlobal(e,t)}once(e,t){return this.on(e,t,{once:!0})}asConsumer(){return this.consumerView||(this.consumerView={on:this.on.bind(this),onAny:this.onAny.bind(this),once:this.once.bind(this)}),this.consumerView}asProducer(){return this.producerView||(this.producerView={emit:this.emit.bind(this),emitBatch:this.emitBatch.bind(this)}),this.producerView}destroy(){if(!this.isDestroyed){this.isDestroyed=!0;for(const e of this.typeSubscriptions.values())for(const t of e)t.unsubscribe();this.typeSubscriptions.clear();for(const e of this.globalSubscriptions)e.unsubscribe();this.globalSubscriptions.length=0,this.subject.complete(),Gs.debug("EventBus destroyed")}}subscribeToType(e,t,n){const{filter:r,priority:o=0,once:a=!1}=n,l=this.nextId++;let c=this.subject.pipe(tf(y=>y.type===e));r&&(c=c.pipe(tf(r))),a&&(c=c.pipe(Hy(1)));const d=c.subscribe({next:y=>{this.executeWithPriority(e,y,t,l)}}),f=()=>{d.unsubscribe();const y=this.typeSubscriptions.get(e);if(y){const v=y.findIndex(b=>b.id===l);v!==-1&&y.splice(v,1)}};this.typeSubscriptions.has(e)||this.typeSubscriptions.set(e,[]);const p={id:l,priority:o,handler:t,unsubscribe:f},m=this.typeSubscriptions.get(e);return m.push(p),m.sort((y,v)=>v.priority-y.priority),f}subscribeGlobal(e,t){const{filter:n,priority:r=0,once:o=!1}=t,a=this.nextId++;let l=this.subject.asObservable();n&&(l=l.pipe(tf(n))),o&&(l=l.pipe(Hy(1)));const c=l.subscribe({next:p=>{this.executeGlobalWithPriority(p,e,a)}}),d=()=>{c.unsubscribe();const p=this.globalSubscriptions.findIndex(m=>m.id===a);p!==-1&&this.globalSubscriptions.splice(p,1)},f={id:a,priority:r,handler:e,unsubscribe:d};return this.globalSubscriptions.push(f),this.globalSubscriptions.sort((p,m)=>m.priority-p.priority),d}executeWithPriority(e,t,n,r){if((this.typeSubscriptions.get(e)||[]).find(l=>l.id===r))try{n(t)}catch(l){Gs.error("Event handler error",{eventType:e,error:l})}}executeGlobalWithPriority(e,t,n){if(this.globalSubscriptions.find(o=>o.id===n))try{t(e)}catch(o){Gs.error("Global event handler error",{eventType:e.type,error:o})}}},WI=class{constructor(e){this.agentId=e}classify(e){const t=e instanceof Error?e:new Error(String(e)),n=t.message;return n.includes("rate limit")||n.includes("429")?this.create("llm","RATE_LIMITED",n,!0,t):n.includes("api key")||n.includes("401")||n.includes("unauthorized")?this.create("llm","INVALID_API_KEY",n,!1,t):n.includes("context")&&n.includes("long")?this.create("llm","CONTEXT_TOO_LONG",n,!0,t):n.includes("overloaded")||n.includes("503")?this.create("llm","OVERLOADED",n,!0,t):n.includes("timeout")||n.includes("ETIMEDOUT")?this.create("network","TIMEOUT",n,!0,t):n.includes("ECONNREFUSED")||n.includes("connection")?this.create("network","CONNECTION_FAILED",n,!0,t):n.includes("network")||n.includes("fetch")?this.create("network","CONNECTION_FAILED",n,!0,t):n.includes("driver")?this.create("driver","RECEIVE_FAILED",n,!0,t):this.create("system","UNKNOWN",n,!0,t)}create(e,t,n,r,o){return{category:e,code:t,message:n,severity:r?"error":"fatal",recoverable:r,cause:o}}createEvent(e){return{type:"error",uuid:`${Date.now()}_${Math.random().toString(36).substring(2,9)}`,agentId:this.agentId,timestamp:Date.now(),data:{error:e}}}},qI=class{constructor(){je(this,"middlewares",[])}use(e){return this.middlewares.push(e),()=>{const t=this.middlewares.indexOf(e);t!==-1&&this.middlewares.splice(t,1)}}async execute(e,t){let n=0;const r=async o=>{if(n<this.middlewares.length){const a=this.middlewares[n++];await a(o,r)}else await t(o)};await r(e)}clear(){this.middlewares.length=0}get size(){return this.middlewares.length}},GI=Gt("core/InterceptorChain"),KI=class{constructor(e){je(this,"interceptors",[]);je(this,"agentId");this.agentId=e}intercept(e){return this.interceptors.push(e),()=>{const t=this.interceptors.indexOf(e);t!==-1&&this.interceptors.splice(t,1)}}execute(e,t){let n=0;const r=o=>{if(n<this.interceptors.length){const a=this.interceptors[n++];try{a(o,r)}catch(l){GI.error("Interceptor error",{agentId:this.agentId,eventType:o.type,interceptorIndex:n-1,error:l}),r(o)}}else t(o)};r(e)}clear(){this.interceptors.length=0}get size(){return this.interceptors.length}},YI={onMessageStart:"message_start",onMessageDelta:"message_delta",onMessageStop:"message_stop",onTextContentBlockStart:"text_content_block_start",onTextDelta:"text_delta",onTextContentBlockStop:"text_content_block_stop",onToolUseContentBlockStart:"tool_use_content_block_start",onInputJsonDelta:"input_json_delta",onToolUseContentBlockStop:"tool_use_content_block_stop",onToolCall:"tool_call",onToolResult:"tool_result",onUserMessage:"user_message",onAssistantMessage:"assistant_message",onToolCallMessage:"tool_call_message",onToolResultMessage:"tool_result_message",onError:"error",onTurnRequest:"turn_request",onTurnResponse:"turn_response"};function XI(e){const t={};for(const[n,r]of Object.entries(YI)){const o=e[n];o&&(t[r]=o)}return t}var zn=Gt("core/AgentInstance"),qy=class{constructor(e,t,n,r,o){je(this,"agentId");je(this,"definition");je(this,"context");je(this,"createdAt");je(this,"sandbox");je(this,"_lifecycle","running");je(this,"engine");je(this,"driver");je(this,"stateMachine",new UI);je(this,"eventBus",new HI);je(this,"errorClassifier");je(this,"middlewareChain",new qI);je(this,"interceptorChain");je(this,"readyHandlers",new Set);je(this,"destroyHandlers",new Set);this.agentId=t.agentId,this.definition=e,this.context=t,this.engine=n,this.createdAt=t.createdAt,this.sandbox=o,this.driver=r,this.errorClassifier=new WI(this.agentId),this.interceptorChain=new KI(this.agentId),zn.debug("AgentInstance created",{agentId:this.agentId,definitionName:e.name,driverName:this.driver.name})}get lifecycle(){return this._lifecycle}get state(){return this.stateMachine.state}async receive(e){if(this._lifecycle==="destroyed"){zn.warn("Receive called on destroyed agent",{agentId:this.agentId});const r=this.errorClassifier.create("system","AGENT_DESTROYED","Agent has been destroyed",!1),o=this.errorClassifier.createEvent(r);throw this.notifyHandlers(o),new Error("[Agent] Agent has been destroyed")}if(this.state!=="idle"){zn.warn("Receive called while agent is busy",{agentId:this.agentId,currentState:this.state});const r=this.errorClassifier.create("system","AGENT_BUSY",`Agent is busy (state: ${this.state}), please wait for current operation to complete`,!1),o=this.errorClassifier.createEvent(r);throw this.notifyHandlers(o),new Error(`[Agent] Agent is busy (state: ${this.state})`)}const t=typeof e=="string"?{id:`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,role:"user",subtype:"user",content:e,timestamp:Date.now()}:e;zn.debug("Receiving message",{agentId:this.agentId,messageId:t.id});const n={uuid:`evt_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,type:"user_message",agentId:this.agentId,timestamp:Date.now(),data:t};this.presentOutput(n),this.notifyHandlers(n),await this.executeMiddlewareChain(t)}async executeMiddlewareChain(e){await this.middlewareChain.execute(e,t=>this.doReceive(t))}processStreamEvent(e){const t=this.engine.process(this.agentId,e);for(const n of t)this.presentOutput(n);for(const n of t)this.notifyHandlers(n)}async doReceive(e){try{zn.debug("Processing message through driver",{agentId:this.agentId,messageId:e.id});const t={type:"conversation_queued",uuid:`${Date.now()}_${Math.random().toString(36).substring(2,9)}`,agentId:this.agentId,timestamp:Date.now(),data:{userMessage:e}};this.notifyHandlers(t);const n=this.driver.receive(e);for await(const r of n)this.processStreamEvent(r);zn.debug("Message processing completed",{agentId:this.agentId,messageId:e.id})}catch(t){const n=this.errorClassifier.classify(t),r=this.errorClassifier.createEvent(n);throw zn.error("Message processing failed",{agentId:this.agentId,messageId:e.id,errorCategory:n.category,errorCode:n.code,error:t}),this.notifyHandlers(r),t}}presentOutput(e){}on(e,t){if(typeof e=="function")return this.eventBus.onAny(e);if(this.isEventHandlerMap(e)){const o=[];for(const[a,l]of Object.entries(e))l&&o.push(this.eventBus.on(a,l));return()=>{for(const a of o)a()}}const n=Array.isArray(e)?e:[e],r=t;return this.eventBus.on(n,r)}isEventHandlerMap(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.keys(e);return t.length===0?!1:t.every(n=>{const r=e[n];return r===void 0||typeof r=="function"})}onStateChange(e){return this.stateMachine.onStateChange(e)}react(e){const t=XI(e);return this.on(t)}onReady(e){if(this._lifecycle==="running")try{e()}catch(t){zn.error("onReady handler error",{agentId:this.agentId,error:t})}return this.readyHandlers.add(e),()=>{this.readyHandlers.delete(e)}}onDestroy(e){return this.destroyHandlers.add(e),()=>{this.destroyHandlers.delete(e)}}use(e){return this.middlewareChain.use(e)}intercept(e){return this.interceptorChain.intercept(e)}interrupt(){zn.debug("User interrupt requested",{agentId:this.agentId,currentState:this.state}),this.driver.interrupt()}async destroy(){zn.debug("Destroying agent",{agentId:this.agentId});for(const e of this.destroyHandlers)try{e()}catch(t){zn.error("onDestroy handler error",{agentId:this.agentId,error:t})}this._lifecycle="destroyed",this.stateMachine.reset(),this.eventBus.destroy(),this.readyHandlers.clear(),this.destroyHandlers.clear(),this.middlewareChain.clear(),this.interceptorChain.clear(),this.engine.clearState(this.agentId),zn.info("Agent destroyed",{agentId:this.agentId})}notifyHandlers(e){JC(e)&&this.stateMachine.process(e),this.executeInterceptorChain(e)}executeInterceptorChain(e){this.interceptorChain.execute(e,t=>this.eventBus.emit(t))}getEventConsumer(){return this.eventBus.asConsumer()}},QI=class{constructor(){je(this,"states",new Map)}get(e){return this.states.get(e)}set(e,t){this.states.set(e,t)}delete(e){this.states.delete(e)}has(e){return this.states.has(e)}clear(){this.states.clear()}get size(){return this.states.size}keys(){return this.states.keys()}};Gt("engine/Mealy");function JI(e){return(t,n)=>{const r={},o=[];for(const a in e){const l=e[a],c=t[a],[d,f]=l(c,n);r[a]=d,o.push(...f)}return[r,o]}}function ZI(e){return()=>{const t={};for(const n in e)t[n]=e[n]();return t}}function oh(){return{currentMessageId:null,messageStartTime:null,pendingContents:{},pendingToolCalls:{}}}function hs(){return`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}var eT=(e,t)=>{switch(t.type){case"message_start":return tT(e,t);case"text_delta":return nT(e,t);case"tool_use_content_block_start":return rT(e,t);case"input_json_delta":return iT(e,t);case"tool_use_content_block_stop":return sT(e,t);case"tool_result":return oT(e,t);case"message_stop":return aT(e,t);default:return[e,[]]}};function tT(e,t){return[{...e,currentMessageId:hs(),messageStartTime:t.timestamp,pendingContents:{}},[]]}function nT(e,t){const r=e.pendingContents[0],o=(r==null?void 0:r.type)==="text"?{...r,textDeltas:[...r.textDeltas||[],t.data.text]}:{type:"text",index:0,textDeltas:[t.data.text]};return[{...e,pendingContents:{...e.pendingContents,0:o}},[]]}function rT(e,t){const r={type:"tool_use",index:1,toolId:t.data.id,toolName:t.data.name,toolInputJson:""};return[{...e,pendingContents:{...e.pendingContents,1:r}},[]]}function iT(e,t){const r=e.pendingContents[1];if(!r||r.type!=="tool_use")return[e,[]];const o={...r,toolInputJson:(r.toolInputJson||"")+t.data.partialJson};return[{...e,pendingContents:{...e.pendingContents,1:o}},[]]}function sT(e,t){const r=e.pendingContents[1];if(!r||r.type!=="tool_use")return[e,[]];let o={};try{o=r.toolInputJson?JSON.parse(r.toolInputJson):{}}catch{o={}}const a=[],l=r.toolId,c=r.toolName,d={type:"tool_call",uuid:hs(),agentId:t.agentId,timestamp:Date.now(),data:{id:l,name:c,input:o}};a.push(d);const f={type:"tool-call",id:l,name:c,input:o},p={id:hs(),role:"assistant",subtype:"tool-call",toolCall:f,timestamp:Date.now()},m={type:"tool_call_message",uuid:hs(),agentId:t.agentId,timestamp:Date.now(),data:p};a.push(m);const{[1]:y,...v}=e.pendingContents;return[{...e,pendingContents:v,pendingToolCalls:{...e.pendingToolCalls,[l]:{id:l,name:c}}},a]}function oT(e,t){const{toolId:n,content:r,isError:o}=t.data,a=e.pendingToolCalls[n],l=(a==null?void 0:a.name)||"unknown",c={type:"tool-result",id:n,name:l,output:{type:o?"error-text":"text",value:typeof r=="string"?r:JSON.stringify(r)}},d={id:hs(),role:"tool",subtype:"tool-result",toolResult:c,toolCallId:n,timestamp:Date.now()},f={type:"tool_result_message",uuid:hs(),agentId:t.agentId,timestamp:Date.now(),data:d},{[n]:p,...m}=e.pendingToolCalls;return[{...e,pendingToolCalls:m},[f]]}function aT(e,t){if(!e.currentMessageId)return[e,[]];const n=[],r=Object.values(e.pendingContents).sort((f,p)=>f.index-p.index);for(const f of r)f.type==="text"&&f.textDeltas&&n.push(f.textDeltas.join(""));const o=n.join(""),a=t.data.stopReason;if(!o||o.trim().length===0){const f=a==="tool_use";return[{...oh(),pendingToolCalls:f?e.pendingToolCalls:{}},[]]}const l={id:e.currentMessageId,role:"assistant",subtype:"assistant",content:o,timestamp:e.messageStartTime||Date.now(),usage:void 0},c={type:"assistant_message",uuid:hs(),agentId:t.agentId,timestamp:Date.now(),data:l},d=a==="tool_use";return[{...oh(),pendingToolCalls:d?e.pendingToolCalls:{}},[c]]}var Ma=Gt("engine/stateEventProcessor");function lT(){return{}}function uo(){return`state_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}var uT=(e,t)=>{switch(Ma.debug(`[Stream Event] ${t.type}`,{context:e,eventData:"data"in t?t.data:void 0}),t.type){case"message_start":return cT(e,t);case"message_delta":return dT(e);case"message_stop":return fT(e,t);case"text_content_block_start":return hT(e,t);case"tool_use_content_block_start":return pT(e,t);case"tool_use_content_block_stop":return mT(e);case"tool_call":return gT(e);case"interrupted":return yT(e,t);default:return Ma.debug(`[Stream Event] ${t.type} (unhandled)`),[e,[]]}};function cT(e,t){const n={type:"conversation_start",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,transition:{reason:"conversation_started",trigger:"message_start"},data:{userMessage:{}}};return[e,[n]]}function dT(e,t){return[e,[]]}function fT(e,t){const n=t.data.stopReason;if(Ma.debug("message_stop received",{stopReason:n}),n==="tool_use")return Ma.debug("Skipping conversation_end (tool_use in progress)"),[e,[]];const r={type:"conversation_end",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,transition:{reason:"conversation_completed",trigger:"message_stop"},data:{assistantMessage:{},durationMs:0,durationApiMs:0,numTurns:0,result:"completed",totalCostUsd:0,usage:{input:0,output:0}}};return[e,[r]]}function hT(e,t){const n={type:"conversation_responding",uuid:uo(),agentId:t.agentId,timestamp:Date.now(),transition:{reason:"assistant_responding",trigger:"text_content_block_start"},data:{}};return[e,[n]]}function pT(e,t){const n=[],r={type:"tool_planned",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,data:{id:t.data.id,name:t.data.name,input:{}}};n.push(r);const o={type:"tool_executing",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,transition:{reason:"tool_planning_started",trigger:"tool_use_content_block_start"},data:{}};return n.push(o),[e,n]}function mT(e,t){return[e,[]]}function gT(e,t){return[e,[]]}function yT(e,t){Ma.debug("interrupted event received",{reason:t.data.reason});const n={type:"conversation_interrupted",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,transition:{reason:t.data.reason,trigger:"interrupted"},data:{reason:t.data.reason}};return[e,[n]]}function vT(){return{pendingTurn:null,costPerInputToken:3e-6,costPerOutputToken:15e-6}}function Fu(){return`turn_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function xT(e,t,n){const r=e.input*t,o=e.output*n;return r+o}var wT=(e,t)=>{switch(t.type){case"user_message":return bT(e,t);case"message_stop":return ST(e,t);case"assistant_message":return[e,[]];default:return[e,[]]}};function bT(e,t){const n=Fu(),r={turnId:n,userMessage:t.data,requestedAt:t.timestamp},o={type:"turn_request",uuid:Fu(),agentId:t.agentId,timestamp:Date.now(),turnId:n,data:{userMessage:t.data,requestedAt:t.timestamp}};return[{...e,pendingTurn:r},[o]]}function ST(e,t){if(!e.pendingTurn)return[e,[]];const n=t.data.stopReason;return n==="end_turn"||n==="max_tokens"||n==="stop_sequence"?kT(e,t.agentId,t.timestamp):[e,[]]}function kT(e,t,n){if(!e.pendingTurn)return[e,[]];const{turnId:r,requestedAt:o}=e.pendingTurn,a=n-o,l={input:0,output:0},c=xT(l,e.costPerInputToken,e.costPerOutputToken),d={type:"turn_response",uuid:Fu(),agentId:t,timestamp:Date.now(),turnId:r,data:{assistantMessage:{id:Fu(),role:"assistant",subtype:"assistant",content:"",timestamp:n},respondedAt:n,durationMs:a,usage:l,costUsd:c}};return[{...e,pendingTurn:null},[d]]}var Gy=JI({messageAssembler:eT,stateEventProcessor:uT,turnTracker:wT}),ET=ZI({messageAssembler:oh,stateEventProcessor:lT,turnTracker:vT}),ca=Gt("engine/AgentEngine"),CT=class{constructor(){je(this,"store");this.store=new QI,ca.debug("AgentEngine initialized")}process(e,t){const n=t.type||"unknown";ca.debug("Processing event",{agentId:e,eventType:n});const r=!this.store.has(e);let o=this.store.get(e)??ET();r&&ca.debug("Created initial state for agent",{agentId:e});const a=[];a.push(t);const[l,c]=Gy(o,t);o=l;for(const d of c){a.push(d);const[f,p]=this.processChained(o,d);o=f,a.push(...p)}return this.store.set(e,o),c.length>0&&ca.debug("Produced outputs",{agentId:e,inputEvent:n,outputCount:a.length,processorOutputs:c.length}),a}processChained(e,t){const[n,r]=Gy(e,t);if(r.length===0)return[n,[]];const o=[...r];let a=n;for(const l of r){const[c,d]=this.processChained(a,l);a=c,o.push(...d)}return[a,o]}clearState(e){ca.debug("Clearing state",{agentId:e}),this.store.delete(e)}hasState(e){return this.store.has(e)}},IT=Object.defineProperty,TT=(e,t,n)=>t in e?IT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Le=(e,t,n)=>TT(e,typeof t!="symbol"?t+"":t,n),Ks=Gt("agentx/DefinitionManager");function Ky(e){return`meta_${e}`}function _T(e){const t=new Date;return{name:e.name,description:e.description,systemPrompt:e.systemPrompt,definition:e,source:"code",createdAt:t,updatedAt:t}}var PT=class{constructor(e){this.repository=e,Le(this,"cache",new Map)}register(e){if(this.cache.has(e.name))throw new Error(`Definition already exists: ${e.name}`);this.cache.set(e.name,e);const t=_T(e);this.repository.saveDefinition(t).catch(o=>{Ks.error("Failed to save definition",{name:e.name,error:o})});const n=Ky(e.name),r={imageId:n,type:"meta",definitionName:e.name,parentImageId:null,definition:e,config:{},messages:[],createdAt:new Date};this.repository.saveImage(r).catch(o=>{Ks.error("Failed to save MetaImage",{definitionName:e.name,error:o})}),Ks.info("Definition registered",{name:e.name,metaImageId:n})}get(e){return this.cache.get(e)}list(){return Array.from(this.cache.values())}has(e){return this.cache.has(e)}unregister(e){if(!this.cache.get(e))return!1;this.cache.delete(e),this.repository.deleteDefinition(e).catch(r=>{Ks.error("Failed to delete definition",{name:e,error:r})});const n=Ky(e);return this.repository.deleteImage(n).catch(r=>{Ks.error("Failed to delete MetaImage",{definitionName:e,error:r})}),Ks.info("Definition unregistered",{name:e}),!0}},fu=Gt("agentx/ImageManager");function AT(e){return`meta_${e}`}function hu(e){const t=e.definition;return e.type==="meta"?{type:"meta",imageId:e.imageId,definitionName:e.definitionName,definition:t,config:e.config,messages:[],createdAt:e.createdAt}:{type:"derived",imageId:e.imageId,parentImageId:e.parentImageId,definitionName:e.definitionName,definition:t,config:e.config,messages:e.messages,createdAt:e.createdAt}}var RT=class{constructor(e,t,n){Le(this,"repository"),Le(this,"containerManager"),Le(this,"defaultContainerId"),this.repository=e,this.containerManager=t,this.defaultContainerId=n}async get(e){const t=await this.repository.findImageById(e);if(t)return hu(t)}async getMetaImage(e){const t=AT(e),n=await this.repository.findImageById(t);if(!(!n||n.type!=="meta"))return hu(n)}async list(){return(await this.repository.findAllImages()).map(hu)}async listByDefinition(e){return(await this.repository.findAllImages()).filter(r=>r.definitionName===e).map(hu)}async exists(e){return this.repository.imageExists(e)}async delete(e){const t=await this.repository.findImageById(e);return t?t.type==="meta"?(fu.warn("Cannot delete MetaImage directly",{imageId:e}),!1):(await this.repository.deleteImage(e),fu.info("Image deleted",{imageId:e}),!0):!1}async run(e,t){fu.info("Running agent from image",{imageId:e,containerId:t==null?void 0:t.containerId});const n=await this.get(e);if(!n)throw new Error(`Image not found: ${e}`);let r=(t==null?void 0:t.containerId)||this.defaultContainerId;return r||(r=(await this.containerManager.create()).containerId,this.defaultContainerId=r,fu.debug("Auto-created default container",{containerId:r})),this.containerManager.run(n,r)}},pu=Gt("agentx/AgentManager"),NT=class{constructor(e){this.containerManager=e}get(e){return this.containerManager.getAgent(e)}has(e){return this.containerManager.hasAgent(e)}list(){return this.containerManager.listAgents()}async destroy(e){pu.debug("Destroying agent",{agentId:e}),await this.containerManager.destroyAgent(e),pu.info("Agent destroyed",{agentId:e})}async destroyAll(){const e=this.containerManager.listAgents();pu.debug("Destroying all agents",{count:e.length}),await this.containerManager.destroyAllAgents(),pu.info("All agents destroyed",{count:e.length})}},Sn=Gt("agentx/SessionManager");function hw(){const e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`session_${e}_${t}`}function jT(){const e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`image_${e}_${t}`}var da=class pw{constructor(t,n,r,o){Le(this,"sessionId"),Le(this,"userId"),Le(this,"imageId"),Le(this,"createdAt"),Le(this,"_title"),Le(this,"_updatedAt"),Le(this,"repository"),Le(this,"containerManager"),Le(this,"defaultContainerId"),this.sessionId=t.sessionId,this.userId=t.userId,this.imageId=t.imageId,this._title=t.title,this.createdAt=t.createdAt.getTime(),this._updatedAt=t.updatedAt.getTime(),this.repository=n,this.containerManager=r,this.defaultContainerId=o}get title(){return this._title}get updatedAt(){return this._updatedAt}async resume(t){Sn.info("Resuming agent from session",{sessionId:this.sessionId,imageId:this.imageId,containerId:t==null?void 0:t.containerId});let n=(t==null?void 0:t.containerId)||this.defaultContainerId;n||(n=(await this.containerManager.create()).containerId,Sn.debug("Auto-created default container for session",{containerId:n,sessionId:this.sessionId}));const r=await this.containerManager.resume(this,n);return this.collect(r),r}collect(t){Sn.debug("Collecting messages from agent",{sessionId:this.sessionId,agentId:t.agentId});const n=this.sessionId,r=this.repository,o=(a,l)=>{const c={messageId:a.id,sessionId:n,role:l,content:a,createdAt:new Date(a.timestamp??Date.now())};r.saveMessage(c).catch(d=>{Sn.error("Failed to persist message",{sessionId:n,messageId:c.messageId,error:d})})};t.on("user_message",a=>o(a.data,"user")),t.on("assistant_message",a=>o(a.data,"assistant")),t.on("tool_call_message",a=>o(a.data,"tool")),t.on("tool_result_message",a=>o(a.data,"tool"))}async getMessages(){return Sn.debug("Getting messages for session",{sessionId:this.sessionId}),(await this.repository.findMessagesBySessionId(this.sessionId)).map(n=>n.content)}async fork(){Sn.info("Forking session",{sessionId:this.sessionId});const t=await this.repository.findImageById(this.imageId);if(!t)throw new Error(`Image not found: ${this.imageId}`);const n=jT(),r={imageId:n,type:"derived",definitionName:t.definitionName,parentImageId:t.imageId,definition:t.definition,config:t.config,messages:[...t.messages],createdAt:new Date};await this.repository.saveImage(r);const o=hw(),a=new Date,l={sessionId:o,userId:this.userId,imageId:n,title:this._title?`Fork of ${this._title}`:null,createdAt:a,updatedAt:a};return await this.repository.saveSession(l),Sn.info("Session forked",{originalSessionId:this.sessionId,newSessionId:o,newImageId:n}),new pw(l,this.repository,this.containerManager,this.defaultContainerId)}async setTitle(t){Sn.debug("Setting session title",{sessionId:this.sessionId,title:t});const n=new Date;await this.repository.saveSession({sessionId:this.sessionId,userId:this.userId,imageId:this.imageId,title:t,createdAt:new Date(this.createdAt),updatedAt:n}),this._title=t,this._updatedAt=n.getTime(),Sn.info("Session title updated",{sessionId:this.sessionId,title:t})}},MT=class{constructor(e,t,n){Le(this,"repository"),Le(this,"containerManager"),Le(this,"defaultContainerId"),this.repository=e,this.containerManager=t,this.defaultContainerId=n}async create(e,t){const n=hw(),r=new Date,o={sessionId:n,userId:t,imageId:e,title:null,createdAt:r,updatedAt:r};return await this.repository.saveSession(o),Sn.info("Session created",{sessionId:n,imageId:e,userId:t}),new da(o,this.repository,this.containerManager,this.defaultContainerId)}async get(e){const t=await this.repository.findSessionById(e);if(t)return new da(t,this.repository,this.containerManager,this.defaultContainerId)}async has(e){return this.repository.sessionExists(e)}async list(){return(await this.repository.findAllSessions()).map(t=>new da(t,this.repository,this.containerManager,this.defaultContainerId))}async listByImage(e){return(await this.repository.findSessionsByImageId(e)).map(n=>new da(n,this.repository,this.containerManager,this.defaultContainerId))}async listByUser(e){return(await this.repository.findSessionsByUserId(e)).map(n=>new da(n,this.repository,this.containerManager,this.defaultContainerId))}async destroy(e){await this.repository.deleteSession(e),Sn.info("Session destroyed",{sessionId:e})}async destroyByImage(e){await this.repository.deleteSessionsByImageId(e),Sn.info("Sessions destroyed by image",{imageId:e})}async destroyAll(){const e=await this.repository.findAllSessions();for(const t of e)await this.repository.deleteSession(t.sessionId);Sn.info("All sessions destroyed")}},mu=Gt("agentx/ErrorManager"),DT=class{constructor(){Le(this,"handlers",new Set)}handle(e,t,n){this.logError(e,t);for(const r of this.handlers)try{r.handle(e,t,n)}catch(o){mu.error("ErrorHandler failed",{error:o})}}addHandler(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}removeHandler(e){this.handlers.delete(e)}logError(e,t){const n=`[${e}] ${t.category}/${t.code}`;t.severity==="fatal"?mu.error(`${n}: ${t.message}`,{error:t}):t.severity==="error"?mu.error(`${n}: ${t.message}`):mu.warn(`${n}: ${t.message}`)}},LT=class extends Error{constructor(e,t,n){super(t),this.code=e,this.details=n,this.name="ApiError"}};function mw(e){return TI.create({prefixUrl:e.baseUrl.replace(/\/+$/,""),headers:e.headers,timeout:e.timeout||3e4,hooks:{afterResponse:[async(t,n,r)=>{var o,a,l;if(!r.ok){const c=await r.json().catch(()=>({}));throw new LT(((o=c.error)==null?void 0:o.code)||"UNKNOWN_ERROR",((a=c.error)==null?void 0:a.message)||`Request failed: ${r.status}`,(l=c.error)==null?void 0:l.details)}return r}]}})}var sr=Gt("agentx/ContainerManager");function zT(){const e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`container_${e}_${t}`}function Yy(){const e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`agent_${e}_${t}`}var OT=class{constructor(e,t){Le(this,"agents",new Map),Le(this,"engine"),Le(this,"runtime"),Le(this,"repository"),this.runtime=e,this.repository=t,this.engine=new CT}async create(e){const t=zT(),n=Date.now(),r={containerId:t,createdAt:n,updatedAt:n,config:e};return await this.repository.saveContainer(r),sr.info("Container created",{containerId:t}),r}async get(e){return this.repository.findContainerById(e)}async list(){return this.repository.findAllContainers()}async delete(e){return await this.repository.containerExists(e)?(await this.repository.deleteContainer(e),sr.info("Container deleted",{containerId:e}),!0):!1}async exists(e){return this.repository.containerExists(e)}async run(e,t){if(sr.info("Running agent from image",{imageId:e.imageId,containerId:t}),!await this.repository.findContainerById(t))throw new Error(`Container not found: ${t}`);let r;this.runtime.agentIdResolver?r=await this.runtime.agentIdResolver.resolveForRun(e.imageId,t):r=Yy();const o={agentId:r,createdAt:Date.now()},a=this.runtime.createSandbox(t),l=this.runtime.createDriver(e.definition,o,a),c=new qy(e.definition,o,this.engine,l,a);return this.agents.set(r,c),sr.info("Agent started",{agentId:r,imageId:e.imageId,containerId:t,definitionName:e.definition.name}),c}async resume(e,t){if(sr.info("Resuming agent from session",{sessionId:e.sessionId,imageId:e.imageId,containerId:t}),!await this.repository.findContainerById(t))throw new Error(`Container not found: ${t}`);const r=await this.repository.findImageById(e.imageId);if(!r)throw new Error(`Image not found: ${e.imageId}`);let o;this.runtime.agentIdResolver?o=await this.runtime.agentIdResolver.resolveForResume(e.sessionId,t):o=Yy();const a={agentId:o,createdAt:Date.now()},l=this.runtime.createSandbox(t),c=r.definition,d=this.runtime.createDriver(c,a,l),f=new qy(c,a,this.engine,d,l);return this.agents.set(o,f),sr.info("Agent resumed",{agentId:o,sessionId:e.sessionId,imageId:e.imageId,containerId:t}),f}async destroyAgent(e){const t=this.agents.get(e);if(!t){sr.warn("Agent not found for destroy",{agentId:e});return}sr.debug("Destroying agent",{agentId:e}),await t.destroy(),this.agents.delete(e),sr.info("Agent destroyed",{agentId:e})}getAgent(e){return this.agents.get(e)}hasAgent(e){return this.agents.has(e)}listAgents(){return Array.from(this.agents.values())}async destroyAllAgents(){const e=Array.from(this.agents.keys());sr.debug("Destroying all agents",{count:e.length}),await Promise.all(e.map(t=>this.destroyAgent(t))),sr.info("All agents destroyed",{count:e.length})}},Xy=Gt("agentx/AgentX");function FT(e,t){if(Xy.info("Creating AgentX instance",{runtime:e.name}),!e.repository)throw new Error("Runtime must have a repository for persistence");const n=e.repository,r=new OT(e,n),o=new DT,a=new PT(n),l=new NT(r),c=new RT(n,r,t==null?void 0:t.containerId),d=new MT(n,r,t==null?void 0:t.containerId);return Xy.debug("AgentX instance created",{runtime:e.name}),{mode:"local",containers:r,definitions:a,images:c,agents:l,sessions:d,errors:o}}var VT=class{constructor(e,t,n={}){this.serverUrl=e,this.agentId=t,this.sseParams=n,Le(this,"eventSource",null),Le(this,"messageQueue",[]),Le(this,"activeIterators",new Set),Le(this,"isDone",!1)}connect(){if(this.eventSource)return;let e=`${this.serverUrl}/agents/${this.agentId}/sse`;if(Object.keys(this.sseParams).length>0){const r=new URLSearchParams(this.sseParams);e+=`?${r.toString()}`}this.eventSource=new EventSource(e);const t=r=>{try{const o=JSON.parse(r.data);if(this.activeIterators.size>0){const a=this.activeIterators.values().next().value;a&&(this.activeIterators.delete(a),a.resolve({value:o,done:!1}))}else this.messageQueue.push(o)}catch{}},n=()=>{var r;this.isDone=!0,(r=this.eventSource)==null||r.close(),this.eventSource=null;for(const o of this.activeIterators)o.reject(new Error("SSE connection error"));this.activeIterators.clear()};for(const r of Kx)this.eventSource.addEventListener(r,t);this.eventSource.addEventListener("error",t),this.eventSource.onmessage=t,this.eventSource.onerror=n}createIterator(){const e=this;return{[Symbol.asyncIterator](){let t=!1;return{async next(){if(e.messageQueue.length>0){const n=e.messageQueue.shift();return n.type==="message_stop"&&n.data.stopReason!=="tool_use"&&(t=!0),{value:n,done:!1}}return t?{done:!0,value:void 0}:e.isDone?{done:!0,value:void 0}:new Promise((n,r)=>{const a={resolve:l=>{l.done||l.value.type==="message_stop"&&l.value.data.stopReason!=="tool_use"&&(t=!0),n(l)},reject:r};e.activeIterators.add(a)})},async return(){return{done:!0,value:void 0}}}}}}close(){this.isDone=!0,this.eventSource&&(this.eventSource.close(),this.eventSource=null);for(const e of this.activeIterators)e.reject(new Error("Connection closed"));this.activeIterators.clear(),this.messageQueue=[]}};function BT(e){const{serverUrl:t,agentId:n,headers:r={},sseParams:o={}}=e;let a=null;return{name:"SSEDriver",async*receive(l){var f;a||(a=new VT(t,n,o),a.connect());const c=`${t}/agents/${n}/messages`,d=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify({content:(typeof l.content=="string",l.content)})});if(!d.ok){const p=await d.json().catch(()=>({}));throw new Error(((f=p.error)==null?void 0:f.message)||`HTTP ${d.status}`)}yield*a.createIterator()},interrupt(){const l=`${t}/agents/${n}/interrupt`;fetch(l,{method:"POST",headers:{"Content-Type":"application/json",...r}}).catch(()=>{})}}}var Qy=Gt("agentx/RemoteRepository"),$T=class{constructor(e){Le(this,"client"),this.client=mw({baseUrl:e.serverUrl,headers:e.headers}),Qy.debug("RemoteRepository created",{serverUrl:e.serverUrl})}async saveDefinition(e){await this.client.put(`definitions/${e.name}`,{json:e})}async findDefinitionByName(e){try{const t=await this.client.get(`definitions/${e}`).json();return this.parseDefinitionRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findAllDefinitions(){return(await this.client.get("definitions").json()).map(t=>this.parseDefinitionRecord(t))}async deleteDefinition(e){await this.client.delete(`definitions/${e}`)}async definitionExists(e){try{return await this.client.head(`definitions/${e}`),!0}catch{return!1}}async saveImage(e){await this.client.put(`images/${e.imageId}`,{json:e})}async findImageById(e){try{const t=await this.client.get(`images/${e}`).json();return this.parseImageRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findAllImages(){return(await this.client.get("images").json()).map(t=>this.parseImageRecord(t))}async deleteImage(e){await this.client.delete(`images/${e}`)}async imageExists(e){try{return await this.client.head(`images/${e}`),!0}catch{return!1}}async saveSession(e){await this.client.put(`sessions/${e.sessionId}`,{json:e})}async findSessionById(e){try{const t=await this.client.get(`sessions/${e}`).json();return this.parseSessionRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findSessionsByImageId(e){return(await this.client.get(`images/${e}/sessions`).json()).map(n=>this.parseSessionRecord(n))}async findSessionsByUserId(e){return(await this.client.get(`users/${e}/sessions`).json()).map(n=>this.parseSessionRecord(n))}async findAllSessions(){return(await this.client.get("sessions").json()).map(t=>this.parseSessionRecord(t))}async deleteSession(e){await this.client.delete(`sessions/${e}`)}async deleteSessionsByImageId(e){await this.client.delete(`images/${e}/sessions`)}async sessionExists(e){try{return await this.client.head(`sessions/${e}`),!0}catch{return!1}}async saveMessage(e){Qy.debug("saveMessage called (noop in browser)")}async findMessageById(e){try{const t=await this.client.get(`messages/${e}`).json();return this.parseMessageRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findMessagesBySessionId(e){return(await this.client.get(`sessions/${e}/messages`).json()).map(n=>this.parseMessageRecord(n))}async deleteMessage(e){await this.client.delete(`messages/${e}`)}async deleteMessagesBySessionId(e){await this.client.delete(`sessions/${e}/messages`)}async countMessagesBySessionId(e){return(await this.client.get(`sessions/${e}/messages/count`).json()).count}async saveContainer(e){await this.client.put(`containers/${e.containerId}`,{json:e})}async findContainerById(e){try{const t=await this.client.get(`containers/${e}`).json();return this.parseContainerRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findAllContainers(){return(await this.client.get("containers").json()).map(t=>this.parseContainerRecord(t))}async deleteContainer(e){await this.client.delete(`containers/${e}`)}async containerExists(e){try{return await this.client.head(`containers/${e}`),!0}catch{return!1}}isNotFound(e){var t;return((t=e==null?void 0:e.response)==null?void 0:t.status)===404}parseDefinitionRecord(e){return{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}}parseImageRecord(e){return{...e,createdAt:new Date(e.createdAt)}}parseSessionRecord(e){return{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}}parseMessageRecord(e){return{...e,createdAt:new Date(e.createdAt)}}parseContainerRecord(e){return{...e}}},Jh=class ba{constructor(t,n={}){Le(this,"name"),Le(this,"level"),Le(this,"collapsed"),this.name=t,this.level=n.level??dn.INFO,this.collapsed=n.collapsed??!0}debug(t,n){this.isDebugEnabled()&&this.log("DEBUG",t,n)}info(t,n){this.isInfoEnabled()&&this.log("INFO",t,n)}warn(t,n){this.isWarnEnabled()&&this.log("WARN",t,n)}error(t,n){this.isErrorEnabled()&&(t instanceof Error?this.log("ERROR",t.message,{...n,stack:t.stack}):this.log("ERROR",t,n))}isDebugEnabled(){return this.level<=dn.DEBUG}isInfoEnabled(){return this.level<=dn.INFO}isWarnEnabled(){return this.level<=dn.WARN}isErrorEnabled(){return this.level<=dn.ERROR}log(t,n,r){const o=new Date().toLocaleTimeString(),a=this.getConsoleMethod(t),l=ba.BADGE_STYLES[t],c=`%c${o} %c${t}%c %c[${this.name}]%c ${n}`,d=[ba.STYLES.TIMESTAMP,l,"",ba.STYLES.NAME,ba.STYLES.MESSAGE];r&&Object.keys(r).length>0?((this.collapsed?console.groupCollapsed:console.group).call(console,c,...d),console.log("Context:",r),console.groupEnd()):a(c,...d)}getConsoleMethod(t){switch(t){case"DEBUG":return console.debug.bind(console);case"INFO":return console.info.bind(console);case"WARN":return console.warn.bind(console);case"ERROR":return console.error.bind(console);default:return console.log.bind(console)}}};Le(Jh,"STYLES",{DEBUG:"color: #6B7280; font-weight: normal;",INFO:"color: #10B981; font-weight: normal;",WARN:"color: #F59E0B; font-weight: bold;",ERROR:"color: #EF4444; font-weight: bold;",TIMESTAMP:"color: #9CA3AF; font-weight: normal;",NAME:"color: #8B5CF6; font-weight: normal;",MESSAGE:"color: inherit; font-weight: normal;"});Le(Jh,"BADGE_STYLES",{DEBUG:"background: #E5E7EB; color: #374151; padding: 2px 6px; border-radius: 3px; font-size: 11px;",INFO:"background: #D1FAE5; color: #065F46; padding: 2px 6px; border-radius: 3px; font-size: 11px;",WARN:"background: #FEF3C7; color: #92400E; padding: 2px 6px; border-radius: 3px; font-size: 11px;",ERROR:"background: #FEE2E2; color: #991B1B; padding: 2px 6px; border-radius: 3px; font-size: 11px;"});var UT=Jh,HT=class{constructor(e={}){Le(this,"options"),Le(this,"loggers",new Map),this.options=e}getLogger(e){if(this.loggers.has(e))return this.loggers.get(e);const t=new UT(e,this.options);return this.loggers.set(e,t),t}},gu=Gt("agentx/RemoteAgentIdResolver"),WT=class{constructor(e){Le(this,"client"),this.client=mw({baseUrl:e.serverUrl,headers:e.headers})}async resolveForRun(e,t){gu.debug("Resolving agent ID for run",{imageId:e,containerId:t});const n=await this.client.post(`images/${e}/run`,{json:{containerId:t}}).json();return gu.info("Agent ID resolved for run",{imageId:e,agentId:n.agentId}),n.agentId}async resolveForResume(e,t){gu.debug("Resolving agent ID for resume",{sessionId:e,containerId:t});const n=await this.client.post(`sessions/${e}/resume`,{json:{containerId:t}}).json();return gu.info("Agent ID resolved for resume",{sessionId:e,agentId:n.agentId}),n.agentId}},Jy={name:"browser-noop",workspace:{id:"noop",name:"noop",path:""},llm:{name:"noop",provide:()=>({})}},qT=class{constructor(e){Le(this,"name","sse"),Le(this,"repository"),Le(this,"loggerFactory"),Le(this,"agentIdResolver"),Le(this,"serverUrl"),Le(this,"headers"),Le(this,"sseParams"),this.serverUrl=e.serverUrl.replace(/\/+$/,""),this.headers=e.headers??{},this.sseParams=e.sseParams??{},this.loggerFactory=new HT({collapsed:!0}),nI(this.loggerFactory),this.repository=new $T({serverUrl:this.serverUrl,headers:this.headers}),this.agentIdResolver=new WT({serverUrl:this.serverUrl,headers:this.headers})}createSandbox(e){return Jy}createDriver(e,t,n){return{...BT({serverUrl:this.serverUrl,agentId:t.agentId,headers:this.headers,sseParams:this.sseParams}),sandbox:Jy}}createLogger(e){return this.loggerFactory.getLogger(e)}};function GT(e){return new qT(e)}var KT=Object.defineProperty,YT=(e,t,n)=>t in e?KT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zy=(e,t,n)=>YT(e,typeof t!="symbol"?t+"":t,n);function XT(e,t={}){const{initialMessages:n=[],onSend:r,onError:o,onStatusChange:a}=t,[l,c]=I.useState(n),[d,f]=I.useState(""),[p,m]=I.useState((e==null?void 0:e.state)??"idle"),[y,v]=I.useState([]),b=I.useRef(!0),S=p==="queued"||p==="responding"||p==="thinking"||p==="planning_tool"||p==="awaiting_tool_result"||p==="conversation_active";I.useEffect(()=>{c([]),f(""),v([]),m((e==null?void 0:e.state)??"idle")},[e]),I.useEffect(()=>{if(!e)return;b.current=!0;const O=e.react({onTextDelta:N=>{b.current&&f(D=>D+N.data.text)},onAssistantMessage:N=>{if(!b.current)return;const D=N.data;f(""),c(H=>H.some(ee=>ee.id===D.id)?H:[...H,D])},onToolCallMessage:N=>{if(!b.current)return;const D=N.data;c(H=>H.some(ee=>ee.id===D.id)?H:[...H,D])},onToolResultMessage:N=>{if(!b.current)return;const D=N.data;c(H=>H.some(ee=>ee.id===D.id)?H:[...H,D])},onError:N=>{if(!b.current)return;const D=N.data.error;v(H=>[...H,D]),f(""),o==null||o(D)}}),V=e.onStateChange(N=>{b.current&&(m(N.current),a==null||a(N.current))});return m(e.state),()=>{b.current=!1,O(),V()}},[e,o,a]);const C=I.useCallback(O=>{if(!e)return;v([]),r==null||r(O);const V={id:`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,role:"user",subtype:"user",content:O,timestamp:Date.now()};c(N=>[...N,V]),e.receive(O).catch(()=>{})},[e,r]),E=I.useCallback(()=>{e==null||e.interrupt()},[e]),P=I.useCallback(()=>{c([]),f("")},[]),T=I.useCallback(()=>{v([])},[]);return{messages:l,streaming:d,status:p,errors:y,send:C,interrupt:E,isLoading:S,clearMessages:P,clearErrors:T}}function ev(e){return{sessionId:e.sessionId,userId:e.userId,imageId:e.imageId,title:e.title,createdAt:e.createdAt,updatedAt:e.updatedAt}}function QT(e,t,n={}){const{autoLoad:r=!0,onSessionChange:o,onSessionsChange:a}=n,[l,c]=I.useState([]),[d,f]=I.useState(null),[p,m]=I.useState(!1),[y,v]=I.useState(null),b=I.useCallback(async()=>{if(!(!e||!("sessions"in e))){m(!0),v(null);try{const O=(await e.sessions.listByUser(t)).map(ev);c(O),a==null||a(O)}catch(T){v(T instanceof Error?T:new Error(String(T)))}finally{m(!1)}}},[e,t,a]);I.useEffect(()=>{r&&b()},[r,b]);const S=I.useCallback(T=>{f(T),o==null||o(T)},[o]),C=I.useCallback(async(T,O)=>{if(!e||!("sessions"in e))throw new Error("AgentX sessions not available");m(!0),v(null);try{const V=await e.sessions.create(T,t);O&&await V.setTitle(O);const N=ev(V);return c(D=>[N,...D]),a==null||a([N,...l]),N}catch(V){const N=V instanceof Error?V:new Error(String(V));throw v(N),N}finally{m(!1)}},[e,t,l,a]),E=I.useCallback(async T=>{if(!e||!("sessions"in e))throw new Error("AgentX sessions not available");m(!0),v(null);try{await e.sessions.destroy(T);const O=l.filter(V=>V.sessionId!==T);c(O),a==null||a(O),(d==null?void 0:d.sessionId)===T&&(f(null),o==null||o(null))}catch(O){const V=O instanceof Error?O:new Error(String(O));throw v(V),V}finally{m(!1)}},[e,l,d,o,a]),P=I.useCallback(async(T,O)=>{if(!e||!("sessions"in e))throw new Error("AgentX sessions not available");v(null);try{const V=await e.sessions.get(T);if(V){await V.setTitle(O);const N=Date.now();c(D=>D.map(H=>H.sessionId===T?{...H,title:O,updatedAt:N}:H)),(d==null?void 0:d.sessionId)===T&&f(D=>D&&{...D,title:O,updatedAt:N})}}catch(V){const N=V instanceof Error?V:new Error(String(V));throw v(N),N}},[e,d]);return{sessions:l,currentSession:d,selectSession:S,createSession:C,deleteSession:E,setSessionTitle:P,refresh:b,isLoading:p,error:y}}/**
53
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function nh(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var rc=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,o,a;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var c=Zf(l),d=c.next();!d.done;d=c.next()){var f=d.value;f.remove(this)}}catch(S){t={error:S}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}else l.remove(this);var p=this.initialTeardown;if(kr(p))try{p()}catch(S){a=S instanceof ef?S.errors:[S]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var y=Zf(m),v=y.next();!v.done;v=y.next()){var b=v.value;try{Vy(b)}catch(S){a=a??[],S instanceof ef?a=th(th([],eh(a)),eh(S.errors)):a.push(S)}}}catch(S){r={error:S}}finally{try{v&&!v.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}}if(a)throw new ef(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Vy(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&nh(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&nh(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),aw=rc.EMPTY;function lw(e){return e instanceof rc||e&&"closed"in e&&kr(e.remove)&&kr(e.add)&&kr(e.unsubscribe)}function Vy(e){kr(e)?e():e.unsubscribe()}var EI={Promise:void 0},CI={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,th([e,t],eh(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function II(e){CI.setTimeout(function(){throw e})}function By(){}function Ru(e){e()}var Qh=(function(e){qa(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,lw(n)&&n.add(r)):r.destination=PI,r}return t.create=function(n,r,o){return new rh(n,r,o)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(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(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(rc),TI=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){du(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){du(r)}else du(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){du(n)}},e})(),rh=(function(e){qa(t,e);function t(n,r,o){var a=e.call(this)||this,l;return kr(n)||!n?l={next:n??void 0,error:r??void 0,complete:o??void 0}:l=n,a.destination=new TI(l),a}return t})(Qh);function du(e){II(e)}function _I(e){throw e}var PI={closed:!0,next:By,error:_I,complete:By},AI=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function RI(e){return e}function NI(e){return e.length===0?RI:e.length===1?e[0]:function(n){return e.reduce(function(r,o){return o(r)},n)}}var ih=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var o=this,a=MI(t)?t:new rh(t,n,r);return Ru(function(){var l=o,c=l.operator,d=l.source;a.add(c?c.call(a,d):d?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=$y(n),new n(function(o,a){var l=new rh({next:function(c){try{t(c)}catch(d){a(d),l.unsubscribe()}},error:a,complete:o});r.subscribe(l)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[AI]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return NI(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=$y(t),new t(function(r,o){var a;n.subscribe(function(l){return a=l},function(l){return o(l)},function(){return r(a)})})},e.create=function(t){return new e(t)},e})();function $y(e){var t;return(t=e??EI.Promise)!==null&&t!==void 0?t:Promise}function jI(e){return e&&kr(e.next)&&kr(e.error)&&kr(e.complete)}function MI(e){return e&&e instanceof Qh||jI(e)&&lw(e)}function DI(e){return kr(e==null?void 0:e.lift)}function uw(e){return function(t){if(DI(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function cw(e,t,n,r,o){return new LI(e,t,n,r,o)}var LI=(function(e){qa(t,e);function t(n,r,o,a,l,c){var d=e.call(this,n)||this;return d.onFinalize=l,d.shouldUnsubscribe=c,d._next=r?function(f){try{r(f)}catch(p){n.error(p)}}:e.prototype._next,d._error=a?function(f){try{a(f)}catch(p){n.error(p)}finally{this.unsubscribe()}}:e.prototype._error,d._complete=o?function(){try{o()}catch(f){n.error(f)}finally{this.unsubscribe()}}:e.prototype._complete,d}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t})(Qh),zI=ow(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),dw=(function(e){qa(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new Uy(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new zI},t.prototype.next=function(n){var r=this;Ru(function(){var o,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var l=Zf(r.currentObservers),c=l.next();!c.done;c=l.next()){var d=c.value;d.next(n)}}catch(f){o={error:f}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}}})},t.prototype.error=function(n){var r=this;Ru(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var o=r.observers;o.length;)o.shift().error(n)}})},t.prototype.complete=function(){var n=this;Ru(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,o=this,a=o.hasError,l=o.isStopped,c=o.observers;return a||l?aw:(this.currentObservers=null,c.push(n),new rc(function(){r.currentObservers=null,nh(c,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,o=r.hasError,a=r.thrownError,l=r.isStopped;o?n.error(a):l&&n.complete()},t.prototype.asObservable=function(){var n=new ih;return n.source=this,n},t.create=function(n,r){return new Uy(n,r)},t})(ih),Uy=(function(e){qa(t,e);function t(n,r){var o=e.call(this)||this;return o.destination=n,o.source=r,o}return t.prototype.next=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.next)===null||o===void 0||o.call(r,n)},t.prototype.error=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.error)===null||o===void 0||o.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,o;return(o=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&o!==void 0?o:aw},t})(dw),OI=new ih(function(e){return e.complete()});function tf(e,t){return uw(function(n,r){var o=0;n.subscribe(cw(r,function(a){return e.call(t,a,o++)&&r.next(a)}))})}function Hy(e){return e<=0?function(){return OI}:uw(function(t,n){var r=0;t.subscribe(cw(n,function(o){++r<=e&&(n.next(o),e<=r&&n.complete())}))})}var FI=Object.defineProperty,VI=(e,t,n)=>t in e?FI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,me=(e,t,n)=>VI(e,typeof t!="symbol"?t+"":t,n),BI=Object.defineProperty,$I=(e,t,n)=>t in e?BI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ls=(e,t,n)=>$I(e,typeof t!="symbol"?t+"":t,n),fw=class sh{constructor(t,n={}){ls(this,"name"),ls(this,"level"),ls(this,"colors"),ls(this,"timestamps"),this.name=t,this.level=n.level??cn.INFO,this.colors=n.colors??this.isNodeEnvironment(),this.timestamps=n.timestamps??!0}debug(t,n){this.isDebugEnabled()&&this.log("DEBUG",t,n)}info(t,n){this.isInfoEnabled()&&this.log("INFO",t,n)}warn(t,n){this.isWarnEnabled()&&this.log("WARN",t,n)}error(t,n){this.isErrorEnabled()&&(t instanceof Error?this.log("ERROR",t.message,{...n,stack:t.stack}):this.log("ERROR",t,n))}isDebugEnabled(){return this.level<=cn.DEBUG}isInfoEnabled(){return this.level<=cn.INFO}isWarnEnabled(){return this.level<=cn.WARN}isErrorEnabled(){return this.level<=cn.ERROR}log(t,n,r){const o=[];if(this.timestamps&&o.push(new Date().toISOString()),this.colors){const c=sh.COLORS[t];o.push(`${c}${t.padEnd(5)}${sh.COLORS.RESET}`)}else o.push(t.padEnd(5));o.push(`[${this.name}]`),o.push(n);const a=o.join(" "),l=this.getConsoleMethod(t);r&&Object.keys(r).length>0?l(a,r):l(a)}getConsoleMethod(t){switch(t){case"DEBUG":return console.debug.bind(console);case"INFO":return console.info.bind(console);case"WARN":return console.warn.bind(console);case"ERROR":return console.error.bind(console);default:return console.log.bind(console)}}isNodeEnvironment(){var t;return typeof process<"u"&&((t=process.versions)==null?void 0:t.node)!==void 0}};ls(fw,"COLORS",{DEBUG:"\x1B[36m",INFO:"\x1B[32m",WARN:"\x1B[33m",ERROR:"\x1B[31m",RESET:"\x1B[0m"});var UI=fw,ka=null,ic=class{static getLogger(t){const n=typeof t=="string"?t:t.name;if(this.loggers.has(n))return this.loggers.get(n);const r=this.createLazyLogger(n);return this.loggers.set(n,r),r}static configure(t){this.config={...this.config,...t}}static reset(){this.loggers.clear(),this.config={defaultLevel:cn.INFO},ka=null}static createLazyLogger(t){let n=null;const r=()=>(n||(n=this.createLogger(t)),n);return{name:t,level:this.config.defaultLevel||cn.INFO,debug:(o,a)=>r().debug(o,a),info:(o,a)=>r().info(o,a),warn:(o,a)=>r().warn(o,a),error:(o,a)=>r().error(o,a),isDebugEnabled:()=>r().isDebugEnabled(),isInfoEnabled:()=>r().isInfoEnabled(),isWarnEnabled:()=>r().isWarnEnabled(),isErrorEnabled:()=>r().isErrorEnabled()}}static createLogger(t){return ka?ka.getLogger(t):this.config.defaultImplementation?this.config.defaultImplementation(t):new UI(t,{level:this.config.defaultLevel,...this.config.consoleOptions})}};ls(ic,"loggers",new Map);ls(ic,"config",{defaultLevel:cn.INFO});function HI(e){ka=e,ic.reset(),ka=e}function qt(e){return ic.getLogger(e)}var Gs=qt("agentx/DefinitionManager");function Wy(e){return`meta_${e}`}function WI(e){const t=new Date;return{name:e.name,description:e.description,systemPrompt:e.systemPrompt,definition:e,source:"code",createdAt:t,updatedAt:t}}var qI=class{constructor(e){this.repository=e,me(this,"cache",new Map)}register(e){if(this.cache.has(e.name))throw new Error(`Definition already exists: ${e.name}`);this.cache.set(e.name,e);const t=WI(e);this.repository.saveDefinition(t).catch(o=>{Gs.error("Failed to save definition",{name:e.name,error:o})});const n=Wy(e.name),r={imageId:n,type:"meta",definitionName:e.name,parentImageId:null,definition:e,config:{},messages:[],createdAt:new Date};this.repository.saveImage(r).catch(o=>{Gs.error("Failed to save MetaImage",{definitionName:e.name,error:o})}),Gs.info("Definition registered",{name:e.name,metaImageId:n})}get(e){return this.cache.get(e)}list(){return Array.from(this.cache.values())}has(e){return this.cache.has(e)}unregister(e){if(!this.cache.get(e))return!1;this.cache.delete(e),this.repository.deleteDefinition(e).catch(r=>{Gs.error("Failed to delete definition",{name:e,error:r})});const n=Wy(e);return this.repository.deleteImage(n).catch(r=>{Gs.error("Failed to delete MetaImage",{definitionName:e,error:r})}),Gs.info("Definition unregistered",{name:e}),!0}},fu=qt("agentx/ImageManager");function GI(e){return`meta_${e}`}function hu(e){const t=e.definition;return e.type==="meta"?{type:"meta",imageId:e.imageId,definitionName:e.definitionName,definition:t,config:e.config,messages:[],createdAt:e.createdAt}:{type:"derived",imageId:e.imageId,parentImageId:e.parentImageId,definitionName:e.definitionName,definition:t,config:e.config,messages:e.messages,createdAt:e.createdAt}}var KI=class{constructor(e,t,n){me(this,"repository"),me(this,"containerManager"),me(this,"defaultContainerId"),this.repository=e,this.containerManager=t,this.defaultContainerId=n}async get(e){const t=await this.repository.findImageById(e);if(t)return hu(t)}async getMetaImage(e){const t=GI(e),n=await this.repository.findImageById(t);if(!(!n||n.type!=="meta"))return hu(n)}async list(){return(await this.repository.findAllImages()).map(hu)}async listByDefinition(e){return(await this.repository.findAllImages()).filter(r=>r.definitionName===e).map(hu)}async exists(e){return this.repository.imageExists(e)}async delete(e){const t=await this.repository.findImageById(e);return t?t.type==="meta"?(fu.warn("Cannot delete MetaImage directly",{imageId:e}),!1):(await this.repository.deleteImage(e),fu.info("Image deleted",{imageId:e}),!0):!1}async run(e,t){fu.info("Running agent from image",{imageId:e,containerId:t==null?void 0:t.containerId});const n=await this.get(e);if(!n)throw new Error(`Image not found: ${e}`);let r=(t==null?void 0:t.containerId)||this.defaultContainerId;return r||(r=(await this.containerManager.create()).containerId,this.defaultContainerId=r,fu.debug("Auto-created default container",{containerId:r})),this.containerManager.run(n,r)}},pu=qt("agentx/AgentManager"),YI=class{constructor(e){this.containerManager=e}get(e){return this.containerManager.getAgent(e)}has(e){return this.containerManager.hasAgent(e)}list(){return this.containerManager.listAgents()}async destroy(e){pu.debug("Destroying agent",{agentId:e}),await this.containerManager.destroyAgent(e),pu.info("Agent destroyed",{agentId:e})}async destroyAll(){const e=this.containerManager.listAgents();pu.debug("Destroying all agents",{count:e.length}),await this.containerManager.destroyAllAgents(),pu.info("All agents destroyed",{count:e.length})}},Sn=qt("agentx/SessionManager");function hw(){const e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`session_${e}_${t}`}function XI(){const e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`image_${e}_${t}`}var ca=class pw{constructor(t,n,r,o){me(this,"sessionId"),me(this,"userId"),me(this,"imageId"),me(this,"createdAt"),me(this,"_title"),me(this,"_updatedAt"),me(this,"repository"),me(this,"containerManager"),me(this,"defaultContainerId"),this.sessionId=t.sessionId,this.userId=t.userId,this.imageId=t.imageId,this._title=t.title,this.createdAt=t.createdAt.getTime(),this._updatedAt=t.updatedAt.getTime(),this.repository=n,this.containerManager=r,this.defaultContainerId=o}get title(){return this._title}get updatedAt(){return this._updatedAt}async resume(t){Sn.info("Resuming agent from session",{sessionId:this.sessionId,imageId:this.imageId,containerId:t==null?void 0:t.containerId});let n=(t==null?void 0:t.containerId)||this.defaultContainerId;n||(n=(await this.containerManager.create()).containerId,Sn.debug("Auto-created default container for session",{containerId:n,sessionId:this.sessionId}));const r=await this.containerManager.resume(this,n);return this.collect(r),r}collect(t){Sn.debug("Collecting messages from agent",{sessionId:this.sessionId,agentId:t.agentId});const n=this.sessionId,r=this.repository,o=(a,l)=>{const c={messageId:a.id,sessionId:n,role:l,content:a,createdAt:new Date(a.timestamp??Date.now())};r.saveMessage(c).catch(d=>{Sn.error("Failed to persist message",{sessionId:n,messageId:c.messageId,error:d})})};t.on("user_message",a=>o(a.data,"user")),t.on("assistant_message",a=>o(a.data,"assistant")),t.on("tool_call_message",a=>o(a.data,"tool")),t.on("tool_result_message",a=>o(a.data,"tool"))}async getMessages(){return Sn.debug("Getting messages for session",{sessionId:this.sessionId}),(await this.repository.findMessagesBySessionId(this.sessionId)).map(n=>n.content)}async fork(){Sn.info("Forking session",{sessionId:this.sessionId});const t=await this.repository.findImageById(this.imageId);if(!t)throw new Error(`Image not found: ${this.imageId}`);const n=XI(),r={imageId:n,type:"derived",definitionName:t.definitionName,parentImageId:t.imageId,definition:t.definition,config:t.config,messages:[...t.messages],createdAt:new Date};await this.repository.saveImage(r);const o=hw(),a=new Date,l={sessionId:o,userId:this.userId,imageId:n,title:this._title?`Fork of ${this._title}`:null,createdAt:a,updatedAt:a};return await this.repository.saveSession(l),Sn.info("Session forked",{originalSessionId:this.sessionId,newSessionId:o,newImageId:n}),new pw(l,this.repository,this.containerManager,this.defaultContainerId)}async setTitle(t){Sn.debug("Setting session title",{sessionId:this.sessionId,title:t});const n=new Date;await this.repository.saveSession({sessionId:this.sessionId,userId:this.userId,imageId:this.imageId,title:t,createdAt:new Date(this.createdAt),updatedAt:n}),this._title=t,this._updatedAt=n.getTime(),Sn.info("Session title updated",{sessionId:this.sessionId,title:t})}},QI=class{constructor(e,t,n){me(this,"repository"),me(this,"containerManager"),me(this,"defaultContainerId"),this.repository=e,this.containerManager=t,this.defaultContainerId=n}async create(e,t){const n=hw(),r=new Date,o={sessionId:n,userId:t,imageId:e,title:null,createdAt:r,updatedAt:r};return await this.repository.saveSession(o),Sn.info("Session created",{sessionId:n,imageId:e,userId:t}),new ca(o,this.repository,this.containerManager,this.defaultContainerId)}async get(e){const t=await this.repository.findSessionById(e);if(t)return new ca(t,this.repository,this.containerManager,this.defaultContainerId)}async has(e){return this.repository.sessionExists(e)}async list(){return(await this.repository.findAllSessions()).map(t=>new ca(t,this.repository,this.containerManager,this.defaultContainerId))}async listByImage(e){return(await this.repository.findSessionsByImageId(e)).map(n=>new ca(n,this.repository,this.containerManager,this.defaultContainerId))}async listByUser(e){return(await this.repository.findSessionsByUserId(e)).map(n=>new ca(n,this.repository,this.containerManager,this.defaultContainerId))}async destroy(e){await this.repository.deleteSession(e),Sn.info("Session destroyed",{sessionId:e})}async destroyByImage(e){await this.repository.deleteSessionsByImageId(e),Sn.info("Sessions destroyed by image",{imageId:e})}async destroyAll(){const e=await this.repository.findAllSessions();for(const t of e)await this.repository.deleteSession(t.sessionId);Sn.info("All sessions destroyed")}},mu=qt("agentx/ErrorManager"),JI=class{constructor(){me(this,"handlers",new Set)}handle(e,t,n){this.logError(e,t);for(const r of this.handlers)try{r.handle(e,t,n)}catch(o){mu.error("ErrorHandler failed",{error:o})}}addHandler(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}removeHandler(e){this.handlers.delete(e)}logError(e,t){const n=`[${e}] ${t.category}/${t.code}`;t.severity==="fatal"?mu.error(`${n}: ${t.message}`,{error:t}):t.severity==="error"?mu.error(`${n}: ${t.message}`):mu.warn(`${n}: ${t.message}`)}},ZI=class extends Error{constructor(e,t,n){super(t),this.code=e,this.details=n,this.name="ApiError"}};function mw(e){return kI.create({prefixUrl:e.baseUrl.replace(/\/+$/,""),headers:e.headers,timeout:e.timeout||3e4,hooks:{afterResponse:[async(t,n,r)=>{var o,a,l;if(!r.ok){const c=await r.json().catch(()=>({}));throw new ZI(((o=c.error)==null?void 0:o.code)||"UNKNOWN_ERROR",((a=c.error)==null?void 0:a.message)||`Request failed: ${r.status}`,(l=c.error)==null?void 0:l.details)}return r}]}})}var qy=qt("core/AgentStateMachine"),eT=class{constructor(){me(this,"_state","idle"),me(this,"handlers",new Set)}get state(){return this._state}process(e){const t=this._state,n=this.mapEventToState(e);n!==null&&t!==n&&(this._state=n,qy.debug("State transition",{eventType:e.type,from:t,to:n}),this.notifyHandlers({prev:t,current:n}))}onStateChange(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}reset(){this._state,this._state="idle",this.handlers.clear()}mapEventToState(e){switch(e.type){case"agent_initializing":return"initializing";case"agent_ready":return"idle";case"agent_destroyed":return"idle";case"conversation_queued":return"queued";case"conversation_start":return"conversation_active";case"conversation_thinking":return"thinking";case"conversation_responding":return"responding";case"conversation_end":return"idle";case"conversation_interrupted":return"idle";case"tool_planned":return"planning_tool";case"tool_executing":return"awaiting_tool_result";case"tool_completed":return"responding";case"tool_failed":return"responding";case"error_occurred":return"idle";default:return null}}notifyHandlers(e){for(const t of this.handlers)try{t(e)}catch(n){qy.error("State change handler error",{from:e.prev,to:e.current,error:n})}}},Ks=qt("core/AgentEventBus"),tT=class{constructor(){me(this,"subject",new dw),me(this,"typeSubscriptions",new Map),me(this,"globalSubscriptions",[]),me(this,"nextId",0),me(this,"isDestroyed",!1),me(this,"producerView",null),me(this,"consumerView",null)}emit(e){if(this.isDestroyed){Ks.warn("Emit called on destroyed EventBus",{eventType:e.type});return}this.subject.next(e)}emitBatch(e){for(const t of e)this.emit(t)}on(e,t,n={}){if(this.isDestroyed)return Ks.warn("Subscribe called on destroyed EventBus"),()=>{};const r=Array.isArray(e)?e:[e],o=[];for(const a of r){const l=this.subscribeToType(a,t,n);o.push(l)}return()=>o.forEach(a=>a())}onAny(e,t={}){return this.isDestroyed?(Ks.warn("Subscribe called on destroyed EventBus"),()=>{}):this.subscribeGlobal(e,t)}once(e,t){return this.on(e,t,{once:!0})}asConsumer(){return this.consumerView||(this.consumerView={on:this.on.bind(this),onAny:this.onAny.bind(this),once:this.once.bind(this)}),this.consumerView}asProducer(){return this.producerView||(this.producerView={emit:this.emit.bind(this),emitBatch:this.emitBatch.bind(this)}),this.producerView}destroy(){if(!this.isDestroyed){this.isDestroyed=!0;for(const e of this.typeSubscriptions.values())for(const t of e)t.unsubscribe();this.typeSubscriptions.clear();for(const e of this.globalSubscriptions)e.unsubscribe();this.globalSubscriptions.length=0,this.subject.complete(),Ks.debug("EventBus destroyed")}}subscribeToType(e,t,n){const{filter:r,priority:o=0,once:a=!1}=n,l=this.nextId++;let c=this.subject.pipe(tf(y=>y.type===e));r&&(c=c.pipe(tf(r))),a&&(c=c.pipe(Hy(1)));const d=c.subscribe({next:y=>{this.executeWithPriority(e,y,t,l)}}),f=()=>{d.unsubscribe();const y=this.typeSubscriptions.get(e);if(y){const v=y.findIndex(b=>b.id===l);v!==-1&&y.splice(v,1)}};this.typeSubscriptions.has(e)||this.typeSubscriptions.set(e,[]);const p={id:l,priority:o,handler:t,unsubscribe:f},m=this.typeSubscriptions.get(e);return m.push(p),m.sort((y,v)=>v.priority-y.priority),f}subscribeGlobal(e,t){const{filter:n,priority:r=0,once:o=!1}=t,a=this.nextId++;let l=this.subject.asObservable();n&&(l=l.pipe(tf(n))),o&&(l=l.pipe(Hy(1)));const c=l.subscribe({next:p=>{this.executeGlobalWithPriority(p,e,a)}}),d=()=>{c.unsubscribe();const p=this.globalSubscriptions.findIndex(m=>m.id===a);p!==-1&&this.globalSubscriptions.splice(p,1)},f={id:a,priority:r,handler:e,unsubscribe:d};return this.globalSubscriptions.push(f),this.globalSubscriptions.sort((p,m)=>m.priority-p.priority),d}executeWithPriority(e,t,n,r){if((this.typeSubscriptions.get(e)||[]).find(l=>l.id===r))try{n(t)}catch(l){Ks.error("Event handler error",{eventType:e,error:l})}}executeGlobalWithPriority(e,t,n){if(this.globalSubscriptions.find(o=>o.id===n))try{t(e)}catch(o){Ks.error("Global event handler error",{eventType:e.type,error:o})}}},nT=class{constructor(e){this.agentId=e}classify(e){const t=e instanceof Error?e:new Error(String(e)),n=t.message;return n.includes("rate limit")||n.includes("429")?this.create("llm","RATE_LIMITED",n,!0,t):n.includes("api key")||n.includes("401")||n.includes("unauthorized")?this.create("llm","INVALID_API_KEY",n,!1,t):n.includes("context")&&n.includes("long")?this.create("llm","CONTEXT_TOO_LONG",n,!0,t):n.includes("overloaded")||n.includes("503")?this.create("llm","OVERLOADED",n,!0,t):n.includes("timeout")||n.includes("ETIMEDOUT")?this.create("network","TIMEOUT",n,!0,t):n.includes("ECONNREFUSED")||n.includes("connection")?this.create("network","CONNECTION_FAILED",n,!0,t):n.includes("network")||n.includes("fetch")?this.create("network","CONNECTION_FAILED",n,!0,t):n.includes("driver")?this.create("driver","RECEIVE_FAILED",n,!0,t):this.create("system","UNKNOWN",n,!0,t)}create(e,t,n,r,o){return{category:e,code:t,message:n,severity:r?"error":"fatal",recoverable:r,cause:o}}createEvent(e){return{type:"error",uuid:`${Date.now()}_${Math.random().toString(36).substring(2,9)}`,agentId:this.agentId,timestamp:Date.now(),data:{error:e}}}},rT=class{constructor(){me(this,"middlewares",[])}use(e){return this.middlewares.push(e),()=>{const t=this.middlewares.indexOf(e);t!==-1&&this.middlewares.splice(t,1)}}async execute(e,t){let n=0;const r=async o=>{if(n<this.middlewares.length){const a=this.middlewares[n++];await a(o,r)}else await t(o)};await r(e)}clear(){this.middlewares.length=0}get size(){return this.middlewares.length}},iT=qt("core/InterceptorChain"),sT=class{constructor(e){me(this,"interceptors",[]),me(this,"agentId"),this.agentId=e}intercept(e){return this.interceptors.push(e),()=>{const t=this.interceptors.indexOf(e);t!==-1&&this.interceptors.splice(t,1)}}execute(e,t){let n=0;const r=o=>{if(n<this.interceptors.length){const a=this.interceptors[n++];try{a(o,r)}catch(l){iT.error("Interceptor error",{agentId:this.agentId,eventType:o.type,interceptorIndex:n-1,error:l}),r(o)}}else t(o)};r(e)}clear(){this.interceptors.length=0}get size(){return this.interceptors.length}},oT={onMessageStart:"message_start",onMessageDelta:"message_delta",onMessageStop:"message_stop",onTextContentBlockStart:"text_content_block_start",onTextDelta:"text_delta",onTextContentBlockStop:"text_content_block_stop",onToolUseContentBlockStart:"tool_use_content_block_start",onInputJsonDelta:"input_json_delta",onToolUseContentBlockStop:"tool_use_content_block_stop",onToolCall:"tool_call",onToolResult:"tool_result",onUserMessage:"user_message",onAssistantMessage:"assistant_message",onToolCallMessage:"tool_call_message",onToolResultMessage:"tool_result_message",onError:"error",onTurnRequest:"turn_request",onTurnResponse:"turn_response"};function aT(e){const t={};for(const[n,r]of Object.entries(oT)){const o=e[n];o&&(t[r]=o)}return t}var zn=qt("core/AgentInstance"),Gy=class{constructor(e,t,n,r,o){me(this,"agentId"),me(this,"definition"),me(this,"context"),me(this,"createdAt"),me(this,"sandbox"),me(this,"_lifecycle","running"),me(this,"engine"),me(this,"driver"),me(this,"stateMachine",new eT),me(this,"eventBus",new tT),me(this,"errorClassifier"),me(this,"middlewareChain",new rT),me(this,"interceptorChain"),me(this,"readyHandlers",new Set),me(this,"destroyHandlers",new Set),this.agentId=t.agentId,this.definition=e,this.context=t,this.engine=n,this.createdAt=t.createdAt,this.sandbox=o,this.driver=r,this.errorClassifier=new nT(this.agentId),this.interceptorChain=new sT(this.agentId),zn.debug("AgentInstance created",{agentId:this.agentId,definitionName:e.name,driverName:this.driver.name})}get lifecycle(){return this._lifecycle}get state(){return this.stateMachine.state}async receive(e){if(this._lifecycle==="destroyed"){zn.warn("Receive called on destroyed agent",{agentId:this.agentId});const r=this.errorClassifier.create("system","AGENT_DESTROYED","Agent has been destroyed",!1),o=this.errorClassifier.createEvent(r);throw this.notifyHandlers(o),new Error("[Agent] Agent has been destroyed")}if(this.state!=="idle"){zn.warn("Receive called while agent is busy",{agentId:this.agentId,currentState:this.state});const r=this.errorClassifier.create("system","AGENT_BUSY",`Agent is busy (state: ${this.state}), please wait for current operation to complete`,!1),o=this.errorClassifier.createEvent(r);throw this.notifyHandlers(o),new Error(`[Agent] Agent is busy (state: ${this.state})`)}const t=typeof e=="string"?{id:`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,role:"user",subtype:"user",content:e,timestamp:Date.now()}:e;zn.debug("Receiving message",{agentId:this.agentId,messageId:t.id});const n={uuid:`evt_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,type:"user_message",agentId:this.agentId,timestamp:Date.now(),data:t};this.presentOutput(n),this.notifyHandlers(n),await this.executeMiddlewareChain(t)}async executeMiddlewareChain(e){await this.middlewareChain.execute(e,t=>this.doReceive(t))}processStreamEvent(e){const t=this.engine.process(this.agentId,e);for(const n of t)this.presentOutput(n);for(const n of t)this.notifyHandlers(n)}async doReceive(e){try{zn.debug("Processing message through driver",{agentId:this.agentId,messageId:e.id});const t={type:"conversation_queued",uuid:`${Date.now()}_${Math.random().toString(36).substring(2,9)}`,agentId:this.agentId,timestamp:Date.now(),data:{userMessage:e}};this.notifyHandlers(t);const n=this.driver.receive(e);for await(const r of n)this.processStreamEvent(r);zn.debug("Message processing completed",{agentId:this.agentId,messageId:e.id})}catch(t){const n=this.errorClassifier.classify(t),r=this.errorClassifier.createEvent(n);throw zn.error("Message processing failed",{agentId:this.agentId,messageId:e.id,errorCategory:n.category,errorCode:n.code,error:t}),this.notifyHandlers(r),t}}presentOutput(e){}on(e,t){if(typeof e=="function")return this.eventBus.onAny(e);if(this.isEventHandlerMap(e)){const o=[];for(const[a,l]of Object.entries(e))l&&o.push(this.eventBus.on(a,l));return()=>{for(const a of o)a()}}const n=Array.isArray(e)?e:[e],r=t;return this.eventBus.on(n,r)}isEventHandlerMap(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.keys(e);return t.length===0?!1:t.every(n=>{const r=e[n];return r===void 0||typeof r=="function"})}onStateChange(e){return this.stateMachine.onStateChange(e)}react(e){const t=aT(e);return this.on(t)}onReady(e){if(this._lifecycle==="running")try{e()}catch(t){zn.error("onReady handler error",{agentId:this.agentId,error:t})}return this.readyHandlers.add(e),()=>{this.readyHandlers.delete(e)}}onDestroy(e){return this.destroyHandlers.add(e),()=>{this.destroyHandlers.delete(e)}}use(e){return this.middlewareChain.use(e)}intercept(e){return this.interceptorChain.intercept(e)}interrupt(){zn.debug("User interrupt requested",{agentId:this.agentId,currentState:this.state}),this.driver.interrupt()}async destroy(){zn.debug("Destroying agent",{agentId:this.agentId});for(const e of this.destroyHandlers)try{e()}catch(t){zn.error("onDestroy handler error",{agentId:this.agentId,error:t})}this._lifecycle="destroyed",this.stateMachine.reset(),this.eventBus.destroy(),this.readyHandlers.clear(),this.destroyHandlers.clear(),this.middlewareChain.clear(),this.interceptorChain.clear(),this.engine.clearState(this.agentId),zn.info("Agent destroyed",{agentId:this.agentId})}notifyHandlers(e){JC(e)&&this.stateMachine.process(e),this.executeInterceptorChain(e)}executeInterceptorChain(e){this.interceptorChain.execute(e,t=>this.eventBus.emit(t))}getEventConsumer(){return this.eventBus.asConsumer()}},lT=class{constructor(){me(this,"states",new Map)}get(e){return this.states.get(e)}set(e,t){this.states.set(e,t)}delete(e){this.states.delete(e)}has(e){return this.states.has(e)}clear(){this.states.clear()}get size(){return this.states.size}keys(){return this.states.keys()}};qt("engine/Mealy");function uT(e){return(t,n)=>{const r={},o=[];for(const a in e){const l=e[a],c=t[a],[d,f]=l(c,n);r[a]=d,o.push(...f)}return[r,o]}}function cT(e){return()=>{const t={};for(const n in e)t[n]=e[n]();return t}}function oh(){return{currentMessageId:null,messageStartTime:null,pendingContents:{},pendingToolCalls:{}}}function hs(){return`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}var dT=(e,t)=>{switch(t.type){case"message_start":return fT(e,t);case"text_delta":return hT(e,t);case"tool_use_content_block_start":return pT(e,t);case"input_json_delta":return mT(e,t);case"tool_use_content_block_stop":return gT(e,t);case"tool_result":return yT(e,t);case"message_stop":return vT(e,t);default:return[e,[]]}};function fT(e,t){return[{...e,currentMessageId:hs(),messageStartTime:t.timestamp,pendingContents:{}},[]]}function hT(e,t){const r=e.pendingContents[0],o=(r==null?void 0:r.type)==="text"?{...r,textDeltas:[...r.textDeltas||[],t.data.text]}:{type:"text",index:0,textDeltas:[t.data.text]};return[{...e,pendingContents:{...e.pendingContents,0:o}},[]]}function pT(e,t){const r={type:"tool_use",index:1,toolId:t.data.id,toolName:t.data.name,toolInputJson:""};return[{...e,pendingContents:{...e.pendingContents,1:r}},[]]}function mT(e,t){const r=e.pendingContents[1];if(!r||r.type!=="tool_use")return[e,[]];const o={...r,toolInputJson:(r.toolInputJson||"")+t.data.partialJson};return[{...e,pendingContents:{...e.pendingContents,1:o}},[]]}function gT(e,t){const r=e.pendingContents[1];if(!r||r.type!=="tool_use")return[e,[]];let o={};try{o=r.toolInputJson?JSON.parse(r.toolInputJson):{}}catch{o={}}const a=[],l=r.toolId,c=r.toolName,d={type:"tool_call",uuid:hs(),agentId:t.agentId,timestamp:Date.now(),data:{id:l,name:c,input:o}};a.push(d);const f={type:"tool-call",id:l,name:c,input:o},p={id:hs(),role:"assistant",subtype:"tool-call",toolCall:f,timestamp:Date.now()},m={type:"tool_call_message",uuid:hs(),agentId:t.agentId,timestamp:Date.now(),data:p};a.push(m);const{[1]:y,...v}=e.pendingContents;return[{...e,pendingContents:v,pendingToolCalls:{...e.pendingToolCalls,[l]:{id:l,name:c}}},a]}function yT(e,t){const{toolId:n,content:r,isError:o}=t.data,a=e.pendingToolCalls[n],l=(a==null?void 0:a.name)||"unknown",c={type:"tool-result",id:n,name:l,output:{type:o?"error-text":"text",value:typeof r=="string"?r:JSON.stringify(r)}},d={id:hs(),role:"tool",subtype:"tool-result",toolResult:c,toolCallId:n,timestamp:Date.now()},f={type:"tool_result_message",uuid:hs(),agentId:t.agentId,timestamp:Date.now(),data:d},{[n]:p,...m}=e.pendingToolCalls;return[{...e,pendingToolCalls:m},[f]]}function vT(e,t){if(!e.currentMessageId)return[e,[]];const n=[],r=Object.values(e.pendingContents).sort((f,p)=>f.index-p.index);for(const f of r)f.type==="text"&&f.textDeltas&&n.push(f.textDeltas.join(""));const o=n.join(""),a=t.data.stopReason;if(!o||o.trim().length===0){const f=a==="tool_use";return[{...oh(),pendingToolCalls:f?e.pendingToolCalls:{}},[]]}const l={id:e.currentMessageId,role:"assistant",subtype:"assistant",content:o,timestamp:e.messageStartTime||Date.now(),usage:void 0},c={type:"assistant_message",uuid:hs(),agentId:t.agentId,timestamp:Date.now(),data:l},d=a==="tool_use";return[{...oh(),pendingToolCalls:d?e.pendingToolCalls:{}},[c]]}var Ma=qt("engine/stateEventProcessor");function xT(){return{}}function uo(){return`state_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}var wT=(e,t)=>{switch(Ma.debug(`[Stream Event] ${t.type}`,{context:e,eventData:"data"in t?t.data:void 0}),t.type){case"message_start":return bT(e,t);case"message_delta":return ST(e);case"message_stop":return kT(e,t);case"text_content_block_start":return ET(e,t);case"tool_use_content_block_start":return CT(e,t);case"tool_use_content_block_stop":return IT(e);case"tool_call":return TT(e);case"interrupted":return _T(e,t);default:return Ma.debug(`[Stream Event] ${t.type} (unhandled)`),[e,[]]}};function bT(e,t){const n={type:"conversation_start",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,transition:{reason:"conversation_started",trigger:"message_start"},data:{userMessage:{}}};return[e,[n]]}function ST(e,t){return[e,[]]}function kT(e,t){const n=t.data.stopReason;if(Ma.debug("message_stop received",{stopReason:n}),n==="tool_use")return Ma.debug("Skipping conversation_end (tool_use in progress)"),[e,[]];const r={type:"conversation_end",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,transition:{reason:"conversation_completed",trigger:"message_stop"},data:{assistantMessage:{},durationMs:0,durationApiMs:0,numTurns:0,result:"completed",totalCostUsd:0,usage:{input:0,output:0}}};return[e,[r]]}function ET(e,t){const n={type:"conversation_responding",uuid:uo(),agentId:t.agentId,timestamp:Date.now(),transition:{reason:"assistant_responding",trigger:"text_content_block_start"},data:{}};return[e,[n]]}function CT(e,t){const n=[],r={type:"tool_planned",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,data:{id:t.data.id,name:t.data.name,input:{}}};n.push(r);const o={type:"tool_executing",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,transition:{reason:"tool_planning_started",trigger:"tool_use_content_block_start"},data:{}};return n.push(o),[e,n]}function IT(e,t){return[e,[]]}function TT(e,t){return[e,[]]}function _T(e,t){Ma.debug("interrupted event received",{reason:t.data.reason});const n={type:"conversation_interrupted",uuid:uo(),agentId:t.agentId,timestamp:t.timestamp,transition:{reason:t.data.reason,trigger:"interrupted"},data:{reason:t.data.reason}};return[e,[n]]}function PT(){return{pendingTurn:null,costPerInputToken:3e-6,costPerOutputToken:15e-6}}function Fu(){return`turn_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function AT(e,t,n){const r=e.input*t,o=e.output*n;return r+o}var RT=(e,t)=>{switch(t.type){case"user_message":return NT(e,t);case"message_stop":return jT(e,t);case"assistant_message":return[e,[]];default:return[e,[]]}};function NT(e,t){const n=Fu(),r={turnId:n,userMessage:t.data,requestedAt:t.timestamp},o={type:"turn_request",uuid:Fu(),agentId:t.agentId,timestamp:Date.now(),turnId:n,data:{userMessage:t.data,requestedAt:t.timestamp}};return[{...e,pendingTurn:r},[o]]}function jT(e,t){if(!e.pendingTurn)return[e,[]];const n=t.data.stopReason;return n==="end_turn"||n==="max_tokens"||n==="stop_sequence"?MT(e,t.agentId,t.timestamp):[e,[]]}function MT(e,t,n){if(!e.pendingTurn)return[e,[]];const{turnId:r,requestedAt:o}=e.pendingTurn,a=n-o,l={input:0,output:0},c=AT(l,e.costPerInputToken,e.costPerOutputToken),d={type:"turn_response",uuid:Fu(),agentId:t,timestamp:Date.now(),turnId:r,data:{assistantMessage:{id:Fu(),role:"assistant",subtype:"assistant",content:"",timestamp:n},respondedAt:n,durationMs:a,usage:l,costUsd:c}};return[{...e,pendingTurn:null},[d]]}var Ky=uT({messageAssembler:dT,stateEventProcessor:wT,turnTracker:RT}),DT=cT({messageAssembler:oh,stateEventProcessor:xT,turnTracker:PT}),da=qt("engine/AgentEngine"),LT=class{constructor(){me(this,"store"),this.store=new lT,da.debug("AgentEngine initialized")}process(e,t){const n=t.type||"unknown";da.debug("Processing event",{agentId:e,eventType:n});const r=!this.store.has(e);let o=this.store.get(e)??DT();r&&da.debug("Created initial state for agent",{agentId:e});const a=[];a.push(t);const[l,c]=Ky(o,t);o=l;for(const d of c){a.push(d);const[f,p]=this.processChained(o,d);o=f,a.push(...p)}return this.store.set(e,o),c.length>0&&da.debug("Produced outputs",{agentId:e,inputEvent:n,outputCount:a.length,processorOutputs:c.length}),a}processChained(e,t){const[n,r]=Ky(e,t);if(r.length===0)return[n,[]];const o=[...r];let a=n;for(const l of r){const[c,d]=this.processChained(a,l);a=c,o.push(...d)}return[a,o]}clearState(e){da.debug("Clearing state",{agentId:e}),this.store.delete(e)}hasState(e){return this.store.has(e)}},sr=qt("agentx/ContainerManager");function zT(){const e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`container_${e}_${t}`}function Yy(){const e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`agent_${e}_${t}`}var OT=class{constructor(e,t){me(this,"agents",new Map),me(this,"engine"),me(this,"runtime"),me(this,"repository"),this.runtime=e,this.repository=t,this.engine=new LT}async create(e){const t=zT(),n=Date.now(),r={containerId:t,createdAt:n,updatedAt:n,config:e};return await this.repository.saveContainer(r),sr.info("Container created",{containerId:t}),r}async get(e){return this.repository.findContainerById(e)}async list(){return this.repository.findAllContainers()}async delete(e){return await this.repository.containerExists(e)?(await this.repository.deleteContainer(e),sr.info("Container deleted",{containerId:e}),!0):!1}async exists(e){return this.repository.containerExists(e)}async run(e,t){if(sr.info("Running agent from image",{imageId:e.imageId,containerId:t}),!await this.repository.findContainerById(t))throw new Error(`Container not found: ${t}`);let r;this.runtime.agentIdResolver?r=await this.runtime.agentIdResolver.resolveForRun(e.imageId,t):r=Yy();const o={agentId:r,createdAt:Date.now()},a=this.runtime.createSandbox(t),l=this.runtime.createDriver(e.definition,o,a),c=new Gy(e.definition,o,this.engine,l,a);return this.agents.set(r,c),sr.info("Agent started",{agentId:r,imageId:e.imageId,containerId:t,definitionName:e.definition.name}),c}async resume(e,t){if(sr.info("Resuming agent from session",{sessionId:e.sessionId,imageId:e.imageId,containerId:t}),!await this.repository.findContainerById(t))throw new Error(`Container not found: ${t}`);const r=await this.repository.findImageById(e.imageId);if(!r)throw new Error(`Image not found: ${e.imageId}`);let o;this.runtime.agentIdResolver?o=await this.runtime.agentIdResolver.resolveForResume(e.sessionId,t):o=Yy();const a={agentId:o,createdAt:Date.now()},l=this.runtime.createSandbox(t),c=r.definition,d=this.runtime.createDriver(c,a,l),f=new Gy(c,a,this.engine,d,l);return this.agents.set(o,f),sr.info("Agent resumed",{agentId:o,sessionId:e.sessionId,imageId:e.imageId,containerId:t}),f}async destroyAgent(e){const t=this.agents.get(e);if(!t){sr.warn("Agent not found for destroy",{agentId:e});return}sr.debug("Destroying agent",{agentId:e}),await t.destroy(),this.agents.delete(e),sr.info("Agent destroyed",{agentId:e})}getAgent(e){return this.agents.get(e)}hasAgent(e){return this.agents.has(e)}listAgents(){return Array.from(this.agents.values())}async destroyAllAgents(){const e=Array.from(this.agents.keys());sr.debug("Destroying all agents",{count:e.length}),await Promise.all(e.map(t=>this.destroyAgent(t))),sr.info("All agents destroyed",{count:e.length})}},Xy=qt("agentx/AgentX");function FT(e,t){if(Xy.info("Creating AgentX instance",{runtime:e.name}),!e.repository)throw new Error("Runtime must have a repository for persistence");const n=e.repository,r=new OT(e,n),o=new JI,a=new qI(n),l=new YI(r),c=new KI(n,r,t==null?void 0:t.containerId),d=new QI(n,r,t==null?void 0:t.containerId);return Xy.debug("AgentX instance created",{runtime:e.name}),{mode:"local",containers:r,definitions:a,images:c,agents:l,sessions:d,errors:o}}var VT=class{constructor(e,t,n={}){this.serverUrl=e,this.agentId=t,this.sseParams=n,me(this,"eventSource",null),me(this,"messageQueue",[]),me(this,"activeIterators",new Set),me(this,"isDone",!1)}connect(){if(this.eventSource)return;let e=`${this.serverUrl}/agents/${this.agentId}/sse`;if(Object.keys(this.sseParams).length>0){const r=new URLSearchParams(this.sseParams);e+=`?${r.toString()}`}this.eventSource=new EventSource(e);const t=r=>{try{const o=JSON.parse(r.data);if(this.activeIterators.size>0){const a=this.activeIterators.values().next().value;a&&(this.activeIterators.delete(a),a.resolve({value:o,done:!1}))}else this.messageQueue.push(o)}catch{}},n=()=>{var r;this.isDone=!0,(r=this.eventSource)==null||r.close(),this.eventSource=null;for(const o of this.activeIterators)o.reject(new Error("SSE connection error"));this.activeIterators.clear()};for(const r of Kx)this.eventSource.addEventListener(r,t);this.eventSource.addEventListener("error",t),this.eventSource.onmessage=t,this.eventSource.onerror=n}createIterator(){const e=this;return{[Symbol.asyncIterator](){let t=!1;return{async next(){if(e.messageQueue.length>0){const n=e.messageQueue.shift();return n.type==="message_stop"&&n.data.stopReason!=="tool_use"&&(t=!0),{value:n,done:!1}}return t?{done:!0,value:void 0}:e.isDone?{done:!0,value:void 0}:new Promise((n,r)=>{const a={resolve:l=>{l.done||l.value.type==="message_stop"&&l.value.data.stopReason!=="tool_use"&&(t=!0),n(l)},reject:r};e.activeIterators.add(a)})},async return(){return{done:!0,value:void 0}}}}}}close(){this.isDone=!0,this.eventSource&&(this.eventSource.close(),this.eventSource=null);for(const e of this.activeIterators)e.reject(new Error("Connection closed"));this.activeIterators.clear(),this.messageQueue=[]}};function BT(e){const{serverUrl:t,agentId:n,headers:r={},sseParams:o={}}=e;let a=null;return{name:"SSEDriver",async*receive(l){var f;a||(a=new VT(t,n,o),a.connect());const c=`${t}/agents/${n}/messages`,d=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify({content:(typeof l.content=="string",l.content)})});if(!d.ok){const p=await d.json().catch(()=>({}));throw new Error(((f=p.error)==null?void 0:f.message)||`HTTP ${d.status}`)}yield*a.createIterator()},interrupt(){const l=`${t}/agents/${n}/interrupt`;fetch(l,{method:"POST",headers:{"Content-Type":"application/json",...r}}).catch(()=>{})}}}var Qy=qt("agentx/RemoteRepository"),$T=class{constructor(e){me(this,"client"),this.client=mw({baseUrl:e.serverUrl,headers:e.headers}),Qy.debug("RemoteRepository created",{serverUrl:e.serverUrl})}async saveDefinition(e){await this.client.put(`definitions/${e.name}`,{json:e})}async findDefinitionByName(e){try{const t=await this.client.get(`definitions/${e}`).json();return this.parseDefinitionRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findAllDefinitions(){return(await this.client.get("definitions").json()).map(t=>this.parseDefinitionRecord(t))}async deleteDefinition(e){await this.client.delete(`definitions/${e}`)}async definitionExists(e){try{return await this.client.head(`definitions/${e}`),!0}catch{return!1}}async saveImage(e){await this.client.put(`images/${e.imageId}`,{json:e})}async findImageById(e){try{const t=await this.client.get(`images/${e}`).json();return this.parseImageRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findAllImages(){return(await this.client.get("images").json()).map(t=>this.parseImageRecord(t))}async deleteImage(e){await this.client.delete(`images/${e}`)}async imageExists(e){try{return await this.client.head(`images/${e}`),!0}catch{return!1}}async saveSession(e){await this.client.put(`sessions/${e.sessionId}`,{json:e})}async findSessionById(e){try{const t=await this.client.get(`sessions/${e}`).json();return this.parseSessionRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findSessionsByImageId(e){return(await this.client.get(`images/${e}/sessions`).json()).map(n=>this.parseSessionRecord(n))}async findSessionsByUserId(e){return(await this.client.get(`users/${e}/sessions`).json()).map(n=>this.parseSessionRecord(n))}async findAllSessions(){return(await this.client.get("sessions").json()).map(t=>this.parseSessionRecord(t))}async deleteSession(e){await this.client.delete(`sessions/${e}`)}async deleteSessionsByImageId(e){await this.client.delete(`images/${e}/sessions`)}async sessionExists(e){try{return await this.client.head(`sessions/${e}`),!0}catch{return!1}}async saveMessage(e){Qy.debug("saveMessage called (noop in browser)")}async findMessageById(e){try{const t=await this.client.get(`messages/${e}`).json();return this.parseMessageRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findMessagesBySessionId(e){return(await this.client.get(`sessions/${e}/messages`).json()).map(n=>this.parseMessageRecord(n))}async deleteMessage(e){await this.client.delete(`messages/${e}`)}async deleteMessagesBySessionId(e){await this.client.delete(`sessions/${e}/messages`)}async countMessagesBySessionId(e){return(await this.client.get(`sessions/${e}/messages/count`).json()).count}async saveContainer(e){await this.client.put(`containers/${e.containerId}`,{json:e})}async findContainerById(e){try{const t=await this.client.get(`containers/${e}`).json();return this.parseContainerRecord(t)}catch(t){if(this.isNotFound(t))return null;throw t}}async findAllContainers(){return(await this.client.get("containers").json()).map(t=>this.parseContainerRecord(t))}async deleteContainer(e){await this.client.delete(`containers/${e}`)}async containerExists(e){try{return await this.client.head(`containers/${e}`),!0}catch{return!1}}isNotFound(e){var t;return((t=e==null?void 0:e.response)==null?void 0:t.status)===404}parseDefinitionRecord(e){return{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}}parseImageRecord(e){return{...e,createdAt:new Date(e.createdAt)}}parseSessionRecord(e){return{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}}parseMessageRecord(e){return{...e,createdAt:new Date(e.createdAt)}}parseContainerRecord(e){return{...e}}},Jh=class ba{constructor(t,n={}){me(this,"name"),me(this,"level"),me(this,"collapsed"),this.name=t,this.level=n.level??cn.INFO,this.collapsed=n.collapsed??!0}debug(t,n){this.isDebugEnabled()&&this.log("DEBUG",t,n)}info(t,n){this.isInfoEnabled()&&this.log("INFO",t,n)}warn(t,n){this.isWarnEnabled()&&this.log("WARN",t,n)}error(t,n){this.isErrorEnabled()&&(t instanceof Error?this.log("ERROR",t.message,{...n,stack:t.stack}):this.log("ERROR",t,n))}isDebugEnabled(){return this.level<=cn.DEBUG}isInfoEnabled(){return this.level<=cn.INFO}isWarnEnabled(){return this.level<=cn.WARN}isErrorEnabled(){return this.level<=cn.ERROR}log(t,n,r){const o=new Date().toLocaleTimeString(),a=this.getConsoleMethod(t),l=ba.BADGE_STYLES[t],c=`%c${o} %c${t}%c %c[${this.name}]%c ${n}`,d=[ba.STYLES.TIMESTAMP,l,"",ba.STYLES.NAME,ba.STYLES.MESSAGE];r&&Object.keys(r).length>0?((this.collapsed?console.groupCollapsed:console.group).call(console,c,...d),console.log("Context:",r),console.groupEnd()):a(c,...d)}getConsoleMethod(t){switch(t){case"DEBUG":return console.debug.bind(console);case"INFO":return console.info.bind(console);case"WARN":return console.warn.bind(console);case"ERROR":return console.error.bind(console);default:return console.log.bind(console)}}};me(Jh,"STYLES",{DEBUG:"color: #6B7280; font-weight: normal;",INFO:"color: #10B981; font-weight: normal;",WARN:"color: #F59E0B; font-weight: bold;",ERROR:"color: #EF4444; font-weight: bold;",TIMESTAMP:"color: #9CA3AF; font-weight: normal;",NAME:"color: #8B5CF6; font-weight: normal;",MESSAGE:"color: inherit; font-weight: normal;"});me(Jh,"BADGE_STYLES",{DEBUG:"background: #E5E7EB; color: #374151; padding: 2px 6px; border-radius: 3px; font-size: 11px;",INFO:"background: #D1FAE5; color: #065F46; padding: 2px 6px; border-radius: 3px; font-size: 11px;",WARN:"background: #FEF3C7; color: #92400E; padding: 2px 6px; border-radius: 3px; font-size: 11px;",ERROR:"background: #FEE2E2; color: #991B1B; padding: 2px 6px; border-radius: 3px; font-size: 11px;"});var UT=Jh,HT=class{constructor(e={}){me(this,"options"),me(this,"loggers",new Map),this.options=e}getLogger(e){if(this.loggers.has(e))return this.loggers.get(e);const t=new UT(e,this.options);return this.loggers.set(e,t),t}},gu=qt("agentx/RemoteAgentIdResolver"),WT=class{constructor(e){me(this,"client"),this.client=mw({baseUrl:e.serverUrl,headers:e.headers})}async resolveForRun(e,t){gu.debug("Resolving agent ID for run",{imageId:e,containerId:t});const n=await this.client.post(`images/${e}/run`,{json:{containerId:t}}).json();return gu.info("Agent ID resolved for run",{imageId:e,agentId:n.agentId}),n.agentId}async resolveForResume(e,t){gu.debug("Resolving agent ID for resume",{sessionId:e,containerId:t});const n=await this.client.post(`sessions/${e}/resume`,{json:{containerId:t}}).json();return gu.info("Agent ID resolved for resume",{sessionId:e,agentId:n.agentId}),n.agentId}},Jy={name:"browser-noop",workspace:{id:"noop",name:"noop",path:""},llm:{name:"noop",provide:()=>({})}},qT=class{constructor(e){me(this,"name","sse"),me(this,"repository"),me(this,"loggerFactory"),me(this,"agentIdResolver"),me(this,"serverUrl"),me(this,"headers"),me(this,"sseParams"),this.serverUrl=e.serverUrl.replace(/\/+$/,""),this.headers=e.headers??{},this.sseParams=e.sseParams??{},this.loggerFactory=new HT({collapsed:!0}),HI(this.loggerFactory),this.repository=new $T({serverUrl:this.serverUrl,headers:this.headers}),this.agentIdResolver=new WT({serverUrl:this.serverUrl,headers:this.headers})}createSandbox(e){return Jy}createDriver(e,t,n){return{...BT({serverUrl:this.serverUrl,agentId:t.agentId,headers:this.headers,sseParams:this.sseParams}),sandbox:Jy}}createLogger(e){return this.loggerFactory.getLogger(e)}};function GT(e){return new qT(e)}var KT=Object.defineProperty,YT=(e,t,n)=>t in e?KT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zy=(e,t,n)=>YT(e,typeof t!="symbol"?t+"":t,n);function XT(e,t={}){const{initialMessages:n=[],onSend:r,onError:o,onStatusChange:a}=t,[l,c]=I.useState(n),[d,f]=I.useState(""),[p,m]=I.useState((e==null?void 0:e.state)??"idle"),[y,v]=I.useState([]),b=I.useRef(!0),S=p==="queued"||p==="responding"||p==="thinking"||p==="planning_tool"||p==="awaiting_tool_result"||p==="conversation_active";I.useEffect(()=>{c([]),f(""),v([]),m((e==null?void 0:e.state)??"idle")},[e]),I.useEffect(()=>{if(!e)return;b.current=!0;const O=e.react({onTextDelta:N=>{b.current&&f(D=>D+N.data.text)},onAssistantMessage:N=>{if(!b.current)return;const D=N.data;f(""),c(H=>H.some(ee=>ee.id===D.id)?H:[...H,D])},onToolCallMessage:N=>{if(!b.current)return;const D=N.data;c(H=>H.some(ee=>ee.id===D.id)?H:[...H,D])},onToolResultMessage:N=>{if(!b.current)return;const D=N.data;c(H=>H.some(ee=>ee.id===D.id)?H:[...H,D])},onError:N=>{if(!b.current)return;const D=N.data.error;v(H=>[...H,D]),f(""),o==null||o(D)}}),V=e.onStateChange(N=>{b.current&&(m(N.current),a==null||a(N.current))});return m(e.state),()=>{b.current=!1,O(),V()}},[e,o,a]);const C=I.useCallback(O=>{if(!e)return;v([]),r==null||r(O);const V={id:`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,role:"user",subtype:"user",content:O,timestamp:Date.now()};c(N=>[...N,V]),e.receive(O).catch(()=>{})},[e,r]),E=I.useCallback(()=>{e==null||e.interrupt()},[e]),P=I.useCallback(()=>{c([]),f("")},[]),T=I.useCallback(()=>{v([])},[]);return{messages:l,streaming:d,status:p,errors:y,send:C,interrupt:E,isLoading:S,clearMessages:P,clearErrors:T}}function ev(e){return{sessionId:e.sessionId,userId:e.userId,imageId:e.imageId,title:e.title,createdAt:e.createdAt,updatedAt:e.updatedAt}}function QT(e,t,n={}){const{autoLoad:r=!0,onSessionChange:o,onSessionsChange:a}=n,[l,c]=I.useState([]),[d,f]=I.useState(null),[p,m]=I.useState(!1),[y,v]=I.useState(null),b=I.useCallback(async()=>{if(!(!e||!("sessions"in e))){m(!0),v(null);try{const O=(await e.sessions.listByUser(t)).map(ev);c(O),a==null||a(O)}catch(T){v(T instanceof Error?T:new Error(String(T)))}finally{m(!1)}}},[e,t,a]);I.useEffect(()=>{r&&b()},[r,b]);const S=I.useCallback(T=>{f(T),o==null||o(T)},[o]),C=I.useCallback(async(T,O)=>{if(!e||!("sessions"in e))throw new Error("AgentX sessions not available");m(!0),v(null);try{const V=await e.sessions.create(T,t);O&&await V.setTitle(O);const N=ev(V);return c(D=>[N,...D]),a==null||a([N,...l]),N}catch(V){const N=V instanceof Error?V:new Error(String(V));throw v(N),N}finally{m(!1)}},[e,t,l,a]),E=I.useCallback(async T=>{if(!e||!("sessions"in e))throw new Error("AgentX sessions not available");m(!0),v(null);try{await e.sessions.destroy(T);const O=l.filter(V=>V.sessionId!==T);c(O),a==null||a(O),(d==null?void 0:d.sessionId)===T&&(f(null),o==null||o(null))}catch(O){const V=O instanceof Error?O:new Error(String(O));throw v(V),V}finally{m(!1)}},[e,l,d,o,a]),P=I.useCallback(async(T,O)=>{if(!e||!("sessions"in e))throw new Error("AgentX sessions not available");v(null);try{const V=await e.sessions.get(T);if(V){await V.setTitle(O);const N=Date.now();c(D=>D.map(H=>H.sessionId===T?{...H,title:O,updatedAt:N}:H)),(d==null?void 0:d.sessionId)===T&&f(D=>D&&{...D,title:O,updatedAt:N})}}catch(V){const N=V instanceof Error?V:new Error(String(V));throw v(N),N}},[e,d]);return{sessions:l,currentSession:d,selectSession:S,createSession:C,deleteSession:E,setSessionTitle:P,refresh:b,isLoading:p,error:y}}/**
54
54
  * @license lucide-react v0.460.0 - ISC
55
55
  *
56
56
  * This source code is licensed under the ISC license.
@@ -70,107 +70,107 @@ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}
70
70
  *
71
71
  * This source code is licensed under the ISC license.
72
72
  * See the LICENSE file in the root directory of this source tree.
73
- */const St=(e,t)=>{const n=I.forwardRef(({className:r,...o},a)=>I.createElement(e_,{ref:a,iconNode:t,className:gw(`lucide-${JT(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
73
+ */const bt=(e,t)=>{const n=I.forwardRef(({className:r,...o},a)=>I.createElement(e_,{ref:a,iconNode:t,className:gw(`lucide-${JT(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
74
74
  * @license lucide-react v0.460.0 - ISC
75
75
  *
76
76
  * This source code is licensed under the ISC license.
77
77
  * See the LICENSE file in the root directory of this source tree.
78
- */const yw=St("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"}]]);/**
78
+ */const yw=bt("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"}]]);/**
79
79
  * @license lucide-react v0.460.0 - ISC
80
80
  *
81
81
  * This source code is licensed under the ISC license.
82
82
  * See the LICENSE file in the root directory of this source tree.
83
- */const t_=St("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
83
+ */const t_=bt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
84
84
  * @license lucide-react v0.460.0 - ISC
85
85
  *
86
86
  * This source code is licensed under the ISC license.
87
87
  * See the LICENSE file in the root directory of this source tree.
88
- */const n_=St("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
88
+ */const n_=bt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
89
89
  * @license lucide-react v0.460.0 - ISC
90
90
  *
91
91
  * This source code is licensed under the ISC license.
92
92
  * See the LICENSE file in the root directory of this source tree.
93
- */St("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
93
+ */bt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
94
94
  * @license lucide-react v0.460.0 - ISC
95
95
  *
96
96
  * This source code is licensed under the ISC license.
97
97
  * See the LICENSE file in the root directory of this source tree.
98
- */const r_=St("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
98
+ */const r_=bt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
99
99
  * @license lucide-react v0.460.0 - ISC
100
100
  *
101
101
  * This source code is licensed under the ISC license.
102
102
  * See the LICENSE file in the root directory of this source tree.
103
- */St("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
103
+ */bt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
104
104
  * @license lucide-react v0.460.0 - ISC
105
105
  *
106
106
  * This source code is licensed under the ISC license.
107
107
  * See the LICENSE file in the root directory of this source tree.
108
- */St("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
108
+ */bt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
109
109
  * @license lucide-react v0.460.0 - ISC
110
110
  *
111
111
  * This source code is licensed under the ISC license.
112
112
  * See the LICENSE file in the root directory of this source tree.
113
- */const i_=St("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
113
+ */const i_=bt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
114
114
  * @license lucide-react v0.460.0 - ISC
115
115
  *
116
116
  * This source code is licensed under the ISC license.
117
117
  * See the LICENSE file in the root directory of this source tree.
118
- */const tv=St("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
118
+ */const tv=bt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
119
119
  * @license lucide-react v0.460.0 - ISC
120
120
  *
121
121
  * This source code is licensed under the ISC license.
122
122
  * See the LICENSE file in the root directory of this source tree.
123
- */const s_=St("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
123
+ */const s_=bt("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
124
124
  * @license lucide-react v0.460.0 - ISC
125
125
  *
126
126
  * This source code is licensed under the ISC license.
127
127
  * See the LICENSE file in the root directory of this source tree.
128
- */const o_=St("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
128
+ */const o_=bt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
129
129
  * @license lucide-react v0.460.0 - ISC
130
130
  *
131
131
  * This source code is licensed under the ISC license.
132
132
  * See the LICENSE file in the root directory of this source tree.
133
- */const vw=St("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
133
+ */const vw=bt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
134
134
  * @license lucide-react v0.460.0 - ISC
135
135
  *
136
136
  * This source code is licensed under the ISC license.
137
137
  * See the LICENSE file in the root directory of this source tree.
138
- */const a_=St("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
138
+ */const a_=bt("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
139
139
  * @license lucide-react v0.460.0 - ISC
140
140
  *
141
141
  * This source code is licensed under the ISC license.
142
142
  * See the LICENSE file in the root directory of this source tree.
143
- */const l_=St("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
143
+ */const l_=bt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
144
144
  * @license lucide-react v0.460.0 - ISC
145
145
  *
146
146
  * This source code is licensed under the ISC license.
147
147
  * See the LICENSE file in the root directory of this source tree.
148
- */const u_=St("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
148
+ */const u_=bt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
149
149
  * @license lucide-react v0.460.0 - ISC
150
150
  *
151
151
  * This source code is licensed under the ISC license.
152
152
  * See the LICENSE file in the root directory of this source tree.
153
- */const c_=St("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
153
+ */const c_=bt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
154
154
  * @license lucide-react v0.460.0 - ISC
155
155
  *
156
156
  * This source code is licensed under the ISC license.
157
157
  * See the LICENSE file in the root directory of this source tree.
158
- */const d_=St("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
158
+ */const d_=bt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
159
159
  * @license lucide-react v0.460.0 - ISC
160
160
  *
161
161
  * This source code is licensed under the ISC license.
162
162
  * See the LICENSE file in the root directory of this source tree.
163
- */const f_=St("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
163
+ */const f_=bt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
164
164
  * @license lucide-react v0.460.0 - ISC
165
165
  *
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
- */const h_=St("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
168
+ */const h_=bt("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
169
169
  * @license lucide-react v0.460.0 - ISC
170
170
  *
171
171
  * This source code is licensed under the ISC license.
172
172
  * See the LICENSE file in the root directory of this source tree.
173
- */const p_=St("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nv=["bg-blue-500","bg-green-500","bg-purple-500","bg-amber-500","bg-rose-500","bg-cyan-500"];function m_(e,t){return e.color?e.color:nv[t%nv.length]}function g_(e){return e.icon?e.icon:e.name.charAt(0).toUpperCase()}function y_({definitions:e,current:t,onSelect:n,onSettings:r,className:o=""}){return w.jsxs("div",{className:`flex flex-col h-full py-2 ${o}`,children:[w.jsx("div",{className:"flex-1 flex flex-col items-center gap-2",children:e.map((a,l)=>{const c=(t==null?void 0:t.name)===a.name,d=m_(a,l),f=g_(a);return w.jsxs("button",{onClick:()=>n(a),className:`
173
+ */const p_=bt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nv=["bg-blue-500","bg-green-500","bg-purple-500","bg-amber-500","bg-rose-500","bg-cyan-500"];function m_(e,t){return e.color?e.color:nv[t%nv.length]}function g_(e){return e.icon?e.icon:e.name.charAt(0).toUpperCase()}function y_({definitions:e,current:t,onSelect:n,onSettings:r,className:o=""}){return w.jsxs("div",{className:`flex flex-col h-full py-2 ${o}`,children:[w.jsx("div",{className:"flex-1 flex flex-col items-center gap-2",children:e.map((a,l)=>{const c=(t==null?void 0:t.name)===a.name,d=m_(a,l),f=g_(a);return w.jsxs("button",{onClick:()=>n(a),className:`
174
174
  relative w-10 h-10 rounded-xl flex items-center justify-center
175
175
  text-white font-semibold text-sm
176
176
  transition-all duration-200
@@ -178,7 +178,7 @@ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}
178
178
  ${c?"ring-2 ring-primary ring-offset-2 ring-offset-background scale-110":"hover:scale-105 opacity-70 hover:opacity-100"}
179
179
  `,title:a.name,children:[f,a.isOnline&&w.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 bg-green-400 rounded-full border-2 border-background"}),a.activeSessionCount&&a.activeSessionCount>0&&w.jsx("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 bg-red-500 text-white text-xs rounded-full flex items-center justify-center",children:a.activeSessionCount>9?"9+":a.activeSessionCount})]},a.name)})}),r&&w.jsx("div",{className:"flex flex-col items-center pt-2 border-t border-border",children:w.jsx("button",{onClick:r,className:`w-10 h-10 rounded-xl flex items-center justify-center
180
180
  text-muted-foreground hover:text-foreground
181
- hover:bg-accent transition-colors`,title:"Settings",children:w.jsx(l_,{className:"w-5 h-5"})})})]})}const Zh=I.createContext({});function ep(e){const t=I.useRef(null);return t.current===null&&(t.current=e()),t.current}const tp=typeof window<"u",xw=tp?I.useLayoutEffect:I.useEffect,sc=I.createContext(null);function np(e,t){e.indexOf(t)===-1&&e.push(t)}function rp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const qr=(e,t,n)=>n>t?t:n<e?e:n;let ip=()=>{};const Gr={},ww=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function bw(e){return typeof e=="object"&&e!==null}const Sw=e=>/^0[^.\s]+$/u.test(e);function sp(e){let t;return()=>(t===void 0&&(t=e()),t)}const qn=e=>e,v_=(e,t)=>n=>t(e(n)),Ga=(...e)=>e.reduce(v_),Da=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class op{constructor(){this.subscriptions=[]}add(t){return np(this.subscriptions,t),()=>rp(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let a=0;a<o;a++){const l=this.subscriptions[a];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Er=e=>e*1e3,Wn=e=>e/1e3;function kw(e,t){return t?e*(1e3/t):0}const Ew=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,x_=1e-7,w_=12;function b_(e,t,n,r,o){let a,l,c=0;do l=t+(n-t)/2,a=Ew(l,r,o)-e,a>0?n=l:t=l;while(Math.abs(a)>x_&&++c<w_);return l}function Ka(e,t,n,r){if(e===t&&n===r)return qn;const o=a=>b_(a,0,1,e,n);return a=>a===0||a===1?a:Ew(o(a),t,r)}const Cw=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Iw=e=>t=>1-e(1-t),Tw=Ka(.33,1.53,.69,.99),ap=Iw(Tw),_w=Cw(ap),Pw=e=>(e*=2)<1?.5*ap(e):.5*(2-Math.pow(2,-10*(e-1))),lp=e=>1-Math.sin(Math.acos(e)),Aw=Iw(lp),Rw=Cw(lp),S_=Ka(.42,0,1,1),k_=Ka(0,0,.58,1),Nw=Ka(.42,0,.58,1),E_=e=>Array.isArray(e)&&typeof e[0]!="number",jw=e=>Array.isArray(e)&&typeof e[0]=="number",C_={linear:qn,easeIn:S_,easeInOut:Nw,easeOut:k_,circIn:lp,circInOut:Rw,circOut:Aw,backIn:ap,backInOut:_w,backOut:Tw,anticipate:Pw},I_=e=>typeof e=="string",rv=e=>{if(jw(e)){ip(e.length===4);const[t,n,r,o]=e;return Ka(t,n,r,o)}else if(I_(e))return C_[e];return e},yu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function T_(e,t){let n=new Set,r=new Set,o=!1,a=!1;const l=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function d(p){l.has(p)&&(f.schedule(p),e()),p(c)}const f={schedule:(p,m=!1,y=!1)=>{const b=y&&o?n:r;return m&&l.add(p),b.has(p)||b.add(p),p},cancel:p=>{r.delete(p),l.delete(p)},process:p=>{if(c=p,o){a=!0;return}o=!0,[n,r]=[r,n],n.forEach(d),n.clear(),o=!1,a&&(a=!1,f.process(p))}};return f}const __=40;function Mw(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,l=yu.reduce((T,O)=>(T[O]=T_(a),T),{}),{setup:c,read:d,resolveKeyframes:f,preUpdate:p,update:m,preRender:y,render:v,postRender:b}=l,S=()=>{const T=Gr.useManualTiming?o.timestamp:performance.now();n=!1,Gr.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(T-o.timestamp,__),1)),o.timestamp=T,o.isProcessing=!0,c.process(o),d.process(o),f.process(o),p.process(o),m.process(o),y.process(o),v.process(o),b.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(S))},C=()=>{n=!0,r=!0,o.isProcessing||e(S)};return{schedule:yu.reduce((T,O)=>{const V=l[O];return T[O]=(N,D=!1,H=!1)=>(n||C(),V.schedule(N,D,H)),T},{}),cancel:T=>{for(let O=0;O<yu.length;O++)l[yu[O]].cancel(T)},state:o,steps:l}}const{schedule:at,cancel:Pi,state:Lt,steps:nf}=Mw(typeof requestAnimationFrame<"u"?requestAnimationFrame:qn,!0);let Nu;function P_(){Nu=void 0}const fn={now:()=>(Nu===void 0&&fn.set(Lt.isProcessing||Gr.useManualTiming?Lt.timestamp:performance.now()),Nu),set:e=>{Nu=e,queueMicrotask(P_)}},Dw=e=>t=>typeof t=="string"&&t.startsWith(e),up=Dw("--"),A_=Dw("var(--"),cp=e=>A_(e)?R_.test(e.split("/*")[0].trim()):!1,R_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,yo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},La={...yo,transform:e=>qr(0,1,e)},vu={...yo,default:1},Ea=e=>Math.round(e*1e5)/1e5,dp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function N_(e){return e==null}const j_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fp=(e,t)=>n=>!!(typeof n=="string"&&j_.test(n)&&n.startsWith(e)||t&&!N_(n)&&Object.prototype.hasOwnProperty.call(n,t)),Lw=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,a,l,c]=r.match(dp);return{[e]:parseFloat(o),[t]:parseFloat(a),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},M_=e=>qr(0,255,e),rf={...yo,transform:e=>Math.round(M_(e))},us={test:fp("rgb","red"),parse:Lw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+rf.transform(e)+", "+rf.transform(t)+", "+rf.transform(n)+", "+Ea(La.transform(r))+")"};function D_(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ah={test:fp("#"),parse:D_,transform:us.transform},Ya=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ii=Ya("deg"),Cr=Ya("%"),_e=Ya("px"),L_=Ya("vh"),z_=Ya("vw"),iv={...Cr,parse:e=>Cr.parse(e)/100,transform:e=>Cr.transform(e*100)},eo={test:fp("hsl","hue"),parse:Lw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Cr.transform(Ea(t))+", "+Cr.transform(Ea(n))+", "+Ea(La.transform(r))+")"},bt={test:e=>us.test(e)||ah.test(e)||eo.test(e),parse:e=>us.test(e)?us.parse(e):eo.test(e)?eo.parse(e):ah.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?us.transform(e):eo.transform(e),getAnimatableNone:e=>{const t=bt.parse(e);return t.alpha=0,bt.transform(t)}},O_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function F_(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(dp))==null?void 0:t.length)||0)+(((n=e.match(O_))==null?void 0:n.length)||0)>0}const zw="number",Ow="color",V_="var",B_="var(",sv="${}",$_=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function za(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let a=0;const c=t.replace($_,d=>(bt.test(d)?(r.color.push(a),o.push(Ow),n.push(bt.parse(d))):d.startsWith(B_)?(r.var.push(a),o.push(V_),n.push(d)):(r.number.push(a),o.push(zw),n.push(parseFloat(d))),++a,sv)).split(sv);return{values:n,split:c,indexes:r,types:o}}function Fw(e){return za(e).values}function Vw(e){const{split:t,types:n}=za(e),r=t.length;return o=>{let a="";for(let l=0;l<r;l++)if(a+=t[l],o[l]!==void 0){const c=n[l];c===zw?a+=Ea(o[l]):c===Ow?a+=bt.transform(o[l]):a+=o[l]}return a}}const U_=e=>typeof e=="number"?0:bt.test(e)?bt.getAnimatableNone(e):e;function H_(e){const t=Fw(e);return Vw(e)(t.map(U_))}const Ai={test:F_,parse:Fw,createTransformer:Vw,getAnimatableNone:H_};function sf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function W_({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,a=0,l=0;if(!t)o=a=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;o=sf(d,c,e+1/3),a=sf(d,c,e),l=sf(d,c,e-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:r}}function Vu(e,t){return n=>n>0?t:e}const ft=(e,t,n)=>e+(t-e)*n,of=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},q_=[ah,us,eo],G_=e=>q_.find(t=>t.test(e));function ov(e){const t=G_(e);if(!t)return!1;let n=t.parse(e);return t===eo&&(n=W_(n)),n}const av=(e,t)=>{const n=ov(e),r=ov(t);if(!n||!r)return Vu(e,t);const o={...n};return a=>(o.red=of(n.red,r.red,a),o.green=of(n.green,r.green,a),o.blue=of(n.blue,r.blue,a),o.alpha=ft(n.alpha,r.alpha,a),us.transform(o))},lh=new Set(["none","hidden"]);function K_(e,t){return lh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Y_(e,t){return n=>ft(e,t,n)}function hp(e){return typeof e=="number"?Y_:typeof e=="string"?cp(e)?Vu:bt.test(e)?av:J_:Array.isArray(e)?Bw:typeof e=="object"?bt.test(e)?av:X_:Vu}function Bw(e,t){const n=[...e],r=n.length,o=e.map((a,l)=>hp(a)(a,t[l]));return a=>{for(let l=0;l<r;l++)n[l]=o[l](a);return n}}function X_(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=hp(e[o])(e[o],t[o]));return o=>{for(const a in r)n[a]=r[a](o);return n}}function Q_(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const a=t.types[o],l=e.indexes[a][r[a]],c=e.values[l]??0;n[o]=c,r[a]++}return n}const J_=(e,t)=>{const n=Ai.createTransformer(t),r=za(e),o=za(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?lh.has(e)&&!o.values.length||lh.has(t)&&!r.values.length?K_(e,t):Ga(Bw(Q_(r,o),o.values),n):Vu(e,t)};function $w(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ft(e,t,n):hp(e)(e,t)}const Z_=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>at.update(t,n),stop:()=>Pi(t),now:()=>Lt.isProcessing?Lt.timestamp:fn.now()}},Uw=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let a=0;a<o;a++)r+=Math.round(e(a/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Bu=2e4;function pp(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Bu;)t+=n,r=e.next(t);return t>=Bu?1/0:t}function eP(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(pp(r),Bu);return{type:"keyframes",ease:a=>r.next(o*a).value/t,duration:Wn(o)}}const tP=5;function Hw(e,t,n){const r=Math.max(t-tP,0);return kw(n-e(r),t-r)}const gt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},af=.001;function nP({duration:e=gt.duration,bounce:t=gt.bounce,velocity:n=gt.velocity,mass:r=gt.mass}){let o,a,l=1-t;l=qr(gt.minDamping,gt.maxDamping,l),e=qr(gt.minDuration,gt.maxDuration,Wn(e)),l<1?(o=f=>{const p=f*l,m=p*e,y=p-n,v=uh(f,l),b=Math.exp(-m);return af-y/v*b},a=f=>{const m=f*l*e,y=m*n+n,v=Math.pow(l,2)*Math.pow(f,2)*e,b=Math.exp(-m),S=uh(Math.pow(f,2),l);return(-o(f)+af>0?-1:1)*((y-v)*b)/S}):(o=f=>{const p=Math.exp(-f*e),m=(f-n)*e+1;return-af+p*m},a=f=>{const p=Math.exp(-f*e),m=(n-f)*(e*e);return p*m});const c=5/e,d=iP(o,a,c);if(e=Er(e),isNaN(d))return{stiffness:gt.stiffness,damping:gt.damping,duration:e};{const f=Math.pow(d,2)*r;return{stiffness:f,damping:l*2*Math.sqrt(r*f),duration:e}}}const rP=12;function iP(e,t,n){let r=n;for(let o=1;o<rP;o++)r=r-e(r)/t(r);return r}function uh(e,t){return e*Math.sqrt(1-t*t)}const sP=["duration","bounce"],oP=["stiffness","damping","mass"];function lv(e,t){return t.some(n=>e[n]!==void 0)}function aP(e){let t={velocity:gt.velocity,stiffness:gt.stiffness,damping:gt.damping,mass:gt.mass,isResolvedFromDuration:!1,...e};if(!lv(e,oP)&&lv(e,sP))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,a=2*qr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:gt.mass,stiffness:o,damping:a}}else{const n=nP(e);t={...t,...n,mass:gt.mass},t.isResolvedFromDuration=!0}return t}function $u(e=gt.visualDuration,t=gt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:a},{stiffness:d,damping:f,mass:p,duration:m,velocity:y,isResolvedFromDuration:v}=aP({...n,velocity:-Wn(n.velocity||0)}),b=y||0,S=f/(2*Math.sqrt(d*p)),C=l-a,E=Wn(Math.sqrt(d/p)),P=Math.abs(C)<5;r||(r=P?gt.restSpeed.granular:gt.restSpeed.default),o||(o=P?gt.restDelta.granular:gt.restDelta.default);let T;if(S<1){const V=uh(E,S);T=N=>{const D=Math.exp(-S*E*N);return l-D*((b+S*E*C)/V*Math.sin(V*N)+C*Math.cos(V*N))}}else if(S===1)T=V=>l-Math.exp(-E*V)*(C+(b+E*C)*V);else{const V=E*Math.sqrt(S*S-1);T=N=>{const D=Math.exp(-S*E*N),H=Math.min(V*N,300);return l-D*((b+S*E*C)*Math.sinh(H)+V*C*Math.cosh(H))/V}}const O={calculatedDuration:v&&m||null,next:V=>{const N=T(V);if(v)c.done=V>=m;else{let D=V===0?b:0;S<1&&(D=V===0?Er(b):Hw(T,V,N));const H=Math.abs(D)<=r,ee=Math.abs(l-N)<=o;c.done=H&&ee}return c.value=c.done?l:N,c},toString:()=>{const V=Math.min(pp(O),Bu),N=Uw(D=>O.next(V*D).value,V,30);return V+"ms "+N},toTransition:()=>{}};return O}$u.applyToOptions=e=>{const t=eP(e,100,$u);return e.ease=t.ease,e.duration=Er(t.duration),e.type="keyframes",e};function ch({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:l,min:c,max:d,restDelta:f=.5,restSpeed:p}){const m=e[0],y={done:!1,value:m},v=H=>c!==void 0&&H<c||d!==void 0&&H>d,b=H=>c===void 0?d:d===void 0||Math.abs(c-H)<Math.abs(d-H)?c:d;let S=n*t;const C=m+S,E=l===void 0?C:l(C);E!==C&&(S=E-m);const P=H=>-S*Math.exp(-H/r),T=H=>E+P(H),O=H=>{const ee=P(H),L=T(H);y.done=Math.abs(ee)<=f,y.value=y.done?E:L};let V,N;const D=H=>{v(y.value)&&(V=H,N=$u({keyframes:[y.value,b(y.value)],velocity:Hw(T,H,y.value),damping:o,stiffness:a,restDelta:f,restSpeed:p}))};return D(0),{calculatedDuration:null,next:H=>{let ee=!1;return!N&&V===void 0&&(ee=!0,O(H),D(H)),V!==void 0&&H>=V?N.next(H-V):(!ee&&O(H),y)}}}function lP(e,t,n){const r=[],o=n||Gr.mix||$w,a=e.length-1;for(let l=0;l<a;l++){let c=o(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||qn:t;c=Ga(d,c)}r.push(c)}return r}function uP(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const a=e.length;if(ip(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=lP(t,r,o),d=c.length,f=p=>{if(l&&p<e[0])return t[0];let m=0;if(d>1)for(;m<e.length-2&&!(p<e[m+1]);m++);const y=Da(e[m],e[m+1],p);return c[m](y)};return n?p=>f(qr(e[0],e[a-1],p)):f}function cP(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Da(0,t,r);e.push(ft(n,1,o))}}function dP(e){const t=[0];return cP(t,e.length-1),t}function fP(e,t){return e.map(n=>n*t)}function hP(e,t){return e.map(()=>t||Nw).splice(0,e.length-1)}function Ca({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=E_(r)?r.map(rv):rv(r),a={done:!1,value:t[0]},l=fP(n&&n.length===t.length?n:dP(t),e),c=uP(l,t,{ease:Array.isArray(o)?o:hP(t,o)});return{calculatedDuration:e,next:d=>(a.value=c(d),a.done=d>=e,a)}}const pP=e=>e!==null;function mp(e,{repeat:t,repeatType:n="loop"},r,o=1){const a=e.filter(pP),c=o<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!c||r===void 0?a[c]:r}const mP={decay:ch,inertia:ch,tween:Ca,keyframes:Ca,spring:$u};function Ww(e){typeof e.type=="string"&&(e.type=mP[e.type])}class gp{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const gP=e=>e/100;class yp extends gp{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,r;const{motionValue:o}=this.options;o&&o.updatedAt!==fn.now()&&this.tick(fn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(n=this.options).onStop)==null||r.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Ww(t);const{type:n=Ca,repeat:r=0,repeatDelay:o=0,repeatType:a,velocity:l=0}=t;let{keyframes:c}=t;const d=n||Ca;d!==Ca&&typeof c[0]!="number"&&(this.mixKeyframes=Ga(gP,$w(c[0],c[1])),c=[0,100]);const f=d({...t,keyframes:c});a==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-l})),f.calculatedDuration===null&&(f.calculatedDuration=pp(f));const{calculatedDuration:p}=f;this.calculatedDuration=p,this.resolvedDuration=p+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=f}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:p,repeat:m,repeatType:y,repeatDelay:v,type:b,onUpdate:S,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const E=this.currentTime-f*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?E<0:E>o;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let T=this.currentTime,O=r;if(m){const H=Math.min(this.currentTime,o)/c;let ee=Math.floor(H),L=H%1;!L&&H>=1&&(L=1),L===1&&ee--,ee=Math.min(ee,m+1),!!(ee%2)&&(y==="reverse"?(L=1-L,v&&(L-=v/c)):y==="mirror"&&(O=l)),T=qr(0,1,L)*c}const V=P?{done:!1,value:p[0]}:O.next(T);a&&(V.value=a(V.value));let{done:N}=V;!P&&d!==null&&(N=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return D&&b!==ch&&(V.value=mp(p,this.options,C,this.speed)),S&&S(V.value),D&&this.finish(),V}then(t,n){return this.finished.then(t,n)}get duration(){return Wn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wn(t)}get time(){return Wn(this.currentTime)}set time(t){var n;t=Er(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(fn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Wn(this.currentTime))}play(){var t,n;if(this.isStopped)return;const{driver:r=Z_,startTime:o}=this.options;this.driver||(this.driver=r(l=>this.tick(l))),(n=(t=this.options).onPlay)==null||n.call(t);const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=o??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(fn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function yP(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const cs=e=>e*180/Math.PI,dh=e=>{const t=cs(Math.atan2(e[1],e[0]));return fh(t)},vP={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:dh,rotateZ:dh,skewX:e=>cs(Math.atan(e[1])),skewY:e=>cs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},fh=e=>(e=e%360,e<0&&(e+=360),e),uv=dh,cv=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),dv=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),xP={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:cv,scaleY:dv,scale:e=>(cv(e)+dv(e))/2,rotateX:e=>fh(cs(Math.atan2(e[6],e[5]))),rotateY:e=>fh(cs(Math.atan2(-e[2],e[0]))),rotateZ:uv,rotate:uv,skewX:e=>cs(Math.atan(e[4])),skewY:e=>cs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hh(e){return e.includes("scale")?1:0}function ph(e,t){if(!e||e==="none")return hh(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=xP,o=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=vP,o=c}if(!o)return hh(t);const a=r[t],l=o[1].split(",").map(bP);return typeof a=="function"?a(l):l[a]}const wP=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ph(n,t)};function bP(e){return parseFloat(e.trim())}const vo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xo=new Set(vo),fv=e=>e===yo||e===_e,SP=new Set(["x","y","z"]),kP=vo.filter(e=>!SP.has(e));function EP(e){const t=[];return kP.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ps={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ph(t,"x"),y:(e,{transform:t})=>ph(t,"y")};ps.translateX=ps.x;ps.translateY=ps.y;const ms=new Set;let mh=!1,gh=!1,yh=!1;function qw(){if(gh){const e=Array.from(ms).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=EP(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([a,l])=>{var c;(c=r.getValue(a))==null||c.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}gh=!1,mh=!1,ms.forEach(e=>e.complete(yh)),ms.clear()}function Gw(){ms.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(gh=!0)})}function CP(){yh=!0,Gw(),qw(),yh=!1}class vp{constructor(t,n,r,o,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(ms.add(this),mh||(mh=!0,at.read(Gw),at.resolveKeyframes(qw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const a=o==null?void 0:o.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),o&&a===void 0&&o.set(t[0])}yP(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ms.delete(this)}cancel(){this.state==="scheduled"&&(ms.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const IP=e=>e.startsWith("--");function TP(e,t,n){IP(t)?e.style.setProperty(t,n):e.style[t]=n}const _P=sp(()=>window.ScrollTimeline!==void 0),PP={};function AP(e,t){const n=sp(e);return()=>PP[t]??n()}const Kw=AP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sa=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,hv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sa([0,.65,.55,1]),circOut:Sa([.55,0,1,.45]),backIn:Sa([.31,.01,.66,-.59]),backOut:Sa([.33,1.53,.69,.99])};function Yw(e,t){if(e)return typeof e=="function"?Kw()?Uw(e,t):"ease-out":jw(e)?Sa(e):Array.isArray(e)?e.map(n=>Yw(n,t)||hv.easeOut):hv[e]}function RP(e,t,n,{delay:r=0,duration:o=300,repeat:a=0,repeatType:l="loop",ease:c="easeOut",times:d}={},f=void 0){const p={[t]:n};d&&(p.offset=d);const m=Yw(c,o);Array.isArray(m)&&(p.easing=m);const y={delay:r,duration:o,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return f&&(y.pseudoElement=f),e.animate(p,y)}function Xw(e){return typeof e=="function"&&"applyToOptions"in e}function NP({type:e,...t}){return Xw(e)&&Kw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class jP extends gp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,ip(typeof t.type!="string");const f=NP(t);this.animation=RP(n,r,o,f,a),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const p=mp(o,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(p):TP(n,r,p),this.animation.cancel()}d==null||d(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var t,n;const r=((n=(t=this.animation.effect)==null?void 0:t.getComputedTiming)==null?void 0:n.call(t).duration)||0;return Wn(Number(r))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wn(t)}get time(){return Wn(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Er(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&_P()?(this.animation.timeline=t,qn):n(this)}}const Qw={anticipate:Pw,backInOut:_w,circInOut:Rw};function MP(e){return e in Qw}function DP(e){typeof e.ease=="string"&&MP(e.ease)&&(e.ease=Qw[e.ease])}const pv=10;class LP extends jP{constructor(t){DP(t),Ww(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:a,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new yp({...l,autoplay:!1}),d=Er(this.finishedTime??this.time);n.setWithVelocity(c.sample(d-pv).value,c.sample(d).value,pv),c.stop()}}const mv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ai.test(e)||e==="0")&&!e.startsWith("url("));function zP(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function OP(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=mv(o,t),c=mv(a,t);return!l||!c?!1:zP(e)||(n==="spring"||Xw(n))&&r}function vh(e){e.duration=0,e.type="keyframes"}const FP=new Set(["opacity","clipPath","filter","transform"]),VP=sp(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function BP(e){var t;const{motionValue:n,name:r,repeatDelay:o,repeatType:a,damping:l,type:c}=e;if(!(((t=n==null?void 0:n.owner)==null?void 0:t.current)instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:p}=n.owner.getProps();return VP()&&r&&FP.has(r)&&(r!=="transform"||!p)&&!f&&!o&&a!=="mirror"&&l!==0&&c!=="inertia"}const $P=40;class UP extends gp{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:l="loop",keyframes:c,name:d,motionValue:f,element:p,...m}){var y;super(),this.stop=()=>{var S,C;this._animation&&(this._animation.stop(),(S=this.stopTimeline)==null||S.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=fn.now();const v={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:a,repeatType:l,name:d,motionValue:f,element:p,...m},b=(p==null?void 0:p.KeyframeResolver)||vp;this.keyframeResolver=new b(c,(S,C,E)=>this.onKeyframesResolved(S,C,v,!E),d,f,p),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:a,type:l,velocity:c,delay:d,isHandoff:f,onUpdate:p}=r;this.resolvedAt=fn.now(),OP(t,a,l,c)||((Gr.instantAnimations||!d)&&(p==null||p(mp(t,r,n))),t[0]=t[t.length-1],vh(r),r.repeat=0);const y={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>$P?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},v=!f&&BP(y)?new LP({...y,element:y.motionValue.owner.current}):new yp(y);v.finished.then(()=>this.notifyFinished()).catch(qn),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),CP()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const HP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function WP(e){const t=HP.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}function Jw(e,t,n=1){const[r,o]=WP(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const l=a.trim();return ww(l)?parseFloat(l):l}return cp(o)?Jw(o,t,n+1):o}function xp(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Zw=new Set(["width","height","top","left","right","bottom",...vo]),qP={test:e=>e==="auto",parse:e=>e},eb=e=>t=>t.test(e),tb=[yo,_e,Cr,Ii,z_,L_,qP],gv=e=>tb.find(eb(e));function GP(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Sw(e):!0}const KP=new Set(["brightness","contrast","saturate","opacity"]);function YP(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(dp)||[];if(!r)return e;const o=n.replace(r,"");let a=KP.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+o+")"}const XP=/\b([a-z-]*)\(.*?\)/gu,xh={...Ai,getAnimatableNone:e=>{const t=e.match(XP);return t?t.map(YP).join(" "):e}},yv={...yo,transform:Math.round},QP={rotate:Ii,rotateX:Ii,rotateY:Ii,rotateZ:Ii,scale:vu,scaleX:vu,scaleY:vu,scaleZ:vu,skew:Ii,skewX:Ii,skewY:Ii,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:La,originX:iv,originY:iv,originZ:_e},wp={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,radius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,backgroundPositionX:_e,backgroundPositionY:_e,...QP,zIndex:yv,fillOpacity:La,strokeOpacity:La,numOctaves:yv},JP={...wp,color:bt,backgroundColor:bt,outlineColor:bt,fill:bt,stroke:bt,borderColor:bt,borderTopColor:bt,borderRightColor:bt,borderBottomColor:bt,borderLeftColor:bt,filter:xh,WebkitFilter:xh},nb=e=>JP[e];function rb(e,t){let n=nb(e);return n!==xh&&(n=Ai),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ZP=new Set(["auto","none","0"]);function eA(e,t,n){let r=0,o;for(;r<e.length&&!o;){const a=e[r];typeof a=="string"&&!ZP.has(a)&&za(a).values.length&&(o=e[r]),r++}if(o&&n)for(const a of t)e[a]=rb(n,o)}class tA extends vp{constructor(t,n,r,o,a){super(t,n,r,o,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),cp(f))){const p=Jw(f,n.current);p!==void 0&&(t[d]=p),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Zw.has(r)||t.length!==2)return;const[o,a]=t,l=gv(o),c=gv(a);if(l!==c)if(fv(l)&&fv(c))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else ps[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||GP(t[o]))&&r.push(o);r.length&&eA(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ps[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:o}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const l=o.length-1,c=o[l];o[l]=ps[r](n.measureViewportBox(),window.getComputedStyle(n.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),(t=this.removedTransforms)!=null&&t.length&&this.removedTransforms.forEach(([d,f])=>{n.getValue(d).set(f)}),this.resolveNoneKeyframes()}}function nA(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const o=document.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const ib=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function sb(e){return bw(e)&&"offsetHeight"in e}const vv=30,rA=e=>!isNaN(parseFloat(e));class iA{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const a=fn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=fn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=rA(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new op);const r=this.events[t].add(n);return t==="change"?()=>{r(),at.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vv);return kw(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function co(e,t){return new iA(e,t)}const{schedule:bp}=Mw(queueMicrotask,!1),ar={x:!1,y:!1};function ob(){return ar.x||ar.y}function sA(e){return e==="x"||e==="y"?ar[e]?null:(ar[e]=!0,()=>{ar[e]=!1}):ar.x||ar.y?null:(ar.x=ar.y=!0,()=>{ar.x=ar.y=!1})}function ab(e,t){const n=nA(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function xv(e){return!(e.pointerType==="touch"||ob())}function oA(e,t,n={}){const[r,o,a]=ab(e,n),l=c=>{if(!xv(c))return;const{target:d}=c,f=t(d,c);if(typeof f!="function"||!d)return;const p=m=>{xv(m)&&(f(m),d.removeEventListener("pointerleave",p))};d.addEventListener("pointerleave",p,o)};return r.forEach(c=>{c.addEventListener("pointerenter",l,o)}),a}const lb=(e,t)=>t?e===t?!0:lb(e,t.parentElement):!1,Sp=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,aA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function lA(e){return aA.has(e.tagName)||e.tabIndex!==-1}const ju=new WeakSet;function wv(e){return t=>{t.key==="Enter"&&e(t)}}function lf(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const uA=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=wv(()=>{if(ju.has(n))return;lf(n,"down");const o=wv(()=>{lf(n,"up")}),a=()=>lf(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function bv(e){return Sp(e)&&!ob()}function cA(e,t,n={}){const[r,o,a]=ab(e,n),l=c=>{const d=c.currentTarget;if(!bv(c))return;ju.add(d);const f=t(d,c),p=(v,b)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",y),ju.has(d)&&ju.delete(d),bv(v)&&typeof f=="function"&&f(v,{success:b})},m=v=>{p(v,d===window||d===document||n.useGlobalTarget||lb(d,v.target))},y=v=>{p(v,!1)};window.addEventListener("pointerup",m,o),window.addEventListener("pointercancel",y,o)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,o),sb(c)&&(c.addEventListener("focus",f=>uA(f,o)),!lA(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),a}function ub(e){return bw(e)&&"ownerSVGElement"in e}function dA(e){return ub(e)&&e.tagName==="svg"}const Wt=e=>!!(e&&e.getVelocity),fA=[...tb,bt,Ai],hA=e=>fA.find(eb(e)),kp=I.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Sv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pA(...e){return t=>{let n=!1;const r=e.map(o=>{const a=Sv(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():Sv(e[o],null)}}}}function mA(...e){return I.useCallback(pA(...e),e)}class gA extends I.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=sb(r)&&r.offsetWidth||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=o-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function yA({children:e,isPresent:t,anchorX:n,root:r}){const o=I.useId(),a=I.useRef(null),l=I.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=I.useContext(kp),d=mA(a,e==null?void 0:e.ref);return I.useInsertionEffect(()=>{const{width:f,height:p,top:m,left:y,right:v}=l.current;if(t||!a.current||!f||!p)return;const b=n==="left"?`left: ${y}`:`right: ${v}`;a.current.dataset.motionPopId=o;const S=document.createElement("style");c&&(S.nonce=c);const C=r??document.head;return C.appendChild(S),S.sheet&&S.sheet.insertRule(`
181
+ hover:bg-accent transition-colors`,title:"Settings",children:w.jsx(l_,{className:"w-5 h-5"})})})]})}const Zh=I.createContext({});function ep(e){const t=I.useRef(null);return t.current===null&&(t.current=e()),t.current}const tp=typeof window<"u",xw=tp?I.useLayoutEffect:I.useEffect,sc=I.createContext(null);function np(e,t){e.indexOf(t)===-1&&e.push(t)}function rp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const qr=(e,t,n)=>n>t?t:n<e?e:n;let ip=()=>{};const Gr={},ww=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function bw(e){return typeof e=="object"&&e!==null}const Sw=e=>/^0[^.\s]+$/u.test(e);function sp(e){let t;return()=>(t===void 0&&(t=e()),t)}const qn=e=>e,v_=(e,t)=>n=>t(e(n)),Ga=(...e)=>e.reduce(v_),Da=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class op{constructor(){this.subscriptions=[]}add(t){return np(this.subscriptions,t),()=>rp(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let a=0;a<o;a++){const l=this.subscriptions[a];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Er=e=>e*1e3,Wn=e=>e/1e3;function kw(e,t){return t?e*(1e3/t):0}const Ew=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,x_=1e-7,w_=12;function b_(e,t,n,r,o){let a,l,c=0;do l=t+(n-t)/2,a=Ew(l,r,o)-e,a>0?n=l:t=l;while(Math.abs(a)>x_&&++c<w_);return l}function Ka(e,t,n,r){if(e===t&&n===r)return qn;const o=a=>b_(a,0,1,e,n);return a=>a===0||a===1?a:Ew(o(a),t,r)}const Cw=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Iw=e=>t=>1-e(1-t),Tw=Ka(.33,1.53,.69,.99),ap=Iw(Tw),_w=Cw(ap),Pw=e=>(e*=2)<1?.5*ap(e):.5*(2-Math.pow(2,-10*(e-1))),lp=e=>1-Math.sin(Math.acos(e)),Aw=Iw(lp),Rw=Cw(lp),S_=Ka(.42,0,1,1),k_=Ka(0,0,.58,1),Nw=Ka(.42,0,.58,1),E_=e=>Array.isArray(e)&&typeof e[0]!="number",jw=e=>Array.isArray(e)&&typeof e[0]=="number",C_={linear:qn,easeIn:S_,easeInOut:Nw,easeOut:k_,circIn:lp,circInOut:Rw,circOut:Aw,backIn:ap,backInOut:_w,backOut:Tw,anticipate:Pw},I_=e=>typeof e=="string",rv=e=>{if(jw(e)){ip(e.length===4);const[t,n,r,o]=e;return Ka(t,n,r,o)}else if(I_(e))return C_[e];return e},yu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function T_(e,t){let n=new Set,r=new Set,o=!1,a=!1;const l=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function d(p){l.has(p)&&(f.schedule(p),e()),p(c)}const f={schedule:(p,m=!1,y=!1)=>{const b=y&&o?n:r;return m&&l.add(p),b.has(p)||b.add(p),p},cancel:p=>{r.delete(p),l.delete(p)},process:p=>{if(c=p,o){a=!0;return}o=!0,[n,r]=[r,n],n.forEach(d),n.clear(),o=!1,a&&(a=!1,f.process(p))}};return f}const __=40;function Mw(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,l=yu.reduce((T,O)=>(T[O]=T_(a),T),{}),{setup:c,read:d,resolveKeyframes:f,preUpdate:p,update:m,preRender:y,render:v,postRender:b}=l,S=()=>{const T=Gr.useManualTiming?o.timestamp:performance.now();n=!1,Gr.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(T-o.timestamp,__),1)),o.timestamp=T,o.isProcessing=!0,c.process(o),d.process(o),f.process(o),p.process(o),m.process(o),y.process(o),v.process(o),b.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(S))},C=()=>{n=!0,r=!0,o.isProcessing||e(S)};return{schedule:yu.reduce((T,O)=>{const V=l[O];return T[O]=(N,D=!1,H=!1)=>(n||C(),V.schedule(N,D,H)),T},{}),cancel:T=>{for(let O=0;O<yu.length;O++)l[yu[O]].cancel(T)},state:o,steps:l}}const{schedule:ot,cancel:Pi,state:Dt,steps:nf}=Mw(typeof requestAnimationFrame<"u"?requestAnimationFrame:qn,!0);let Nu;function P_(){Nu=void 0}const dn={now:()=>(Nu===void 0&&dn.set(Dt.isProcessing||Gr.useManualTiming?Dt.timestamp:performance.now()),Nu),set:e=>{Nu=e,queueMicrotask(P_)}},Dw=e=>t=>typeof t=="string"&&t.startsWith(e),up=Dw("--"),A_=Dw("var(--"),cp=e=>A_(e)?R_.test(e.split("/*")[0].trim()):!1,R_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,yo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},La={...yo,transform:e=>qr(0,1,e)},vu={...yo,default:1},Ea=e=>Math.round(e*1e5)/1e5,dp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function N_(e){return e==null}const j_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fp=(e,t)=>n=>!!(typeof n=="string"&&j_.test(n)&&n.startsWith(e)||t&&!N_(n)&&Object.prototype.hasOwnProperty.call(n,t)),Lw=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,a,l,c]=r.match(dp);return{[e]:parseFloat(o),[t]:parseFloat(a),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},M_=e=>qr(0,255,e),rf={...yo,transform:e=>Math.round(M_(e))},us={test:fp("rgb","red"),parse:Lw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+rf.transform(e)+", "+rf.transform(t)+", "+rf.transform(n)+", "+Ea(La.transform(r))+")"};function D_(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ah={test:fp("#"),parse:D_,transform:us.transform},Ya=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ii=Ya("deg"),Cr=Ya("%"),Pe=Ya("px"),L_=Ya("vh"),z_=Ya("vw"),iv={...Cr,parse:e=>Cr.parse(e)/100,transform:e=>Cr.transform(e*100)},eo={test:fp("hsl","hue"),parse:Lw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Cr.transform(Ea(t))+", "+Cr.transform(Ea(n))+", "+Ea(La.transform(r))+")"},wt={test:e=>us.test(e)||ah.test(e)||eo.test(e),parse:e=>us.test(e)?us.parse(e):eo.test(e)?eo.parse(e):ah.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?us.transform(e):eo.transform(e),getAnimatableNone:e=>{const t=wt.parse(e);return t.alpha=0,wt.transform(t)}},O_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function F_(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(dp))==null?void 0:t.length)||0)+(((n=e.match(O_))==null?void 0:n.length)||0)>0}const zw="number",Ow="color",V_="var",B_="var(",sv="${}",$_=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function za(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let a=0;const c=t.replace($_,d=>(wt.test(d)?(r.color.push(a),o.push(Ow),n.push(wt.parse(d))):d.startsWith(B_)?(r.var.push(a),o.push(V_),n.push(d)):(r.number.push(a),o.push(zw),n.push(parseFloat(d))),++a,sv)).split(sv);return{values:n,split:c,indexes:r,types:o}}function Fw(e){return za(e).values}function Vw(e){const{split:t,types:n}=za(e),r=t.length;return o=>{let a="";for(let l=0;l<r;l++)if(a+=t[l],o[l]!==void 0){const c=n[l];c===zw?a+=Ea(o[l]):c===Ow?a+=wt.transform(o[l]):a+=o[l]}return a}}const U_=e=>typeof e=="number"?0:wt.test(e)?wt.getAnimatableNone(e):e;function H_(e){const t=Fw(e);return Vw(e)(t.map(U_))}const Ai={test:F_,parse:Fw,createTransformer:Vw,getAnimatableNone:H_};function sf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function W_({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,a=0,l=0;if(!t)o=a=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;o=sf(d,c,e+1/3),a=sf(d,c,e),l=sf(d,c,e-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:r}}function Vu(e,t){return n=>n>0?t:e}const dt=(e,t,n)=>e+(t-e)*n,of=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},q_=[ah,us,eo],G_=e=>q_.find(t=>t.test(e));function ov(e){const t=G_(e);if(!t)return!1;let n=t.parse(e);return t===eo&&(n=W_(n)),n}const av=(e,t)=>{const n=ov(e),r=ov(t);if(!n||!r)return Vu(e,t);const o={...n};return a=>(o.red=of(n.red,r.red,a),o.green=of(n.green,r.green,a),o.blue=of(n.blue,r.blue,a),o.alpha=dt(n.alpha,r.alpha,a),us.transform(o))},lh=new Set(["none","hidden"]);function K_(e,t){return lh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Y_(e,t){return n=>dt(e,t,n)}function hp(e){return typeof e=="number"?Y_:typeof e=="string"?cp(e)?Vu:wt.test(e)?av:J_:Array.isArray(e)?Bw:typeof e=="object"?wt.test(e)?av:X_:Vu}function Bw(e,t){const n=[...e],r=n.length,o=e.map((a,l)=>hp(a)(a,t[l]));return a=>{for(let l=0;l<r;l++)n[l]=o[l](a);return n}}function X_(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=hp(e[o])(e[o],t[o]));return o=>{for(const a in r)n[a]=r[a](o);return n}}function Q_(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const a=t.types[o],l=e.indexes[a][r[a]],c=e.values[l]??0;n[o]=c,r[a]++}return n}const J_=(e,t)=>{const n=Ai.createTransformer(t),r=za(e),o=za(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?lh.has(e)&&!o.values.length||lh.has(t)&&!r.values.length?K_(e,t):Ga(Bw(Q_(r,o),o.values),n):Vu(e,t)};function $w(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?dt(e,t,n):hp(e)(e,t)}const Z_=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ot.update(t,n),stop:()=>Pi(t),now:()=>Dt.isProcessing?Dt.timestamp:dn.now()}},Uw=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let a=0;a<o;a++)r+=Math.round(e(a/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Bu=2e4;function pp(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Bu;)t+=n,r=e.next(t);return t>=Bu?1/0:t}function eP(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(pp(r),Bu);return{type:"keyframes",ease:a=>r.next(o*a).value/t,duration:Wn(o)}}const tP=5;function Hw(e,t,n){const r=Math.max(t-tP,0);return kw(n-e(r),t-r)}const mt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},af=.001;function nP({duration:e=mt.duration,bounce:t=mt.bounce,velocity:n=mt.velocity,mass:r=mt.mass}){let o,a,l=1-t;l=qr(mt.minDamping,mt.maxDamping,l),e=qr(mt.minDuration,mt.maxDuration,Wn(e)),l<1?(o=f=>{const p=f*l,m=p*e,y=p-n,v=uh(f,l),b=Math.exp(-m);return af-y/v*b},a=f=>{const m=f*l*e,y=m*n+n,v=Math.pow(l,2)*Math.pow(f,2)*e,b=Math.exp(-m),S=uh(Math.pow(f,2),l);return(-o(f)+af>0?-1:1)*((y-v)*b)/S}):(o=f=>{const p=Math.exp(-f*e),m=(f-n)*e+1;return-af+p*m},a=f=>{const p=Math.exp(-f*e),m=(n-f)*(e*e);return p*m});const c=5/e,d=iP(o,a,c);if(e=Er(e),isNaN(d))return{stiffness:mt.stiffness,damping:mt.damping,duration:e};{const f=Math.pow(d,2)*r;return{stiffness:f,damping:l*2*Math.sqrt(r*f),duration:e}}}const rP=12;function iP(e,t,n){let r=n;for(let o=1;o<rP;o++)r=r-e(r)/t(r);return r}function uh(e,t){return e*Math.sqrt(1-t*t)}const sP=["duration","bounce"],oP=["stiffness","damping","mass"];function lv(e,t){return t.some(n=>e[n]!==void 0)}function aP(e){let t={velocity:mt.velocity,stiffness:mt.stiffness,damping:mt.damping,mass:mt.mass,isResolvedFromDuration:!1,...e};if(!lv(e,oP)&&lv(e,sP))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,a=2*qr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:mt.mass,stiffness:o,damping:a}}else{const n=nP(e);t={...t,...n,mass:mt.mass},t.isResolvedFromDuration=!0}return t}function $u(e=mt.visualDuration,t=mt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:a},{stiffness:d,damping:f,mass:p,duration:m,velocity:y,isResolvedFromDuration:v}=aP({...n,velocity:-Wn(n.velocity||0)}),b=y||0,S=f/(2*Math.sqrt(d*p)),C=l-a,E=Wn(Math.sqrt(d/p)),P=Math.abs(C)<5;r||(r=P?mt.restSpeed.granular:mt.restSpeed.default),o||(o=P?mt.restDelta.granular:mt.restDelta.default);let T;if(S<1){const V=uh(E,S);T=N=>{const D=Math.exp(-S*E*N);return l-D*((b+S*E*C)/V*Math.sin(V*N)+C*Math.cos(V*N))}}else if(S===1)T=V=>l-Math.exp(-E*V)*(C+(b+E*C)*V);else{const V=E*Math.sqrt(S*S-1);T=N=>{const D=Math.exp(-S*E*N),H=Math.min(V*N,300);return l-D*((b+S*E*C)*Math.sinh(H)+V*C*Math.cosh(H))/V}}const O={calculatedDuration:v&&m||null,next:V=>{const N=T(V);if(v)c.done=V>=m;else{let D=V===0?b:0;S<1&&(D=V===0?Er(b):Hw(T,V,N));const H=Math.abs(D)<=r,ee=Math.abs(l-N)<=o;c.done=H&&ee}return c.value=c.done?l:N,c},toString:()=>{const V=Math.min(pp(O),Bu),N=Uw(D=>O.next(V*D).value,V,30);return V+"ms "+N},toTransition:()=>{}};return O}$u.applyToOptions=e=>{const t=eP(e,100,$u);return e.ease=t.ease,e.duration=Er(t.duration),e.type="keyframes",e};function ch({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:l,min:c,max:d,restDelta:f=.5,restSpeed:p}){const m=e[0],y={done:!1,value:m},v=H=>c!==void 0&&H<c||d!==void 0&&H>d,b=H=>c===void 0?d:d===void 0||Math.abs(c-H)<Math.abs(d-H)?c:d;let S=n*t;const C=m+S,E=l===void 0?C:l(C);E!==C&&(S=E-m);const P=H=>-S*Math.exp(-H/r),T=H=>E+P(H),O=H=>{const ee=P(H),L=T(H);y.done=Math.abs(ee)<=f,y.value=y.done?E:L};let V,N;const D=H=>{v(y.value)&&(V=H,N=$u({keyframes:[y.value,b(y.value)],velocity:Hw(T,H,y.value),damping:o,stiffness:a,restDelta:f,restSpeed:p}))};return D(0),{calculatedDuration:null,next:H=>{let ee=!1;return!N&&V===void 0&&(ee=!0,O(H),D(H)),V!==void 0&&H>=V?N.next(H-V):(!ee&&O(H),y)}}}function lP(e,t,n){const r=[],o=n||Gr.mix||$w,a=e.length-1;for(let l=0;l<a;l++){let c=o(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||qn:t;c=Ga(d,c)}r.push(c)}return r}function uP(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const a=e.length;if(ip(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=lP(t,r,o),d=c.length,f=p=>{if(l&&p<e[0])return t[0];let m=0;if(d>1)for(;m<e.length-2&&!(p<e[m+1]);m++);const y=Da(e[m],e[m+1],p);return c[m](y)};return n?p=>f(qr(e[0],e[a-1],p)):f}function cP(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Da(0,t,r);e.push(dt(n,1,o))}}function dP(e){const t=[0];return cP(t,e.length-1),t}function fP(e,t){return e.map(n=>n*t)}function hP(e,t){return e.map(()=>t||Nw).splice(0,e.length-1)}function Ca({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=E_(r)?r.map(rv):rv(r),a={done:!1,value:t[0]},l=fP(n&&n.length===t.length?n:dP(t),e),c=uP(l,t,{ease:Array.isArray(o)?o:hP(t,o)});return{calculatedDuration:e,next:d=>(a.value=c(d),a.done=d>=e,a)}}const pP=e=>e!==null;function mp(e,{repeat:t,repeatType:n="loop"},r,o=1){const a=e.filter(pP),c=o<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!c||r===void 0?a[c]:r}const mP={decay:ch,inertia:ch,tween:Ca,keyframes:Ca,spring:$u};function Ww(e){typeof e.type=="string"&&(e.type=mP[e.type])}class gp{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const gP=e=>e/100;class yp extends gp{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,r;const{motionValue:o}=this.options;o&&o.updatedAt!==dn.now()&&this.tick(dn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(n=this.options).onStop)==null||r.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Ww(t);const{type:n=Ca,repeat:r=0,repeatDelay:o=0,repeatType:a,velocity:l=0}=t;let{keyframes:c}=t;const d=n||Ca;d!==Ca&&typeof c[0]!="number"&&(this.mixKeyframes=Ga(gP,$w(c[0],c[1])),c=[0,100]);const f=d({...t,keyframes:c});a==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-l})),f.calculatedDuration===null&&(f.calculatedDuration=pp(f));const{calculatedDuration:p}=f;this.calculatedDuration=p,this.resolvedDuration=p+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=f}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:p,repeat:m,repeatType:y,repeatDelay:v,type:b,onUpdate:S,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const E=this.currentTime-f*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?E<0:E>o;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let T=this.currentTime,O=r;if(m){const H=Math.min(this.currentTime,o)/c;let ee=Math.floor(H),L=H%1;!L&&H>=1&&(L=1),L===1&&ee--,ee=Math.min(ee,m+1),!!(ee%2)&&(y==="reverse"?(L=1-L,v&&(L-=v/c)):y==="mirror"&&(O=l)),T=qr(0,1,L)*c}const V=P?{done:!1,value:p[0]}:O.next(T);a&&(V.value=a(V.value));let{done:N}=V;!P&&d!==null&&(N=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return D&&b!==ch&&(V.value=mp(p,this.options,C,this.speed)),S&&S(V.value),D&&this.finish(),V}then(t,n){return this.finished.then(t,n)}get duration(){return Wn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wn(t)}get time(){return Wn(this.currentTime)}set time(t){var n;t=Er(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(dn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Wn(this.currentTime))}play(){var t,n;if(this.isStopped)return;const{driver:r=Z_,startTime:o}=this.options;this.driver||(this.driver=r(l=>this.tick(l))),(n=(t=this.options).onPlay)==null||n.call(t);const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=o??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(dn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function yP(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const cs=e=>e*180/Math.PI,dh=e=>{const t=cs(Math.atan2(e[1],e[0]));return fh(t)},vP={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:dh,rotateZ:dh,skewX:e=>cs(Math.atan(e[1])),skewY:e=>cs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},fh=e=>(e=e%360,e<0&&(e+=360),e),uv=dh,cv=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),dv=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),xP={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:cv,scaleY:dv,scale:e=>(cv(e)+dv(e))/2,rotateX:e=>fh(cs(Math.atan2(e[6],e[5]))),rotateY:e=>fh(cs(Math.atan2(-e[2],e[0]))),rotateZ:uv,rotate:uv,skewX:e=>cs(Math.atan(e[4])),skewY:e=>cs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hh(e){return e.includes("scale")?1:0}function ph(e,t){if(!e||e==="none")return hh(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=xP,o=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=vP,o=c}if(!o)return hh(t);const a=r[t],l=o[1].split(",").map(bP);return typeof a=="function"?a(l):l[a]}const wP=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ph(n,t)};function bP(e){return parseFloat(e.trim())}const vo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xo=new Set(vo),fv=e=>e===yo||e===Pe,SP=new Set(["x","y","z"]),kP=vo.filter(e=>!SP.has(e));function EP(e){const t=[];return kP.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ps={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ph(t,"x"),y:(e,{transform:t})=>ph(t,"y")};ps.translateX=ps.x;ps.translateY=ps.y;const ms=new Set;let mh=!1,gh=!1,yh=!1;function qw(){if(gh){const e=Array.from(ms).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=EP(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([a,l])=>{var c;(c=r.getValue(a))==null||c.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}gh=!1,mh=!1,ms.forEach(e=>e.complete(yh)),ms.clear()}function Gw(){ms.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(gh=!0)})}function CP(){yh=!0,Gw(),qw(),yh=!1}class vp{constructor(t,n,r,o,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(ms.add(this),mh||(mh=!0,ot.read(Gw),ot.resolveKeyframes(qw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const a=o==null?void 0:o.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),o&&a===void 0&&o.set(t[0])}yP(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ms.delete(this)}cancel(){this.state==="scheduled"&&(ms.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const IP=e=>e.startsWith("--");function TP(e,t,n){IP(t)?e.style.setProperty(t,n):e.style[t]=n}const _P=sp(()=>window.ScrollTimeline!==void 0),PP={};function AP(e,t){const n=sp(e);return()=>PP[t]??n()}const Kw=AP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sa=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,hv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sa([0,.65,.55,1]),circOut:Sa([.55,0,1,.45]),backIn:Sa([.31,.01,.66,-.59]),backOut:Sa([.33,1.53,.69,.99])};function Yw(e,t){if(e)return typeof e=="function"?Kw()?Uw(e,t):"ease-out":jw(e)?Sa(e):Array.isArray(e)?e.map(n=>Yw(n,t)||hv.easeOut):hv[e]}function RP(e,t,n,{delay:r=0,duration:o=300,repeat:a=0,repeatType:l="loop",ease:c="easeOut",times:d}={},f=void 0){const p={[t]:n};d&&(p.offset=d);const m=Yw(c,o);Array.isArray(m)&&(p.easing=m);const y={delay:r,duration:o,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return f&&(y.pseudoElement=f),e.animate(p,y)}function Xw(e){return typeof e=="function"&&"applyToOptions"in e}function NP({type:e,...t}){return Xw(e)&&Kw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class jP extends gp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,ip(typeof t.type!="string");const f=NP(t);this.animation=RP(n,r,o,f,a),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const p=mp(o,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(p):TP(n,r,p),this.animation.cancel()}d==null||d(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var t,n;const r=((n=(t=this.animation.effect)==null?void 0:t.getComputedTiming)==null?void 0:n.call(t).duration)||0;return Wn(Number(r))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wn(t)}get time(){return Wn(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Er(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&_P()?(this.animation.timeline=t,qn):n(this)}}const Qw={anticipate:Pw,backInOut:_w,circInOut:Rw};function MP(e){return e in Qw}function DP(e){typeof e.ease=="string"&&MP(e.ease)&&(e.ease=Qw[e.ease])}const pv=10;class LP extends jP{constructor(t){DP(t),Ww(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:a,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new yp({...l,autoplay:!1}),d=Er(this.finishedTime??this.time);n.setWithVelocity(c.sample(d-pv).value,c.sample(d).value,pv),c.stop()}}const mv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ai.test(e)||e==="0")&&!e.startsWith("url("));function zP(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function OP(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=mv(o,t),c=mv(a,t);return!l||!c?!1:zP(e)||(n==="spring"||Xw(n))&&r}function vh(e){e.duration=0,e.type="keyframes"}const FP=new Set(["opacity","clipPath","filter","transform"]),VP=sp(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function BP(e){var t;const{motionValue:n,name:r,repeatDelay:o,repeatType:a,damping:l,type:c}=e;if(!(((t=n==null?void 0:n.owner)==null?void 0:t.current)instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:p}=n.owner.getProps();return VP()&&r&&FP.has(r)&&(r!=="transform"||!p)&&!f&&!o&&a!=="mirror"&&l!==0&&c!=="inertia"}const $P=40;class UP extends gp{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:l="loop",keyframes:c,name:d,motionValue:f,element:p,...m}){var y;super(),this.stop=()=>{var S,C;this._animation&&(this._animation.stop(),(S=this.stopTimeline)==null||S.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=dn.now();const v={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:a,repeatType:l,name:d,motionValue:f,element:p,...m},b=(p==null?void 0:p.KeyframeResolver)||vp;this.keyframeResolver=new b(c,(S,C,E)=>this.onKeyframesResolved(S,C,v,!E),d,f,p),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:a,type:l,velocity:c,delay:d,isHandoff:f,onUpdate:p}=r;this.resolvedAt=dn.now(),OP(t,a,l,c)||((Gr.instantAnimations||!d)&&(p==null||p(mp(t,r,n))),t[0]=t[t.length-1],vh(r),r.repeat=0);const y={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>$P?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},v=!f&&BP(y)?new LP({...y,element:y.motionValue.owner.current}):new yp(y);v.finished.then(()=>this.notifyFinished()).catch(qn),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),CP()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const HP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function WP(e){const t=HP.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}function Jw(e,t,n=1){const[r,o]=WP(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const l=a.trim();return ww(l)?parseFloat(l):l}return cp(o)?Jw(o,t,n+1):o}function xp(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Zw=new Set(["width","height","top","left","right","bottom",...vo]),qP={test:e=>e==="auto",parse:e=>e},eb=e=>t=>t.test(e),tb=[yo,Pe,Cr,Ii,z_,L_,qP],gv=e=>tb.find(eb(e));function GP(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Sw(e):!0}const KP=new Set(["brightness","contrast","saturate","opacity"]);function YP(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(dp)||[];if(!r)return e;const o=n.replace(r,"");let a=KP.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+o+")"}const XP=/\b([a-z-]*)\(.*?\)/gu,xh={...Ai,getAnimatableNone:e=>{const t=e.match(XP);return t?t.map(YP).join(" "):e}},yv={...yo,transform:Math.round},QP={rotate:Ii,rotateX:Ii,rotateY:Ii,rotateZ:Ii,scale:vu,scaleX:vu,scaleY:vu,scaleZ:vu,skew:Ii,skewX:Ii,skewY:Ii,distance:Pe,translateX:Pe,translateY:Pe,translateZ:Pe,x:Pe,y:Pe,z:Pe,perspective:Pe,transformPerspective:Pe,opacity:La,originX:iv,originY:iv,originZ:Pe},wp={borderWidth:Pe,borderTopWidth:Pe,borderRightWidth:Pe,borderBottomWidth:Pe,borderLeftWidth:Pe,borderRadius:Pe,radius:Pe,borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomRightRadius:Pe,borderBottomLeftRadius:Pe,width:Pe,maxWidth:Pe,height:Pe,maxHeight:Pe,top:Pe,right:Pe,bottom:Pe,left:Pe,padding:Pe,paddingTop:Pe,paddingRight:Pe,paddingBottom:Pe,paddingLeft:Pe,margin:Pe,marginTop:Pe,marginRight:Pe,marginBottom:Pe,marginLeft:Pe,backgroundPositionX:Pe,backgroundPositionY:Pe,...QP,zIndex:yv,fillOpacity:La,strokeOpacity:La,numOctaves:yv},JP={...wp,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:xh,WebkitFilter:xh},nb=e=>JP[e];function rb(e,t){let n=nb(e);return n!==xh&&(n=Ai),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ZP=new Set(["auto","none","0"]);function eA(e,t,n){let r=0,o;for(;r<e.length&&!o;){const a=e[r];typeof a=="string"&&!ZP.has(a)&&za(a).values.length&&(o=e[r]),r++}if(o&&n)for(const a of t)e[a]=rb(n,o)}class tA extends vp{constructor(t,n,r,o,a){super(t,n,r,o,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),cp(f))){const p=Jw(f,n.current);p!==void 0&&(t[d]=p),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Zw.has(r)||t.length!==2)return;const[o,a]=t,l=gv(o),c=gv(a);if(l!==c)if(fv(l)&&fv(c))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else ps[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||GP(t[o]))&&r.push(o);r.length&&eA(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ps[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:o}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const l=o.length-1,c=o[l];o[l]=ps[r](n.measureViewportBox(),window.getComputedStyle(n.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),(t=this.removedTransforms)!=null&&t.length&&this.removedTransforms.forEach(([d,f])=>{n.getValue(d).set(f)}),this.resolveNoneKeyframes()}}function nA(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const o=document.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const ib=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function sb(e){return bw(e)&&"offsetHeight"in e}const vv=30,rA=e=>!isNaN(parseFloat(e));class iA{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const a=dn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=dn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=rA(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new op);const r=this.events[t].add(n);return t==="change"?()=>{r(),ot.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=dn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vv);return kw(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function co(e,t){return new iA(e,t)}const{schedule:bp}=Mw(queueMicrotask,!1),ar={x:!1,y:!1};function ob(){return ar.x||ar.y}function sA(e){return e==="x"||e==="y"?ar[e]?null:(ar[e]=!0,()=>{ar[e]=!1}):ar.x||ar.y?null:(ar.x=ar.y=!0,()=>{ar.x=ar.y=!1})}function ab(e,t){const n=nA(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function xv(e){return!(e.pointerType==="touch"||ob())}function oA(e,t,n={}){const[r,o,a]=ab(e,n),l=c=>{if(!xv(c))return;const{target:d}=c,f=t(d,c);if(typeof f!="function"||!d)return;const p=m=>{xv(m)&&(f(m),d.removeEventListener("pointerleave",p))};d.addEventListener("pointerleave",p,o)};return r.forEach(c=>{c.addEventListener("pointerenter",l,o)}),a}const lb=(e,t)=>t?e===t?!0:lb(e,t.parentElement):!1,Sp=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,aA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function lA(e){return aA.has(e.tagName)||e.tabIndex!==-1}const ju=new WeakSet;function wv(e){return t=>{t.key==="Enter"&&e(t)}}function lf(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const uA=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=wv(()=>{if(ju.has(n))return;lf(n,"down");const o=wv(()=>{lf(n,"up")}),a=()=>lf(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function bv(e){return Sp(e)&&!ob()}function cA(e,t,n={}){const[r,o,a]=ab(e,n),l=c=>{const d=c.currentTarget;if(!bv(c))return;ju.add(d);const f=t(d,c),p=(v,b)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",y),ju.has(d)&&ju.delete(d),bv(v)&&typeof f=="function"&&f(v,{success:b})},m=v=>{p(v,d===window||d===document||n.useGlobalTarget||lb(d,v.target))},y=v=>{p(v,!1)};window.addEventListener("pointerup",m,o),window.addEventListener("pointercancel",y,o)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,o),sb(c)&&(c.addEventListener("focus",f=>uA(f,o)),!lA(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),a}function ub(e){return bw(e)&&"ownerSVGElement"in e}function dA(e){return ub(e)&&e.tagName==="svg"}const Ht=e=>!!(e&&e.getVelocity),fA=[...tb,wt,Ai],hA=e=>fA.find(eb(e)),kp=I.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Sv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pA(...e){return t=>{let n=!1;const r=e.map(o=>{const a=Sv(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():Sv(e[o],null)}}}}function mA(...e){return I.useCallback(pA(...e),e)}class gA extends I.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=sb(r)&&r.offsetWidth||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=o-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function yA({children:e,isPresent:t,anchorX:n,root:r}){const o=I.useId(),a=I.useRef(null),l=I.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=I.useContext(kp),d=mA(a,e==null?void 0:e.ref);return I.useInsertionEffect(()=>{const{width:f,height:p,top:m,left:y,right:v}=l.current;if(t||!a.current||!f||!p)return;const b=n==="left"?`left: ${y}`:`right: ${v}`;a.current.dataset.motionPopId=o;const S=document.createElement("style");c&&(S.nonce=c);const C=r??document.head;return C.appendChild(S),S.sheet&&S.sheet.insertRule(`
182
182
  [data-motion-pop-id="${o}"] {
183
183
  position: absolute !important;
184
184
  width: ${f}px !important;
@@ -186,7 +186,7 @@ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}
186
186
  ${b}px !important;
187
187
  top: ${m}px !important;
188
188
  }
189
- `),()=>{C.contains(S)&&C.removeChild(S)}},[t]),w.jsx(gA,{isPresent:t,childRef:a,sizeRef:l,children:I.cloneElement(e,{ref:d})})}const vA=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:a,mode:l,anchorX:c,root:d})=>{const f=ep(xA),p=I.useId();let m=!0,y=I.useMemo(()=>(m=!1,{id:p,initial:t,isPresent:n,custom:o,onExitComplete:v=>{f.set(v,!0);for(const b of f.values())if(!b)return;r&&r()},register:v=>(f.set(v,!1),()=>f.delete(v))}),[n,f,r]);return a&&m&&(y={...y}),I.useMemo(()=>{f.forEach((v,b)=>f.set(b,!1))},[n]),I.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),l==="popLayout"&&(e=w.jsx(yA,{isPresent:n,anchorX:c,root:d,children:e})),w.jsx(sc.Provider,{value:y,children:e})};function xA(){return new Map}function cb(e=!0){const t=I.useContext(sc);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,a=I.useId();I.useEffect(()=>{if(e)return o(a)},[e]);const l=I.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,l]:[!0]}const xu=e=>e.key||"";function kv(e){const t=[];return I.Children.forEach(e,n=>{I.isValidElement(n)&&t.push(n)}),t}const db=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:a="sync",propagate:l=!1,anchorX:c="left",root:d})=>{const[f,p]=cb(l),m=I.useMemo(()=>kv(e),[e]),y=l&&!f?[]:m.map(xu),v=I.useRef(!0),b=I.useRef(m),S=ep(()=>new Map),[C,E]=I.useState(m),[P,T]=I.useState(m);xw(()=>{v.current=!1,b.current=m;for(let N=0;N<P.length;N++){const D=xu(P[N]);y.includes(D)?S.delete(D):S.get(D)!==!0&&S.set(D,!1)}},[P,y.length,y.join("-")]);const O=[];if(m!==C){let N=[...m];for(let D=0;D<P.length;D++){const H=P[D],ee=xu(H);y.includes(ee)||(N.splice(D,0,H),O.push(H))}return a==="wait"&&O.length&&(N=O),T(kv(N)),E(m),null}const{forceRender:V}=I.useContext(Zh);return w.jsx(w.Fragment,{children:P.map(N=>{const D=xu(N),H=l&&!f?!1:m===P||y.includes(D),ee=()=>{if(S.has(D))S.set(D,!0);else return;let L=!0;S.forEach(te=>{te||(L=!1)}),L&&(V==null||V(),T(b.current),l&&(p==null||p()),r&&r())};return w.jsx(vA,{isPresent:H,initial:!v.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:a,root:d,onExitComplete:H?void 0:ee,anchorX:c,children:N},D)})})},fb=I.createContext({strict:!1}),Ev={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},fo={};for(const e in Ev)fo[e]={isEnabled:t=>Ev[e].some(n=>!!t[n])};function wA(e){for(const t in e)fo[t]={...fo[t],...e[t]}}const bA=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Uu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bA.has(e)}let hb=e=>!Uu(e);function SA(e){typeof e=="function"&&(hb=t=>t.startsWith("on")?!Uu(t):e(t))}try{SA(require("@emotion/is-prop-valid").default)}catch{}function kA(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(hb(o)||n===!0&&Uu(o)||!t&&!Uu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const oc=I.createContext({});function ac(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Oa(e){return typeof e=="string"||Array.isArray(e)}const Ep=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cp=["initial",...Ep];function lc(e){return ac(e.animate)||Cp.some(t=>Oa(e[t]))}function pb(e){return!!(lc(e)||e.variants)}function EA(e,t){if(lc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Oa(n)?n:void 0,animate:Oa(r)?r:void 0}}return e.inherit!==!1?t:{}}function CA(e){const{initial:t,animate:n}=EA(e,I.useContext(oc));return I.useMemo(()=>({initial:t,animate:n}),[Cv(t),Cv(n)])}function Cv(e){return Array.isArray(e)?e.join(" "):e}const Fa={};function IA(e){for(const t in e)Fa[t]=e[t],up(t)&&(Fa[t].isCSSVariable=!0)}function mb(e,{layout:t,layoutId:n}){return xo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Fa[e]||e==="opacity")}const TA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_A=vo.length;function PA(e,t,n){let r="",o=!0;for(let a=0;a<_A;a++){const l=vo[a],c=e[l];if(c===void 0)continue;let d=!0;if(typeof c=="number"?d=c===(l.startsWith("scale")?1:0):d=parseFloat(c)===0,!d||n){const f=ib(c,wp[l]);if(!d){o=!1;const p=TA[l]||l;r+=`${p}(${f}) `}n&&(t[l]=f)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Ip(e,t,n){const{style:r,vars:o,transformOrigin:a}=e;let l=!1,c=!1;for(const d in t){const f=t[d];if(xo.has(d)){l=!0;continue}else if(up(d)){o[d]=f;continue}else{const p=ib(f,wp[d]);d.startsWith("origin")?(c=!0,a[d]=p):r[d]=p}}if(t.transform||(l||n?r.transform=PA(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:p=0}=a;r.transformOrigin=`${d} ${f} ${p}`}}const Tp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gb(e,t,n){for(const r in t)!Wt(t[r])&&!mb(r,n)&&(e[r]=t[r])}function AA({transformTemplate:e},t){return I.useMemo(()=>{const n=Tp();return Ip(n,t,e),Object.assign({},n.vars,n.style)},[t])}function RA(e,t){const n=e.style||{},r={};return gb(r,n,e),Object.assign(r,AA(e,t)),r}function NA(e,t){const n={},r=RA(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const jA={offset:"stroke-dashoffset",array:"stroke-dasharray"},MA={offset:"strokeDashoffset",array:"strokeDasharray"};function DA(e,t,n=1,r=0,o=!0){e.pathLength=1;const a=o?jA:MA;e[a.offset]=_e.transform(-r);const l=_e.transform(t),c=_e.transform(n);e[a.array]=`${l} ${c}`}function yb(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,f,p){if(Ip(e,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:y}=e;m.transform&&(y.transform=m.transform,delete m.transform),(y.transform||m.transformOrigin)&&(y.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),y.transform&&(y.transformBox=(p==null?void 0:p.transformBox)??"fill-box",delete m.transformBox),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),o!==void 0&&DA(m,o,a,l,!1)}const vb=()=>({...Tp(),attrs:{}}),xb=e=>typeof e=="string"&&e.toLowerCase()==="svg";function LA(e,t,n,r){const o=I.useMemo(()=>{const a=vb();return yb(a,t,xb(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};gb(a,e.style,e),o.style={...a,...o.style}}return o}const zA=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _p(e){return typeof e!="string"||e.includes("-")?!1:!!(zA.indexOf(e)>-1||/[A-Z]/u.test(e))}function OA(e,t,n,{latestValues:r},o,a=!1){const c=(_p(e)?LA:NA)(t,r,o,e),d=kA(t,typeof e=="string",a),f=e!==I.Fragment?{...d,...c,ref:n}:{},{children:p}=t,m=I.useMemo(()=>Wt(p)?p.get():p,[p]);return I.createElement(e,{...f,children:m})}function Iv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Pp(e,t,n,r){if(typeof t=="function"){const[o,a]=Iv(r);t=t(n!==void 0?n:e.custom,o,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,a]=Iv(r);t=t(n!==void 0?n:e.custom,o,a)}return t}function Mu(e){return Wt(e)?e.get():e}function FA({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:VA(n,r,o,e),renderState:t()}}function VA(e,t,n,r){const o={},a=r(e,{});for(const y in a)o[y]=Mu(a[y]);let{initial:l,animate:c}=e;const d=lc(e),f=pb(e);t&&f&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const m=p?c:l;if(m&&typeof m!="boolean"&&!ac(m)){const y=Array.isArray(m)?m:[m];for(let v=0;v<y.length;v++){const b=Pp(e,y[v]);if(b){const{transitionEnd:S,transition:C,...E}=b;for(const P in E){let T=E[P];if(Array.isArray(T)){const O=p?T.length-1:0;T=T[O]}T!==null&&(o[P]=T)}for(const P in S)o[P]=S[P]}}}return o}const wb=e=>(t,n)=>{const r=I.useContext(oc),o=I.useContext(sc),a=()=>FA(e,t,r,o);return n?a():ep(a)};function Ap(e,t,n){var r;const{style:o}=e,a={};for(const l in o)(Wt(o[l])||t.style&&Wt(t.style[l])||mb(l,e)||((r=n==null?void 0:n.getValue(l))==null?void 0:r.liveStyle)!==void 0)&&(a[l]=o[l]);return a}const BA=wb({scrapeMotionValuesFromProps:Ap,createRenderState:Tp});function bb(e,t,n){const r=Ap(e,t,n);for(const o in e)if(Wt(e[o])||Wt(t[o])){const a=vo.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[a]=e[o]}return r}const $A=wb({scrapeMotionValuesFromProps:bb,createRenderState:vb}),UA=Symbol.for("motionComponentSymbol");function to(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function HA(e,t,n){return I.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):to(n)&&(n.current=r))},[t])}const Rp=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),WA="framerAppearId",Sb="data-"+Rp(WA),kb=I.createContext({});function qA(e,t,n,r,o){var a,l;const{visualElement:c}=I.useContext(oc),d=I.useContext(fb),f=I.useContext(sc),p=I.useContext(kp).reducedMotion,m=I.useRef(null);r=r||d.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:c,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:p}));const y=m.current,v=I.useContext(kb);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&GA(m.current,n,o,v);const b=I.useRef(!1);I.useInsertionEffect(()=>{y&&b.current&&y.update(n,f)});const S=n[Sb],C=I.useRef(!!S&&!((a=window.MotionHandoffIsComplete)!=null&&a.call(window,S))&&((l=window.MotionHasOptimisedAnimation)==null?void 0:l.call(window,S)));return xw(()=>{y&&(b.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),C.current&&y.animationState&&y.animationState.animateChanges())}),I.useEffect(()=>{y&&(!C.current&&y.animationState&&y.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,S)}),C.current=!1),y.enteringChildren=void 0)}),y}function GA(e,t,n,r){const{layoutId:o,layout:a,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:f,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Eb(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!l||c&&to(c),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:d,layoutRoot:f})}function Eb(e){if(e)return e.options.allowProjection!==!1?e.projection:Eb(e.parent)}function uf(e,{forwardMotionProps:t=!1}={},n,r){n&&wA(n);const o=_p(e)?$A:BA;function a(c,d){let f;const p={...I.useContext(kp),...c,layoutId:KA(c)},{isStatic:m}=p,y=CA(c),v=o(c,m);if(!m&&tp){YA();const b=XA(p);f=b.MeasureLayout,y.visualElement=qA(e,v,p,r,b.ProjectionNode)}return w.jsxs(oc.Provider,{value:y,children:[f&&y.visualElement?w.jsx(f,{visualElement:y.visualElement,...p}):null,OA(e,c,HA(v,y.visualElement,d),v,m,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=I.forwardRef(a);return l[UA]=e,l}function KA({layoutId:e}){const t=I.useContext(Zh).id;return t&&e!==void 0?t+"-"+e:e}function YA(e,t){I.useContext(fb).strict}function XA(e){const{drag:t,layout:n}=fo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function QA(e,t){if(typeof Proxy>"u")return uf;const n=new Map,r=(a,l)=>uf(a,l,e,t),o=(a,l)=>r(a,l);return new Proxy(o,{get:(a,l)=>l==="create"?r:(n.has(l)||n.set(l,uf(l,void 0,e,t)),n.get(l))})}function Cb({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function JA({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ZA(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function cf(e){return e===void 0||e===1}function wh({scale:e,scaleX:t,scaleY:n}){return!cf(e)||!cf(t)||!cf(n)}function os(e){return wh(e)||Ib(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ib(e){return Tv(e.x)||Tv(e.y)}function Tv(e){return e&&e!=="0%"}function Hu(e,t,n){const r=e-n,o=t*r;return n+o}function _v(e,t,n,r,o){return o!==void 0&&(e=Hu(e,o,r)),Hu(e,n,r)+t}function bh(e,t=0,n=1,r,o){e.min=_v(e.min,t,n,r,o),e.max=_v(e.max,t,n,r,o)}function Tb(e,{x:t,y:n}){bh(e.x,t.translate,t.scale,t.originPoint),bh(e.y,n.translate,n.scale,n.originPoint)}const Pv=.999999999999,Av=1.0000000000001;function eR(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let a,l;for(let c=0;c<o;c++){a=n[c],l=a.projectionDelta;const{visualElement:d}=a.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&ro(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,Tb(e,l)),r&&os(a.latestValues)&&ro(e,a.latestValues))}t.x<Av&&t.x>Pv&&(t.x=1),t.y<Av&&t.y>Pv&&(t.y=1)}function no(e,t){e.min=e.min+t,e.max=e.max+t}function Rv(e,t,n,r,o=.5){const a=ft(e.min,e.max,o);bh(e,t,n,a,r)}function ro(e,t){Rv(e.x,t.x,t.scaleX,t.scale,t.originX),Rv(e.y,t.y,t.scaleY,t.scale,t.originY)}function _b(e,t){return Cb(ZA(e.getBoundingClientRect(),t))}function tR(e,t,n){const r=_b(e,n),{scroll:o}=t;return o&&(no(r.x,o.offset.x),no(r.y,o.offset.y)),r}const Nv=()=>({translate:0,scale:1,origin:0,originPoint:0}),io=()=>({x:Nv(),y:Nv()}),jv=()=>({min:0,max:0}),It=()=>({x:jv(),y:jv()}),Sh={current:null},Pb={current:!1};function nR(){if(Pb.current=!0,!!tp)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Sh.current=e.matches;e.addEventListener("change",t),t()}else Sh.current=!1}const rR=new WeakMap;function iR(e,t,n){for(const r in t){const o=t[r],a=n[r];if(Wt(o))e.addValue(r,o);else if(Wt(a))e.addValue(r,co(o,{owner:e}));else if(a!==o)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(o):l.hasAnimated||l.set(o)}else{const l=e.getStaticValue(r);e.addValue(r,co(l!==void 0?l:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Mv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class sR{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:a,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=vp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=fn.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,at.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=lc(n),this.isVariantNode=pb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in m){const v=m[y];d[y]!==void 0&&Wt(v)&&v.set(d[y])}}mount(t){var n;this.current=t,rR.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,o)=>this.bindToMotionValue(o,r)),Pb.current||nR(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Sh.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Pi(this.notifyUpdate),Pi(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=xo.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&at.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in fo){const n=fo[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):It()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Mv.length;r++){const o=Mv[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const a="on"+o,l=t[a];l&&(this.propEventSubscriptions[o]=this.on(o,l))}this.prevMotionValues=iR(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=co(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(ww(r)||Sw(r))?r=parseFloat(r):!hA(r)&&Ai.test(n)&&(r=rb(t,n)),this.setBaseTarget(t,Wt(r)?r.get():r)),Wt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let o;if(typeof r=="string"||typeof r=="object"){const l=Pp(this.props,r,(n=this.presenceContext)==null?void 0:n.custom);l&&(o=l[t])}if(r&&o!==void 0)return o;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Wt(a)?a:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new op),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){bp.render(this.render)}}class Ab extends sR{constructor(){super(...arguments),this.KeyframeResolver=tA}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Wt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rb(e,{style:t,vars:n},r,o){const a=e.style;let l;for(l in t)a[l]=t[l];o==null||o.applyProjectionStyles(a,r);for(l in n)a.setProperty(l,n[l])}function oR(e){return window.getComputedStyle(e)}class aR extends Ab{constructor(){super(...arguments),this.type="html",this.renderInstance=Rb}readValueFromInstance(t,n){var r;if(xo.has(n))return(r=this.projection)!=null&&r.isProjecting?hh(n):wP(t,n);{const o=oR(t),a=(up(n)?o.getPropertyValue(n):o[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _b(t,n)}build(t,n,r){Ip(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ap(t,n,r)}}const Nb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function lR(e,t,n,r){Rb(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Nb.has(o)?o:Rp(o),t.attrs[o])}class uR extends Ab{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=It}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(xo.has(n)){const r=nb(n);return r&&r.default||0}return n=Nb.has(n)?n:Rp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return bb(t,n,r)}build(t,n,r){yb(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){lR(t,n,r,o)}mount(t){this.isSVGTag=xb(t.tagName),super.mount(t)}}const cR=(e,t)=>_p(e)?new uR(t):new aR(t,{allowProjection:e!==I.Fragment});function so(e,t,n){const r=e.getProps();return Pp(r,t,n!==void 0?n:r.custom,e)}const kh=e=>Array.isArray(e);function dR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,co(n))}function fR(e){return kh(e)?e[e.length-1]||0:e}function hR(e,t){const n=so(e,t);let{transitionEnd:r={},transition:o={},...a}=n||{};a={...a,...r};for(const l in a){const c=fR(a[l]);dR(e,l,c)}}function pR(e){return!!(Wt(e)&&e.add)}function Eh(e,t){const n=e.getValue("willChange");if(pR(n))return n.add(t);if(!n&&Gr.WillChange){const r=new Gr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function jb(e){return e.props[Sb]}const mR=e=>e!==null;function gR(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(mR),a=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[a]}const yR={type:"spring",stiffness:500,damping:25,restSpeed:10},vR=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xR={type:"keyframes",duration:.8},wR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bR=(e,{keyframes:t})=>t.length>2?xR:xo.has(e)?e.startsWith("scale")?vR(t[1]):yR:wR;function SR({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:a,repeatType:l,repeatDelay:c,from:d,elapsed:f,...p}){return!!Object.keys(p).length}const Np=(e,t,n,r={},o,a)=>l=>{const c=xp(r,e)||{},d=c.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Er(d);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-f,onUpdate:y=>{t.set(y),c.onUpdate&&c.onUpdate(y)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:a?void 0:o};SR(c)||Object.assign(p,bR(e,p)),p.duration&&(p.duration=Er(p.duration)),p.repeatDelay&&(p.repeatDelay=Er(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let m=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(vh(p),p.delay===0&&(m=!0)),(Gr.instantAnimations||Gr.skipAnimations)&&(m=!0,vh(p),p.delay=0),p.allowFlatten=!c.type&&!c.ease,m&&!a&&t.get()!==void 0){const y=gR(p.keyframes,c);if(y!==void 0){at.update(()=>{p.onUpdate(y),p.onComplete()});return}}return c.isSync?new yp(p):new UP(p)};function kR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Mb(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:l,...c}=t;r&&(a=r);const d=[],f=o&&e.animationState&&e.animationState.getState()[o];for(const p in c){const m=e.getValue(p,e.latestValues[p]??null),y=c[p];if(y===void 0||f&&kR(f,p))continue;const v={delay:n,...xp(a||{},p)},b=m.get();if(b!==void 0&&!m.isAnimating&&!Array.isArray(y)&&y===b&&!v.velocity)continue;let S=!1;if(window.MotionHandoffAnimation){const E=jb(e);if(E){const P=window.MotionHandoffAnimation(E,p,at);P!==null&&(v.startTime=P,S=!0)}}Eh(e,p),m.start(Np(p,m,y,e.shouldReduceMotion&&Zw.has(p)?{type:!1}:v,e,S));const C=m.animation;C&&d.push(C)}return l&&Promise.all(d).then(()=>{at.update(()=>{l&&hR(e,l)})}),d}function Db(e,t,n,r=0,o=1){const a=Array.from(e).sort((f,p)=>f.sortNodePosition(p)).indexOf(t),l=e.size,c=(l-1)*r;return typeof n=="function"?n(a,l):o===1?a*r:c-a*r}function Ch(e,t,n={}){var r;const o=so(e,t,n.type==="exit"?(r=e.presenceContext)==null?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(a=n.transitionOverride);const l=o?()=>Promise.all(Mb(e,o,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:p=0,staggerChildren:m,staggerDirection:y}=a;return ER(e,t,f,p,m,y,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[f,p]=d==="beforeChildren"?[l,c]:[c,l];return f().then(()=>p())}else return Promise.all([l(),c(n.delay)])}function ER(e,t,n=0,r=0,o=0,a=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(Ch(d,t,{...l,delay:n+(typeof r=="function"?0:r)+Db(e.variantChildren,d,r,o,a)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function CR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(a=>Ch(e,a,n));r=Promise.all(o)}else if(typeof t=="string")r=Ch(e,t,n);else{const o=typeof t=="function"?so(e,t,n.custom):t;r=Promise.all(Mb(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Lb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const IR=Cp.length;function zb(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zb(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<IR;n++){const r=Cp[n],o=e.props[r];(Oa(o)||o===!1)&&(t[r]=o)}return t}const TR=[...Ep].reverse(),_R=Ep.length;function PR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>CR(e,n,r)))}function AR(e){let t=PR(e),n=Dv(),r=!0;const o=d=>(f,p)=>{var m;const y=so(e,p,d==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(y){const{transition:v,transitionEnd:b,...S}=y;f={...f,...S,...b}}return f};function a(d){t=d(e)}function l(d){const{props:f}=e,p=zb(e.parent)||{},m=[],y=new Set;let v={},b=1/0;for(let C=0;C<_R;C++){const E=TR[C],P=n[E],T=f[E]!==void 0?f[E]:p[E],O=Oa(T),V=E===d?P.isActive:null;V===!1&&(b=C);let N=T===p[E]&&T!==f[E]&&O;if(N&&r&&e.manuallyAnimateOnMount&&(N=!1),P.protectedKeys={...v},!P.isActive&&V===null||!T&&!P.prevProp||ac(T)||typeof T=="boolean")continue;const D=RR(P.prevProp,T);let H=D||E===d&&P.isActive&&!N&&O||C>b&&O,ee=!1;const L=Array.isArray(T)?T:[T];let te=L.reduce(o(E),{});V===!1&&(te={});const{prevResolvedValues:G={}}=P,X={...G,...te},Q=oe=>{H=!0,y.has(oe)&&(ee=!0,y.delete(oe)),P.needsAnimating[oe]=!0;const U=e.getValue(oe);U&&(U.liveStyle=!1)};for(const oe in X){const U=te[oe],se=G[oe];if(v.hasOwnProperty(oe))continue;let _=!1;kh(U)&&kh(se)?_=!Lb(U,se):_=U!==se,_?U!=null?Q(oe):y.add(oe):U!==void 0&&y.has(oe)?Q(oe):P.protectedKeys[oe]=!0}P.prevProp=T,P.prevResolvedValues=te,P.isActive&&(v={...v,...te}),r&&e.blockInitialAnimation&&(H=!1);const re=N&&D;H&&(!re||ee)&&m.push(...L.map(oe=>{const U={type:E};if(typeof oe=="string"&&r&&!re&&e.manuallyAnimateOnMount&&e.parent){const{parent:se}=e,_=so(se,oe);if(se.enteringChildren&&_){const{delayChildren:j}=_.transition||{};U.delay=Db(se.enteringChildren,e,j)}}return{animation:oe,options:U}}))}if(y.size){const C={};if(typeof f.initial!="boolean"){const E=so(e,Array.isArray(f.initial)?f.initial[0]:f.initial);E&&E.transition&&(C.transition=E.transition)}y.forEach(E=>{const P=e.getBaseTarget(E),T=e.getValue(E);T&&(T.liveStyle=!0),C[E]=P??null}),m.push({animation:C})}let S=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,S?t(m):Promise.resolve()}function c(d,f){var p;if(n[d].isActive===f)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(y=>{var v;return(v=y.animationState)==null?void 0:v.setActive(d,f)}),n[d].isActive=f;const m=l(d);for(const y in n)n[y].protectedKeys={};return m}return{animateChanges:l,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Dv()}}}function RR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Lb(t,e):!1}function ns(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dv(){return{animate:ns(!0),whileInView:ns(),whileHover:ns(),whileTap:ns(),whileDrag:ns(),whileFocus:ns(),exit:ns()}}class Ni{constructor(t){this.isMounted=!1,this.node=t}update(){}}class NR extends Ni{constructor(t){super(t),t.animationState||(t.animationState=AR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ac(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let jR=0;class MR extends Ni{constructor(){super(...arguments),this.id=jR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const DR={animation:{Feature:NR},exit:{Feature:MR}};function Va(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Xa(e){return{point:{x:e.pageX,y:e.pageY}}}const LR=e=>t=>Sp(t)&&e(t,Xa(t));function Ia(e,t,n,r){return Va(e,t,LR(n),r)}const Ob=1e-4,zR=1-Ob,OR=1+Ob,Fb=.01,FR=0-Fb,VR=0+Fb;function en(e){return e.max-e.min}function BR(e,t,n){return Math.abs(e-t)<=n}function Lv(e,t,n,r=.5){e.origin=r,e.originPoint=ft(t.min,t.max,e.origin),e.scale=en(n)/en(t),e.translate=ft(n.min,n.max,e.origin)-e.originPoint,(e.scale>=zR&&e.scale<=OR||isNaN(e.scale))&&(e.scale=1),(e.translate>=FR&&e.translate<=VR||isNaN(e.translate))&&(e.translate=0)}function Ta(e,t,n,r){Lv(e.x,t.x,n.x,r?r.originX:void 0),Lv(e.y,t.y,n.y,r?r.originY:void 0)}function zv(e,t,n){e.min=n.min+t.min,e.max=e.min+en(t)}function $R(e,t,n){zv(e.x,t.x,n.x),zv(e.y,t.y,n.y)}function Ov(e,t,n){e.min=t.min-n.min,e.max=e.min+en(t)}function Wu(e,t,n){Ov(e.x,t.x,n.x),Ov(e.y,t.y,n.y)}function Vn(e){return[e("x"),e("y")]}const Vb=({current:e})=>e?e.ownerDocument.defaultView:null,Fv=(e,t)=>Math.abs(e-t);function UR(e,t){const n=Fv(e.x,t.x),r=Fv(e.y,t.y);return Math.sqrt(n**2+r**2)}class Bb{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:a=!1,distanceThreshold:l=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ff(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,b=UR(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!b)return;const{point:S}=y,{timestamp:C}=Lt;this.history.push({...S,timestamp:C});const{onStart:E,onMove:P}=this.handlers;v||(E&&E(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,y)},this.handlePointerMove=(y,v)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=df(v,this.transformPagePoint),at.update(this.updatePoint,!0)},this.handlePointerUp=(y,v)=>{this.end();const{onEnd:b,onSessionEnd:S,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=ff(y.type==="pointercancel"?this.lastMoveEventInfo:df(v,this.transformPagePoint),this.history);this.startEvent&&b&&b(y,E),S&&S(y,E)},!Sp(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=o||window;const c=Xa(t),d=df(c,this.transformPagePoint),{point:f}=d,{timestamp:p}=Lt;this.history=[{...f,timestamp:p}];const{onSessionStart:m}=n;m&&m(t,ff(d,this.history)),this.removeListeners=Ga(Ia(this.contextWindow,"pointermove",this.handlePointerMove),Ia(this.contextWindow,"pointerup",this.handlePointerUp),Ia(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Pi(this.updatePoint)}}function df(e,t){return t?{point:t(e.point)}:e}function Vv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ff({point:e},t){return{point:e,delta:Vv(e,$b(t)),offset:Vv(e,HR(t)),velocity:WR(t,.1)}}function HR(e){return e[0]}function $b(e){return e[e.length-1]}function WR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=$b(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Er(t)));)n--;if(!r)return{x:0,y:0};const a=Wn(o.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const l={x:(o.x-r.x)/a,y:(o.y-r.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function qR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ft(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ft(n,e,r.max):Math.min(e,n)),e}function Bv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function GR(e,{top:t,left:n,bottom:r,right:o}){return{x:Bv(e.x,n,o),y:Bv(e.y,t,r)}}function $v(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function KR(e,t){return{x:$v(e.x,t.x),y:$v(e.y,t.y)}}function YR(e,t){let n=.5;const r=en(e),o=en(t);return o>r?n=Da(t.min,t.max-r,e.min):r>o&&(n=Da(e.min,e.max-o,t.min)),qr(0,1,n)}function XR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ih=.35;function QR(e=Ih){return e===!1?e=0:e===!0&&(e=Ih),{x:Uv(e,"left","right"),y:Uv(e,"top","bottom")}}function Uv(e,t,n){return{min:Hv(e,t),max:Hv(e,n)}}function Hv(e,t){return typeof e=="number"?e:e[t]||0}const JR=new WeakMap;class ZR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=It(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const a=m=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Xa(m).point)},l=(m,y)=>{const{drag:v,dragPropagation:b,onDragStart:S}=this.getProps();if(v&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sA(v),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vn(E=>{let P=this.getAxisMotionValue(E).get()||0;if(Cr.test(P)){const{projection:T}=this.visualElement;if(T&&T.layout){const O=T.layout.layoutBox[E];O&&(P=en(O)*(parseFloat(P)/100))}}this.originPoint[E]=P}),S&&at.postRender(()=>S(m,y)),Eh(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},c=(m,y)=>{this.latestPointerEvent=m,this.latestPanInfo=y;const{dragPropagation:v,dragDirectionLock:b,onDirectionLock:S,onDrag:C}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:E}=y;if(b&&this.currentDirection===null){this.currentDirection=eN(E),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",y.point,E),this.updateAxis("y",y.point,E),this.visualElement.render(),C&&C(m,y)},d=(m,y)=>{this.latestPointerEvent=m,this.latestPanInfo=y,this.stop(m,y),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>Vn(m=>{var y;return this.getAnimationState(m)==="paused"&&((y=this.getAxisMotionValue(m).animation)==null?void 0:y.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new Bb(t,{onSessionStart:a,onStart:l,onMove:c,onSessionEnd:d,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:r,contextWindow:Vb(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!o||!r)return;const{velocity:l}=o;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&at.postRender(()=>c(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!wu(t,o,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=qR(l,this.constraints[t],this.elastic[t])),a.set(l)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)==null?void 0:t.layout,a=this.constraints;n&&to(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=GR(o.layoutBox,n):this.constraints=!1,this.elastic=QR(r),a!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Vn(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=XR(o.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!to(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const a=tR(r,o.root,this.visualElement.getTransformPagePoint());let l=KR(o.layout.layoutBox,a);if(n){const c=n(JA(l));this.hasMutatedConstraints=!!c,c&&(l=Cb(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},f=Vn(p=>{if(!wu(p,n,this.currentDirection))return;let m=d&&d[p]||{};l&&(m={min:0,max:0});const y=o?200:1e6,v=o?40:1e7,b={type:"inertia",velocity:r?t[p]:0,bounceStiffness:y,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...a,...m};return this.startAxisValueAnimation(p,b)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Eh(this.visualElement,t),r.start(Np(t,r,0,n,this.visualElement,!1))}stopAnimation(){Vn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Vn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Vn(n=>{const{drag:r}=this.getProps();if(!wu(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,a=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:c}=o.layout.layoutBox[n];a.set(t[n]-ft(l,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!to(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Vn(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const d=c.get();o[l]=YR({min:d,max:d},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Vn(l=>{if(!wu(l,t,null))return;const c=this.getAxisMotionValue(l),{min:d,max:f}=this.constraints[l];c.set(ft(d,f,o[l]))})}addListeners(){if(!this.visualElement.current)return;JR.set(this.visualElement,this);const t=this.visualElement.current,n=Ia(t,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps();f&&p&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();to(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),at.read(r);const l=Va(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Vn(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{l(),n(),a(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:a=!1,dragElastic:l=Ih,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:a,dragElastic:l,dragMomentum:c}}}function wu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function eN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tN extends Ni{constructor(t){super(t),this.removeGroupControls=qn,this.removeListeners=qn,this.controls=new ZR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Wv=e=>(t,n)=>{e&&at.postRender(()=>e(t,n))};class nN extends Ni{constructor(){super(...arguments),this.removePointerDownListener=qn}onPointerDown(t){this.session=new Bb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Vb(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Wv(t),onStart:Wv(n),onMove:r,onEnd:(a,l)=>{delete this.session,o&&at.postRender(()=>o(a,l))}}}mount(){this.removePointerDownListener=Ia(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Du={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function qv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const fa={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=qv(e,t.target.x),r=qv(e,t.target.y);return`${n}% ${r}%`}},rN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ai.parse(e);if(o.length>5)return r;const a=Ai.createTransformer(e),l=typeof o[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;o[0+l]/=c,o[1+l]/=d;const f=ft(c,d,.5);return typeof o[2+l]=="number"&&(o[2+l]/=f),typeof o[3+l]=="number"&&(o[3+l]/=f),a(o)}};let hf=!1;class iN extends I.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:a}=t;IA(sN),a&&(n.group&&n.group.add(a),r&&r.register&&o&&r.register(a),hf&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Du.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:a}=this.props,{projection:l}=r;return l&&(l.isPresent=a,hf=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==a?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||at.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),bp.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;hf=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ub(e){const[t,n]=cb(),r=I.useContext(Zh);return w.jsx(iN,{...e,layoutGroup:r,switchLayoutGroup:I.useContext(kb),isPresent:t,safeToRemove:n})}const sN={borderRadius:{...fa,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fa,borderTopRightRadius:fa,borderBottomLeftRadius:fa,borderBottomRightRadius:fa,boxShadow:rN};function oN(e,t,n){const r=Wt(e)?e:co(e);return r.start(Np("",r,t,n)),r.animation}const aN=(e,t)=>e.depth-t.depth;class lN{constructor(){this.children=[],this.isDirty=!1}add(t){np(this.children,t),this.isDirty=!0}remove(t){rp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(aN),this.isDirty=!1,this.children.forEach(t)}}function uN(e,t){const n=fn.now(),r=({timestamp:o})=>{const a=o-n;a>=t&&(Pi(r),e(a-t))};return at.setup(r,!0),()=>Pi(r)}const Hb=["TopLeft","TopRight","BottomLeft","BottomRight"],cN=Hb.length,Gv=e=>typeof e=="string"?parseFloat(e):e,Kv=e=>typeof e=="number"||_e.test(e);function dN(e,t,n,r,o,a){o?(e.opacity=ft(0,n.opacity??1,fN(r)),e.opacityExit=ft(t.opacity??1,0,hN(r))):a&&(e.opacity=ft(t.opacity??1,n.opacity??1,r));for(let l=0;l<cN;l++){const c=`border${Hb[l]}Radius`;let d=Yv(t,c),f=Yv(n,c);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||Kv(d)===Kv(f)?(e[c]=Math.max(ft(Gv(d),Gv(f),r),0),(Cr.test(f)||Cr.test(d))&&(e[c]+="%")):e[c]=f}(t.rotate||n.rotate)&&(e.rotate=ft(t.rotate||0,n.rotate||0,r))}function Yv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const fN=Wb(0,.5,Aw),hN=Wb(.5,.95,qn);function Wb(e,t,n){return r=>r<e?0:r>t?1:n(Da(e,t,r))}function Xv(e,t){e.min=t.min,e.max=t.max}function or(e,t){Xv(e.x,t.x),Xv(e.y,t.y)}function Qv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Jv(e,t,n,r,o){return e-=t,e=Hu(e,1/n,r),o!==void 0&&(e=Hu(e,1/o,r)),e}function pN(e,t=0,n=1,r=.5,o,a=e,l=e){if(Cr.test(t)&&(t=parseFloat(t),t=ft(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=ft(a.min,a.max,r);e===a&&(c-=t),e.min=Jv(e.min,t,n,c,o),e.max=Jv(e.max,t,n,c,o)}function Zv(e,t,[n,r,o],a,l){pN(e,t[n],t[r],t[o],t.scale,a,l)}const mN=["x","scaleX","originX"],gN=["y","scaleY","originY"];function e0(e,t,n,r){Zv(e.x,t,mN,n?n.x:void 0,r?r.x:void 0),Zv(e.y,t,gN,n?n.y:void 0,r?r.y:void 0)}function t0(e){return e.translate===0&&e.scale===1}function qb(e){return t0(e.x)&&t0(e.y)}function n0(e,t){return e.min===t.min&&e.max===t.max}function yN(e,t){return n0(e.x,t.x)&&n0(e.y,t.y)}function r0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gb(e,t){return r0(e.x,t.x)&&r0(e.y,t.y)}function i0(e){return en(e.x)/en(e.y)}function s0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class vN{constructor(){this.members=[]}add(t){np(this.members,t),t.scheduleRender()}remove(t){if(rp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const a=this.members[o];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function xN(e,t,n){let r="";const o=e.x.translate/t.x,a=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((o||a||l)&&(r=`translate3d(${o}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:p,rotateX:m,rotateY:y,skewX:v,skewY:b}=n;f&&(r=`perspective(${f}px) ${r}`),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),y&&(r+=`rotateY(${y}deg) `),v&&(r+=`skewX(${v}deg) `),b&&(r+=`skewY(${b}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(r+=`scale(${c}, ${d})`),r||"none"}const pf=["","X","Y","Z"],wN=1e3;let bN=0;function mf(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Kb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=jb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",at,!(o||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Kb(r)}function Yb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(l={},c=t==null?void 0:t()){this.id=bN++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(EN),this.nodes.forEach(_N),this.nodes.forEach(PN),this.nodes.forEach(CN)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new lN)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new op),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const d=this.eventHandlers.get(l);d&&d.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=ub(l)&&!dA(l),this.instance=l;const{layoutId:c,layout:d,visualElement:f}=this.options;if(f&&!f.current&&f.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let p,m=0;const y=()=>this.root.updateBlockedByResize=!1;at.read(()=>{m=window.innerWidth}),e(l,()=>{const v=window.innerWidth;v!==m&&(m=v,this.root.updateBlockedByResize=!0,p&&p(),p=uN(y,250),Du.hasAnimatedSinceResize&&(Du.hasAnimatedSinceResize=!1,this.nodes.forEach(l0)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:m,hasRelativeLayoutChanged:y,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||f.getDefaultTransition()||MN,{onLayoutAnimationStart:S,onLayoutAnimationComplete:C}=f.getProps(),E=!this.targetLayout||!Gb(this.targetLayout,v),P=!m&&y;if(this.options.layoutRoot||this.resumeFrom||P||m&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...xp(b,"layout"),onPlay:S,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(p,P)}else m||l0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Pi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(AN),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Kb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const m=this.path[p];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(o0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(a0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(TN),this.nodes.forEach(SN),this.nodes.forEach(kN)):this.nodes.forEach(a0),this.clearAllSnapshots();const c=fn.now();Lt.delta=qr(0,1e3/60,c-Lt.timestamp),Lt.timestamp=c,Lt.isProcessing=!0,nf.update.process(Lt),nf.preRender.process(Lt),nf.render.process(Lt),Lt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bp.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(IN),this.sharedNodes.forEach(RN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,at.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){at.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!en(this.snapshot.measuredBox.x)&&!en(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=It(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!o)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!qb(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,p=f!==this.prevTransformTemplateValue;l&&this.instance&&(c||os(this.latestValues)||p)&&(o(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),DN(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:c}=this.options;if(!c)return It();const d=c.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(LN))){const{scroll:p}=this.root;p&&(no(d.x,p.offset.x),no(d.y,p.offset.y))}return d}removeElementScroll(l){var c;const d=It();if(or(d,l),(c=this.scroll)!=null&&c.wasRoot)return d;for(let f=0;f<this.path.length;f++){const p=this.path[f],{scroll:m,options:y}=p;p!==this.root&&m&&y.layoutScroll&&(m.wasRoot&&or(d,l),no(d.x,m.offset.x),no(d.y,m.offset.y))}return d}applyTransform(l,c=!1){const d=It();or(d,l);for(let f=0;f<this.path.length;f++){const p=this.path[f];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&ro(d,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),os(p.latestValues)&&ro(d,p.latestValues)}return os(this.latestValues)&&ro(d,this.latestValues),d}removeTransform(l){const c=It();or(c,l);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!f.instance||!os(f.latestValues))continue;wh(f.latestValues)&&f.updateSnapshot();const p=It(),m=f.measurePageBox();or(p,m),e0(c,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,p)}return os(this.latestValues)&&e0(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Lt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var c;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==d;if(!(l||f&&this.isSharedProjectionDirty||this.isProjectionDirty||(c=this.parent)!=null&&c.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:y}=this.options;if(!this.layout||!(m||y))return;this.resolvedRelativeTargetAt=Lt.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=It(),this.targetWithTransforms=It()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$R(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):or(this.target,this.layout.layoutBox),Tb(this.target,this.targetDelta)):or(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||wh(this.parent.latestValues)||Ib(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,d){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=It(),this.relativeTargetOrigin=It(),Wu(this.relativeTargetOrigin,c,d),or(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var l;const c=this.getLead(),d=!!this.resumingFrom||this!==c;let f=!0;if((this.isProjectionDirty||(l=this.parent)!=null&&l.isProjectionDirty)&&(f=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===Lt.timestamp&&(f=!1),f)return;const{layout:p,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||m))return;or(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,v=this.treeScale.y;eR(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=It());const{target:b}=c;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Qv(this.prevProjectionDelta.x,this.projectionDelta.x),Qv(this.prevProjectionDelta.y,this.projectionDelta.y)),Ta(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==v||!s0(this.projectionDelta.x,this.prevProjectionDelta.x)||!s0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=io(),this.projectionDelta=io(),this.projectionDeltaWithTransform=io()}setAnimationOrigin(l,c=!1){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},m=io();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const y=It(),v=d?d.source:void 0,b=this.layout?this.layout.source:void 0,S=v!==b,C=this.getStack(),E=!C||C.members.length<=1,P=!!(S&&!E&&this.options.crossfade===!0&&!this.path.some(jN));this.animationProgress=0;let T;this.mixTargetDelta=O=>{const V=O/1e3;u0(m.x,l.x,V),u0(m.y,l.y,V),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Wu(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),NN(this.relativeTarget,this.relativeTargetOrigin,y,V),T&&yN(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=It()),or(T,this.relativeTarget)),S&&(this.animationValues=p,dN(p,f,this.latestValues,V,P,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var c,d,f;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(f=(d=this.resumingFrom)==null?void 0:d.currentAnimation)==null||f.stop(),this.pendingAnimation&&(Pi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{Du.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=co(0)),this.currentAnimation=oN(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),l.onUpdate&&l.onUpdate(p)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(wN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:f,latestValues:p}=l;if(!(!c||!d||!f)){if(this!==l&&this.layout&&f&&Xb(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||It();const m=en(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+m;const y=en(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+y}or(c,d),ro(c,p),Ta(this.projectionDeltaWithTransform,this.layoutCorrected,c,p)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new vN),this.sharedNodes.get(l).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:c}=this.options;return c?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:c}=this.options;return c?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const f={};d.z&&mf("z",l,f,this.animationValues);for(let p=0;p<pf.length;p++)mf(`rotate${pf[p]}`,l,f,this.animationValues),mf(`skew${pf[p]}`,l,f,this.animationValues);l.render();for(const p in f)l.setStaticValue(p,f[p]),this.animationValues&&(this.animationValues[p]=f[p]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Mu(c==null?void 0:c.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Mu(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!os(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const p=f.animationValues||f.latestValues;this.applyTransformsToTarget();let m=xN(this.projectionDeltaWithTransform,this.treeScale,p);d&&(m=d(p,m)),l.transform=m;const{x:y,y:v}=this.projectionDelta;l.transformOrigin=`${y.origin*100}% ${v.origin*100}% 0`,f.animationValues?l.opacity=f===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:l.opacity=f===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const b in Fa){if(p[b]===void 0)continue;const{correct:S,applyTo:C,isCSSVariable:E}=Fa[b],P=m==="none"?p[b]:S(p[b],f);if(C){const T=C.length;for(let O=0;O<T;O++)l[C[O]]=P}else E?this.options.visualElement.renderState.vars[b]=P:l[b]=P}this.options.layoutId&&(l.pointerEvents=f===this?Mu(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var c;return(c=l.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(o0),this.root.sharedNodes.clear()}}}function SN(e){e.updateLayout()}function kN(e){var t;const n=((t=e.resumeFrom)==null?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:a}=e.options,l=n.source!==e.layout.source;a==="size"?Vn(m=>{const y=l?n.measuredBox[m]:n.layoutBox[m],v=en(y);y.min=r[m].min,y.max=y.min+v}):Xb(a,n.layoutBox,r)&&Vn(m=>{const y=l?n.measuredBox[m]:n.layoutBox[m],v=en(r[m]);y.max=y.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+v)});const c=io();Ta(c,r,n.layoutBox);const d=io();l?Ta(d,e.applyTransform(o,!0),n.measuredBox):Ta(d,r,n.layoutBox);const f=!qb(c);let p=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:y,layout:v}=m;if(y&&v){const b=It();Wu(b,n.layoutBox,y.layoutBox);const S=It();Wu(S,r,v.layoutBox),Gb(b,S)||(p=!0),m.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=b,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:d,layoutDelta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function EN(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function CN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function IN(e){e.clearSnapshot()}function o0(e){e.clearMeasurements()}function a0(e){e.isLayoutDirty=!1}function TN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function l0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _N(e){e.resolveTargetDelta()}function PN(e){e.calcProjection()}function AN(e){e.resetSkewAndRotation()}function RN(e){e.removeLeadSnapshot()}function u0(e,t,n){e.translate=ft(t.translate,0,n),e.scale=ft(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function c0(e,t,n,r){e.min=ft(t.min,n.min,r),e.max=ft(t.max,n.max,r)}function NN(e,t,n,r){c0(e.x,t.x,n.x,r),c0(e.y,t.y,n.y,r)}function jN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const MN={duration:.45,ease:[.4,0,.1,1]},d0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),f0=d0("applewebkit/")&&!d0("chrome/")?Math.round:qn;function h0(e){e.min=f0(e.min),e.max=f0(e.max)}function DN(e){h0(e.x),h0(e.y)}function Xb(e,t,n){return e==="position"||e==="preserve-aspect"&&!BR(i0(t),i0(n),.2)}function LN(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const zN=Yb({attachResizeListener:(e,t)=>Va(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),gf={current:void 0},Qb=Yb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gf.current){const e=new zN({});e.mount(window),e.setOptions({layoutScroll:!0}),gf.current=e}return gf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ON={pan:{Feature:nN},drag:{Feature:tN,ProjectionNode:Qb,MeasureLayout:Ub}};function p0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,a=r[o];a&&at.postRender(()=>a(t,Xa(t)))}class FN extends Ni{mount(){const{current:t}=this.node;t&&(this.unmount=oA(t,(n,r)=>(p0(this.node,r,"Start"),o=>p0(this.node,o,"End"))))}unmount(){}}class VN extends Ni{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ga(Va(this.node.current,"focus",()=>this.onFocus()),Va(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function m0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),a=r[o];a&&at.postRender(()=>a(t,Xa(t)))}class BN extends Ni{mount(){const{current:t}=this.node;t&&(this.unmount=cA(t,(n,r)=>(m0(this.node,r,"Start"),(o,{success:a})=>m0(this.node,o,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Th=new WeakMap,yf=new WeakMap,$N=e=>{const t=Th.get(e.target);t&&t(e)},UN=e=>{e.forEach($N)};function HN({root:e,...t}){const n=e||document;yf.has(n)||yf.set(n,{});const r=yf.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(UN,{root:e,...t})),r[o]}function WN(e,t,n){const r=HN(t);return Th.set(e,n),r.observe(e),()=>{Th.delete(e),r.unobserve(e)}}const qN={some:0,all:1};class GN extends Ni{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:a}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:qN[o]},c=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,a&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),y=f?p:m;y&&y(d)};return WN(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(KN(t,n))&&this.startObserver()}unmount(){}}function KN({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const YN={inView:{Feature:GN},tap:{Feature:BN},focus:{Feature:VN},hover:{Feature:FN}},XN={layout:{ProjectionNode:Qb,MeasureLayout:Ub}},QN={...DR,...YN,...ON,...XN},jp=QA(QN,cR),JN={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0},exit:{opacity:0,x:-20,transition:{duration:.15}}};function ZN(e){const n=Date.now()-e,r=Math.floor(n/6e4),o=Math.floor(n/36e5),a=Math.floor(n/864e5);return r<1?"Just now":r<60?`${r}m ago`:o<24?`${o}h ago`:a<7?`${a}d ago`:new Date(e).toLocaleDateString()}function ej({sessions:e,current:t,agentName:n,onSelect:r,onCreate:o,onDelete:a,className:l=""}){const[c,d]=I.useState(""),f=I.useMemo(()=>{let p=e;if(c.trim()){const m=c.toLowerCase();p=p.filter(y=>{var v,b;return((v=y.title)==null?void 0:v.toLowerCase().includes(m))||((b=y.preview)==null?void 0:b.toLowerCase().includes(m))})}return[...p].sort((m,y)=>y.updatedAt-m.updatedAt)},[e,c]);return w.jsxs("div",{className:`flex flex-col h-full ${l}`,children:[w.jsx("div",{className:"p-3 border-b border-border",children:w.jsxs("div",{className:"flex gap-2",children:[w.jsxs("div",{className:"relative flex-1",children:[w.jsx(vw,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),w.jsx("input",{type:"text",placeholder:"Search sessions...",value:c,onChange:p=>d(p.target.value),className:`w-full pl-8 pr-3 py-1.5 text-sm bg-muted/50 border border-border rounded-md
189
+ `),()=>{C.contains(S)&&C.removeChild(S)}},[t]),w.jsx(gA,{isPresent:t,childRef:a,sizeRef:l,children:I.cloneElement(e,{ref:d})})}const vA=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:a,mode:l,anchorX:c,root:d})=>{const f=ep(xA),p=I.useId();let m=!0,y=I.useMemo(()=>(m=!1,{id:p,initial:t,isPresent:n,custom:o,onExitComplete:v=>{f.set(v,!0);for(const b of f.values())if(!b)return;r&&r()},register:v=>(f.set(v,!1),()=>f.delete(v))}),[n,f,r]);return a&&m&&(y={...y}),I.useMemo(()=>{f.forEach((v,b)=>f.set(b,!1))},[n]),I.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),l==="popLayout"&&(e=w.jsx(yA,{isPresent:n,anchorX:c,root:d,children:e})),w.jsx(sc.Provider,{value:y,children:e})};function xA(){return new Map}function cb(e=!0){const t=I.useContext(sc);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,a=I.useId();I.useEffect(()=>{if(e)return o(a)},[e]);const l=I.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,l]:[!0]}const xu=e=>e.key||"";function kv(e){const t=[];return I.Children.forEach(e,n=>{I.isValidElement(n)&&t.push(n)}),t}const db=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:a="sync",propagate:l=!1,anchorX:c="left",root:d})=>{const[f,p]=cb(l),m=I.useMemo(()=>kv(e),[e]),y=l&&!f?[]:m.map(xu),v=I.useRef(!0),b=I.useRef(m),S=ep(()=>new Map),[C,E]=I.useState(m),[P,T]=I.useState(m);xw(()=>{v.current=!1,b.current=m;for(let N=0;N<P.length;N++){const D=xu(P[N]);y.includes(D)?S.delete(D):S.get(D)!==!0&&S.set(D,!1)}},[P,y.length,y.join("-")]);const O=[];if(m!==C){let N=[...m];for(let D=0;D<P.length;D++){const H=P[D],ee=xu(H);y.includes(ee)||(N.splice(D,0,H),O.push(H))}return a==="wait"&&O.length&&(N=O),T(kv(N)),E(m),null}const{forceRender:V}=I.useContext(Zh);return w.jsx(w.Fragment,{children:P.map(N=>{const D=xu(N),H=l&&!f?!1:m===P||y.includes(D),ee=()=>{if(S.has(D))S.set(D,!0);else return;let L=!0;S.forEach(te=>{te||(L=!1)}),L&&(V==null||V(),T(b.current),l&&(p==null||p()),r&&r())};return w.jsx(vA,{isPresent:H,initial:!v.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:a,root:d,onExitComplete:H?void 0:ee,anchorX:c,children:N},D)})})},fb=I.createContext({strict:!1}),Ev={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},fo={};for(const e in Ev)fo[e]={isEnabled:t=>Ev[e].some(n=>!!t[n])};function wA(e){for(const t in e)fo[t]={...fo[t],...e[t]}}const bA=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Uu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bA.has(e)}let hb=e=>!Uu(e);function SA(e){typeof e=="function"&&(hb=t=>t.startsWith("on")?!Uu(t):e(t))}try{SA(require("@emotion/is-prop-valid").default)}catch{}function kA(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(hb(o)||n===!0&&Uu(o)||!t&&!Uu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const oc=I.createContext({});function ac(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Oa(e){return typeof e=="string"||Array.isArray(e)}const Ep=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cp=["initial",...Ep];function lc(e){return ac(e.animate)||Cp.some(t=>Oa(e[t]))}function pb(e){return!!(lc(e)||e.variants)}function EA(e,t){if(lc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Oa(n)?n:void 0,animate:Oa(r)?r:void 0}}return e.inherit!==!1?t:{}}function CA(e){const{initial:t,animate:n}=EA(e,I.useContext(oc));return I.useMemo(()=>({initial:t,animate:n}),[Cv(t),Cv(n)])}function Cv(e){return Array.isArray(e)?e.join(" "):e}const Fa={};function IA(e){for(const t in e)Fa[t]=e[t],up(t)&&(Fa[t].isCSSVariable=!0)}function mb(e,{layout:t,layoutId:n}){return xo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Fa[e]||e==="opacity")}const TA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_A=vo.length;function PA(e,t,n){let r="",o=!0;for(let a=0;a<_A;a++){const l=vo[a],c=e[l];if(c===void 0)continue;let d=!0;if(typeof c=="number"?d=c===(l.startsWith("scale")?1:0):d=parseFloat(c)===0,!d||n){const f=ib(c,wp[l]);if(!d){o=!1;const p=TA[l]||l;r+=`${p}(${f}) `}n&&(t[l]=f)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Ip(e,t,n){const{style:r,vars:o,transformOrigin:a}=e;let l=!1,c=!1;for(const d in t){const f=t[d];if(xo.has(d)){l=!0;continue}else if(up(d)){o[d]=f;continue}else{const p=ib(f,wp[d]);d.startsWith("origin")?(c=!0,a[d]=p):r[d]=p}}if(t.transform||(l||n?r.transform=PA(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:p=0}=a;r.transformOrigin=`${d} ${f} ${p}`}}const Tp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gb(e,t,n){for(const r in t)!Ht(t[r])&&!mb(r,n)&&(e[r]=t[r])}function AA({transformTemplate:e},t){return I.useMemo(()=>{const n=Tp();return Ip(n,t,e),Object.assign({},n.vars,n.style)},[t])}function RA(e,t){const n=e.style||{},r={};return gb(r,n,e),Object.assign(r,AA(e,t)),r}function NA(e,t){const n={},r=RA(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const jA={offset:"stroke-dashoffset",array:"stroke-dasharray"},MA={offset:"strokeDashoffset",array:"strokeDasharray"};function DA(e,t,n=1,r=0,o=!0){e.pathLength=1;const a=o?jA:MA;e[a.offset]=Pe.transform(-r);const l=Pe.transform(t),c=Pe.transform(n);e[a.array]=`${l} ${c}`}function yb(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,f,p){if(Ip(e,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:y}=e;m.transform&&(y.transform=m.transform,delete m.transform),(y.transform||m.transformOrigin)&&(y.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),y.transform&&(y.transformBox=(p==null?void 0:p.transformBox)??"fill-box",delete m.transformBox),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),o!==void 0&&DA(m,o,a,l,!1)}const vb=()=>({...Tp(),attrs:{}}),xb=e=>typeof e=="string"&&e.toLowerCase()==="svg";function LA(e,t,n,r){const o=I.useMemo(()=>{const a=vb();return yb(a,t,xb(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};gb(a,e.style,e),o.style={...a,...o.style}}return o}const zA=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _p(e){return typeof e!="string"||e.includes("-")?!1:!!(zA.indexOf(e)>-1||/[A-Z]/u.test(e))}function OA(e,t,n,{latestValues:r},o,a=!1){const c=(_p(e)?LA:NA)(t,r,o,e),d=kA(t,typeof e=="string",a),f=e!==I.Fragment?{...d,...c,ref:n}:{},{children:p}=t,m=I.useMemo(()=>Ht(p)?p.get():p,[p]);return I.createElement(e,{...f,children:m})}function Iv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Pp(e,t,n,r){if(typeof t=="function"){const[o,a]=Iv(r);t=t(n!==void 0?n:e.custom,o,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,a]=Iv(r);t=t(n!==void 0?n:e.custom,o,a)}return t}function Mu(e){return Ht(e)?e.get():e}function FA({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:VA(n,r,o,e),renderState:t()}}function VA(e,t,n,r){const o={},a=r(e,{});for(const y in a)o[y]=Mu(a[y]);let{initial:l,animate:c}=e;const d=lc(e),f=pb(e);t&&f&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const m=p?c:l;if(m&&typeof m!="boolean"&&!ac(m)){const y=Array.isArray(m)?m:[m];for(let v=0;v<y.length;v++){const b=Pp(e,y[v]);if(b){const{transitionEnd:S,transition:C,...E}=b;for(const P in E){let T=E[P];if(Array.isArray(T)){const O=p?T.length-1:0;T=T[O]}T!==null&&(o[P]=T)}for(const P in S)o[P]=S[P]}}}return o}const wb=e=>(t,n)=>{const r=I.useContext(oc),o=I.useContext(sc),a=()=>FA(e,t,r,o);return n?a():ep(a)};function Ap(e,t,n){var r;const{style:o}=e,a={};for(const l in o)(Ht(o[l])||t.style&&Ht(t.style[l])||mb(l,e)||((r=n==null?void 0:n.getValue(l))==null?void 0:r.liveStyle)!==void 0)&&(a[l]=o[l]);return a}const BA=wb({scrapeMotionValuesFromProps:Ap,createRenderState:Tp});function bb(e,t,n){const r=Ap(e,t,n);for(const o in e)if(Ht(e[o])||Ht(t[o])){const a=vo.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[a]=e[o]}return r}const $A=wb({scrapeMotionValuesFromProps:bb,createRenderState:vb}),UA=Symbol.for("motionComponentSymbol");function to(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function HA(e,t,n){return I.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):to(n)&&(n.current=r))},[t])}const Rp=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),WA="framerAppearId",Sb="data-"+Rp(WA),kb=I.createContext({});function qA(e,t,n,r,o){var a,l;const{visualElement:c}=I.useContext(oc),d=I.useContext(fb),f=I.useContext(sc),p=I.useContext(kp).reducedMotion,m=I.useRef(null);r=r||d.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:c,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:p}));const y=m.current,v=I.useContext(kb);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&GA(m.current,n,o,v);const b=I.useRef(!1);I.useInsertionEffect(()=>{y&&b.current&&y.update(n,f)});const S=n[Sb],C=I.useRef(!!S&&!((a=window.MotionHandoffIsComplete)!=null&&a.call(window,S))&&((l=window.MotionHasOptimisedAnimation)==null?void 0:l.call(window,S)));return xw(()=>{y&&(b.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),C.current&&y.animationState&&y.animationState.animateChanges())}),I.useEffect(()=>{y&&(!C.current&&y.animationState&&y.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,S)}),C.current=!1),y.enteringChildren=void 0)}),y}function GA(e,t,n,r){const{layoutId:o,layout:a,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:f,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Eb(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!l||c&&to(c),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:d,layoutRoot:f})}function Eb(e){if(e)return e.options.allowProjection!==!1?e.projection:Eb(e.parent)}function uf(e,{forwardMotionProps:t=!1}={},n,r){n&&wA(n);const o=_p(e)?$A:BA;function a(c,d){let f;const p={...I.useContext(kp),...c,layoutId:KA(c)},{isStatic:m}=p,y=CA(c),v=o(c,m);if(!m&&tp){YA();const b=XA(p);f=b.MeasureLayout,y.visualElement=qA(e,v,p,r,b.ProjectionNode)}return w.jsxs(oc.Provider,{value:y,children:[f&&y.visualElement?w.jsx(f,{visualElement:y.visualElement,...p}):null,OA(e,c,HA(v,y.visualElement,d),v,m,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=I.forwardRef(a);return l[UA]=e,l}function KA({layoutId:e}){const t=I.useContext(Zh).id;return t&&e!==void 0?t+"-"+e:e}function YA(e,t){I.useContext(fb).strict}function XA(e){const{drag:t,layout:n}=fo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function QA(e,t){if(typeof Proxy>"u")return uf;const n=new Map,r=(a,l)=>uf(a,l,e,t),o=(a,l)=>r(a,l);return new Proxy(o,{get:(a,l)=>l==="create"?r:(n.has(l)||n.set(l,uf(l,void 0,e,t)),n.get(l))})}function Cb({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function JA({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ZA(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function cf(e){return e===void 0||e===1}function wh({scale:e,scaleX:t,scaleY:n}){return!cf(e)||!cf(t)||!cf(n)}function os(e){return wh(e)||Ib(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ib(e){return Tv(e.x)||Tv(e.y)}function Tv(e){return e&&e!=="0%"}function Hu(e,t,n){const r=e-n,o=t*r;return n+o}function _v(e,t,n,r,o){return o!==void 0&&(e=Hu(e,o,r)),Hu(e,n,r)+t}function bh(e,t=0,n=1,r,o){e.min=_v(e.min,t,n,r,o),e.max=_v(e.max,t,n,r,o)}function Tb(e,{x:t,y:n}){bh(e.x,t.translate,t.scale,t.originPoint),bh(e.y,n.translate,n.scale,n.originPoint)}const Pv=.999999999999,Av=1.0000000000001;function eR(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let a,l;for(let c=0;c<o;c++){a=n[c],l=a.projectionDelta;const{visualElement:d}=a.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&ro(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,Tb(e,l)),r&&os(a.latestValues)&&ro(e,a.latestValues))}t.x<Av&&t.x>Pv&&(t.x=1),t.y<Av&&t.y>Pv&&(t.y=1)}function no(e,t){e.min=e.min+t,e.max=e.max+t}function Rv(e,t,n,r,o=.5){const a=dt(e.min,e.max,o);bh(e,t,n,a,r)}function ro(e,t){Rv(e.x,t.x,t.scaleX,t.scale,t.originX),Rv(e.y,t.y,t.scaleY,t.scale,t.originY)}function _b(e,t){return Cb(ZA(e.getBoundingClientRect(),t))}function tR(e,t,n){const r=_b(e,n),{scroll:o}=t;return o&&(no(r.x,o.offset.x),no(r.y,o.offset.y)),r}const Nv=()=>({translate:0,scale:1,origin:0,originPoint:0}),io=()=>({x:Nv(),y:Nv()}),jv=()=>({min:0,max:0}),Ct=()=>({x:jv(),y:jv()}),Sh={current:null},Pb={current:!1};function nR(){if(Pb.current=!0,!!tp)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Sh.current=e.matches;e.addEventListener("change",t),t()}else Sh.current=!1}const rR=new WeakMap;function iR(e,t,n){for(const r in t){const o=t[r],a=n[r];if(Ht(o))e.addValue(r,o);else if(Ht(a))e.addValue(r,co(o,{owner:e}));else if(a!==o)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(o):l.hasAnimated||l.set(o)}else{const l=e.getStaticValue(r);e.addValue(r,co(l!==void 0?l:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Mv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class sR{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:a,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=vp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=dn.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,ot.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=lc(n),this.isVariantNode=pb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in m){const v=m[y];d[y]!==void 0&&Ht(v)&&v.set(d[y])}}mount(t){var n;this.current=t,rR.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,o)=>this.bindToMotionValue(o,r)),Pb.current||nR(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Sh.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Pi(this.notifyUpdate),Pi(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=xo.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ot.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in fo){const n=fo[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ct()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Mv.length;r++){const o=Mv[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const a="on"+o,l=t[a];l&&(this.propEventSubscriptions[o]=this.on(o,l))}this.prevMotionValues=iR(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=co(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(ww(r)||Sw(r))?r=parseFloat(r):!hA(r)&&Ai.test(n)&&(r=rb(t,n)),this.setBaseTarget(t,Ht(r)?r.get():r)),Ht(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let o;if(typeof r=="string"||typeof r=="object"){const l=Pp(this.props,r,(n=this.presenceContext)==null?void 0:n.custom);l&&(o=l[t])}if(r&&o!==void 0)return o;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Ht(a)?a:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new op),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){bp.render(this.render)}}class Ab extends sR{constructor(){super(...arguments),this.KeyframeResolver=tA}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ht(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rb(e,{style:t,vars:n},r,o){const a=e.style;let l;for(l in t)a[l]=t[l];o==null||o.applyProjectionStyles(a,r);for(l in n)a.setProperty(l,n[l])}function oR(e){return window.getComputedStyle(e)}class aR extends Ab{constructor(){super(...arguments),this.type="html",this.renderInstance=Rb}readValueFromInstance(t,n){var r;if(xo.has(n))return(r=this.projection)!=null&&r.isProjecting?hh(n):wP(t,n);{const o=oR(t),a=(up(n)?o.getPropertyValue(n):o[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _b(t,n)}build(t,n,r){Ip(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ap(t,n,r)}}const Nb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function lR(e,t,n,r){Rb(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Nb.has(o)?o:Rp(o),t.attrs[o])}class uR extends Ab{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ct}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(xo.has(n)){const r=nb(n);return r&&r.default||0}return n=Nb.has(n)?n:Rp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return bb(t,n,r)}build(t,n,r){yb(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){lR(t,n,r,o)}mount(t){this.isSVGTag=xb(t.tagName),super.mount(t)}}const cR=(e,t)=>_p(e)?new uR(t):new aR(t,{allowProjection:e!==I.Fragment});function so(e,t,n){const r=e.getProps();return Pp(r,t,n!==void 0?n:r.custom,e)}const kh=e=>Array.isArray(e);function dR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,co(n))}function fR(e){return kh(e)?e[e.length-1]||0:e}function hR(e,t){const n=so(e,t);let{transitionEnd:r={},transition:o={},...a}=n||{};a={...a,...r};for(const l in a){const c=fR(a[l]);dR(e,l,c)}}function pR(e){return!!(Ht(e)&&e.add)}function Eh(e,t){const n=e.getValue("willChange");if(pR(n))return n.add(t);if(!n&&Gr.WillChange){const r=new Gr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function jb(e){return e.props[Sb]}const mR=e=>e!==null;function gR(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(mR),a=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[a]}const yR={type:"spring",stiffness:500,damping:25,restSpeed:10},vR=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xR={type:"keyframes",duration:.8},wR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bR=(e,{keyframes:t})=>t.length>2?xR:xo.has(e)?e.startsWith("scale")?vR(t[1]):yR:wR;function SR({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:a,repeatType:l,repeatDelay:c,from:d,elapsed:f,...p}){return!!Object.keys(p).length}const Np=(e,t,n,r={},o,a)=>l=>{const c=xp(r,e)||{},d=c.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Er(d);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-f,onUpdate:y=>{t.set(y),c.onUpdate&&c.onUpdate(y)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:a?void 0:o};SR(c)||Object.assign(p,bR(e,p)),p.duration&&(p.duration=Er(p.duration)),p.repeatDelay&&(p.repeatDelay=Er(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let m=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(vh(p),p.delay===0&&(m=!0)),(Gr.instantAnimations||Gr.skipAnimations)&&(m=!0,vh(p),p.delay=0),p.allowFlatten=!c.type&&!c.ease,m&&!a&&t.get()!==void 0){const y=gR(p.keyframes,c);if(y!==void 0){ot.update(()=>{p.onUpdate(y),p.onComplete()});return}}return c.isSync?new yp(p):new UP(p)};function kR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Mb(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:l,...c}=t;r&&(a=r);const d=[],f=o&&e.animationState&&e.animationState.getState()[o];for(const p in c){const m=e.getValue(p,e.latestValues[p]??null),y=c[p];if(y===void 0||f&&kR(f,p))continue;const v={delay:n,...xp(a||{},p)},b=m.get();if(b!==void 0&&!m.isAnimating&&!Array.isArray(y)&&y===b&&!v.velocity)continue;let S=!1;if(window.MotionHandoffAnimation){const E=jb(e);if(E){const P=window.MotionHandoffAnimation(E,p,ot);P!==null&&(v.startTime=P,S=!0)}}Eh(e,p),m.start(Np(p,m,y,e.shouldReduceMotion&&Zw.has(p)?{type:!1}:v,e,S));const C=m.animation;C&&d.push(C)}return l&&Promise.all(d).then(()=>{ot.update(()=>{l&&hR(e,l)})}),d}function Db(e,t,n,r=0,o=1){const a=Array.from(e).sort((f,p)=>f.sortNodePosition(p)).indexOf(t),l=e.size,c=(l-1)*r;return typeof n=="function"?n(a,l):o===1?a*r:c-a*r}function Ch(e,t,n={}){var r;const o=so(e,t,n.type==="exit"?(r=e.presenceContext)==null?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(a=n.transitionOverride);const l=o?()=>Promise.all(Mb(e,o,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:p=0,staggerChildren:m,staggerDirection:y}=a;return ER(e,t,f,p,m,y,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[f,p]=d==="beforeChildren"?[l,c]:[c,l];return f().then(()=>p())}else return Promise.all([l(),c(n.delay)])}function ER(e,t,n=0,r=0,o=0,a=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(Ch(d,t,{...l,delay:n+(typeof r=="function"?0:r)+Db(e.variantChildren,d,r,o,a)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function CR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(a=>Ch(e,a,n));r=Promise.all(o)}else if(typeof t=="string")r=Ch(e,t,n);else{const o=typeof t=="function"?so(e,t,n.custom):t;r=Promise.all(Mb(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Lb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const IR=Cp.length;function zb(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zb(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<IR;n++){const r=Cp[n],o=e.props[r];(Oa(o)||o===!1)&&(t[r]=o)}return t}const TR=[...Ep].reverse(),_R=Ep.length;function PR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>CR(e,n,r)))}function AR(e){let t=PR(e),n=Dv(),r=!0;const o=d=>(f,p)=>{var m;const y=so(e,p,d==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(y){const{transition:v,transitionEnd:b,...S}=y;f={...f,...S,...b}}return f};function a(d){t=d(e)}function l(d){const{props:f}=e,p=zb(e.parent)||{},m=[],y=new Set;let v={},b=1/0;for(let C=0;C<_R;C++){const E=TR[C],P=n[E],T=f[E]!==void 0?f[E]:p[E],O=Oa(T),V=E===d?P.isActive:null;V===!1&&(b=C);let N=T===p[E]&&T!==f[E]&&O;if(N&&r&&e.manuallyAnimateOnMount&&(N=!1),P.protectedKeys={...v},!P.isActive&&V===null||!T&&!P.prevProp||ac(T)||typeof T=="boolean")continue;const D=RR(P.prevProp,T);let H=D||E===d&&P.isActive&&!N&&O||C>b&&O,ee=!1;const L=Array.isArray(T)?T:[T];let te=L.reduce(o(E),{});V===!1&&(te={});const{prevResolvedValues:G={}}=P,X={...G,...te},Q=oe=>{H=!0,y.has(oe)&&(ee=!0,y.delete(oe)),P.needsAnimating[oe]=!0;const U=e.getValue(oe);U&&(U.liveStyle=!1)};for(const oe in X){const U=te[oe],se=G[oe];if(v.hasOwnProperty(oe))continue;let _=!1;kh(U)&&kh(se)?_=!Lb(U,se):_=U!==se,_?U!=null?Q(oe):y.add(oe):U!==void 0&&y.has(oe)?Q(oe):P.protectedKeys[oe]=!0}P.prevProp=T,P.prevResolvedValues=te,P.isActive&&(v={...v,...te}),r&&e.blockInitialAnimation&&(H=!1);const re=N&&D;H&&(!re||ee)&&m.push(...L.map(oe=>{const U={type:E};if(typeof oe=="string"&&r&&!re&&e.manuallyAnimateOnMount&&e.parent){const{parent:se}=e,_=so(se,oe);if(se.enteringChildren&&_){const{delayChildren:j}=_.transition||{};U.delay=Db(se.enteringChildren,e,j)}}return{animation:oe,options:U}}))}if(y.size){const C={};if(typeof f.initial!="boolean"){const E=so(e,Array.isArray(f.initial)?f.initial[0]:f.initial);E&&E.transition&&(C.transition=E.transition)}y.forEach(E=>{const P=e.getBaseTarget(E),T=e.getValue(E);T&&(T.liveStyle=!0),C[E]=P??null}),m.push({animation:C})}let S=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,S?t(m):Promise.resolve()}function c(d,f){var p;if(n[d].isActive===f)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(y=>{var v;return(v=y.animationState)==null?void 0:v.setActive(d,f)}),n[d].isActive=f;const m=l(d);for(const y in n)n[y].protectedKeys={};return m}return{animateChanges:l,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Dv()}}}function RR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Lb(t,e):!1}function ns(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dv(){return{animate:ns(!0),whileInView:ns(),whileHover:ns(),whileTap:ns(),whileDrag:ns(),whileFocus:ns(),exit:ns()}}class Ni{constructor(t){this.isMounted=!1,this.node=t}update(){}}class NR extends Ni{constructor(t){super(t),t.animationState||(t.animationState=AR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ac(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let jR=0;class MR extends Ni{constructor(){super(...arguments),this.id=jR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const DR={animation:{Feature:NR},exit:{Feature:MR}};function Va(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Xa(e){return{point:{x:e.pageX,y:e.pageY}}}const LR=e=>t=>Sp(t)&&e(t,Xa(t));function Ia(e,t,n,r){return Va(e,t,LR(n),r)}const Ob=1e-4,zR=1-Ob,OR=1+Ob,Fb=.01,FR=0-Fb,VR=0+Fb;function Zt(e){return e.max-e.min}function BR(e,t,n){return Math.abs(e-t)<=n}function Lv(e,t,n,r=.5){e.origin=r,e.originPoint=dt(t.min,t.max,e.origin),e.scale=Zt(n)/Zt(t),e.translate=dt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=zR&&e.scale<=OR||isNaN(e.scale))&&(e.scale=1),(e.translate>=FR&&e.translate<=VR||isNaN(e.translate))&&(e.translate=0)}function Ta(e,t,n,r){Lv(e.x,t.x,n.x,r?r.originX:void 0),Lv(e.y,t.y,n.y,r?r.originY:void 0)}function zv(e,t,n){e.min=n.min+t.min,e.max=e.min+Zt(t)}function $R(e,t,n){zv(e.x,t.x,n.x),zv(e.y,t.y,n.y)}function Ov(e,t,n){e.min=t.min-n.min,e.max=e.min+Zt(t)}function Wu(e,t,n){Ov(e.x,t.x,n.x),Ov(e.y,t.y,n.y)}function Vn(e){return[e("x"),e("y")]}const Vb=({current:e})=>e?e.ownerDocument.defaultView:null,Fv=(e,t)=>Math.abs(e-t);function UR(e,t){const n=Fv(e.x,t.x),r=Fv(e.y,t.y);return Math.sqrt(n**2+r**2)}class Bb{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:a=!1,distanceThreshold:l=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ff(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,b=UR(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!b)return;const{point:S}=y,{timestamp:C}=Dt;this.history.push({...S,timestamp:C});const{onStart:E,onMove:P}=this.handlers;v||(E&&E(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,y)},this.handlePointerMove=(y,v)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=df(v,this.transformPagePoint),ot.update(this.updatePoint,!0)},this.handlePointerUp=(y,v)=>{this.end();const{onEnd:b,onSessionEnd:S,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=ff(y.type==="pointercancel"?this.lastMoveEventInfo:df(v,this.transformPagePoint),this.history);this.startEvent&&b&&b(y,E),S&&S(y,E)},!Sp(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=o||window;const c=Xa(t),d=df(c,this.transformPagePoint),{point:f}=d,{timestamp:p}=Dt;this.history=[{...f,timestamp:p}];const{onSessionStart:m}=n;m&&m(t,ff(d,this.history)),this.removeListeners=Ga(Ia(this.contextWindow,"pointermove",this.handlePointerMove),Ia(this.contextWindow,"pointerup",this.handlePointerUp),Ia(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Pi(this.updatePoint)}}function df(e,t){return t?{point:t(e.point)}:e}function Vv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ff({point:e},t){return{point:e,delta:Vv(e,$b(t)),offset:Vv(e,HR(t)),velocity:WR(t,.1)}}function HR(e){return e[0]}function $b(e){return e[e.length-1]}function WR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=$b(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Er(t)));)n--;if(!r)return{x:0,y:0};const a=Wn(o.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const l={x:(o.x-r.x)/a,y:(o.y-r.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function qR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?dt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?dt(n,e,r.max):Math.min(e,n)),e}function Bv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function GR(e,{top:t,left:n,bottom:r,right:o}){return{x:Bv(e.x,n,o),y:Bv(e.y,t,r)}}function $v(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function KR(e,t){return{x:$v(e.x,t.x),y:$v(e.y,t.y)}}function YR(e,t){let n=.5;const r=Zt(e),o=Zt(t);return o>r?n=Da(t.min,t.max-r,e.min):r>o&&(n=Da(e.min,e.max-o,t.min)),qr(0,1,n)}function XR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ih=.35;function QR(e=Ih){return e===!1?e=0:e===!0&&(e=Ih),{x:Uv(e,"left","right"),y:Uv(e,"top","bottom")}}function Uv(e,t,n){return{min:Hv(e,t),max:Hv(e,n)}}function Hv(e,t){return typeof e=="number"?e:e[t]||0}const JR=new WeakMap;class ZR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const a=m=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Xa(m).point)},l=(m,y)=>{const{drag:v,dragPropagation:b,onDragStart:S}=this.getProps();if(v&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sA(v),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vn(E=>{let P=this.getAxisMotionValue(E).get()||0;if(Cr.test(P)){const{projection:T}=this.visualElement;if(T&&T.layout){const O=T.layout.layoutBox[E];O&&(P=Zt(O)*(parseFloat(P)/100))}}this.originPoint[E]=P}),S&&ot.postRender(()=>S(m,y)),Eh(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},c=(m,y)=>{this.latestPointerEvent=m,this.latestPanInfo=y;const{dragPropagation:v,dragDirectionLock:b,onDirectionLock:S,onDrag:C}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:E}=y;if(b&&this.currentDirection===null){this.currentDirection=eN(E),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",y.point,E),this.updateAxis("y",y.point,E),this.visualElement.render(),C&&C(m,y)},d=(m,y)=>{this.latestPointerEvent=m,this.latestPanInfo=y,this.stop(m,y),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>Vn(m=>{var y;return this.getAnimationState(m)==="paused"&&((y=this.getAxisMotionValue(m).animation)==null?void 0:y.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new Bb(t,{onSessionStart:a,onStart:l,onMove:c,onSessionEnd:d,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:r,contextWindow:Vb(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!o||!r)return;const{velocity:l}=o;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&ot.postRender(()=>c(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!wu(t,o,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=qR(l,this.constraints[t],this.elastic[t])),a.set(l)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)==null?void 0:t.layout,a=this.constraints;n&&to(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=GR(o.layoutBox,n):this.constraints=!1,this.elastic=QR(r),a!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Vn(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=XR(o.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!to(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const a=tR(r,o.root,this.visualElement.getTransformPagePoint());let l=KR(o.layout.layoutBox,a);if(n){const c=n(JA(l));this.hasMutatedConstraints=!!c,c&&(l=Cb(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},f=Vn(p=>{if(!wu(p,n,this.currentDirection))return;let m=d&&d[p]||{};l&&(m={min:0,max:0});const y=o?200:1e6,v=o?40:1e7,b={type:"inertia",velocity:r?t[p]:0,bounceStiffness:y,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...a,...m};return this.startAxisValueAnimation(p,b)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Eh(this.visualElement,t),r.start(Np(t,r,0,n,this.visualElement,!1))}stopAnimation(){Vn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Vn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Vn(n=>{const{drag:r}=this.getProps();if(!wu(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,a=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:c}=o.layout.layoutBox[n];a.set(t[n]-dt(l,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!to(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Vn(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const d=c.get();o[l]=YR({min:d,max:d},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Vn(l=>{if(!wu(l,t,null))return;const c=this.getAxisMotionValue(l),{min:d,max:f}=this.constraints[l];c.set(dt(d,f,o[l]))})}addListeners(){if(!this.visualElement.current)return;JR.set(this.visualElement,this);const t=this.visualElement.current,n=Ia(t,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps();f&&p&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();to(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ot.read(r);const l=Va(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Vn(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{l(),n(),a(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:a=!1,dragElastic:l=Ih,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:a,dragElastic:l,dragMomentum:c}}}function wu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function eN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tN extends Ni{constructor(t){super(t),this.removeGroupControls=qn,this.removeListeners=qn,this.controls=new ZR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Wv=e=>(t,n)=>{e&&ot.postRender(()=>e(t,n))};class nN extends Ni{constructor(){super(...arguments),this.removePointerDownListener=qn}onPointerDown(t){this.session=new Bb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Vb(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Wv(t),onStart:Wv(n),onMove:r,onEnd:(a,l)=>{delete this.session,o&&ot.postRender(()=>o(a,l))}}}mount(){this.removePointerDownListener=Ia(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Du={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function qv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const fa={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Pe.test(e))e=parseFloat(e);else return e;const n=qv(e,t.target.x),r=qv(e,t.target.y);return`${n}% ${r}%`}},rN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ai.parse(e);if(o.length>5)return r;const a=Ai.createTransformer(e),l=typeof o[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;o[0+l]/=c,o[1+l]/=d;const f=dt(c,d,.5);return typeof o[2+l]=="number"&&(o[2+l]/=f),typeof o[3+l]=="number"&&(o[3+l]/=f),a(o)}};let hf=!1;class iN extends I.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:a}=t;IA(sN),a&&(n.group&&n.group.add(a),r&&r.register&&o&&r.register(a),hf&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Du.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:a}=this.props,{projection:l}=r;return l&&(l.isPresent=a,hf=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==a?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||ot.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),bp.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;hf=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ub(e){const[t,n]=cb(),r=I.useContext(Zh);return w.jsx(iN,{...e,layoutGroup:r,switchLayoutGroup:I.useContext(kb),isPresent:t,safeToRemove:n})}const sN={borderRadius:{...fa,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fa,borderTopRightRadius:fa,borderBottomLeftRadius:fa,borderBottomRightRadius:fa,boxShadow:rN};function oN(e,t,n){const r=Ht(e)?e:co(e);return r.start(Np("",r,t,n)),r.animation}const aN=(e,t)=>e.depth-t.depth;class lN{constructor(){this.children=[],this.isDirty=!1}add(t){np(this.children,t),this.isDirty=!0}remove(t){rp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(aN),this.isDirty=!1,this.children.forEach(t)}}function uN(e,t){const n=dn.now(),r=({timestamp:o})=>{const a=o-n;a>=t&&(Pi(r),e(a-t))};return ot.setup(r,!0),()=>Pi(r)}const Hb=["TopLeft","TopRight","BottomLeft","BottomRight"],cN=Hb.length,Gv=e=>typeof e=="string"?parseFloat(e):e,Kv=e=>typeof e=="number"||Pe.test(e);function dN(e,t,n,r,o,a){o?(e.opacity=dt(0,n.opacity??1,fN(r)),e.opacityExit=dt(t.opacity??1,0,hN(r))):a&&(e.opacity=dt(t.opacity??1,n.opacity??1,r));for(let l=0;l<cN;l++){const c=`border${Hb[l]}Radius`;let d=Yv(t,c),f=Yv(n,c);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||Kv(d)===Kv(f)?(e[c]=Math.max(dt(Gv(d),Gv(f),r),0),(Cr.test(f)||Cr.test(d))&&(e[c]+="%")):e[c]=f}(t.rotate||n.rotate)&&(e.rotate=dt(t.rotate||0,n.rotate||0,r))}function Yv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const fN=Wb(0,.5,Aw),hN=Wb(.5,.95,qn);function Wb(e,t,n){return r=>r<e?0:r>t?1:n(Da(e,t,r))}function Xv(e,t){e.min=t.min,e.max=t.max}function or(e,t){Xv(e.x,t.x),Xv(e.y,t.y)}function Qv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Jv(e,t,n,r,o){return e-=t,e=Hu(e,1/n,r),o!==void 0&&(e=Hu(e,1/o,r)),e}function pN(e,t=0,n=1,r=.5,o,a=e,l=e){if(Cr.test(t)&&(t=parseFloat(t),t=dt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=dt(a.min,a.max,r);e===a&&(c-=t),e.min=Jv(e.min,t,n,c,o),e.max=Jv(e.max,t,n,c,o)}function Zv(e,t,[n,r,o],a,l){pN(e,t[n],t[r],t[o],t.scale,a,l)}const mN=["x","scaleX","originX"],gN=["y","scaleY","originY"];function e0(e,t,n,r){Zv(e.x,t,mN,n?n.x:void 0,r?r.x:void 0),Zv(e.y,t,gN,n?n.y:void 0,r?r.y:void 0)}function t0(e){return e.translate===0&&e.scale===1}function qb(e){return t0(e.x)&&t0(e.y)}function n0(e,t){return e.min===t.min&&e.max===t.max}function yN(e,t){return n0(e.x,t.x)&&n0(e.y,t.y)}function r0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gb(e,t){return r0(e.x,t.x)&&r0(e.y,t.y)}function i0(e){return Zt(e.x)/Zt(e.y)}function s0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class vN{constructor(){this.members=[]}add(t){np(this.members,t),t.scheduleRender()}remove(t){if(rp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const a=this.members[o];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function xN(e,t,n){let r="";const o=e.x.translate/t.x,a=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((o||a||l)&&(r=`translate3d(${o}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:p,rotateX:m,rotateY:y,skewX:v,skewY:b}=n;f&&(r=`perspective(${f}px) ${r}`),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),y&&(r+=`rotateY(${y}deg) `),v&&(r+=`skewX(${v}deg) `),b&&(r+=`skewY(${b}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(r+=`scale(${c}, ${d})`),r||"none"}const pf=["","X","Y","Z"],wN=1e3;let bN=0;function mf(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Kb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=jb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ot,!(o||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Kb(r)}function Yb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(l={},c=t==null?void 0:t()){this.id=bN++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(EN),this.nodes.forEach(_N),this.nodes.forEach(PN),this.nodes.forEach(CN)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new lN)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new op),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const d=this.eventHandlers.get(l);d&&d.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=ub(l)&&!dA(l),this.instance=l;const{layoutId:c,layout:d,visualElement:f}=this.options;if(f&&!f.current&&f.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let p,m=0;const y=()=>this.root.updateBlockedByResize=!1;ot.read(()=>{m=window.innerWidth}),e(l,()=>{const v=window.innerWidth;v!==m&&(m=v,this.root.updateBlockedByResize=!0,p&&p(),p=uN(y,250),Du.hasAnimatedSinceResize&&(Du.hasAnimatedSinceResize=!1,this.nodes.forEach(l0)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:m,hasRelativeLayoutChanged:y,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||f.getDefaultTransition()||MN,{onLayoutAnimationStart:S,onLayoutAnimationComplete:C}=f.getProps(),E=!this.targetLayout||!Gb(this.targetLayout,v),P=!m&&y;if(this.options.layoutRoot||this.resumeFrom||P||m&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...xp(b,"layout"),onPlay:S,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(p,P)}else m||l0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Pi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(AN),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Kb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const m=this.path[p];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(o0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(a0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(TN),this.nodes.forEach(SN),this.nodes.forEach(kN)):this.nodes.forEach(a0),this.clearAllSnapshots();const c=dn.now();Dt.delta=qr(0,1e3/60,c-Dt.timestamp),Dt.timestamp=c,Dt.isProcessing=!0,nf.update.process(Dt),nf.preRender.process(Dt),nf.render.process(Dt),Dt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bp.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(IN),this.sharedNodes.forEach(RN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ot.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ot.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Zt(this.snapshot.measuredBox.x)&&!Zt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Ct(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!o)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!qb(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,p=f!==this.prevTransformTemplateValue;l&&this.instance&&(c||os(this.latestValues)||p)&&(o(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),DN(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:c}=this.options;if(!c)return Ct();const d=c.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(LN))){const{scroll:p}=this.root;p&&(no(d.x,p.offset.x),no(d.y,p.offset.y))}return d}removeElementScroll(l){var c;const d=Ct();if(or(d,l),(c=this.scroll)!=null&&c.wasRoot)return d;for(let f=0;f<this.path.length;f++){const p=this.path[f],{scroll:m,options:y}=p;p!==this.root&&m&&y.layoutScroll&&(m.wasRoot&&or(d,l),no(d.x,m.offset.x),no(d.y,m.offset.y))}return d}applyTransform(l,c=!1){const d=Ct();or(d,l);for(let f=0;f<this.path.length;f++){const p=this.path[f];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&ro(d,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),os(p.latestValues)&&ro(d,p.latestValues)}return os(this.latestValues)&&ro(d,this.latestValues),d}removeTransform(l){const c=Ct();or(c,l);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!f.instance||!os(f.latestValues))continue;wh(f.latestValues)&&f.updateSnapshot();const p=Ct(),m=f.measurePageBox();or(p,m),e0(c,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,p)}return os(this.latestValues)&&e0(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Dt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var c;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==d;if(!(l||f&&this.isSharedProjectionDirty||this.isProjectionDirty||(c=this.parent)!=null&&c.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:y}=this.options;if(!this.layout||!(m||y))return;this.resolvedRelativeTargetAt=Dt.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ct(),this.targetWithTransforms=Ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$R(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):or(this.target,this.layout.layoutBox),Tb(this.target,this.targetDelta)):or(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||wh(this.parent.latestValues)||Ib(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,d){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ct(),this.relativeTargetOrigin=Ct(),Wu(this.relativeTargetOrigin,c,d),or(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var l;const c=this.getLead(),d=!!this.resumingFrom||this!==c;let f=!0;if((this.isProjectionDirty||(l=this.parent)!=null&&l.isProjectionDirty)&&(f=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===Dt.timestamp&&(f=!1),f)return;const{layout:p,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||m))return;or(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,v=this.treeScale.y;eR(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=Ct());const{target:b}=c;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Qv(this.prevProjectionDelta.x,this.projectionDelta.x),Qv(this.prevProjectionDelta.y,this.projectionDelta.y)),Ta(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==v||!s0(this.projectionDelta.x,this.prevProjectionDelta.x)||!s0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=io(),this.projectionDelta=io(),this.projectionDeltaWithTransform=io()}setAnimationOrigin(l,c=!1){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},m=io();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const y=Ct(),v=d?d.source:void 0,b=this.layout?this.layout.source:void 0,S=v!==b,C=this.getStack(),E=!C||C.members.length<=1,P=!!(S&&!E&&this.options.crossfade===!0&&!this.path.some(jN));this.animationProgress=0;let T;this.mixTargetDelta=O=>{const V=O/1e3;u0(m.x,l.x,V),u0(m.y,l.y,V),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Wu(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),NN(this.relativeTarget,this.relativeTargetOrigin,y,V),T&&yN(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Ct()),or(T,this.relativeTarget)),S&&(this.animationValues=p,dN(p,f,this.latestValues,V,P,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var c,d,f;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(f=(d=this.resumingFrom)==null?void 0:d.currentAnimation)==null||f.stop(),this.pendingAnimation&&(Pi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ot.update(()=>{Du.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=co(0)),this.currentAnimation=oN(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),l.onUpdate&&l.onUpdate(p)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(wN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:f,latestValues:p}=l;if(!(!c||!d||!f)){if(this!==l&&this.layout&&f&&Xb(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||Ct();const m=Zt(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+m;const y=Zt(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+y}or(c,d),ro(c,p),Ta(this.projectionDeltaWithTransform,this.layoutCorrected,c,p)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new vN),this.sharedNodes.get(l).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:c}=this.options;return c?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:c}=this.options;return c?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const f={};d.z&&mf("z",l,f,this.animationValues);for(let p=0;p<pf.length;p++)mf(`rotate${pf[p]}`,l,f,this.animationValues),mf(`skew${pf[p]}`,l,f,this.animationValues);l.render();for(const p in f)l.setStaticValue(p,f[p]),this.animationValues&&(this.animationValues[p]=f[p]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Mu(c==null?void 0:c.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Mu(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!os(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const p=f.animationValues||f.latestValues;this.applyTransformsToTarget();let m=xN(this.projectionDeltaWithTransform,this.treeScale,p);d&&(m=d(p,m)),l.transform=m;const{x:y,y:v}=this.projectionDelta;l.transformOrigin=`${y.origin*100}% ${v.origin*100}% 0`,f.animationValues?l.opacity=f===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:l.opacity=f===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const b in Fa){if(p[b]===void 0)continue;const{correct:S,applyTo:C,isCSSVariable:E}=Fa[b],P=m==="none"?p[b]:S(p[b],f);if(C){const T=C.length;for(let O=0;O<T;O++)l[C[O]]=P}else E?this.options.visualElement.renderState.vars[b]=P:l[b]=P}this.options.layoutId&&(l.pointerEvents=f===this?Mu(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var c;return(c=l.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(o0),this.root.sharedNodes.clear()}}}function SN(e){e.updateLayout()}function kN(e){var t;const n=((t=e.resumeFrom)==null?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:a}=e.options,l=n.source!==e.layout.source;a==="size"?Vn(m=>{const y=l?n.measuredBox[m]:n.layoutBox[m],v=Zt(y);y.min=r[m].min,y.max=y.min+v}):Xb(a,n.layoutBox,r)&&Vn(m=>{const y=l?n.measuredBox[m]:n.layoutBox[m],v=Zt(r[m]);y.max=y.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+v)});const c=io();Ta(c,r,n.layoutBox);const d=io();l?Ta(d,e.applyTransform(o,!0),n.measuredBox):Ta(d,r,n.layoutBox);const f=!qb(c);let p=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:y,layout:v}=m;if(y&&v){const b=Ct();Wu(b,n.layoutBox,y.layoutBox);const S=Ct();Wu(S,r,v.layoutBox),Gb(b,S)||(p=!0),m.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=b,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:d,layoutDelta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function EN(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function CN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function IN(e){e.clearSnapshot()}function o0(e){e.clearMeasurements()}function a0(e){e.isLayoutDirty=!1}function TN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function l0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _N(e){e.resolveTargetDelta()}function PN(e){e.calcProjection()}function AN(e){e.resetSkewAndRotation()}function RN(e){e.removeLeadSnapshot()}function u0(e,t,n){e.translate=dt(t.translate,0,n),e.scale=dt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function c0(e,t,n,r){e.min=dt(t.min,n.min,r),e.max=dt(t.max,n.max,r)}function NN(e,t,n,r){c0(e.x,t.x,n.x,r),c0(e.y,t.y,n.y,r)}function jN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const MN={duration:.45,ease:[.4,0,.1,1]},d0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),f0=d0("applewebkit/")&&!d0("chrome/")?Math.round:qn;function h0(e){e.min=f0(e.min),e.max=f0(e.max)}function DN(e){h0(e.x),h0(e.y)}function Xb(e,t,n){return e==="position"||e==="preserve-aspect"&&!BR(i0(t),i0(n),.2)}function LN(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const zN=Yb({attachResizeListener:(e,t)=>Va(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),gf={current:void 0},Qb=Yb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gf.current){const e=new zN({});e.mount(window),e.setOptions({layoutScroll:!0}),gf.current=e}return gf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ON={pan:{Feature:nN},drag:{Feature:tN,ProjectionNode:Qb,MeasureLayout:Ub}};function p0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,a=r[o];a&&ot.postRender(()=>a(t,Xa(t)))}class FN extends Ni{mount(){const{current:t}=this.node;t&&(this.unmount=oA(t,(n,r)=>(p0(this.node,r,"Start"),o=>p0(this.node,o,"End"))))}unmount(){}}class VN extends Ni{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ga(Va(this.node.current,"focus",()=>this.onFocus()),Va(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function m0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),a=r[o];a&&ot.postRender(()=>a(t,Xa(t)))}class BN extends Ni{mount(){const{current:t}=this.node;t&&(this.unmount=cA(t,(n,r)=>(m0(this.node,r,"Start"),(o,{success:a})=>m0(this.node,o,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Th=new WeakMap,yf=new WeakMap,$N=e=>{const t=Th.get(e.target);t&&t(e)},UN=e=>{e.forEach($N)};function HN({root:e,...t}){const n=e||document;yf.has(n)||yf.set(n,{});const r=yf.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(UN,{root:e,...t})),r[o]}function WN(e,t,n){const r=HN(t);return Th.set(e,n),r.observe(e),()=>{Th.delete(e),r.unobserve(e)}}const qN={some:0,all:1};class GN extends Ni{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:a}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:qN[o]},c=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,a&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),y=f?p:m;y&&y(d)};return WN(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(KN(t,n))&&this.startObserver()}unmount(){}}function KN({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const YN={inView:{Feature:GN},tap:{Feature:BN},focus:{Feature:VN},hover:{Feature:FN}},XN={layout:{ProjectionNode:Qb,MeasureLayout:Ub}},QN={...DR,...YN,...ON,...XN},jp=QA(QN,cR),JN={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0},exit:{opacity:0,x:-20,transition:{duration:.15}}};function ZN(e){const n=Date.now()-e,r=Math.floor(n/6e4),o=Math.floor(n/36e5),a=Math.floor(n/864e5);return r<1?"Just now":r<60?`${r}m ago`:o<24?`${o}h ago`:a<7?`${a}d ago`:new Date(e).toLocaleDateString()}function ej({sessions:e,current:t,agentName:n,onSelect:r,onCreate:o,onDelete:a,className:l=""}){const[c,d]=I.useState(""),f=I.useMemo(()=>{let p=e;if(c.trim()){const m=c.toLowerCase();p=p.filter(y=>{var v,b;return((v=y.title)==null?void 0:v.toLowerCase().includes(m))||((b=y.preview)==null?void 0:b.toLowerCase().includes(m))})}return[...p].sort((m,y)=>y.updatedAt-m.updatedAt)},[e,c]);return w.jsxs("div",{className:`flex flex-col h-full ${l}`,children:[w.jsx("div",{className:"p-3 border-b border-border",children:w.jsxs("div",{className:"flex gap-2",children:[w.jsxs("div",{className:"relative flex-1",children:[w.jsx(vw,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),w.jsx("input",{type:"text",placeholder:"Search sessions...",value:c,onChange:p=>d(p.target.value),className:`w-full pl-8 pr-3 py-1.5 text-sm bg-muted/50 border border-border rounded-md
190
190
  placeholder:text-muted-foreground
191
191
  focus:outline-none focus:ring-1 focus:ring-primary`})]}),o&&w.jsx("button",{onClick:o,className:`flex items-center justify-center w-8 h-8 rounded-md
192
192
  text-primary-foreground bg-primary hover:bg-primary/90
@@ -196,10 +196,10 @@ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}
196
196
  ${y?"bg-blue-100 dark:bg-blue-900/30 border-l-blue-500":"hover:bg-muted/50 border-l-transparent"}
197
197
  `,onClick:()=>r(p),children:[w.jsxs("div",{className:"flex-1 min-w-0",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("span",{className:"text-sm font-medium truncate",children:p.title??"Untitled conversation"}),p.unreadCount&&p.unreadCount>0&&w.jsx("span",{className:"flex-shrink-0 min-w-[18px] h-[18px] px-1 bg-primary text-primary-foreground text-xs rounded-full flex items-center justify-center",children:p.unreadCount})]}),p.preview&&w.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p.preview}),w.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ZN(p.updatedAt)})]}),a&&w.jsx("button",{onClick:v=>{v.stopPropagation(),a(p.sessionId)},className:`absolute right-2 top-1/2 -translate-y-1/2 p-1.5 rounded-md
198
198
  opacity-0 group-hover:opacity-100 transition-opacity
199
- hover:bg-destructive/10 hover:text-destructive`,title:"Delete session",children:w.jsx(u_,{className:"w-4 h-4"})})]},p.sessionId)})}),f.length===0&&w.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[w.jsx(s_,{className:"w-8 h-8 text-muted-foreground mb-2"}),w.jsx("p",{className:"text-sm text-muted-foreground",children:c?"No sessions found":"No sessions yet"}),!c&&o&&w.jsx("button",{onClick:o,className:"mt-2 text-sm text-primary hover:underline",children:"Start a new conversation"})]})]})]})}function Jb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Jb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Zb(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Jb(e))&&(r&&(r+=" "),r+=t);return r}const g0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,y0=Zb,uc=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return y0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,l=Object.keys(o).map(f=>{const p=n==null?void 0:n[f],m=a==null?void 0:a[f];if(p===null)return null;const y=g0(p)||g0(m);return o[f][y]}),c=n&&Object.entries(n).reduce((f,p)=>{let[m,y]=p;return y===void 0||(f[m]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:y,...v}=p;return Object.entries(v).every(b=>{let[S,C]=b;return Array.isArray(C)?C.includes({...a,...c}[S]):{...a,...c}[S]===C})?[...f,m,y]:f},[]);return y0(e,l,d,n==null?void 0:n.class,n==null?void 0:n.className)},Mp="-",tj=e=>{const t=rj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const c=l.split(Mp);return c[0]===""&&c.length!==1&&c.shift(),e1(c,t)||nj(l)},getConflictingClassGroupIds:(l,c)=>{const d=n[l]||[];return c&&r[l]?[...d,...r[l]]:d}}},e1=(e,t)=>{var n;if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),a=o?e1(e.slice(1),o):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(Mp);return(n=t.validators.find(({validator:c})=>c(l)))==null?void 0:n.classGroupId},v0=/^\[(.+)\]$/,nj=e=>{if(v0.test(e)){const t=v0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rj=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sj(Object.entries(e.classGroups),n).forEach(([a,l])=>{_h(l,r,a,t)}),r},_h=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:x0(t,o);a.classGroupId=n;return}if(typeof o=="function"){if(ij(o)){_h(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,l])=>{_h(l,x0(t,a),n,r)})})},x0=(e,t)=>{let n=e;return t.split(Mp).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ij=e=>e.isThemeGetter,sj=(e,t)=>t?e.map(([n,r])=>{const o=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([l,c])=>[t+l,c])):a);return[n,o]}):e,oj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(a,l)=>{n.set(a,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let l=n.get(a);if(l!==void 0)return l;if((l=r.get(a))!==void 0)return o(a,l),l},set(a,l){n.has(a)?n.set(a,l):o(a,l)}}},t1="!",aj=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],a=t.length,l=c=>{const d=[];let f=0,p=0,m;for(let C=0;C<c.length;C++){let E=c[C];if(f===0){if(E===o&&(r||c.slice(C,C+a)===t)){d.push(c.slice(p,C)),p=C+a;continue}if(E==="/"){m=C;continue}}E==="["?f++:E==="]"&&f--}const y=d.length===0?c:c.substring(p),v=y.startsWith(t1),b=v?y.substring(1):y,S=m&&m>p?m-p:void 0;return{modifiers:d,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:S}};return n?c=>n({className:c,parseClassName:l}):l},lj=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},uj=e=>({cache:oj(e.cacheSize),parseClassName:aj(e),...tj(e)}),cj=/\s+/,dj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],l=e.trim().split(cj);let c="";for(let d=l.length-1;d>=0;d-=1){const f=l[d],{modifiers:p,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:v}=n(f);let b=!!v,S=r(b?y.substring(0,v):y);if(!S){if(!b){c=f+(c.length>0?" "+c:c);continue}if(S=r(y),!S){c=f+(c.length>0?" "+c:c);continue}b=!1}const C=lj(p).join(":"),E=m?C+t1:C,P=E+S;if(a.includes(P))continue;a.push(P);const T=o(S,b);for(let O=0;O<T.length;++O){const V=T[O];a.push(E+V)}c=f+(c.length>0?" "+c:c)}return c};function fj(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=n1(t))&&(r&&(r+=" "),r+=n);return r}const n1=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=n1(e[r]))&&(n&&(n+=" "),n+=t);return n};function hj(e,...t){let n,r,o,a=l;function l(d){const f=t.reduce((p,m)=>m(p),e());return n=uj(f),r=n.cache.get,o=n.cache.set,a=c,c(d)}function c(d){const f=r(d);if(f)return f;const p=dj(d,n);return o(d,p),p}return function(){return a(fj.apply(null,arguments))}}const it=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},r1=/^\[(?:([a-z-]+):)?(.+)\]$/i,pj=/^\d+\/\d+$/,mj=new Set(["px","full","screen"]),gj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yj=/\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$/,vj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,xj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$r=e=>oo(e)||mj.has(e)||pj.test(e),ki=e=>wo(e,"length",_j),oo=e=>!!e&&!Number.isNaN(Number(e)),vf=e=>wo(e,"number",oo),ha=e=>!!e&&Number.isInteger(Number(e)),bj=e=>e.endsWith("%")&&oo(e.slice(0,-1)),Me=e=>r1.test(e),Ei=e=>gj.test(e),Sj=new Set(["length","size","percentage"]),kj=e=>wo(e,Sj,i1),Ej=e=>wo(e,"position",i1),Cj=new Set(["image","url"]),Ij=e=>wo(e,Cj,Aj),Tj=e=>wo(e,"",Pj),pa=()=>!0,wo=(e,t,n)=>{const r=r1.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},_j=e=>yj.test(e)&&!vj.test(e),i1=()=>!1,Pj=e=>xj.test(e),Aj=e=>wj.test(e),Rj=()=>{const e=it("colors"),t=it("spacing"),n=it("blur"),r=it("brightness"),o=it("borderColor"),a=it("borderRadius"),l=it("borderSpacing"),c=it("borderWidth"),d=it("contrast"),f=it("grayscale"),p=it("hueRotate"),m=it("invert"),y=it("gap"),v=it("gradientColorStops"),b=it("gradientColorStopPositions"),S=it("inset"),C=it("margin"),E=it("opacity"),P=it("padding"),T=it("saturate"),O=it("scale"),V=it("sepia"),N=it("skew"),D=it("space"),H=it("translate"),ee=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",Me,t],G=()=>[Me,t],X=()=>["",$r,ki],Q=()=>["auto",oo,Me],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],fe=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",Me],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[oo,Me];return{cacheSize:500,separator:":",theme:{colors:[pa],spacing:[$r,ki],blur:["none","",Ei,Me],brightness:j(),borderColor:[e],borderRadius:["none","","full",Ei,Me],borderSpacing:G(),borderWidth:X(),contrast:j(),grayscale:se(),hueRotate:j(),invert:se(),gap:G(),gradientColorStops:[e],gradientColorStopPositions:[bj,ki],inset:te(),margin:te(),opacity:j(),padding:G(),saturate:j(),scale:j(),sepia:se(),skew:j(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[Ei]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),Me]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ha,Me]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",ha,Me]}],"grid-cols":[{"grid-cols":[pa]}],"col-start-end":[{col:["auto",{span:["full",ha,Me]},Me]}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":[pa]}],"row-start-end":[{row:["auto",{span:[ha,Me]},Me]}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[P]}],px:[{px:[P]}],py:[{py:[P]}],ps:[{ps:[P]}],pe:[{pe:[P]}],pt:[{pt:[P]}],pr:[{pr:[P]}],pb:[{pb:[P]}],pl:[{pl:[P]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,t]}],"min-w":[{"min-w":[Me,t,"min","max","fit"]}],"max-w":[{"max-w":[Me,t,"none","full","min","max","fit","prose",{screen:[Ei]},Ei]}],h:[{h:[Me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ei,ki]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vf]}],"font-family":[{font:[pa]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Me]}],"line-clamp":[{"line-clamp":["none",oo,vf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$r,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$r,ki]}],"underline-offset":[{"underline-offset":["auto",$r,Me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),Ej]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ij]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...fe(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:fe()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...fe()]}],"outline-offset":[{"outline-offset":[$r,Me]}],"outline-w":[{outline:[$r,ki]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[$r,ki]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ei,Tj]}],"shadow-color":[{shadow:[pa]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ei,Me]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[m]}],saturate:[{saturate:[T]}],sepia:[{sepia:[V]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[ha,Me]}],"translate-x":[{"translate-x":[H]}],"translate-y":[{"translate-y":[H]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",Me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$r,ki,vf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Nj=hj(Rj);function Ae(...e){return Nj(Zb(e))}const jj=uc("w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",{variants:{variant:{primary:"bg-blue-600",secondary:"bg-amber-500",success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-500",neutral:"bg-slate-500"},size:{sm:"w-6 h-6",md:"w-8 h-8",lg:"w-10 h-10"}},defaultVariants:{variant:"primary",size:"md"}}),bo=I.forwardRef(({label:e,icon:t,src:n,alt:r,variant:o,size:a,className:l,...c},d)=>w.jsxs("div",{ref:d,className:Ae("flex items-center gap-3 mb-2",l),...c,children:[w.jsx("div",{className:Ae(jj({variant:o,size:a})),children:n?w.jsx("img",{src:n,alt:r||e,className:"w-full h-full rounded-full object-cover"}):t||w.jsx("span",{className:"text-white font-medium text-sm",children:e.charAt(0).toUpperCase()})}),w.jsx("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:e})]}));bo.displayName="MessageAvatar";function Mj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Dj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zj={};function w0(e,t){return(zj.jsx?Lj:Dj).test(e)}const Oj=/[ \t\n\f\r]/g;function Fj(e){return typeof e=="object"?e.type==="text"?b0(e.value):!1:b0(e)}function b0(e){return e.replace(Oj,"")===""}class Qa{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Qa.prototype.normal={};Qa.prototype.property={};Qa.prototype.space=void 0;function s1(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Qa(n,r,t)}function Ph(e){return e.toLowerCase()}class hn{constructor(t,n){this.attribute=n,this.property=t}}hn.prototype.attribute="";hn.prototype.booleanish=!1;hn.prototype.boolean=!1;hn.prototype.commaOrSpaceSeparated=!1;hn.prototype.commaSeparated=!1;hn.prototype.defined=!1;hn.prototype.mustUseProperty=!1;hn.prototype.number=!1;hn.prototype.overloadedBoolean=!1;hn.prototype.property="";hn.prototype.spaceSeparated=!1;hn.prototype.space=void 0;let Vj=0;const De=ys(),wt=ys(),Ah=ys(),ae=ys(),et=ys(),ao=ys(),bn=ys();function ys(){return 2**++Vj}const Rh=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:wt,commaOrSpaceSeparated:bn,commaSeparated:ao,number:ae,overloadedBoolean:Ah,spaceSeparated:et},Symbol.toStringTag,{value:"Module"})),xf=Object.keys(Rh);class Dp extends hn{constructor(t,n,r,o){let a=-1;if(super(t,n),S0(this,"space",o),typeof r=="number")for(;++a<xf.length;){const l=xf[a];S0(this,xf[a],(r&Rh[l])===Rh[l])}}}Dp.prototype.defined=!0;function S0(e,t,n){n&&(e[t]=n)}function So(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const a=new Dp(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Ph(r)]=r,n[Ph(a.attribute)]=r}return new Qa(t,n,e.space)}const o1=So({properties:{ariaActiveDescendant:null,ariaAtomic:wt,ariaAutoComplete:null,ariaBusy:wt,ariaChecked:wt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:et,ariaCurrent:null,ariaDescribedBy:et,ariaDetails:null,ariaDisabled:wt,ariaDropEffect:et,ariaErrorMessage:null,ariaExpanded:wt,ariaFlowTo:et,ariaGrabbed:wt,ariaHasPopup:null,ariaHidden:wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:et,ariaLevel:ae,ariaLive:null,ariaModal:wt,ariaMultiLine:wt,ariaMultiSelectable:wt,ariaOrientation:null,ariaOwns:et,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:wt,ariaReadOnly:wt,ariaRelevant:null,ariaRequired:wt,ariaRoleDescription:et,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:wt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function a1(e,t){return t in e?e[t]:t}function l1(e,t){return a1(e,t.toLowerCase())}const Bj=So({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ao,acceptCharset:et,accessKey:et,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:et,autoFocus:De,autoPlay:De,blocking:et,capture:null,charSet:null,checked:De,cite:null,className:et,cols:ae,colSpan:null,content:null,contentEditable:wt,controls:De,controlsList:et,coords:ae|ao,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:Ah,draggable:wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:et,height:ae,hidden:Ah,high:ae,href:null,hrefLang:null,htmlFor:et,httpEquiv:et,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:et,itemRef:et,itemScope:De,itemType:et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:De,optimum:ae,pattern:null,ping:et,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:et,required:De,reversed:De,rows:ae,rowSpan:ae,sandbox:et,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:wt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:et,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:wt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:l1}),$j=So({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bn,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ao,g2:ao,glyphName:ao,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:a1}),u1=So({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),c1=So({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:l1}),d1=So({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Uj={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Hj=/[A-Z]/g,k0=/-[a-z]/g,Wj=/^data[-\w.:]+$/i;function qj(e,t){const n=Ph(t);let r=t,o=hn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Wj.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(k0,Kj);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!k0.test(a)){let l=a.replace(Hj,Gj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Dp}return new o(r,t)}function Gj(e){return"-"+e.toLowerCase()}function Kj(e){return e.charAt(1).toUpperCase()}const Yj=s1([o1,Bj,u1,c1,d1],"html"),Lp=s1([o1,$j,u1,c1,d1],"svg");function Xj(e){return e.join(" ").trim()}function f1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ys={},wf,E0;function Qj(){if(E0)return wf;E0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
200
- `,f="/",p="*",m="",y="comment",v="declaration";wf=function(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var E=1,P=1;function T(X){var Q=X.match(t);Q&&(E+=Q.length);var re=X.lastIndexOf(d);P=~re?X.length-re:P+X.length}function O(){var X={line:E,column:P};return function(Q){return Q.position=new V(X),H(),Q}}function V(X){this.start=X,this.end={line:E,column:P},this.source=C.source}V.prototype.content=S;function N(X){var Q=new Error(C.source+":"+E+":"+P+": "+X);if(Q.reason=X,Q.filename=C.source,Q.line=E,Q.column=P,Q.source=S,!C.silent)throw Q}function D(X){var Q=X.exec(S);if(Q){var re=Q[0];return T(re),S=S.slice(re.length),Q}}function H(){D(n)}function ee(X){var Q;for(X=X||[];Q=L();)Q!==!1&&X.push(Q);return X}function L(){var X=O();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var Q=2;m!=S.charAt(Q)&&(p!=S.charAt(Q)||f!=S.charAt(Q+1));)++Q;if(Q+=2,m===S.charAt(Q-1))return N("End of comment missing");var re=S.slice(2,Q-2);return P+=2,T(re),S=S.slice(Q),P+=2,X({type:y,comment:re})}}function te(){var X=O(),Q=D(r);if(Q){if(L(),!D(o))return N("property missing ':'");var re=D(a),fe=X({type:v,property:b(Q[0].replace(e,m)),value:re?b(re[0].replace(e,m)):m});return D(l),fe}}function G(){var X=[];ee(X);for(var Q;Q=te();)Q!==!1&&(X.push(Q),ee(X));return X}return H(),G()};function b(S){return S?S.replace(c,m):m}return wf}var C0;function Jj(){if(C0)return Ys;C0=1;var e=Ys&&Ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=n;const t=e(Qj());function n(r,o){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof o=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?o(f,p,d):p&&(a=a||{},a[f]=p)}),a}return Ys}var ma={},I0;function Zj(){if(I0)return ma;I0=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},l=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(o,c):f=f.replace(r,c),f.replace(t,l))};return ma.camelCase=d,ma}var ga,T0;function eM(){if(T0)return ga;T0=1;var e=ga&&ga.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Jj()),n=Zj();function r(o,a){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,d){c&&d&&(l[(0,n.camelCase)(c,a)]=d)}),l}return r.default=r,ga=r,ga}var tM=eM();const nM=f1(tM),h1=p1("end"),zp=p1("start");function p1(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function rM(e){const t=zp(e),n=h1(e);if(t&&n)return{start:t,end:n}}function _a(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_0(e.position):"start"in e||"end"in e?_0(e):"line"in e||"column"in e?Nh(e):""}function Nh(e){return P0(e&&e.line)+":"+P0(e&&e.column)}function _0(e){return Nh(e&&e.start)+"-"+Nh(e&&e.end)}function P0(e){return e&&typeof e=="number"?e:1}class Kt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?o=t:!a.cause&&t&&(l=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=_a(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Kt.prototype.file="";Kt.prototype.name="";Kt.prototype.reason="";Kt.prototype.message="";Kt.prototype.stack="";Kt.prototype.column=void 0;Kt.prototype.line=void 0;Kt.prototype.ancestors=void 0;Kt.prototype.cause=void 0;Kt.prototype.fatal=void 0;Kt.prototype.place=void 0;Kt.prototype.ruleId=void 0;Kt.prototype.source=void 0;const Op={}.hasOwnProperty,iM=new Map,sM=/[A-Z]/g,oM=new Set(["table","tbody","thead","tfoot","tr"]),aM=new Set(["td","th"]),m1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lM(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=gM(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=mM(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Lp:Yj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=g1(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function g1(e,t,n){if(t.type==="element")return uM(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return cM(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fM(e,t,n);if(t.type==="mdxjsEsm")return dM(e,t);if(t.type==="root")return hM(e,t,n);if(t.type==="text")return pM(e,t)}function uM(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Lp,e.schema=o),e.ancestors.push(t);const a=v1(e,t.tagName,!1),l=yM(e,t);let c=Vp(e,t);return oM.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Fj(d):!0})),y1(e,l,a,t),Fp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function cM(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ba(e,t.position)}function dM(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ba(e,t.position)}function fM(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Lp,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:v1(e,t.name,!0),l=vM(e,t),c=Vp(e,t);return y1(e,l,a,t),Fp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function hM(e,t,n){const r={};return Fp(r,Vp(e,t)),e.create(t,e.Fragment,r,n)}function pM(e,t){return t.value}function y1(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mM(e,t,n){return r;function r(o,a,l,c){const f=Array.isArray(l.children)?n:t;return c?f(a,l,c):f(a,l)}}function gM(e,t){return n;function n(r,o,a,l){const c=Array.isArray(a.children),d=zp(r);return t(o,a,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function yM(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Op.call(t.properties,o)){const a=xM(e,o,t.properties[o]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&aM.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vM(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Ba(e,t.position);else{const o=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else Ba(e,t.position);else a=r.value===null?!0:r.value;n[o]=a}return n}function Vp(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:iM;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=o.get(d)||0;l=d+"-"+f,o.set(d,f+1)}}const c=g1(e,a,l);c!==void 0&&n.push(c)}return n}function xM(e,t,n){const r=qj(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Mj(n):Xj(n)),r.property==="style"){let o=typeof n=="object"?n:wM(e,String(n));return e.stylePropertyNameCase==="css"&&(o=bM(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Uj[r.property]||r.property:r.attribute,n]}}function wM(e,t){try{return nM(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Kt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=m1+"#cannot-parse-style-attribute",o}}function v1(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,l;for(;++a<o.length;){const c=w0(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=w0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Op.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ba(e)}function Ba(e,t){const n=new Kt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=m1+"#cannot-handle-mdx-estrees-without-createevaluater",n}function bM(e){const t={};let n;for(n in e)Op.call(e,n)&&(t[SM(n)]=e[n]);return t}function SM(e){let t=e.replace(sM,kM);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function kM(e){return"-"+e.toLowerCase()}const bf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},EM={};function Bp(e,t){const n=EM,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return x1(e,r,o)}function x1(e,t,n){if(CM(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return A0(e.children,t,n)}return Array.isArray(e)?A0(e,t,n):""}function A0(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=x1(e[o],t,n);return r.join("")}function CM(e){return!!(e&&typeof e=="object")}const R0=document.createElement("i");function $p(e){const t="&"+e+";";R0.innerHTML=t;const n=R0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function En(e,t,n,r){const o=e.length;let a=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Un(e,t){return e.length>0?(En(e,e.length,0,t),e):t}const N0={}.hasOwnProperty;function w1(e){const t={};let n=-1;for(;++n<e.length;)IM(t,e[n]);return t}function IM(e,t){let n;for(n in t){const o=(N0.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){N0.call(o,l)||(o[l]=[]);const c=a[l];TM(o[l],Array.isArray(c)?c:c?[c]:[])}}}function TM(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);En(e,0,0,r)}function b1(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function cr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zt=ji(/[A-Za-z]/),qt=ji(/[\dA-Za-z]/),_M=ji(/[#-'*+\--9=?A-Z^-~]/);function qu(e){return e!==null&&(e<32||e===127)}const jh=ji(/\d/),PM=ji(/[\dA-Fa-f]/),AM=ji(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function Je(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const cc=ji(new RegExp("\\p{P}|\\p{S}","u")),gs=ji(/\s/);function ji(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ko(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&qt(e.charCodeAt(n+1))&&qt(e.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),o=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function We(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Be(d)?(e.enter(n),c(d)):t(d)}function c(d){return Be(d)&&a++<o?(e.consume(d),c):(e.exit(n),t(d))}}const RM={tokenize:NM};function NM(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),We(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ce(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const jM={tokenize:MM},j0={tokenize:DM};function MM(e){const t=this,n=[];let r=0,o,a,l;return c;function c(T){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,d,f)(T)}return f(T)}function d(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&P();const O=t.events.length;let V=O,N;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){N=t.events[V][1].end;break}E(r);let D=O;for(;D<t.events.length;)t.events[D][1].end={...N},D++;return En(t.events,V+1,0,t.events.slice(O)),t.events.length=D,f(T)}return c(T)}function f(T){if(r===n.length){if(!o)return y(T);if(o.currentConstruct&&o.currentConstruct.concrete)return b(T);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(j0,p,m)(T)}function p(T){return o&&P(),E(r),y(T)}function m(T){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,b(T)}function y(T){return t.containerState={},e.attempt(j0,v,b)(T)}function v(T){return r++,n.push([t.currentConstruct,t.containerState]),y(T)}function b(T){if(T===null){o&&P(),E(0),e.consume(T);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),S(T)}function S(T){if(T===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(T);return}return Ce(T)?(e.consume(T),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(T),S)}function C(T,O){const V=t.sliceStream(T);if(O&&V.push(null),T.previous=a,a&&(a.next=T),a=T,o.defineSkip(T.start),o.write(V),t.parser.lazy[T.start.line]){let N=o.events.length;for(;N--;)if(o.events[N][1].start.offset<l&&(!o.events[N][1].end||o.events[N][1].end.offset>l))return;const D=t.events.length;let H=D,ee,L;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(ee){L=t.events[H][1].end;break}ee=!0}for(E(r),N=D;N<t.events.length;)t.events[N][1].end={...L},N++;En(t.events,H+1,0,t.events.slice(D)),t.events.length=N}}function E(T){let O=n.length;for(;O-- >T;){const V=n[O];t.containerState=V[1],V[0].exit.call(t,e)}n.length=T}function P(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function DM(e,t,n){return We(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ho(e){if(e===null||Je(e)||gs(e))return 1;if(cc(e))return 2}function dc(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Mh={name:"attention",resolveAll:LM,tokenize:zM};function LM(e,t){let n=-1,r,o,a,l,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[n][1].start};M0(m,-d),M0(y,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Un(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Un(f,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=Un(f,dc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Un(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Un(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,En(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function zM(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=ho(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),p=ho(d),m=!p||p===2&&o||n.includes(d),y=!o||o===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(o||!y)),f._close=!!(a===42?y:y&&(p||!m)),t(d)}}function M0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const OM={name:"autolink",tokenize:FM};function FM(e,t,n){let r=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return Zt(v)?(e.consume(v),l):v===64?n(v):f(v)}function l(v){return v===43||v===45||v===46||qt(v)?(r=1,c(v)):f(v)}function c(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||qt(v))&&r++<32?(e.consume(v),c):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||qu(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):_M(v)?(e.consume(v),f):n(v)}function p(v){return qt(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||qt(v))&&r++<63){const b=v===45?y:m;return e.consume(v),b}return n(v)}}const Ja={partial:!0,tokenize:VM};function VM(e,t,n){return r;function r(a){return Be(a)?We(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Ce(a)?t(a):n(a)}}const S1={continuation:{tokenize:$M},exit:UM,name:"blockQuote",tokenize:BM};function BM(e,t,n){const r=this;return o;function o(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Be(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function $M(e,t,n){const r=this;return o;function o(l){return Be(l)?We(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(S1,t,n)(l)}}function UM(e){e.exit("blockQuote")}const k1={name:"characterEscape",tokenize:HM};function HM(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return AM(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const E1={name:"characterReference",tokenize:WM};function WM(e,t,n){const r=this;let o=0,a,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,l=qt,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=PM,p):(e.enter("characterReferenceValue"),a=7,l=jh,p(m))}function p(m){if(m===59&&o){const y=e.exit("characterReferenceValue");return l===qt&&!$p(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&o++<a?(e.consume(m),p):n(m)}}const D0={partial:!0,tokenize:GM},L0={concrete:!0,name:"codeFenced",tokenize:qM};function qM(e,t,n){const r=this,o={partial:!0,tokenize:V};let a=0,l=0,c;return d;function d(N){return f(N)}function f(N){const D=r.events[r.events.length-1];return a=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,c=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===c?(l++,e.consume(N),p):l<3?n(N):(e.exit("codeFencedFenceSequence"),Be(N)?We(e,m,"whitespace")(N):m(N))}function m(N){return N===null||Ce(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(D0,S,O)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(N))}function y(N){return N===null||Ce(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(N)):Be(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),We(e,v,"whitespace")(N)):N===96&&N===c?n(N):(e.consume(N),y)}function v(N){return N===null||Ce(N)?m(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(N))}function b(N){return N===null||Ce(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(N)):N===96&&N===c?n(N):(e.consume(N),b)}function S(N){return e.attempt(o,O,C)(N)}function C(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),E}function E(N){return a>0&&Be(N)?We(e,P,"linePrefix",a+1)(N):P(N)}function P(N){return N===null||Ce(N)?e.check(D0,S,O)(N):(e.enter("codeFlowValue"),T(N))}function T(N){return N===null||Ce(N)?(e.exit("codeFlowValue"),P(N)):(e.consume(N),T)}function O(N){return e.exit("codeFenced"),t(N)}function V(N,D,H){let ee=0;return L;function L(re){return N.enter("lineEnding"),N.consume(re),N.exit("lineEnding"),te}function te(re){return N.enter("codeFencedFence"),Be(re)?We(N,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):G(re)}function G(re){return re===c?(N.enter("codeFencedFenceSequence"),X(re)):H(re)}function X(re){return re===c?(ee++,N.consume(re),X):ee>=l?(N.exit("codeFencedFenceSequence"),Be(re)?We(N,Q,"whitespace")(re):Q(re)):H(re)}function Q(re){return re===null||Ce(re)?(N.exit("codeFencedFence"),D(re)):H(re)}}}function GM(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Sf={name:"codeIndented",tokenize:YM},KM={partial:!0,tokenize:XM};function YM(e,t,n){const r=this;return o;function o(f){return e.enter("codeIndented"),We(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):Ce(f)?e.attempt(KM,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Ce(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function XM(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):Ce(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):We(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):Ce(l)?o(l):n(l)}}const QM={name:"codeText",previous:ZM,resolve:JM,tokenize:eD};function JM(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function ZM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function eD(e,t,n){let r=0,o,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),o=0,p(m)):Ce(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||Ce(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function p(m){return m===96?(e.consume(m),o++,p):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",f(m))}}class tD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&ya(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ya(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ya(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ya(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ya(this.left,n.reverse())}}}function ya(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function C1(e){const t={};let n=-1,r,o,a,l,c,d,f;const p=new tD(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,nD(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,o=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(r[1].end={...p.get(o)[1].start},c=p.slice(o,n),c.unshift(r),p.splice(o,n-o+1,c))}}return En(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function nD(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],f={};let p,m,y=-1,v=n,b=0,S=0;const C=[S];for(;v;){for(;e.get(++o)[1]!==v;);a.push(o),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(S=y+1,C.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):C.pop(),y=C.length;y--;){const E=c.slice(C[y],C[y+1]),P=a.pop();d.push([P,P+E.length-1]),e.splice(P,2,E)}for(d.reverse(),y=-1;++y<d.length;)f[b+d[y][0]]=b+d[y][1],b+=d[y][1]-d[y][0]-1;return f}const rD={resolve:sD,tokenize:oD},iD={partial:!0,tokenize:aD};function sD(e){return C1(e),e}function oD(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?a(c):Ce(c)?e.check(iD,l,a)(c):(e.consume(c),o)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function aD(e,t,n){const r=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),We(e,a,"linePrefix")}function a(l){if(l===null||Ce(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function I1(e,t,n,r,o,a,l,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(E){return E===60?(e.enter(r),e.enter(o),e.enter(a),e.consume(E),e.exit(a),y):E===null||E===32||E===41||qu(E)?n(E):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(E))}function y(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(o),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(E))}function v(E){return E===62?(e.exit("chunkString"),e.exit(c),y(E)):E===null||E===60||Ce(E)?n(E):(e.consume(E),E===92?b:v)}function b(E){return E===60||E===62||E===92?(e.consume(E),v):v(E)}function S(E){return!p&&(E===null||E===41||Je(E))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(E)):p<f&&E===40?(e.consume(E),p++,S):E===41?(e.consume(E),p--,S):E===null||E===32||E===40||qu(E)?n(E):(e.consume(E),E===92?C:S)}function C(E){return E===40||E===41||E===92?(e.consume(E),S):S(E)}}function T1(e,t,n,r,o,a){const l=this;let c=0,d;return f;function f(v){return e.enter(r),e.enter(o),e.consume(v),e.exit(o),e.enter(a),p}function p(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(o),e.consume(v),e.exit(o),e.exit(r),t):Ce(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||Ce(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!Be(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function _1(e,t,n,r,o,a){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(o),e.consume(y),e.exit(o),l=y===40?41:y,d):n(y)}function d(y){return y===l?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===l?(e.exit(a),d(l)):y===null?n(y):Ce(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),We(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===l||y===null||Ce(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===l||y===92?(e.consume(y),p):p(y)}}function Pa(e,t){let n;return r;function r(o){return Ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Be(o)?We(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const lD={name:"definition",tokenize:cD},uD={partial:!0,tokenize:dD};function cD(e,t,n){const r=this;let o;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return T1.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return o=cr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return Je(v)?Pa(e,f)(v):f(v)}function f(v){return I1(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(uD,m,m)(v)}function m(v){return Be(v)?We(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ce(v)?(e.exit("definition"),r.parser.defined.push(o),t(v)):n(v)}}function dD(e,t,n){return r;function r(c){return Je(c)?Pa(e,o)(c):n(c)}function o(c){return _1(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Be(c)?We(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ce(c)?t(c):n(c)}}const fD={name:"hardBreakEscape",tokenize:hD};function hD(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Ce(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const pD={name:"headingAtx",resolve:mD,tokenize:gD};function mD(e,t){let n=e.length-2,r=3,o,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},En(e,r,n-r+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function gD(e,t,n){let r=0;return o;function o(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||Je(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Ce(p)?(e.exit("atxHeading"),t(p)):Be(p)?We(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||Je(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const yD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],z0=["pre","script","style","textarea"],vD={concrete:!0,name:"htmlFlow",resolveTo:bD,tokenize:SD},xD={partial:!0,tokenize:ED},wD={partial:!0,tokenize:kD};function bD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SD(e,t,n){const r=this;let o,a,l,c,d;return f;function f(A){return p(A)}function p(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),y):A===47?(e.consume(A),a=!0,S):A===63?(e.consume(A),o=3,r.interrupt?t:_):Zt(A)?(e.consume(A),l=String.fromCharCode(A),C):n(A)}function y(A){return A===45?(e.consume(A),o=2,v):A===91?(e.consume(A),o=5,c=0,b):Zt(A)?(e.consume(A),o=4,r.interrupt?t:_):n(A)}function v(A){return A===45?(e.consume(A),r.interrupt?t:_):n(A)}function b(A){const be="CDATA[";return A===be.charCodeAt(c++)?(e.consume(A),c===be.length?r.interrupt?t:G:b):n(A)}function S(A){return Zt(A)?(e.consume(A),l=String.fromCharCode(A),C):n(A)}function C(A){if(A===null||A===47||A===62||Je(A)){const be=A===47,Ie=l.toLowerCase();return!be&&!a&&z0.includes(Ie)?(o=1,r.interrupt?t(A):G(A)):yD.includes(l.toLowerCase())?(o=6,be?(e.consume(A),E):r.interrupt?t(A):G(A)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):a?P(A):T(A))}return A===45||qt(A)?(e.consume(A),l+=String.fromCharCode(A),C):n(A)}function E(A){return A===62?(e.consume(A),r.interrupt?t:G):n(A)}function P(A){return Be(A)?(e.consume(A),P):L(A)}function T(A){return A===47?(e.consume(A),L):A===58||A===95||Zt(A)?(e.consume(A),O):Be(A)?(e.consume(A),T):L(A)}function O(A){return A===45||A===46||A===58||A===95||qt(A)?(e.consume(A),O):V(A)}function V(A){return A===61?(e.consume(A),N):Be(A)?(e.consume(A),V):T(A)}function N(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),d=A,D):Be(A)?(e.consume(A),N):H(A)}function D(A){return A===d?(e.consume(A),d=null,ee):A===null||Ce(A)?n(A):(e.consume(A),D)}function H(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Je(A)?V(A):(e.consume(A),H)}function ee(A){return A===47||A===62||Be(A)?T(A):n(A)}function L(A){return A===62?(e.consume(A),te):n(A)}function te(A){return A===null||Ce(A)?G(A):Be(A)?(e.consume(A),te):n(A)}function G(A){return A===45&&o===2?(e.consume(A),fe):A===60&&o===1?(e.consume(A),oe):A===62&&o===4?(e.consume(A),j):A===63&&o===3?(e.consume(A),_):A===93&&o===5?(e.consume(A),se):Ce(A)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(xD,Y,X)(A)):A===null||Ce(A)?(e.exit("htmlFlowData"),X(A)):(e.consume(A),G)}function X(A){return e.check(wD,Q,Y)(A)}function Q(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),re}function re(A){return A===null||Ce(A)?X(A):(e.enter("htmlFlowData"),G(A))}function fe(A){return A===45?(e.consume(A),_):G(A)}function oe(A){return A===47?(e.consume(A),l="",U):G(A)}function U(A){if(A===62){const be=l.toLowerCase();return z0.includes(be)?(e.consume(A),j):G(A)}return Zt(A)&&l.length<8?(e.consume(A),l+=String.fromCharCode(A),U):G(A)}function se(A){return A===93?(e.consume(A),_):G(A)}function _(A){return A===62?(e.consume(A),j):A===45&&o===2?(e.consume(A),_):G(A)}function j(A){return A===null||Ce(A)?(e.exit("htmlFlowData"),Y(A)):(e.consume(A),j)}function Y(A){return e.exit("htmlFlow"),t(A)}}function kD(e,t,n){const r=this;return o;function o(l){return Ce(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ED(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ja,t,n)}}const CD={name:"htmlText",tokenize:ID};function ID(e,t,n){const r=this;let o,a,l;return c;function c(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),d}function d(_){return _===33?(e.consume(_),f):_===47?(e.consume(_),V):_===63?(e.consume(_),T):Zt(_)?(e.consume(_),H):n(_)}function f(_){return _===45?(e.consume(_),p):_===91?(e.consume(_),a=0,b):Zt(_)?(e.consume(_),P):n(_)}function p(_){return _===45?(e.consume(_),v):n(_)}function m(_){return _===null?n(_):_===45?(e.consume(_),y):Ce(_)?(l=m,oe(_)):(e.consume(_),m)}function y(_){return _===45?(e.consume(_),v):m(_)}function v(_){return _===62?fe(_):_===45?y(_):m(_)}function b(_){const j="CDATA[";return _===j.charCodeAt(a++)?(e.consume(_),a===j.length?S:b):n(_)}function S(_){return _===null?n(_):_===93?(e.consume(_),C):Ce(_)?(l=S,oe(_)):(e.consume(_),S)}function C(_){return _===93?(e.consume(_),E):S(_)}function E(_){return _===62?fe(_):_===93?(e.consume(_),E):S(_)}function P(_){return _===null||_===62?fe(_):Ce(_)?(l=P,oe(_)):(e.consume(_),P)}function T(_){return _===null?n(_):_===63?(e.consume(_),O):Ce(_)?(l=T,oe(_)):(e.consume(_),T)}function O(_){return _===62?fe(_):T(_)}function V(_){return Zt(_)?(e.consume(_),N):n(_)}function N(_){return _===45||qt(_)?(e.consume(_),N):D(_)}function D(_){return Ce(_)?(l=D,oe(_)):Be(_)?(e.consume(_),D):fe(_)}function H(_){return _===45||qt(_)?(e.consume(_),H):_===47||_===62||Je(_)?ee(_):n(_)}function ee(_){return _===47?(e.consume(_),fe):_===58||_===95||Zt(_)?(e.consume(_),L):Ce(_)?(l=ee,oe(_)):Be(_)?(e.consume(_),ee):fe(_)}function L(_){return _===45||_===46||_===58||_===95||qt(_)?(e.consume(_),L):te(_)}function te(_){return _===61?(e.consume(_),G):Ce(_)?(l=te,oe(_)):Be(_)?(e.consume(_),te):ee(_)}function G(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),o=_,X):Ce(_)?(l=G,oe(_)):Be(_)?(e.consume(_),G):(e.consume(_),Q)}function X(_){return _===o?(e.consume(_),o=void 0,re):_===null?n(_):Ce(_)?(l=X,oe(_)):(e.consume(_),X)}function Q(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Je(_)?ee(_):(e.consume(_),Q)}function re(_){return _===47||_===62||Je(_)?ee(_):n(_)}function fe(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function oe(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),U}function U(_){return Be(_)?We(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):se(_)}function se(_){return e.enter("htmlTextData"),l(_)}}const Up={name:"labelEnd",resolveAll:AD,resolveTo:RD,tokenize:ND},TD={tokenize:jD},_D={tokenize:MD},PD={tokenize:DD};function AD(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&En(e,0,e.length,n),e}function RD(e,t){let n=e.length,r=0,o,a,l,c;for(;n--;)if(o=e[n][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=Un(c,e.slice(a+1,a+r+3)),c=Un(c,[["enter",p,t]]),c=Un(c,dc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=Un(c,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),c=Un(c,e.slice(l+1)),c=Un(c,[["exit",d,t]]),En(e,a,e.length,c),e}function ND(e,t,n){const r=this;let o=r.events.length,a,l;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){a=r.events[o][1];break}return c;function c(y){return a?a._inactive?m(y):(l=r.parser.defined.includes(cr(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(TD,p,l?p:m)(y):y===91?e.attempt(_D,p,l?f:m)(y):l?p(y):m(y)}function f(y){return e.attempt(PD,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function jD(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),o}function o(m){return Je(m)?Pa(e,a)(m):a(m)}function a(m){return m===41?p(m):I1(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return Je(m)?Pa(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?_1(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Je(m)?Pa(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function MD(e,t,n){const r=this;return o;function o(c){return T1.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(cr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function DD(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const LD={name:"labelStartImage",resolveAll:Up.resolveAll,tokenize:zD};function zD(e,t,n){const r=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const OD={name:"labelStartLink",resolveAll:Up.resolveAll,tokenize:FD};function FD(e,t,n){const r=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const kf={name:"lineEnding",tokenize:VD};function VD(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),We(e,t,"linePrefix")}}const Lu={name:"thematicBreak",tokenize:BD};function BD(e,t,n){let r=0,o;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return o=f,c(f)}function c(f){return f===o?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ce(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===o?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Be(f)?We(e,c,"whitespace")(f):c(f))}}const cn={continuation:{tokenize:WD},exit:GD,name:"list",tokenize:HD},$D={partial:!0,tokenize:KD},UD={partial:!0,tokenize:qD};function HD(e,t,n){const r=this,o=r.events[r.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(v){const b=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:jh(v)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Lu,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return jh(v)&&++l<10?(e.consume(v),d):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Ja,r.interrupt?n:p,e.attempt($D,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return Be(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function WD(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ja,o,a);function o(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,We(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!Be(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(UD,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,We(e,e.attempt(cn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function qD(e,t,n){const r=this;return We(e,o,"listItemIndent",r.containerState.size+1);function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function GD(e){e.exit(this.containerState.type)}function KD(e,t,n){const r=this;return We(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const l=r.events[r.events.length-1];return!Be(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const O0={name:"setextUnderline",resolveTo:YD,tokenize:XD};function YD(e,t){let n=e.length,r,o,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function XD(e,t,n){const r=this;let o;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),o=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===o?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Be(f)?We(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ce(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const QD={tokenize:JD};function JD(e){const t=this,n=e.attempt(Ja,r,e.attempt(this.parser.constructs.flowInitial,o,We(e,e.attempt(this.parser.constructs.flow,o,e.attempt(rD,o)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ZD={resolveAll:A1()},eL=P1("string"),tL=P1("text");function P1(e){return{resolveAll:A1(e==="text"?nL:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],a=n.attempt(o,l,c);return l;function l(p){return f(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=o[p];let y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function A1(e){return t;function t(n,r){let o=-1,a;for(;++o<=n.length;)a===void 0?n[o]&&n[o][1].type==="data"&&(a=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==a+2&&(n[a][1].end=n[o-1][1].end,n.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(n,r):n}}function nL(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let a=o.length,l=-1,c=0,d;for(;a--;){const f=o[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const rL={42:cn,43:cn,45:cn,48:cn,49:cn,50:cn,51:cn,52:cn,53:cn,54:cn,55:cn,56:cn,57:cn,62:S1},iL={91:lD},sL={[-2]:Sf,[-1]:Sf,32:Sf},oL={35:pD,42:Lu,45:[O0,Lu],60:vD,61:O0,95:Lu,96:L0,126:L0},aL={38:E1,92:k1},lL={[-5]:kf,[-4]:kf,[-3]:kf,33:LD,38:E1,42:Mh,60:[OM,CD],91:OD,92:[fD,k1],93:Up,95:Mh,96:QM},uL={null:[Mh,ZD]},cL={null:[42,95]},dL={null:[]},fL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cL,contentInitial:iL,disable:dL,document:rL,flow:oL,flowInitial:sL,insideSpan:uL,string:aL,text:lL},Symbol.toStringTag,{value:"Module"}));function hL(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},a=[];let l=[],c=[];const d={attempt:D(V),check:D(N),consume:P,enter:T,exit:O,interrupt:D(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:b,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(te){return l=Un(l,te),C(),l[l.length-1]!==null?[]:(H(t,0),f.events=dc(a,f.events,f),f.events)}function y(te,G){return mL(v(te),G)}function v(te){return pL(l,te)}function b(){const{_bufferIndex:te,_index:G,line:X,column:Q,offset:re}=r;return{_bufferIndex:te,_index:G,line:X,column:Q,offset:re}}function S(te){o[te.line]=te.column,L()}function C(){let te;for(;r._index<l.length;){const G=l[r._index];if(typeof G=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<G.length;)E(G.charCodeAt(r._bufferIndex));else E(G)}}function E(te){p=p(te)}function P(te){Ce(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,L()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=te}function T(te,G){const X=G||{};return X.type=te,X.start=b(),f.events.push(["enter",X,f]),c.push(X),X}function O(te){const G=c.pop();return G.end=b(),f.events.push(["exit",G,f]),G}function V(te,G){H(te,G.from)}function N(te,G){G.restore()}function D(te,G){return X;function X(Q,re,fe){let oe,U,se,_;return Array.isArray(Q)?Y(Q):"tokenize"in Q?Y([Q]):j(Q);function j(Se){return Oe;function Oe(de){const he=de!==null&&Se[de],Re=de!==null&&Se.null,Ye=[...Array.isArray(he)?he:he?[he]:[],...Array.isArray(Re)?Re:Re?[Re]:[]];return Y(Ye)(de)}}function Y(Se){return oe=Se,U=0,Se.length===0?fe:A(Se[U])}function A(Se){return Oe;function Oe(de){return _=ee(),se=Se,Se.partial||(f.currentConstruct=Se),Se.name&&f.parser.constructs.disable.null.includes(Se.name)?Ie():Se.tokenize.call(G?Object.assign(Object.create(f),G):f,d,be,Ie)(de)}}function be(Se){return te(se,_),re}function Ie(Se){return _.restore(),++U<oe.length?A(oe[U]):fe}}}function H(te,G){te.resolveAll&&!a.includes(te)&&a.push(te),te.resolve&&En(f.events,G,f.events.length-G,te.resolve(f.events.slice(G),f)),te.resolveTo&&(f.events=te.resolveTo(f.events,f))}function ee(){const te=b(),G=f.previous,X=f.currentConstruct,Q=f.events.length,re=Array.from(c);return{from:Q,restore:fe};function fe(){r=te,f.previous=G,f.currentConstruct=X,f.events.length=Q,c=re,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function pL(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,a)];else{if(l=e.slice(n,o),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[o].slice(0,a))}return l}function mL(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
199
+ hover:bg-destructive/10 hover:text-destructive`,title:"Delete session",children:w.jsx(u_,{className:"w-4 h-4"})})]},p.sessionId)})}),f.length===0&&w.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[w.jsx(s_,{className:"w-8 h-8 text-muted-foreground mb-2"}),w.jsx("p",{className:"text-sm text-muted-foreground",children:c?"No sessions found":"No sessions yet"}),!c&&o&&w.jsx("button",{onClick:o,className:"mt-2 text-sm text-primary hover:underline",children:"Start a new conversation"})]})]})]})}function Jb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Jb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Zb(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Jb(e))&&(r&&(r+=" "),r+=t);return r}const g0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,y0=Zb,uc=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return y0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,l=Object.keys(o).map(f=>{const p=n==null?void 0:n[f],m=a==null?void 0:a[f];if(p===null)return null;const y=g0(p)||g0(m);return o[f][y]}),c=n&&Object.entries(n).reduce((f,p)=>{let[m,y]=p;return y===void 0||(f[m]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:y,...v}=p;return Object.entries(v).every(b=>{let[S,C]=b;return Array.isArray(C)?C.includes({...a,...c}[S]):{...a,...c}[S]===C})?[...f,m,y]:f},[]);return y0(e,l,d,n==null?void 0:n.class,n==null?void 0:n.className)},Mp="-",tj=e=>{const t=rj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const c=l.split(Mp);return c[0]===""&&c.length!==1&&c.shift(),e1(c,t)||nj(l)},getConflictingClassGroupIds:(l,c)=>{const d=n[l]||[];return c&&r[l]?[...d,...r[l]]:d}}},e1=(e,t)=>{var n;if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),a=o?e1(e.slice(1),o):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(Mp);return(n=t.validators.find(({validator:c})=>c(l)))==null?void 0:n.classGroupId},v0=/^\[(.+)\]$/,nj=e=>{if(v0.test(e)){const t=v0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rj=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sj(Object.entries(e.classGroups),n).forEach(([a,l])=>{_h(l,r,a,t)}),r},_h=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:x0(t,o);a.classGroupId=n;return}if(typeof o=="function"){if(ij(o)){_h(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,l])=>{_h(l,x0(t,a),n,r)})})},x0=(e,t)=>{let n=e;return t.split(Mp).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ij=e=>e.isThemeGetter,sj=(e,t)=>t?e.map(([n,r])=>{const o=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([l,c])=>[t+l,c])):a);return[n,o]}):e,oj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(a,l)=>{n.set(a,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let l=n.get(a);if(l!==void 0)return l;if((l=r.get(a))!==void 0)return o(a,l),l},set(a,l){n.has(a)?n.set(a,l):o(a,l)}}},t1="!",aj=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],a=t.length,l=c=>{const d=[];let f=0,p=0,m;for(let C=0;C<c.length;C++){let E=c[C];if(f===0){if(E===o&&(r||c.slice(C,C+a)===t)){d.push(c.slice(p,C)),p=C+a;continue}if(E==="/"){m=C;continue}}E==="["?f++:E==="]"&&f--}const y=d.length===0?c:c.substring(p),v=y.startsWith(t1),b=v?y.substring(1):y,S=m&&m>p?m-p:void 0;return{modifiers:d,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:S}};return n?c=>n({className:c,parseClassName:l}):l},lj=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},uj=e=>({cache:oj(e.cacheSize),parseClassName:aj(e),...tj(e)}),cj=/\s+/,dj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],l=e.trim().split(cj);let c="";for(let d=l.length-1;d>=0;d-=1){const f=l[d],{modifiers:p,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:v}=n(f);let b=!!v,S=r(b?y.substring(0,v):y);if(!S){if(!b){c=f+(c.length>0?" "+c:c);continue}if(S=r(y),!S){c=f+(c.length>0?" "+c:c);continue}b=!1}const C=lj(p).join(":"),E=m?C+t1:C,P=E+S;if(a.includes(P))continue;a.push(P);const T=o(S,b);for(let O=0;O<T.length;++O){const V=T[O];a.push(E+V)}c=f+(c.length>0?" "+c:c)}return c};function fj(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=n1(t))&&(r&&(r+=" "),r+=n);return r}const n1=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=n1(e[r]))&&(n&&(n+=" "),n+=t);return n};function hj(e,...t){let n,r,o,a=l;function l(d){const f=t.reduce((p,m)=>m(p),e());return n=uj(f),r=n.cache.get,o=n.cache.set,a=c,c(d)}function c(d){const f=r(d);if(f)return f;const p=dj(d,n);return o(d,p),p}return function(){return a(fj.apply(null,arguments))}}const rt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},r1=/^\[(?:([a-z-]+):)?(.+)\]$/i,pj=/^\d+\/\d+$/,mj=new Set(["px","full","screen"]),gj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yj=/\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$/,vj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,xj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$r=e=>oo(e)||mj.has(e)||pj.test(e),ki=e=>wo(e,"length",_j),oo=e=>!!e&&!Number.isNaN(Number(e)),vf=e=>wo(e,"number",oo),ha=e=>!!e&&Number.isInteger(Number(e)),bj=e=>e.endsWith("%")&&oo(e.slice(0,-1)),Me=e=>r1.test(e),Ei=e=>gj.test(e),Sj=new Set(["length","size","percentage"]),kj=e=>wo(e,Sj,i1),Ej=e=>wo(e,"position",i1),Cj=new Set(["image","url"]),Ij=e=>wo(e,Cj,Aj),Tj=e=>wo(e,"",Pj),pa=()=>!0,wo=(e,t,n)=>{const r=r1.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},_j=e=>yj.test(e)&&!vj.test(e),i1=()=>!1,Pj=e=>xj.test(e),Aj=e=>wj.test(e),Rj=()=>{const e=rt("colors"),t=rt("spacing"),n=rt("blur"),r=rt("brightness"),o=rt("borderColor"),a=rt("borderRadius"),l=rt("borderSpacing"),c=rt("borderWidth"),d=rt("contrast"),f=rt("grayscale"),p=rt("hueRotate"),m=rt("invert"),y=rt("gap"),v=rt("gradientColorStops"),b=rt("gradientColorStopPositions"),S=rt("inset"),C=rt("margin"),E=rt("opacity"),P=rt("padding"),T=rt("saturate"),O=rt("scale"),V=rt("sepia"),N=rt("skew"),D=rt("space"),H=rt("translate"),ee=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",Me,t],G=()=>[Me,t],X=()=>["",$r,ki],Q=()=>["auto",oo,Me],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],fe=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",Me],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[oo,Me];return{cacheSize:500,separator:":",theme:{colors:[pa],spacing:[$r,ki],blur:["none","",Ei,Me],brightness:j(),borderColor:[e],borderRadius:["none","","full",Ei,Me],borderSpacing:G(),borderWidth:X(),contrast:j(),grayscale:se(),hueRotate:j(),invert:se(),gap:G(),gradientColorStops:[e],gradientColorStopPositions:[bj,ki],inset:te(),margin:te(),opacity:j(),padding:G(),saturate:j(),scale:j(),sepia:se(),skew:j(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[Ei]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),Me]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ha,Me]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",ha,Me]}],"grid-cols":[{"grid-cols":[pa]}],"col-start-end":[{col:["auto",{span:["full",ha,Me]},Me]}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":[pa]}],"row-start-end":[{row:["auto",{span:[ha,Me]},Me]}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[P]}],px:[{px:[P]}],py:[{py:[P]}],ps:[{ps:[P]}],pe:[{pe:[P]}],pt:[{pt:[P]}],pr:[{pr:[P]}],pb:[{pb:[P]}],pl:[{pl:[P]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,t]}],"min-w":[{"min-w":[Me,t,"min","max","fit"]}],"max-w":[{"max-w":[Me,t,"none","full","min","max","fit","prose",{screen:[Ei]},Ei]}],h:[{h:[Me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ei,ki]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vf]}],"font-family":[{font:[pa]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Me]}],"line-clamp":[{"line-clamp":["none",oo,vf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$r,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$r,ki]}],"underline-offset":[{"underline-offset":["auto",$r,Me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),Ej]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ij]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...fe(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:fe()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...fe()]}],"outline-offset":[{"outline-offset":[$r,Me]}],"outline-w":[{outline:[$r,ki]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[$r,ki]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ei,Tj]}],"shadow-color":[{shadow:[pa]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ei,Me]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[m]}],saturate:[{saturate:[T]}],sepia:[{sepia:[V]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[ha,Me]}],"translate-x":[{"translate-x":[H]}],"translate-y":[{"translate-y":[H]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",Me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$r,ki,vf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Nj=hj(Rj);function Re(...e){return Nj(Zb(e))}const jj=uc("w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",{variants:{variant:{primary:"bg-blue-600",secondary:"bg-amber-500",success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-500",neutral:"bg-slate-500"},size:{sm:"w-6 h-6",md:"w-8 h-8",lg:"w-10 h-10"}},defaultVariants:{variant:"primary",size:"md"}}),bo=I.forwardRef(({label:e,icon:t,src:n,alt:r,variant:o,size:a,className:l,...c},d)=>w.jsxs("div",{ref:d,className:Re("flex items-center gap-3 mb-2",l),...c,children:[w.jsx("div",{className:Re(jj({variant:o,size:a})),children:n?w.jsx("img",{src:n,alt:r||e,className:"w-full h-full rounded-full object-cover"}):t||w.jsx("span",{className:"text-white font-medium text-sm",children:e.charAt(0).toUpperCase()})}),w.jsx("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:e})]}));bo.displayName="MessageAvatar";function Mj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Dj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zj={};function w0(e,t){return(zj.jsx?Lj:Dj).test(e)}const Oj=/[ \t\n\f\r]/g;function Fj(e){return typeof e=="object"?e.type==="text"?b0(e.value):!1:b0(e)}function b0(e){return e.replace(Oj,"")===""}class Qa{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Qa.prototype.normal={};Qa.prototype.property={};Qa.prototype.space=void 0;function s1(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Qa(n,r,t)}function Ph(e){return e.toLowerCase()}class fn{constructor(t,n){this.attribute=n,this.property=t}}fn.prototype.attribute="";fn.prototype.booleanish=!1;fn.prototype.boolean=!1;fn.prototype.commaOrSpaceSeparated=!1;fn.prototype.commaSeparated=!1;fn.prototype.defined=!1;fn.prototype.mustUseProperty=!1;fn.prototype.number=!1;fn.prototype.overloadedBoolean=!1;fn.prototype.property="";fn.prototype.spaceSeparated=!1;fn.prototype.space=void 0;let Vj=0;const De=ys(),xt=ys(),Ah=ys(),ae=ys(),Ze=ys(),ao=ys(),bn=ys();function ys(){return 2**++Vj}const Rh=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:xt,commaOrSpaceSeparated:bn,commaSeparated:ao,number:ae,overloadedBoolean:Ah,spaceSeparated:Ze},Symbol.toStringTag,{value:"Module"})),xf=Object.keys(Rh);class Dp extends fn{constructor(t,n,r,o){let a=-1;if(super(t,n),S0(this,"space",o),typeof r=="number")for(;++a<xf.length;){const l=xf[a];S0(this,xf[a],(r&Rh[l])===Rh[l])}}}Dp.prototype.defined=!0;function S0(e,t,n){n&&(e[t]=n)}function So(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const a=new Dp(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Ph(r)]=r,n[Ph(a.attribute)]=r}return new Qa(t,n,e.space)}const o1=So({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Ze,ariaCurrent:null,ariaDescribedBy:Ze,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:Ze,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:Ze,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ze,ariaLevel:ae,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:Ze,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:Ze,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:xt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function a1(e,t){return t in e?e[t]:t}function l1(e,t){return a1(e,t.toLowerCase())}const Bj=So({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ao,acceptCharset:Ze,accessKey:Ze,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:Ze,autoFocus:De,autoPlay:De,blocking:Ze,capture:null,charSet:null,checked:De,cite:null,className:Ze,cols:ae,colSpan:null,content:null,contentEditable:xt,controls:De,controlsList:Ze,coords:ae|ao,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:Ah,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:Ze,height:ae,hidden:Ah,high:ae,href:null,hrefLang:null,htmlFor:Ze,httpEquiv:Ze,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:Ze,itemRef:Ze,itemScope:De,itemType:Ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:De,optimum:ae,pattern:null,ping:Ze,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:Ze,required:De,reversed:De,rows:ae,rowSpan:ae,sandbox:Ze,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:xt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ze,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:xt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:l1}),$j=So({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bn,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ao,g2:ao,glyphName:ao,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:a1}),u1=So({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),c1=So({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:l1}),d1=So({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Uj={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Hj=/[A-Z]/g,k0=/-[a-z]/g,Wj=/^data[-\w.:]+$/i;function qj(e,t){const n=Ph(t);let r=t,o=fn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Wj.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(k0,Kj);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!k0.test(a)){let l=a.replace(Hj,Gj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Dp}return new o(r,t)}function Gj(e){return"-"+e.toLowerCase()}function Kj(e){return e.charAt(1).toUpperCase()}const Yj=s1([o1,Bj,u1,c1,d1],"html"),Lp=s1([o1,$j,u1,c1,d1],"svg");function Xj(e){return e.join(" ").trim()}function f1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ys={},wf,E0;function Qj(){if(E0)return wf;E0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
200
+ `,f="/",p="*",m="",y="comment",v="declaration";wf=function(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var E=1,P=1;function T(X){var Q=X.match(t);Q&&(E+=Q.length);var re=X.lastIndexOf(d);P=~re?X.length-re:P+X.length}function O(){var X={line:E,column:P};return function(Q){return Q.position=new V(X),H(),Q}}function V(X){this.start=X,this.end={line:E,column:P},this.source=C.source}V.prototype.content=S;function N(X){var Q=new Error(C.source+":"+E+":"+P+": "+X);if(Q.reason=X,Q.filename=C.source,Q.line=E,Q.column=P,Q.source=S,!C.silent)throw Q}function D(X){var Q=X.exec(S);if(Q){var re=Q[0];return T(re),S=S.slice(re.length),Q}}function H(){D(n)}function ee(X){var Q;for(X=X||[];Q=L();)Q!==!1&&X.push(Q);return X}function L(){var X=O();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var Q=2;m!=S.charAt(Q)&&(p!=S.charAt(Q)||f!=S.charAt(Q+1));)++Q;if(Q+=2,m===S.charAt(Q-1))return N("End of comment missing");var re=S.slice(2,Q-2);return P+=2,T(re),S=S.slice(Q),P+=2,X({type:y,comment:re})}}function te(){var X=O(),Q=D(r);if(Q){if(L(),!D(o))return N("property missing ':'");var re=D(a),fe=X({type:v,property:b(Q[0].replace(e,m)),value:re?b(re[0].replace(e,m)):m});return D(l),fe}}function G(){var X=[];ee(X);for(var Q;Q=te();)Q!==!1&&(X.push(Q),ee(X));return X}return H(),G()};function b(S){return S?S.replace(c,m):m}return wf}var C0;function Jj(){if(C0)return Ys;C0=1;var e=Ys&&Ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=n;const t=e(Qj());function n(r,o){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof o=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?o(f,p,d):p&&(a=a||{},a[f]=p)}),a}return Ys}var ma={},I0;function Zj(){if(I0)return ma;I0=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},l=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(o,c):f=f.replace(r,c),f.replace(t,l))};return ma.camelCase=d,ma}var ga,T0;function eM(){if(T0)return ga;T0=1;var e=ga&&ga.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Jj()),n=Zj();function r(o,a){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,d){c&&d&&(l[(0,n.camelCase)(c,a)]=d)}),l}return r.default=r,ga=r,ga}var tM=eM();const nM=f1(tM),h1=p1("end"),zp=p1("start");function p1(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function rM(e){const t=zp(e),n=h1(e);if(t&&n)return{start:t,end:n}}function _a(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_0(e.position):"start"in e||"end"in e?_0(e):"line"in e||"column"in e?Nh(e):""}function Nh(e){return P0(e&&e.line)+":"+P0(e&&e.column)}function _0(e){return Nh(e&&e.start)+"-"+Nh(e&&e.end)}function P0(e){return e&&typeof e=="number"?e:1}class Gt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?o=t:!a.cause&&t&&(l=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=_a(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Gt.prototype.file="";Gt.prototype.name="";Gt.prototype.reason="";Gt.prototype.message="";Gt.prototype.stack="";Gt.prototype.column=void 0;Gt.prototype.line=void 0;Gt.prototype.ancestors=void 0;Gt.prototype.cause=void 0;Gt.prototype.fatal=void 0;Gt.prototype.place=void 0;Gt.prototype.ruleId=void 0;Gt.prototype.source=void 0;const Op={}.hasOwnProperty,iM=new Map,sM=/[A-Z]/g,oM=new Set(["table","tbody","thead","tfoot","tr"]),aM=new Set(["td","th"]),m1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lM(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=gM(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=mM(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Lp:Yj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=g1(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function g1(e,t,n){if(t.type==="element")return uM(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return cM(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fM(e,t,n);if(t.type==="mdxjsEsm")return dM(e,t);if(t.type==="root")return hM(e,t,n);if(t.type==="text")return pM(e,t)}function uM(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Lp,e.schema=o),e.ancestors.push(t);const a=v1(e,t.tagName,!1),l=yM(e,t);let c=Vp(e,t);return oM.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Fj(d):!0})),y1(e,l,a,t),Fp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function cM(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ba(e,t.position)}function dM(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ba(e,t.position)}function fM(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Lp,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:v1(e,t.name,!0),l=vM(e,t),c=Vp(e,t);return y1(e,l,a,t),Fp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function hM(e,t,n){const r={};return Fp(r,Vp(e,t)),e.create(t,e.Fragment,r,n)}function pM(e,t){return t.value}function y1(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mM(e,t,n){return r;function r(o,a,l,c){const f=Array.isArray(l.children)?n:t;return c?f(a,l,c):f(a,l)}}function gM(e,t){return n;function n(r,o,a,l){const c=Array.isArray(a.children),d=zp(r);return t(o,a,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function yM(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Op.call(t.properties,o)){const a=xM(e,o,t.properties[o]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&aM.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vM(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Ba(e,t.position);else{const o=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else Ba(e,t.position);else a=r.value===null?!0:r.value;n[o]=a}return n}function Vp(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:iM;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=o.get(d)||0;l=d+"-"+f,o.set(d,f+1)}}const c=g1(e,a,l);c!==void 0&&n.push(c)}return n}function xM(e,t,n){const r=qj(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Mj(n):Xj(n)),r.property==="style"){let o=typeof n=="object"?n:wM(e,String(n));return e.stylePropertyNameCase==="css"&&(o=bM(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Uj[r.property]||r.property:r.attribute,n]}}function wM(e,t){try{return nM(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Gt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=m1+"#cannot-parse-style-attribute",o}}function v1(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,l;for(;++a<o.length;){const c=w0(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=w0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Op.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ba(e)}function Ba(e,t){const n=new Gt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=m1+"#cannot-handle-mdx-estrees-without-createevaluater",n}function bM(e){const t={};let n;for(n in e)Op.call(e,n)&&(t[SM(n)]=e[n]);return t}function SM(e){let t=e.replace(sM,kM);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function kM(e){return"-"+e.toLowerCase()}const bf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},EM={};function Bp(e,t){const n=EM,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return x1(e,r,o)}function x1(e,t,n){if(CM(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return A0(e.children,t,n)}return Array.isArray(e)?A0(e,t,n):""}function A0(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=x1(e[o],t,n);return r.join("")}function CM(e){return!!(e&&typeof e=="object")}const R0=document.createElement("i");function $p(e){const t="&"+e+";";R0.innerHTML=t;const n=R0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function En(e,t,n,r){const o=e.length;let a=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Un(e,t){return e.length>0?(En(e,e.length,0,t),e):t}const N0={}.hasOwnProperty;function w1(e){const t={};let n=-1;for(;++n<e.length;)IM(t,e[n]);return t}function IM(e,t){let n;for(n in t){const o=(N0.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){N0.call(o,l)||(o[l]=[]);const c=a[l];TM(o[l],Array.isArray(c)?c:c?[c]:[])}}}function TM(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);En(e,0,0,r)}function b1(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function cr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jt=ji(/[A-Za-z]/),Wt=ji(/[\dA-Za-z]/),_M=ji(/[#-'*+\--9=?A-Z^-~]/);function qu(e){return e!==null&&(e<32||e===127)}const jh=ji(/\d/),PM=ji(/[\dA-Fa-f]/),AM=ji(/[!-/:-@[-`{-~]/);function Ie(e){return e!==null&&e<-2}function Qe(e){return e!==null&&(e<0||e===32)}function Ve(e){return e===-2||e===-1||e===32}const cc=ji(new RegExp("\\p{P}|\\p{S}","u")),gs=ji(/\s/);function ji(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ko(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Wt(e.charCodeAt(n+1))&&Wt(e.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),o=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function He(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Ve(d)?(e.enter(n),c(d)):t(d)}function c(d){return Ve(d)&&a++<o?(e.consume(d),c):(e.exit(n),t(d))}}const RM={tokenize:NM};function NM(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),He(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ie(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const jM={tokenize:MM},j0={tokenize:DM};function MM(e){const t=this,n=[];let r=0,o,a,l;return c;function c(T){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,d,f)(T)}return f(T)}function d(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&P();const O=t.events.length;let V=O,N;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){N=t.events[V][1].end;break}E(r);let D=O;for(;D<t.events.length;)t.events[D][1].end={...N},D++;return En(t.events,V+1,0,t.events.slice(O)),t.events.length=D,f(T)}return c(T)}function f(T){if(r===n.length){if(!o)return y(T);if(o.currentConstruct&&o.currentConstruct.concrete)return b(T);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(j0,p,m)(T)}function p(T){return o&&P(),E(r),y(T)}function m(T){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,b(T)}function y(T){return t.containerState={},e.attempt(j0,v,b)(T)}function v(T){return r++,n.push([t.currentConstruct,t.containerState]),y(T)}function b(T){if(T===null){o&&P(),E(0),e.consume(T);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),S(T)}function S(T){if(T===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(T);return}return Ie(T)?(e.consume(T),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(T),S)}function C(T,O){const V=t.sliceStream(T);if(O&&V.push(null),T.previous=a,a&&(a.next=T),a=T,o.defineSkip(T.start),o.write(V),t.parser.lazy[T.start.line]){let N=o.events.length;for(;N--;)if(o.events[N][1].start.offset<l&&(!o.events[N][1].end||o.events[N][1].end.offset>l))return;const D=t.events.length;let H=D,ee,L;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(ee){L=t.events[H][1].end;break}ee=!0}for(E(r),N=D;N<t.events.length;)t.events[N][1].end={...L},N++;En(t.events,H+1,0,t.events.slice(D)),t.events.length=N}}function E(T){let O=n.length;for(;O-- >T;){const V=n[O];t.containerState=V[1],V[0].exit.call(t,e)}n.length=T}function P(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function DM(e,t,n){return He(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ho(e){if(e===null||Qe(e)||gs(e))return 1;if(cc(e))return 2}function dc(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Mh={name:"attention",resolveAll:LM,tokenize:zM};function LM(e,t){let n=-1,r,o,a,l,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[n][1].start};M0(m,-d),M0(y,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Un(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Un(f,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=Un(f,dc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Un(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Un(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,En(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function zM(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=ho(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),p=ho(d),m=!p||p===2&&o||n.includes(d),y=!o||o===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(o||!y)),f._close=!!(a===42?y:y&&(p||!m)),t(d)}}function M0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const OM={name:"autolink",tokenize:FM};function FM(e,t,n){let r=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return Jt(v)?(e.consume(v),l):v===64?n(v):f(v)}function l(v){return v===43||v===45||v===46||Wt(v)?(r=1,c(v)):f(v)}function c(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||Wt(v))&&r++<32?(e.consume(v),c):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||qu(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):_M(v)?(e.consume(v),f):n(v)}function p(v){return Wt(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||Wt(v))&&r++<63){const b=v===45?y:m;return e.consume(v),b}return n(v)}}const Ja={partial:!0,tokenize:VM};function VM(e,t,n){return r;function r(a){return Ve(a)?He(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Ie(a)?t(a):n(a)}}const S1={continuation:{tokenize:$M},exit:UM,name:"blockQuote",tokenize:BM};function BM(e,t,n){const r=this;return o;function o(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Ve(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function $M(e,t,n){const r=this;return o;function o(l){return Ve(l)?He(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(S1,t,n)(l)}}function UM(e){e.exit("blockQuote")}const k1={name:"characterEscape",tokenize:HM};function HM(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return AM(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const E1={name:"characterReference",tokenize:WM};function WM(e,t,n){const r=this;let o=0,a,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,l=Wt,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=PM,p):(e.enter("characterReferenceValue"),a=7,l=jh,p(m))}function p(m){if(m===59&&o){const y=e.exit("characterReferenceValue");return l===Wt&&!$p(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&o++<a?(e.consume(m),p):n(m)}}const D0={partial:!0,tokenize:GM},L0={concrete:!0,name:"codeFenced",tokenize:qM};function qM(e,t,n){const r=this,o={partial:!0,tokenize:V};let a=0,l=0,c;return d;function d(N){return f(N)}function f(N){const D=r.events[r.events.length-1];return a=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,c=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===c?(l++,e.consume(N),p):l<3?n(N):(e.exit("codeFencedFenceSequence"),Ve(N)?He(e,m,"whitespace")(N):m(N))}function m(N){return N===null||Ie(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(D0,S,O)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(N))}function y(N){return N===null||Ie(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(N)):Ve(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),He(e,v,"whitespace")(N)):N===96&&N===c?n(N):(e.consume(N),y)}function v(N){return N===null||Ie(N)?m(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(N))}function b(N){return N===null||Ie(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(N)):N===96&&N===c?n(N):(e.consume(N),b)}function S(N){return e.attempt(o,O,C)(N)}function C(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),E}function E(N){return a>0&&Ve(N)?He(e,P,"linePrefix",a+1)(N):P(N)}function P(N){return N===null||Ie(N)?e.check(D0,S,O)(N):(e.enter("codeFlowValue"),T(N))}function T(N){return N===null||Ie(N)?(e.exit("codeFlowValue"),P(N)):(e.consume(N),T)}function O(N){return e.exit("codeFenced"),t(N)}function V(N,D,H){let ee=0;return L;function L(re){return N.enter("lineEnding"),N.consume(re),N.exit("lineEnding"),te}function te(re){return N.enter("codeFencedFence"),Ve(re)?He(N,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):G(re)}function G(re){return re===c?(N.enter("codeFencedFenceSequence"),X(re)):H(re)}function X(re){return re===c?(ee++,N.consume(re),X):ee>=l?(N.exit("codeFencedFenceSequence"),Ve(re)?He(N,Q,"whitespace")(re):Q(re)):H(re)}function Q(re){return re===null||Ie(re)?(N.exit("codeFencedFence"),D(re)):H(re)}}}function GM(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Sf={name:"codeIndented",tokenize:YM},KM={partial:!0,tokenize:XM};function YM(e,t,n){const r=this;return o;function o(f){return e.enter("codeIndented"),He(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):Ie(f)?e.attempt(KM,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Ie(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function XM(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):Ie(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):He(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):Ie(l)?o(l):n(l)}}const QM={name:"codeText",previous:ZM,resolve:JM,tokenize:eD};function JM(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function ZM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function eD(e,t,n){let r=0,o,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),o=0,p(m)):Ie(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||Ie(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function p(m){return m===96?(e.consume(m),o++,p):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",f(m))}}class tD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&ya(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ya(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ya(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ya(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ya(this.left,n.reverse())}}}function ya(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function C1(e){const t={};let n=-1,r,o,a,l,c,d,f;const p=new tD(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,nD(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,o=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(r[1].end={...p.get(o)[1].start},c=p.slice(o,n),c.unshift(r),p.splice(o,n-o+1,c))}}return En(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function nD(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],f={};let p,m,y=-1,v=n,b=0,S=0;const C=[S];for(;v;){for(;e.get(++o)[1]!==v;);a.push(o),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(S=y+1,C.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):C.pop(),y=C.length;y--;){const E=c.slice(C[y],C[y+1]),P=a.pop();d.push([P,P+E.length-1]),e.splice(P,2,E)}for(d.reverse(),y=-1;++y<d.length;)f[b+d[y][0]]=b+d[y][1],b+=d[y][1]-d[y][0]-1;return f}const rD={resolve:sD,tokenize:oD},iD={partial:!0,tokenize:aD};function sD(e){return C1(e),e}function oD(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?a(c):Ie(c)?e.check(iD,l,a)(c):(e.consume(c),o)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function aD(e,t,n){const r=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),He(e,a,"linePrefix")}function a(l){if(l===null||Ie(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function I1(e,t,n,r,o,a,l,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(E){return E===60?(e.enter(r),e.enter(o),e.enter(a),e.consume(E),e.exit(a),y):E===null||E===32||E===41||qu(E)?n(E):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(E))}function y(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(o),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(E))}function v(E){return E===62?(e.exit("chunkString"),e.exit(c),y(E)):E===null||E===60||Ie(E)?n(E):(e.consume(E),E===92?b:v)}function b(E){return E===60||E===62||E===92?(e.consume(E),v):v(E)}function S(E){return!p&&(E===null||E===41||Qe(E))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(E)):p<f&&E===40?(e.consume(E),p++,S):E===41?(e.consume(E),p--,S):E===null||E===32||E===40||qu(E)?n(E):(e.consume(E),E===92?C:S)}function C(E){return E===40||E===41||E===92?(e.consume(E),S):S(E)}}function T1(e,t,n,r,o,a){const l=this;let c=0,d;return f;function f(v){return e.enter(r),e.enter(o),e.consume(v),e.exit(o),e.enter(a),p}function p(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(o),e.consume(v),e.exit(o),e.exit(r),t):Ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||Ie(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!Ve(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function _1(e,t,n,r,o,a){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(o),e.consume(y),e.exit(o),l=y===40?41:y,d):n(y)}function d(y){return y===l?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===l?(e.exit(a),d(l)):y===null?n(y):Ie(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),He(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===l||y===null||Ie(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===l||y===92?(e.consume(y),p):p(y)}}function Pa(e,t){let n;return r;function r(o){return Ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Ve(o)?He(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const lD={name:"definition",tokenize:cD},uD={partial:!0,tokenize:dD};function cD(e,t,n){const r=this;let o;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return T1.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return o=cr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return Qe(v)?Pa(e,f)(v):f(v)}function f(v){return I1(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(uD,m,m)(v)}function m(v){return Ve(v)?He(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ie(v)?(e.exit("definition"),r.parser.defined.push(o),t(v)):n(v)}}function dD(e,t,n){return r;function r(c){return Qe(c)?Pa(e,o)(c):n(c)}function o(c){return _1(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Ve(c)?He(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ie(c)?t(c):n(c)}}const fD={name:"hardBreakEscape",tokenize:hD};function hD(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Ie(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const pD={name:"headingAtx",resolve:mD,tokenize:gD};function mD(e,t){let n=e.length-2,r=3,o,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},En(e,r,n-r+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function gD(e,t,n){let r=0;return o;function o(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||Qe(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Ie(p)?(e.exit("atxHeading"),t(p)):Ve(p)?He(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||Qe(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const yD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],z0=["pre","script","style","textarea"],vD={concrete:!0,name:"htmlFlow",resolveTo:bD,tokenize:SD},xD={partial:!0,tokenize:ED},wD={partial:!0,tokenize:kD};function bD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SD(e,t,n){const r=this;let o,a,l,c,d;return f;function f(A){return p(A)}function p(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),y):A===47?(e.consume(A),a=!0,S):A===63?(e.consume(A),o=3,r.interrupt?t:_):Jt(A)?(e.consume(A),l=String.fromCharCode(A),C):n(A)}function y(A){return A===45?(e.consume(A),o=2,v):A===91?(e.consume(A),o=5,c=0,b):Jt(A)?(e.consume(A),o=4,r.interrupt?t:_):n(A)}function v(A){return A===45?(e.consume(A),r.interrupt?t:_):n(A)}function b(A){const Se="CDATA[";return A===Se.charCodeAt(c++)?(e.consume(A),c===Se.length?r.interrupt?t:G:b):n(A)}function S(A){return Jt(A)?(e.consume(A),l=String.fromCharCode(A),C):n(A)}function C(A){if(A===null||A===47||A===62||Qe(A)){const Se=A===47,Te=l.toLowerCase();return!Se&&!a&&z0.includes(Te)?(o=1,r.interrupt?t(A):G(A)):yD.includes(l.toLowerCase())?(o=6,Se?(e.consume(A),E):r.interrupt?t(A):G(A)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):a?P(A):T(A))}return A===45||Wt(A)?(e.consume(A),l+=String.fromCharCode(A),C):n(A)}function E(A){return A===62?(e.consume(A),r.interrupt?t:G):n(A)}function P(A){return Ve(A)?(e.consume(A),P):L(A)}function T(A){return A===47?(e.consume(A),L):A===58||A===95||Jt(A)?(e.consume(A),O):Ve(A)?(e.consume(A),T):L(A)}function O(A){return A===45||A===46||A===58||A===95||Wt(A)?(e.consume(A),O):V(A)}function V(A){return A===61?(e.consume(A),N):Ve(A)?(e.consume(A),V):T(A)}function N(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),d=A,D):Ve(A)?(e.consume(A),N):H(A)}function D(A){return A===d?(e.consume(A),d=null,ee):A===null||Ie(A)?n(A):(e.consume(A),D)}function H(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Qe(A)?V(A):(e.consume(A),H)}function ee(A){return A===47||A===62||Ve(A)?T(A):n(A)}function L(A){return A===62?(e.consume(A),te):n(A)}function te(A){return A===null||Ie(A)?G(A):Ve(A)?(e.consume(A),te):n(A)}function G(A){return A===45&&o===2?(e.consume(A),fe):A===60&&o===1?(e.consume(A),oe):A===62&&o===4?(e.consume(A),j):A===63&&o===3?(e.consume(A),_):A===93&&o===5?(e.consume(A),se):Ie(A)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(xD,Y,X)(A)):A===null||Ie(A)?(e.exit("htmlFlowData"),X(A)):(e.consume(A),G)}function X(A){return e.check(wD,Q,Y)(A)}function Q(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),re}function re(A){return A===null||Ie(A)?X(A):(e.enter("htmlFlowData"),G(A))}function fe(A){return A===45?(e.consume(A),_):G(A)}function oe(A){return A===47?(e.consume(A),l="",U):G(A)}function U(A){if(A===62){const Se=l.toLowerCase();return z0.includes(Se)?(e.consume(A),j):G(A)}return Jt(A)&&l.length<8?(e.consume(A),l+=String.fromCharCode(A),U):G(A)}function se(A){return A===93?(e.consume(A),_):G(A)}function _(A){return A===62?(e.consume(A),j):A===45&&o===2?(e.consume(A),_):G(A)}function j(A){return A===null||Ie(A)?(e.exit("htmlFlowData"),Y(A)):(e.consume(A),j)}function Y(A){return e.exit("htmlFlow"),t(A)}}function kD(e,t,n){const r=this;return o;function o(l){return Ie(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ED(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ja,t,n)}}const CD={name:"htmlText",tokenize:ID};function ID(e,t,n){const r=this;let o,a,l;return c;function c(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),d}function d(_){return _===33?(e.consume(_),f):_===47?(e.consume(_),V):_===63?(e.consume(_),T):Jt(_)?(e.consume(_),H):n(_)}function f(_){return _===45?(e.consume(_),p):_===91?(e.consume(_),a=0,b):Jt(_)?(e.consume(_),P):n(_)}function p(_){return _===45?(e.consume(_),v):n(_)}function m(_){return _===null?n(_):_===45?(e.consume(_),y):Ie(_)?(l=m,oe(_)):(e.consume(_),m)}function y(_){return _===45?(e.consume(_),v):m(_)}function v(_){return _===62?fe(_):_===45?y(_):m(_)}function b(_){const j="CDATA[";return _===j.charCodeAt(a++)?(e.consume(_),a===j.length?S:b):n(_)}function S(_){return _===null?n(_):_===93?(e.consume(_),C):Ie(_)?(l=S,oe(_)):(e.consume(_),S)}function C(_){return _===93?(e.consume(_),E):S(_)}function E(_){return _===62?fe(_):_===93?(e.consume(_),E):S(_)}function P(_){return _===null||_===62?fe(_):Ie(_)?(l=P,oe(_)):(e.consume(_),P)}function T(_){return _===null?n(_):_===63?(e.consume(_),O):Ie(_)?(l=T,oe(_)):(e.consume(_),T)}function O(_){return _===62?fe(_):T(_)}function V(_){return Jt(_)?(e.consume(_),N):n(_)}function N(_){return _===45||Wt(_)?(e.consume(_),N):D(_)}function D(_){return Ie(_)?(l=D,oe(_)):Ve(_)?(e.consume(_),D):fe(_)}function H(_){return _===45||Wt(_)?(e.consume(_),H):_===47||_===62||Qe(_)?ee(_):n(_)}function ee(_){return _===47?(e.consume(_),fe):_===58||_===95||Jt(_)?(e.consume(_),L):Ie(_)?(l=ee,oe(_)):Ve(_)?(e.consume(_),ee):fe(_)}function L(_){return _===45||_===46||_===58||_===95||Wt(_)?(e.consume(_),L):te(_)}function te(_){return _===61?(e.consume(_),G):Ie(_)?(l=te,oe(_)):Ve(_)?(e.consume(_),te):ee(_)}function G(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),o=_,X):Ie(_)?(l=G,oe(_)):Ve(_)?(e.consume(_),G):(e.consume(_),Q)}function X(_){return _===o?(e.consume(_),o=void 0,re):_===null?n(_):Ie(_)?(l=X,oe(_)):(e.consume(_),X)}function Q(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Qe(_)?ee(_):(e.consume(_),Q)}function re(_){return _===47||_===62||Qe(_)?ee(_):n(_)}function fe(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function oe(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),U}function U(_){return Ve(_)?He(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):se(_)}function se(_){return e.enter("htmlTextData"),l(_)}}const Up={name:"labelEnd",resolveAll:AD,resolveTo:RD,tokenize:ND},TD={tokenize:jD},_D={tokenize:MD},PD={tokenize:DD};function AD(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&En(e,0,e.length,n),e}function RD(e,t){let n=e.length,r=0,o,a,l,c;for(;n--;)if(o=e[n][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=Un(c,e.slice(a+1,a+r+3)),c=Un(c,[["enter",p,t]]),c=Un(c,dc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=Un(c,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),c=Un(c,e.slice(l+1)),c=Un(c,[["exit",d,t]]),En(e,a,e.length,c),e}function ND(e,t,n){const r=this;let o=r.events.length,a,l;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){a=r.events[o][1];break}return c;function c(y){return a?a._inactive?m(y):(l=r.parser.defined.includes(cr(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(TD,p,l?p:m)(y):y===91?e.attempt(_D,p,l?f:m)(y):l?p(y):m(y)}function f(y){return e.attempt(PD,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function jD(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),o}function o(m){return Qe(m)?Pa(e,a)(m):a(m)}function a(m){return m===41?p(m):I1(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return Qe(m)?Pa(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?_1(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Qe(m)?Pa(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function MD(e,t,n){const r=this;return o;function o(c){return T1.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(cr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function DD(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const LD={name:"labelStartImage",resolveAll:Up.resolveAll,tokenize:zD};function zD(e,t,n){const r=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const OD={name:"labelStartLink",resolveAll:Up.resolveAll,tokenize:FD};function FD(e,t,n){const r=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const kf={name:"lineEnding",tokenize:VD};function VD(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),He(e,t,"linePrefix")}}const Lu={name:"thematicBreak",tokenize:BD};function BD(e,t,n){let r=0,o;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return o=f,c(f)}function c(f){return f===o?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ie(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===o?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Ve(f)?He(e,c,"whitespace")(f):c(f))}}const un={continuation:{tokenize:WD},exit:GD,name:"list",tokenize:HD},$D={partial:!0,tokenize:KD},UD={partial:!0,tokenize:qD};function HD(e,t,n){const r=this,o=r.events[r.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(v){const b=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:jh(v)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Lu,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return jh(v)&&++l<10?(e.consume(v),d):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Ja,r.interrupt?n:p,e.attempt($D,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return Ve(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function WD(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ja,o,a);function o(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,He(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!Ve(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(UD,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,He(e,e.attempt(un,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function qD(e,t,n){const r=this;return He(e,o,"listItemIndent",r.containerState.size+1);function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function GD(e){e.exit(this.containerState.type)}function KD(e,t,n){const r=this;return He(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const l=r.events[r.events.length-1];return!Ve(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const O0={name:"setextUnderline",resolveTo:YD,tokenize:XD};function YD(e,t){let n=e.length,r,o,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function XD(e,t,n){const r=this;let o;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),o=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===o?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Ve(f)?He(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ie(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const QD={tokenize:JD};function JD(e){const t=this,n=e.attempt(Ja,r,e.attempt(this.parser.constructs.flowInitial,o,He(e,e.attempt(this.parser.constructs.flow,o,e.attempt(rD,o)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ZD={resolveAll:A1()},eL=P1("string"),tL=P1("text");function P1(e){return{resolveAll:A1(e==="text"?nL:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],a=n.attempt(o,l,c);return l;function l(p){return f(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=o[p];let y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function A1(e){return t;function t(n,r){let o=-1,a;for(;++o<=n.length;)a===void 0?n[o]&&n[o][1].type==="data"&&(a=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==a+2&&(n[a][1].end=n[o-1][1].end,n.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(n,r):n}}function nL(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let a=o.length,l=-1,c=0,d;for(;a--;){const f=o[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const rL={42:un,43:un,45:un,48:un,49:un,50:un,51:un,52:un,53:un,54:un,55:un,56:un,57:un,62:S1},iL={91:lD},sL={[-2]:Sf,[-1]:Sf,32:Sf},oL={35:pD,42:Lu,45:[O0,Lu],60:vD,61:O0,95:Lu,96:L0,126:L0},aL={38:E1,92:k1},lL={[-5]:kf,[-4]:kf,[-3]:kf,33:LD,38:E1,42:Mh,60:[OM,CD],91:OD,92:[fD,k1],93:Up,95:Mh,96:QM},uL={null:[Mh,ZD]},cL={null:[42,95]},dL={null:[]},fL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cL,contentInitial:iL,disable:dL,document:rL,flow:oL,flowInitial:sL,insideSpan:uL,string:aL,text:lL},Symbol.toStringTag,{value:"Module"}));function hL(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},a=[];let l=[],c=[];const d={attempt:D(V),check:D(N),consume:P,enter:T,exit:O,interrupt:D(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:b,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(te){return l=Un(l,te),C(),l[l.length-1]!==null?[]:(H(t,0),f.events=dc(a,f.events,f),f.events)}function y(te,G){return mL(v(te),G)}function v(te){return pL(l,te)}function b(){const{_bufferIndex:te,_index:G,line:X,column:Q,offset:re}=r;return{_bufferIndex:te,_index:G,line:X,column:Q,offset:re}}function S(te){o[te.line]=te.column,L()}function C(){let te;for(;r._index<l.length;){const G=l[r._index];if(typeof G=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<G.length;)E(G.charCodeAt(r._bufferIndex));else E(G)}}function E(te){p=p(te)}function P(te){Ie(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,L()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=te}function T(te,G){const X=G||{};return X.type=te,X.start=b(),f.events.push(["enter",X,f]),c.push(X),X}function O(te){const G=c.pop();return G.end=b(),f.events.push(["exit",G,f]),G}function V(te,G){H(te,G.from)}function N(te,G){G.restore()}function D(te,G){return X;function X(Q,re,fe){let oe,U,se,_;return Array.isArray(Q)?Y(Q):"tokenize"in Q?Y([Q]):j(Q);function j(ke){return ze;function ze(de){const he=de!==null&&ke[de],Ne=de!==null&&ke.null,Ke=[...Array.isArray(he)?he:he?[he]:[],...Array.isArray(Ne)?Ne:Ne?[Ne]:[]];return Y(Ke)(de)}}function Y(ke){return oe=ke,U=0,ke.length===0?fe:A(ke[U])}function A(ke){return ze;function ze(de){return _=ee(),se=ke,ke.partial||(f.currentConstruct=ke),ke.name&&f.parser.constructs.disable.null.includes(ke.name)?Te():ke.tokenize.call(G?Object.assign(Object.create(f),G):f,d,Se,Te)(de)}}function Se(ke){return te(se,_),re}function Te(ke){return _.restore(),++U<oe.length?A(oe[U]):fe}}}function H(te,G){te.resolveAll&&!a.includes(te)&&a.push(te),te.resolve&&En(f.events,G,f.events.length-G,te.resolve(f.events.slice(G),f)),te.resolveTo&&(f.events=te.resolveTo(f.events,f))}function ee(){const te=b(),G=f.previous,X=f.currentConstruct,Q=f.events.length,re=Array.from(c);return{from:Q,restore:fe};function fe(){r=te,f.previous=G,f.currentConstruct=X,f.events.length=Q,c=re,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function pL(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,a)];else{if(l=e.slice(n,o),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[o].slice(0,a))}return l}function mL(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
201
201
  `;break}case-3:{l=`\r
202
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(a)}o=a===-2,r.push(l)}return r.join("")}function gL(e){const r={constructs:w1([fL,...(e||{}).extensions||[]]),content:o(RM),defined:[],document:o(jM),flow:o(QD),lazy:{},string:o(eL),text:o(tL)};return r;function o(a){return l;function l(c){return hL(r,a,c)}}}function yL(e){for(;!C1(e););return e}const F0=/[\0\t\n\r]/g;function vL(){let e=1,t="",n=!0,r;return o;function o(a,l,c){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(F0.lastIndex=m,f=F0.exec(a),y=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(y),!f){t=a.slice(m);break}if(v===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const xL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wL(e){return e.replace(xL,bL)}function bL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return b1(n.slice(a?2:1),a?16:10)}return $p(n)||e}const R1={}.hasOwnProperty;function SL(e,t,n){return typeof t!="string"&&(n=t,t=void 0),kL(n)(yL(gL(n).document().write(vL()(e,t,!0))))}function kL(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Qr),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:a(Xr),blockQuote:a(Re),characterEscape:ee,characterReference:ee,codeFenced:a(Ye),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ye,l),codeText:a(Mi,l),codeTextData:ee,data:ee,codeFlowValue:ee,definition:a(Kn),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Yr),hardBreakEscape:a(Di),hardBreakTrailing:a(Di),htmlFlow:a(tn,l),htmlFlowData:ee,htmlText:a(tn,l),htmlTextData:ee,image:a(Li),label:l,link:a(Qr),listItem:a(Cn),listItemValue:y,listOrdered:a(fr,m),listUnordered:a(fr),paragraph:a(Yn),reference:A,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Xr),strong:a(Jr),thematicBreak:a(ei)},exit:{atxHeading:d(),atxHeadingSequence:V,autolink:d(),autolinkEmail:he,autolinkProtocol:de,blockQuote:d(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:Se,characterReference:Oe,codeFenced:d(C),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:L,codeIndented:d(E),codeText:d(re),codeTextData:L,data:L,definition:d(),definitionDestinationString:O,definitionLabelString:P,definitionTitleString:T,emphasis:d(),hardBreakEscape:d(G),hardBreakTrailing:d(G),htmlFlow:d(X),htmlFlowData:L,htmlText:d(Q),htmlTextData:L,image:d(oe),label:se,labelText:U,lineEnding:te,link:d(fe),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:be,resourceDestinationString:_,resourceTitleString:j,resource:Y,setextHeading:d(H),setextHeadingLineSequence:D,setextHeadingText:N,strong:d(),thematicBreak:d()}};N1(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let ue={type:"root",children:[]};const Te={stack:[ue],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:p,data:n},ze=[];let $e=-1;for(;++$e<K.length;)if(K[$e][1].type==="listOrdered"||K[$e][1].type==="listUnordered")if(K[$e][0]==="enter")ze.push($e);else{const kt=ze.pop();$e=o(K,kt,$e)}for($e=-1;++$e<K.length;){const kt=t[K[$e][0]];R1.call(kt,K[$e][1].type)&&kt[K[$e][1].type].call(Object.assign({sliceSerialize:K[$e][2].sliceSerialize},Te),K[$e][1])}if(Te.tokenStack.length>0){const kt=Te.tokenStack[Te.tokenStack.length-1];(kt[1]||V0).call(Te,void 0,kt[0])}for(ue.position={start:Ci(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Ci(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<t.transforms.length;)ue=t.transforms[$e](ue)||ue;return ue}function o(K,ue,Te){let ze=ue-1,$e=-1,kt=!1,In,zt,Ot,Nt;for(;++ze<=Te;){const tt=K[ze];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?$e++:$e--,Nt=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&(In&&!Nt&&!$e&&!Ot&&(Ot=ze),Nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Nt=void 0}if(!$e&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||$e===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if(In){let Yt=ze;for(zt=void 0;Yt--;){const ht=K[Yt];if(ht[1].type==="lineEnding"||ht[1].type==="lineEndingBlank"){if(ht[0]==="exit")continue;zt&&(K[zt][1].type="lineEndingBlank",kt=!0),ht[1].type="lineEnding",zt=Yt}else if(!(ht[1].type==="linePrefix"||ht[1].type==="blockQuotePrefix"||ht[1].type==="blockQuotePrefixWhitespace"||ht[1].type==="blockQuoteMarker"||ht[1].type==="listItemIndent"))break}Ot&&(!zt||Ot<zt)&&(In._spread=!0),In.end=Object.assign({},zt?K[zt][1].start:tt[1].end),K.splice(zt||ze,0,["exit",In,tt[2]]),ze++,Te++}if(tt[1].type==="listItemPrefix"){const Yt={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};In=Yt,K.splice(ze,0,["enter",Yt,tt[2]]),ze++,Te++,Ot=void 0,Nt=!0}}}return K[ue][1]._spread=kt,Te}function a(K,ue){return Te;function Te(ze){c.call(this,K(ze),ze),ue&&ue.call(this,ze)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(K,ue,Te){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([ue,Te||void 0]),K.position={start:Ci(ue.start),end:void 0}}function d(K){return ue;function ue(Te){K&&K.call(this,Te),f.call(this,Te)}}function f(K,ue){const Te=this.stack.pop(),ze=this.tokenStack.pop();if(ze)ze[0].type!==K.type&&(ue?ue.call(this,K,ze[0]):(ze[1]||V0).call(this,K,ze[0]));else throw new Error("Cannot close `"+K.type+"` ("+_a({start:K.start,end:K.end})+"): it’s not open");Te.position.end=Ci(K.end)}function p(){return Bp(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(K){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function v(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=K}function b(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=K}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K.replace(/(\r?\n|\r)$/g,"")}function P(K){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ue,Te.identifier=cr(this.sliceSerialize(K)).toLowerCase()}function T(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.title=K}function O(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.url=K}function V(K){const ue=this.stack[this.stack.length-1];if(!ue.depth){const Te=this.sliceSerialize(K).length;ue.depth=Te}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function D(K){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(K){const Te=this.stack[this.stack.length-1].children;let ze=Te[Te.length-1];(!ze||ze.type!=="text")&&(ze=Zr(),ze.position={start:Ci(K.start),end:void 0},Te.push(ze)),this.stack.push(ze)}function L(K){const ue=this.stack.pop();ue.value+=this.sliceSerialize(K),ue.position.end=Ci(K.end)}function te(K){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ue.children[ue.children.length-1];Te.position.end=Ci(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ue.type)&&(ee.call(this,K),L.call(this,K))}function G(){this.data.atHardBreak=!0}function X(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K}function Q(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K}function re(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K}function fe(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ue,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function oe(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ue,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function U(K){const ue=this.sliceSerialize(K),Te=this.stack[this.stack.length-2];Te.label=wL(ue),Te.identifier=cr(ue).toLowerCase()}function se(){const K=this.stack[this.stack.length-1],ue=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const ze=K.children;Te.children=ze}else Te.alt=ue}function _(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.url=K}function j(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.title=K}function Y(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function be(K){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ue,Te.identifier=cr(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function Ie(K){this.data.characterReferenceType=K.type}function Se(K){const ue=this.sliceSerialize(K),Te=this.data.characterReferenceType;let ze;Te?(ze=b1(ue,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=$p(ue);const $e=this.stack[this.stack.length-1];$e.value+=ze}function Oe(K){const ue=this.stack.pop();ue.position.end=Ci(K.end)}function de(K){L.call(this,K);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(K)}function he(K){L.call(this,K);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(K)}function Re(){return{type:"blockquote",children:[]}}function Ye(){return{type:"code",lang:null,meta:null,value:""}}function Mi(){return{type:"inlineCode",value:""}}function Kn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Yr(){return{type:"emphasis",children:[]}}function Xr(){return{type:"heading",depth:0,children:[]}}function Di(){return{type:"break"}}function tn(){return{type:"html",value:""}}function Li(){return{type:"image",title:null,url:"",alt:null}}function Qr(){return{type:"link",title:null,url:"",children:[]}}function fr(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function Cn(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Yn(){return{type:"paragraph",children:[]}}function Jr(){return{type:"strong",children:[]}}function Zr(){return{type:"text",value:""}}function ei(){return{type:"thematicBreak"}}}function Ci(e){return{line:e.line,column:e.column,offset:e.offset}}function N1(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?N1(e,r):EL(e,r)}}function EL(e,t){let n;for(n in t)if(R1.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function V0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_a({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_a({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_a({start:t.start,end:t.end})+") is still open")}function CL(e){const t=this;t.parser=n;function n(r){return SL(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function IL(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function TL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
202
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(a)}o=a===-2,r.push(l)}return r.join("")}function gL(e){const r={constructs:w1([fL,...(e||{}).extensions||[]]),content:o(RM),defined:[],document:o(jM),flow:o(QD),lazy:{},string:o(eL),text:o(tL)};return r;function o(a){return l;function l(c){return hL(r,a,c)}}}function yL(e){for(;!C1(e););return e}const F0=/[\0\t\n\r]/g;function vL(){let e=1,t="",n=!0,r;return o;function o(a,l,c){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(F0.lastIndex=m,f=F0.exec(a),y=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(y),!f){t=a.slice(m);break}if(v===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const xL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wL(e){return e.replace(xL,bL)}function bL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return b1(n.slice(a?2:1),a?16:10)}return $p(n)||e}const R1={}.hasOwnProperty;function SL(e,t,n){return typeof t!="string"&&(n=t,t=void 0),kL(n)(yL(gL(n).document().write(vL()(e,t,!0))))}function kL(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Qr),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:a(Xr),blockQuote:a(Ne),characterEscape:ee,characterReference:ee,codeFenced:a(Ke),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ke,l),codeText:a(Mi,l),codeTextData:ee,data:ee,codeFlowValue:ee,definition:a(Kn),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Yr),hardBreakEscape:a(Di),hardBreakTrailing:a(Di),htmlFlow:a(en,l),htmlFlowData:ee,htmlText:a(en,l),htmlTextData:ee,image:a(Li),label:l,link:a(Qr),listItem:a(Cn),listItemValue:y,listOrdered:a(fr,m),listUnordered:a(fr),paragraph:a(Yn),reference:A,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Xr),strong:a(Jr),thematicBreak:a(ei)},exit:{atxHeading:d(),atxHeadingSequence:V,autolink:d(),autolinkEmail:he,autolinkProtocol:de,blockQuote:d(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:ke,characterReference:ze,codeFenced:d(C),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:L,codeIndented:d(E),codeText:d(re),codeTextData:L,data:L,definition:d(),definitionDestinationString:O,definitionLabelString:P,definitionTitleString:T,emphasis:d(),hardBreakEscape:d(G),hardBreakTrailing:d(G),htmlFlow:d(X),htmlFlowData:L,htmlText:d(Q),htmlTextData:L,image:d(oe),label:se,labelText:U,lineEnding:te,link:d(fe),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Se,resourceDestinationString:_,resourceTitleString:j,resource:Y,setextHeading:d(H),setextHeadingLineSequence:D,setextHeadingText:N,strong:d(),thematicBreak:d()}};N1(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let ue={type:"root",children:[]};const _e={stack:[ue],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:p,data:n},Le=[];let Be=-1;for(;++Be<K.length;)if(K[Be][1].type==="listOrdered"||K[Be][1].type==="listUnordered")if(K[Be][0]==="enter")Le.push(Be);else{const St=Le.pop();Be=o(K,St,Be)}for(Be=-1;++Be<K.length;){const St=t[K[Be][0]];R1.call(St,K[Be][1].type)&&St[K[Be][1].type].call(Object.assign({sliceSerialize:K[Be][2].sliceSerialize},_e),K[Be][1])}if(_e.tokenStack.length>0){const St=_e.tokenStack[_e.tokenStack.length-1];(St[1]||V0).call(_e,void 0,St[0])}for(ue.position={start:Ci(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Ci(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)ue=t.transforms[Be](ue)||ue;return ue}function o(K,ue,_e){let Le=ue-1,Be=-1,St=!1,In,Lt,zt,Rt;for(;++Le<=_e;){const et=K[Le];switch(et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{et[0]==="enter"?Be++:Be--,Rt=void 0;break}case"lineEndingBlank":{et[0]==="enter"&&(In&&!Rt&&!Be&&!zt&&(zt=Le),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!Be&&et[0]==="enter"&&et[1].type==="listItemPrefix"||Be===-1&&et[0]==="exit"&&(et[1].type==="listUnordered"||et[1].type==="listOrdered")){if(In){let Kt=Le;for(Lt=void 0;Kt--;){const ft=K[Kt];if(ft[1].type==="lineEnding"||ft[1].type==="lineEndingBlank"){if(ft[0]==="exit")continue;Lt&&(K[Lt][1].type="lineEndingBlank",St=!0),ft[1].type="lineEnding",Lt=Kt}else if(!(ft[1].type==="linePrefix"||ft[1].type==="blockQuotePrefix"||ft[1].type==="blockQuotePrefixWhitespace"||ft[1].type==="blockQuoteMarker"||ft[1].type==="listItemIndent"))break}zt&&(!Lt||zt<Lt)&&(In._spread=!0),In.end=Object.assign({},Lt?K[Lt][1].start:et[1].end),K.splice(Lt||Le,0,["exit",In,et[2]]),Le++,_e++}if(et[1].type==="listItemPrefix"){const Kt={type:"listItem",_spread:!1,start:Object.assign({},et[1].start),end:void 0};In=Kt,K.splice(Le,0,["enter",Kt,et[2]]),Le++,_e++,zt=void 0,Rt=!0}}}return K[ue][1]._spread=St,_e}function a(K,ue){return _e;function _e(Le){c.call(this,K(Le),Le),ue&&ue.call(this,Le)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(K,ue,_e){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([ue,_e||void 0]),K.position={start:Ci(ue.start),end:void 0}}function d(K){return ue;function ue(_e){K&&K.call(this,_e),f.call(this,_e)}}function f(K,ue){const _e=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==K.type&&(ue?ue.call(this,K,Le[0]):(Le[1]||V0).call(this,K,Le[0]));else throw new Error("Cannot close `"+K.type+"` ("+_a({start:K.start,end:K.end})+"): it’s not open");_e.position.end=Ci(K.end)}function p(){return Bp(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(K){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function v(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=K}function b(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=K}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K.replace(/(\r?\n|\r)$/g,"")}function P(K){const ue=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ue,_e.identifier=cr(this.sliceSerialize(K)).toLowerCase()}function T(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.title=K}function O(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.url=K}function V(K){const ue=this.stack[this.stack.length-1];if(!ue.depth){const _e=this.sliceSerialize(K).length;ue.depth=_e}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function D(K){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(K){const _e=this.stack[this.stack.length-1].children;let Le=_e[_e.length-1];(!Le||Le.type!=="text")&&(Le=Zr(),Le.position={start:Ci(K.start),end:void 0},_e.push(Le)),this.stack.push(Le)}function L(K){const ue=this.stack.pop();ue.value+=this.sliceSerialize(K),ue.position.end=Ci(K.end)}function te(K){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=ue.children[ue.children.length-1];_e.position.end=Ci(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ue.type)&&(ee.call(this,K),L.call(this,K))}function G(){this.data.atHardBreak=!0}function X(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K}function Q(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K}function re(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.value=K}function fe(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ue,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function oe(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ue,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function U(K){const ue=this.sliceSerialize(K),_e=this.stack[this.stack.length-2];_e.label=wL(ue),_e.identifier=cr(ue).toLowerCase()}function se(){const K=this.stack[this.stack.length-1],ue=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const Le=K.children;_e.children=Le}else _e.alt=ue}function _(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.url=K}function j(){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.title=K}function Y(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function Se(K){const ue=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ue,_e.identifier=cr(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function Te(K){this.data.characterReferenceType=K.type}function ke(K){const ue=this.sliceSerialize(K),_e=this.data.characterReferenceType;let Le;_e?(Le=b1(ue,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=$p(ue);const Be=this.stack[this.stack.length-1];Be.value+=Le}function ze(K){const ue=this.stack.pop();ue.position.end=Ci(K.end)}function de(K){L.call(this,K);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(K)}function he(K){L.call(this,K);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(K)}function Ne(){return{type:"blockquote",children:[]}}function Ke(){return{type:"code",lang:null,meta:null,value:""}}function Mi(){return{type:"inlineCode",value:""}}function Kn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Yr(){return{type:"emphasis",children:[]}}function Xr(){return{type:"heading",depth:0,children:[]}}function Di(){return{type:"break"}}function en(){return{type:"html",value:""}}function Li(){return{type:"image",title:null,url:"",alt:null}}function Qr(){return{type:"link",title:null,url:"",children:[]}}function fr(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function Cn(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Yn(){return{type:"paragraph",children:[]}}function Jr(){return{type:"strong",children:[]}}function Zr(){return{type:"text",value:""}}function ei(){return{type:"thematicBreak"}}}function Ci(e){return{line:e.line,column:e.column,offset:e.offset}}function N1(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?N1(e,r):EL(e,r)}}function EL(e,t){let n;for(n in t)if(R1.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function V0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_a({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_a({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_a({start:t.start,end:t.end})+") is still open")}function CL(e){const t=this;t.parser=n;function n(r){return SL(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function IL(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function TL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
203
203
  `}]}function _L(e,t){const n=t.value?t.value+`
204
204
  `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function PL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=ko(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function NL(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function j1(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function ML(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return j1(e,t);const o={src:ko(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function DL(e,t){const n={src:ko(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function LL(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function zL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return j1(e,t);const o={href:ko(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function OL(e,t){const n={href:ko(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function FL(e,t,n){const r=e.all(t),o=n?VL(n):M1(t),a={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(o||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
205
205
  `}),p.type==="element"&&p.tagName==="p"&&!o?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
@@ -209,7 +209,7 @@ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}
209
209
  `});++r<e.length;)r&&n.push({type:"text",value:`
210
210
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
211
211
  `}),n}function G0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function K0(e,t){const n=pz(e,t),r=n.one(e,void 0),o=iz(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
212
- `},o),a}function xz(e,t){return e&&"run"in e?async function(n,r){const o=K0(n,{file:r,...t});await e.run(o,r)}:function(n,r){return K0(n,{file:r,...e||t})}}function Y0(e){if(e)throw e}var Ef,X0;function wz(){if(X0)return Ef;X0=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Ef=function d(){var f,p,m,y,v,b,S=arguments[0],C=1,E=arguments.length,P=!1;for(typeof S=="boolean"&&(P=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<E;++C)if(f=arguments[C],f!=null)for(p in f)m=c(S,p),y=c(f,p),S!==y&&(P&&y&&(a(y)||(v=o(y)))?(v?(v=!1,b=m&&o(m)?m:[]):b=m&&a(m)?m:{},l(S,{name:p,newValue:d(P,b,y)})):typeof y<"u"&&l(S,{name:p,newValue:y}));return S},Ef}var bz=wz();const Cf=f1(bz);function zh(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Sz(){const e=[],t={run:n,use:r};return t;function n(...o){let a=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(d,...f){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<o.length;)(f[m]===null||f[m]===void 0)&&(f[m]=o[m]);o=f,p?kz(p,c)(...f):l(null,...f)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function kz(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(o);try{d=e.apply(this,l)}catch(f){const p=f;if(c&&n)throw p;return o(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,o):d instanceof Error?o(d):a(d))}function o(l,...c){n||(n=!0,t(l,...c))}function a(l){o(null,l)}}const br={basename:Ez,dirname:Cz,extname:Iz,join:Tz,sep:"/"};function Ez(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Za(e);let n=0,r=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else r<0&&(a=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else l<0&&(a=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(r=o):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Cz(e){if(Za(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Iz(e){Za(e);let t=e.length,n=-1,r=0,o=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||n<0||a===0||a===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function Tz(...e){let t=-1,n;for(;++t<e.length;)Za(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_z(n)}function _z(e){Za(e);const t=e.codePointAt(0)===47;let n=Pz(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Pz(e,t){let n="",r=0,o=-1,a=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||a===1))if(o!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),o=l,a=0;continue}}else if(n.length>0){n="",r=0,o=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function Za(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Az={cwd:Rz};function Rz(){return"/"}function Oh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Nz(e){if(typeof e=="string")e=new URL(e);else if(!Oh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return jz(e)}function jz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const If=["history","path","basename","stem","extname","dirname"];class V1{constructor(t){let n;t?Oh(t)?n={path:t}:typeof t=="string"||Mz(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Az.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<If.length;){const a=If[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)If.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?br.basename(this.path):void 0}set basename(t){_f(t,"basename"),Tf(t,"basename"),this.path=br.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?br.dirname(this.path):void 0}set dirname(t){Q0(this.basename,"dirname"),this.path=br.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?br.extname(this.path):void 0}set extname(t){if(Tf(t,"extname"),Q0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=br.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Oh(t)&&(t=Nz(t)),_f(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?br.basename(this.path,this.extname):void 0}set stem(t){_f(t,"stem"),Tf(t,"stem"),this.path=br.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Kt(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Tf(e,t){if(e&&e.includes(br.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+br.sep+"`")}function _f(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Q0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Mz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Dz=(function(e){const r=this.constructor.prototype,o=r[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Lz={}.hasOwnProperty;class Yp extends Dz{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Sz()}copy(){const t=new Yp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Cf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Rf("data",this.frozen),this.namespace[t]=n,this):Lz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rf("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ku(t),r=this.parser||this.Parser;return Pf("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Pf("process",this.parser||this.Parser),Af("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const c=ku(t),d=r.parse(c);r.run(d,c,function(p,m,y){if(p||!m||!y)return f(p);const v=m,b=r.stringify(v,y);Fz(b)?y.value=b:y.result=b,f(p,y)});function f(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Pf("processSync",this.parser||this.Parser),Af("processSync",this.compiler||this.Compiler),this.process(t,o),Z0("processSync","process",n),r;function o(a,l){n=!0,Y0(a),r=l}}run(t,n,r){J0(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,c){const d=ku(n);o.run(t,d,f);function f(p,m,y){const v=m||t;p?c(p):l?l(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,o;return this.run(t,n,a),Z0("runSync","run",r),o;function a(l,c){Y0(l),o=c,r=!0}}stringify(t,n){this.freeze();const r=ku(n),o=this.compiler||this.Compiler;return Af("stringify",o),J0(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Rf("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(o.settings=Cf(!0,o.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===f){y=m;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[v,...b]=p;const S=r[y][1];zh(S)&&zh(v)&&(v=Cf(!0,S,v)),r[y]=[f,v,...b]}}}}const zz=new Yp().freeze();function Pf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Af(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rf(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function J0(e){if(!zh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Z0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ku(e){return Oz(e)?e:new V1(e)}function Oz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fz(e){return typeof e=="string"||Vz(e)}function Vz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ex=[],tx={allowDangerousHtml:!0},$z=/^(https?|ircs?|mailto|xmpp)$/i,Uz=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Hz(e){const t=Wz(e),n=qz(e);return Gz(t.runSync(t.parse(n),n),e)}function Wz(e){const t=e.rehypePlugins||ex,n=e.remarkPlugins||ex,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tx}:tx;return zz().use(CL).use(n).use(xz,r).use(t)}function qz(e){const t=e.children||"",n=new V1;return typeof t=="string"&&(n.value=t),n}function Gz(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||Kz;for(const p of Uz)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Bz+p.id,void 0);return Kp(e,f),lM(e,{Fragment:w.Fragment,components:o,ignoreInvalidStyle:!0,jsx:w.jsx,jsxs:w.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return l?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in bf)if(Object.hasOwn(bf,v)&&Object.hasOwn(p.properties,v)){const b=p.properties[v],S=bf[v];(S===null||S.includes(p.tagName))&&(p.properties[v]=d(String(b||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,y)),v&&y&&typeof m=="number")return c&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function Kz(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||$z.test(e.slice(0,t))?e:""}function nx(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function Yz(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Xz(e,t,n){const o=hc((n||{}).ignore||[]),a=Qz(t);let l=-1;for(;++l<a.length;)F1(e,"text",c);function c(f,p){let m=-1,y;for(;++m<p.length;){const v=p[m],b=y?y.children:void 0;if(o(v,b?b.indexOf(v):void 0,y))return;y=v}if(y)return d(f,p)}function d(f,p){const m=p[p.length-1],y=a[l][0],v=a[l][1];let b=0;const C=m.children.indexOf(f);let E=!1,P=[];y.lastIndex=0;let T=y.exec(f.value);for(;T;){const O=T.index,V={index:T.index,input:T.input,stack:[...p,f]};let N=v(...T,V);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?y.lastIndex=O+1:(b!==O&&P.push({type:"text",value:f.value.slice(b,O)}),Array.isArray(N)?P.push(...N):N&&P.push(N),b=O+T[0].length,E=!0),!y.global)break;T=y.exec(f.value)}return E?(b<f.value.length&&P.push({type:"text",value:f.value.slice(b)}),m.children.splice(C,1,...P)):P=[f],C+P.length}}function Qz(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([Jz(o[0]),Zz(o[1])])}return t}function Jz(e){return typeof e=="string"?new RegExp(Yz(e),"g"):e}function Zz(e){return typeof e=="function"?e:function(){return e}}const Nf="phrasing",jf=["autolink","link","image","label"];function eO(){return{transforms:[aO],enter:{literalAutolink:nO,literalAutolinkEmail:Mf,literalAutolinkHttp:Mf,literalAutolinkWww:Mf},exit:{literalAutolink:oO,literalAutolinkEmail:sO,literalAutolinkHttp:rO,literalAutolinkWww:iO}}}function tO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Nf,notInConstruct:jf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Nf,notInConstruct:jf},{character:":",before:"[ps]",after:"\\/",inConstruct:Nf,notInConstruct:jf}]}}function nO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Mf(e){this.config.enter.autolinkProtocol.call(this,e)}function rO(e){this.config.exit.autolinkProtocol.call(this,e)}function iO(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function sO(e){this.config.exit.autolinkEmail.call(this,e)}function oO(e){this.exit(e)}function aO(e){Xz(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),uO]],{ignore:["link","linkReference"]})}function lO(e,t,n,r,o){let a="";if(!B1(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!cO(n)))return!1;const l=dO(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function uO(e,t,n,r){return!B1(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function cO(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function dO(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=nx(e,"(");let a=nx(e,")");for(;r!==-1&&o>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function B1(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gs(n)||cc(n))&&(!t||n!==47)}$1.peek=wO;function fO(){this.buffer()}function hO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function pO(){this.buffer()}function mO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yO(e){this.exit(e)}function vO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xO(e){this.exit(e)}function wO(){return"["}function $1(e,t,n,r){const o=n.createTracker(r);let a=o.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=o.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=o.move("]"),a}function bO(){return{enter:{gfmFootnoteCallString:fO,gfmFootnoteCall:hO,gfmFootnoteDefinitionLabelString:pO,gfmFootnoteDefinition:mO},exit:{gfmFootnoteCallString:gO,gfmFootnoteCall:yO,gfmFootnoteDefinitionLabelString:vO,gfmFootnoteDefinition:xO}}}function SO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$1},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,a,l){const c=a.createTracker(l);let d=c.move("[^");const f=a.enter("footnoteDefinition"),p=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
212
+ `},o),a}function xz(e,t){return e&&"run"in e?async function(n,r){const o=K0(n,{file:r,...t});await e.run(o,r)}:function(n,r){return K0(n,{file:r,...e||t})}}function Y0(e){if(e)throw e}var Ef,X0;function wz(){if(X0)return Ef;X0=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Ef=function d(){var f,p,m,y,v,b,S=arguments[0],C=1,E=arguments.length,P=!1;for(typeof S=="boolean"&&(P=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<E;++C)if(f=arguments[C],f!=null)for(p in f)m=c(S,p),y=c(f,p),S!==y&&(P&&y&&(a(y)||(v=o(y)))?(v?(v=!1,b=m&&o(m)?m:[]):b=m&&a(m)?m:{},l(S,{name:p,newValue:d(P,b,y)})):typeof y<"u"&&l(S,{name:p,newValue:y}));return S},Ef}var bz=wz();const Cf=f1(bz);function zh(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Sz(){const e=[],t={run:n,use:r};return t;function n(...o){let a=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(d,...f){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<o.length;)(f[m]===null||f[m]===void 0)&&(f[m]=o[m]);o=f,p?kz(p,c)(...f):l(null,...f)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function kz(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(o);try{d=e.apply(this,l)}catch(f){const p=f;if(c&&n)throw p;return o(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,o):d instanceof Error?o(d):a(d))}function o(l,...c){n||(n=!0,t(l,...c))}function a(l){o(null,l)}}const br={basename:Ez,dirname:Cz,extname:Iz,join:Tz,sep:"/"};function Ez(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Za(e);let n=0,r=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else r<0&&(a=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else l<0&&(a=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(r=o):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Cz(e){if(Za(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Iz(e){Za(e);let t=e.length,n=-1,r=0,o=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||n<0||a===0||a===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function Tz(...e){let t=-1,n;for(;++t<e.length;)Za(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_z(n)}function _z(e){Za(e);const t=e.codePointAt(0)===47;let n=Pz(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Pz(e,t){let n="",r=0,o=-1,a=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||a===1))if(o!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),o=l,a=0;continue}}else if(n.length>0){n="",r=0,o=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function Za(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Az={cwd:Rz};function Rz(){return"/"}function Oh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Nz(e){if(typeof e=="string")e=new URL(e);else if(!Oh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return jz(e)}function jz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const If=["history","path","basename","stem","extname","dirname"];class V1{constructor(t){let n;t?Oh(t)?n={path:t}:typeof t=="string"||Mz(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Az.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<If.length;){const a=If[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)If.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?br.basename(this.path):void 0}set basename(t){_f(t,"basename"),Tf(t,"basename"),this.path=br.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?br.dirname(this.path):void 0}set dirname(t){Q0(this.basename,"dirname"),this.path=br.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?br.extname(this.path):void 0}set extname(t){if(Tf(t,"extname"),Q0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=br.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Oh(t)&&(t=Nz(t)),_f(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?br.basename(this.path,this.extname):void 0}set stem(t){_f(t,"stem"),Tf(t,"stem"),this.path=br.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Gt(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Tf(e,t){if(e&&e.includes(br.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+br.sep+"`")}function _f(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Q0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Mz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Dz=(function(e){const r=this.constructor.prototype,o=r[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Lz={}.hasOwnProperty;class Yp extends Dz{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Sz()}copy(){const t=new Yp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Cf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Rf("data",this.frozen),this.namespace[t]=n,this):Lz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rf("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ku(t),r=this.parser||this.Parser;return Pf("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Pf("process",this.parser||this.Parser),Af("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const c=ku(t),d=r.parse(c);r.run(d,c,function(p,m,y){if(p||!m||!y)return f(p);const v=m,b=r.stringify(v,y);Fz(b)?y.value=b:y.result=b,f(p,y)});function f(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Pf("processSync",this.parser||this.Parser),Af("processSync",this.compiler||this.Compiler),this.process(t,o),Z0("processSync","process",n),r;function o(a,l){n=!0,Y0(a),r=l}}run(t,n,r){J0(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,c){const d=ku(n);o.run(t,d,f);function f(p,m,y){const v=m||t;p?c(p):l?l(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,o;return this.run(t,n,a),Z0("runSync","run",r),o;function a(l,c){Y0(l),o=c,r=!0}}stringify(t,n){this.freeze();const r=ku(n),o=this.compiler||this.Compiler;return Af("stringify",o),J0(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Rf("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(o.settings=Cf(!0,o.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===f){y=m;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[v,...b]=p;const S=r[y][1];zh(S)&&zh(v)&&(v=Cf(!0,S,v)),r[y]=[f,v,...b]}}}}const zz=new Yp().freeze();function Pf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Af(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rf(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function J0(e){if(!zh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Z0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ku(e){return Oz(e)?e:new V1(e)}function Oz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fz(e){return typeof e=="string"||Vz(e)}function Vz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ex=[],tx={allowDangerousHtml:!0},$z=/^(https?|ircs?|mailto|xmpp)$/i,Uz=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Hz(e){const t=Wz(e),n=qz(e);return Gz(t.runSync(t.parse(n),n),e)}function Wz(e){const t=e.rehypePlugins||ex,n=e.remarkPlugins||ex,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tx}:tx;return zz().use(CL).use(n).use(xz,r).use(t)}function qz(e){const t=e.children||"",n=new V1;return typeof t=="string"&&(n.value=t),n}function Gz(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||Kz;for(const p of Uz)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Bz+p.id,void 0);return Kp(e,f),lM(e,{Fragment:w.Fragment,components:o,ignoreInvalidStyle:!0,jsx:w.jsx,jsxs:w.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return l?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in bf)if(Object.hasOwn(bf,v)&&Object.hasOwn(p.properties,v)){const b=p.properties[v],S=bf[v];(S===null||S.includes(p.tagName))&&(p.properties[v]=d(String(b||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,y)),v&&y&&typeof m=="number")return c&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function Kz(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||$z.test(e.slice(0,t))?e:""}function nx(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function Yz(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Xz(e,t,n){const o=hc((n||{}).ignore||[]),a=Qz(t);let l=-1;for(;++l<a.length;)F1(e,"text",c);function c(f,p){let m=-1,y;for(;++m<p.length;){const v=p[m],b=y?y.children:void 0;if(o(v,b?b.indexOf(v):void 0,y))return;y=v}if(y)return d(f,p)}function d(f,p){const m=p[p.length-1],y=a[l][0],v=a[l][1];let b=0;const C=m.children.indexOf(f);let E=!1,P=[];y.lastIndex=0;let T=y.exec(f.value);for(;T;){const O=T.index,V={index:T.index,input:T.input,stack:[...p,f]};let N=v(...T,V);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?y.lastIndex=O+1:(b!==O&&P.push({type:"text",value:f.value.slice(b,O)}),Array.isArray(N)?P.push(...N):N&&P.push(N),b=O+T[0].length,E=!0),!y.global)break;T=y.exec(f.value)}return E?(b<f.value.length&&P.push({type:"text",value:f.value.slice(b)}),m.children.splice(C,1,...P)):P=[f],C+P.length}}function Qz(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([Jz(o[0]),Zz(o[1])])}return t}function Jz(e){return typeof e=="string"?new RegExp(Yz(e),"g"):e}function Zz(e){return typeof e=="function"?e:function(){return e}}const Nf="phrasing",jf=["autolink","link","image","label"];function eO(){return{transforms:[aO],enter:{literalAutolink:nO,literalAutolinkEmail:Mf,literalAutolinkHttp:Mf,literalAutolinkWww:Mf},exit:{literalAutolink:oO,literalAutolinkEmail:sO,literalAutolinkHttp:rO,literalAutolinkWww:iO}}}function tO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Nf,notInConstruct:jf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Nf,notInConstruct:jf},{character:":",before:"[ps]",after:"\\/",inConstruct:Nf,notInConstruct:jf}]}}function nO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Mf(e){this.config.enter.autolinkProtocol.call(this,e)}function rO(e){this.config.exit.autolinkProtocol.call(this,e)}function iO(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function sO(e){this.config.exit.autolinkEmail.call(this,e)}function oO(e){this.exit(e)}function aO(e){Xz(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),uO]],{ignore:["link","linkReference"]})}function lO(e,t,n,r,o){let a="";if(!B1(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!cO(n)))return!1;const l=dO(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function uO(e,t,n,r){return!B1(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function cO(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function dO(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=nx(e,"(");let a=nx(e,")");for(;r!==-1&&o>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function B1(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gs(n)||cc(n))&&(!t||n!==47)}$1.peek=wO;function fO(){this.buffer()}function hO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function pO(){this.buffer()}function mO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yO(e){this.exit(e)}function vO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xO(e){this.exit(e)}function wO(){return"["}function $1(e,t,n,r){const o=n.createTracker(r);let a=o.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=o.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=o.move("]"),a}function bO(){return{enter:{gfmFootnoteCallString:fO,gfmFootnoteCall:hO,gfmFootnoteDefinitionLabelString:pO,gfmFootnoteDefinition:mO},exit:{gfmFootnoteCallString:gO,gfmFootnoteCall:yO,gfmFootnoteDefinitionLabelString:vO,gfmFootnoteDefinition:xO}}}function SO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$1},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,a,l){const c=a.createTracker(l);let d=c.move("[^");const f=a.enter("footnoteDefinition"),p=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
213
213
  `:" ")+a.indentLines(a.containerFlow(r,c.current()),t?U1:kO))),f(),d}}function kO(e,t,n){return t===0?e:U1(e,t,n)}function U1(e,t,n){return(n?"":" ")+e}const EO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];H1.peek=PO;function CO(){return{canContainEols:["delete"],enter:{strikethrough:TO},exit:{strikethrough:_O}}}function IO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:EO}],handlers:{delete:H1}}}function TO(e){this.enter({type:"delete",children:[]},e)}function _O(e){this.exit(e)}function H1(e,t,n,r){const o=n.createTracker(r),a=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),a(),l}function PO(){return"~"}function AO(e){return e.length}function RO(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||AO,a=[],l=[],c=[],d=[];let f=0,p=-1;for(;++p<e.length;){const S=[],C=[];let E=-1;for(e[p].length>f&&(f=e[p].length);++E<e[p].length;){const P=NO(e[p][E]);if(n.alignDelimiters!==!1){const T=o(P);C[E]=T,(d[E]===void 0||T>d[E])&&(d[E]=T)}S.push(P)}l[p]=S,c[p]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<f;)a[m]=rx(r[m]);else{const S=rx(r);for(;++m<f;)a[m]=S}m=-1;const y=[],v=[];for(;++m<f;){const S=a[m];let C="",E="";S===99?(C=":",E=":"):S===108?C=":":S===114&&(E=":");let P=n.alignDelimiters===!1?1:Math.max(1,d[m]-C.length-E.length);const T=C+"-".repeat(P)+E;n.alignDelimiters!==!1&&(P=C.length+P+E.length,P>d[m]&&(d[m]=P),v[m]=P),y[m]=T}l.splice(1,0,y),c.splice(1,0,v),p=-1;const b=[];for(;++p<l.length;){const S=l[p],C=c[p];m=-1;const E=[];for(;++m<f;){const P=S[m]||"";let T="",O="";if(n.alignDelimiters!==!1){const V=d[m]-(C[m]||0),N=a[m];N===114?T=" ".repeat(V):N===99?V%2?(T=" ".repeat(V/2+.5),O=" ".repeat(V/2-.5)):(T=" ".repeat(V/2),O=T):O=" ".repeat(V)}n.delimiterStart!==!1&&!m&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&P==="")&&(n.delimiterStart!==!1||m)&&E.push(" "),n.alignDelimiters!==!1&&E.push(T),E.push(P),n.alignDelimiters!==!1&&E.push(O),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||m!==f-1)&&E.push("|")}b.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return b.join(`
214
214
  `)}function NO(e){return e==null?"":String(e)}function rx(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function jO(e,t,n,r){const o=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),MO);return o(),l}function MO(e,t,n){return">"+(n?"":" ")+e}function DO(e,t){return ix(e,t.inConstruct,!0)&&!ix(e,t.notInConstruct,!1)}function ix(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function sx(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
215
215
  `&&DO(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
@@ -224,7 +224,7 @@ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}
224
224
  `))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
225
225
  `,...a.current()});return/^[\t ]/.test(f)&&(f=$a(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),c(),f}q1.peek=qO;function q1(e){return e.value||""}function qO(){return"<"}G1.peek=GO;function G1(e,t,n,r){const o=Xp(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("![");return f+=d.move(n.safe(e.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+o),f+=d.move(n.safe(e.title,{before:f,after:o,...d.current()})),f+=d.move(o),c()),f+=d.move(")"),l(),f}function GO(){return"!"}K1.peek=KO;function K1(e,t,n,r){const o=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const f=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,a(),o==="full"||!f||f!==m?d+=c.move(m+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function KO(){return"!"}Y1.peek=YO;function Y1(e,t,n){let r=e.value||"",o="`",a=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(r);){let f=d.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(d.index+1)}}return o+r+o}function YO(){return"`"}function X1(e,t){const n=Bp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Q1.peek=XO;function Q1(e,t,n,r){const o=Xp(n),a=o==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,d;if(X1(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),c(),n.stack=p,m}c=n.enter("link"),d=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(e,{before:f,after:"](",...l.current()})),f+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(e.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(d=n.enter("destinationRaw"),f+=l.move(n.safe(e.url,{before:f,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),f+=l.move(" "+o),f+=l.move(n.safe(e.title,{before:f,after:o,...l.current()})),f+=l.move(o),d()),f+=l.move(")"),c(),f}function XO(e,t,n){return X1(e,n)?"<":"["}J1.peek=QO;function J1(e,t,n,r){const o=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const f=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,a(),o==="full"||!f||f!==m?d+=c.move(m+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function QO(){return"["}function Qp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function JO(e){const t=Qp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ZO(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Z1(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function eF(e,t,n,r){const o=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?ZO(n):Qp(n);const c=e.ordered?l==="."?")":".":JO(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),Z1(n)===l&&p){let m=-1;for(;++m<e.children.length;){const y=e.children[m];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const f=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,o(),f}function tF(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function nF(e,t,n,r){const o=tF(n);let a=n.bulletCurrent||Qp(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(a+" ".repeat(l-a.length)),c.shift(l);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),p);return d(),f;function p(m,y,v){return y?(v?"":" ".repeat(l))+m:(v?a:a+" ".repeat(l-a.length))+m}}function rF(e,t,n,r){const o=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),o(),l}const iF=hc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sF(e,t,n,r){return(e.children.some(function(l){return iF(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}eS.peek=aF;function eS(e,t,n,r){const o=oF(n),a=n.enter("strong"),l=n.createTracker(r),c=l.move(o+o);let d=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const f=d.charCodeAt(0),p=Yu(r.before.charCodeAt(r.before.length-1),f,o);p.inside&&(d=$a(f)+d.slice(1));const m=d.charCodeAt(d.length-1),y=Yu(r.after.charCodeAt(0),m,o);y.inside&&(d=d.slice(0,-1)+$a(m));const v=l.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+v}function aF(e,t,n){return n.options.strong||"*"}function lF(e,t,n,r){return n.safe(e.value,r)}function uF(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function cF(e,t,n){const r=(Z1(n)+(n.options.ruleSpaces?" ":"")).repeat(uF(n));return n.options.ruleSpaces?r.slice(0,-1):r}const tS={blockquote:jO,break:sx,code:FO,definition:BO,emphasis:W1,hardBreak:sx,heading:WO,html:q1,image:G1,imageReference:K1,inlineCode:Y1,link:Q1,linkReference:J1,list:eF,listItem:nF,paragraph:rF,root:sF,strong:eS,text:lF,thematicBreak:cF};function dF(){return{enter:{table:fF,tableData:ox,tableHeader:ox,tableRow:pF},exit:{codeText:mF,table:hF,tableData:Df,tableHeader:Df,tableRow:Df}}}function fF(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function hF(e){this.exit(e),this.data.inTable=void 0}function pF(e){this.enter({type:"tableRow",children:[]},e)}function Df(e){this.exit(e)}function ox(e){this.enter({type:"tableCell",children:[]},e)}function mF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gF(e,t){return t==="|"?t:e}function yF(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
226
226
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:d,tableRow:c}};function l(v,b,S,C){return f(p(v,S,C),v.align)}function c(v,b,S,C){const E=m(v,S,C),P=f([E]);return P.slice(0,P.indexOf(`
227
- `))}function d(v,b,S,C){const E=S.enter("tableCell"),P=S.enter("phrasing"),T=S.containerPhrasing(v,{...C,before:a,after:a});return P(),E(),T}function f(v,b){return RO(v,{align:b,alignDelimiters:r,padding:n,stringLength:o})}function p(v,b,S){const C=v.children;let E=-1;const P=[],T=b.enter("table");for(;++E<C.length;)P[E]=m(C[E],b,S);return T(),P}function m(v,b,S){const C=v.children;let E=-1;const P=[],T=b.enter("tableRow");for(;++E<C.length;)P[E]=d(C[E],v,b,S);return T(),P}function y(v,b,S){let C=tS.inlineCode(v,b,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function vF(){return{exit:{taskListCheckValueChecked:ax,taskListCheckValueUnchecked:ax,paragraph:wF}}}function xF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bF}}}function ax(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function wF(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let a=-1,l;for(;++a<o.length;){const c=o[a];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function bF(e,t,n,r){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(l);let d=tS.listItem(e,t,n,{...r,...c.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(p){return p+l}}function SF(){return[eO(),bO(),CO(),dF(),vF()]}function kF(e){return{extensions:[tO(),SO(e),IO(),yF(e),xF()]}}const EF={tokenize:AF,partial:!0},nS={tokenize:RF,partial:!0},rS={tokenize:NF,partial:!0},iS={tokenize:jF,partial:!0},CF={tokenize:MF,partial:!0},sS={name:"wwwAutolink",tokenize:_F,previous:aS},oS={name:"protocolAutolink",tokenize:PF,previous:lS},Kr={name:"emailAutolink",tokenize:TF,previous:uS},Tr={};function IF(){return{text:Tr}}let rs=48;for(;rs<123;)Tr[rs]=Kr,rs++,rs===58?rs=65:rs===91&&(rs=97);Tr[43]=Kr;Tr[45]=Kr;Tr[46]=Kr;Tr[95]=Kr;Tr[72]=[Kr,oS];Tr[104]=[Kr,oS];Tr[87]=[Kr,sS];Tr[119]=[Kr,sS];function TF(e,t,n){const r=this;let o,a;return l;function l(m){return!Fh(m)||!uS.call(r,r.previous)||Jp(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Fh(m)?(e.consume(m),c):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(CF,p,f)(m):m===45||m===95||qt(m)?(a=!0,e.consume(m),d):p(m)}function f(m){return e.consume(m),o=!0,d}function p(m){return a&&o&&Zt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function _F(e,t,n){const r=this;return o;function o(l){return l!==87&&l!==119||!aS.call(r,r.previous)||Jp(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(EF,e.attempt(nS,e.attempt(rS,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function PF(e,t,n){const r=this;let o="",a=!1;return l;function l(m){return(m===72||m===104)&&lS.call(r,r.previous)&&!Jp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(Zt(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const y=o.toLowerCase();if(y==="http"||y==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?f:(a=!0,d)):n(m)}function f(m){return m===null||qu(m)||Je(m)||gs(m)||cc(m)?n(m):e.attempt(nS,e.attempt(rS,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function AF(e,t,n){let r=0;return o;function o(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),o):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function RF(e,t,n){let r,o,a;return l;function l(f){return f===46||f===95?e.check(iS,d,c)(f):f===null||Je(f)||gs(f)||f!==45&&cc(f)?d(f):(a=!0,e.consume(f),l)}function c(f){return f===95?r=!0:(o=r,r=void 0),e.consume(f),l}function d(f){return o||r||!a?n(f):t(f)}}function NF(e,t){let n=0,r=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(iS,t,a)(l):l===null||Je(l)||gs(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&r++,e.consume(l),o}}function jF(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),o):c===60||c===null||Je(c)||gs(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||Je(c)||gs(c)?t(c):r(c)}function a(c){return Zt(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):Zt(c)?(e.consume(c),l):n(c)}}function MF(e,t,n){return r;function r(a){return e.consume(a),o}function o(a){return qt(a)?n(a):t(a)}}function aS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Je(e)}function lS(e){return!Zt(e)}function uS(e){return!(e===47||Fh(e))}function Fh(e){return e===43||e===45||e===46||e===95||qt(e)}function Jp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const DF={tokenize:UF,partial:!0};function LF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:VF,continuation:{tokenize:BF},exit:$F}},text:{91:{name:"gfmFootnoteCall",tokenize:FF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zF,resolveTo:OF}}}}function zF(e,t,n){const r=this;let o=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;o--;){const d=r.events[o][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const f=cr(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function OF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function FF(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(m){if(a>999||m===93&&!l||m===null||m===91||Je(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return o.includes(cr(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Je(m)||(l=!0),a++,e.consume(m),m===92?p:f}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}}function VF(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return d;function d(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(b)}function p(b){if(l>999||b===93&&!c||b===null||b===91||Je(b))return n(b);if(b===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=cr(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Je(b)||(c=!0),l++,e.consume(b),b===92?m:p}function m(b){return b===91||b===92||b===93?(e.consume(b),l++,p):p(b)}function y(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),o.includes(a)||o.push(a),We(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function BF(e,t,n){return e.check(Ja,t,e.attempt(DF,t,n))}function $F(e){e.exit("gfmFootnoteDefinition")}function UF(e,t,n){const r=this;return We(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function HF(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},y=[["enter",p,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",m,c]],v=c.parser.constructs.insideSpan.null;v&&En(y,y.length,0,dc(v,l.slice(f+1,d),c)),En(y,y.length,0,[["exit",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",p,c]]),En(l,f-1,d-f+3,y),d=f+y.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,c,d){const f=this.previous,p=this.events;let m=0;return y;function y(b){return f===126&&p[p.length-1][1].type!=="characterEscape"?d(b):(l.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const S=ho(f);if(b===126)return m>1?d(b):(l.consume(b),m++,v);if(m<2&&!n)return d(b);const C=l.exit("strikethroughSequenceTemporary"),E=ho(b);return C._open=!E||E===2&&!!S,C._close=!S||S===2&&!!E,c(b)}}}class WF{constructor(){this.map=[]}add(t,n,r){qF(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const a of o)t.push(a);o=r.pop()}this.map.length=0}}function qF(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function GF(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function KF(){return{flow:{null:{name:"table",tokenize:YF,resolveAll:XF}}}}function YF(e,t,n){const r=this;let o=0,a=0,l;return c;function c(L){let te=r.events.length-1;for(;te>-1;){const Q=r.events[te][1].type;if(Q==="lineEnding"||Q==="linePrefix")te--;else break}const G=te>-1?r.events[te][1].type:null,X=G==="tableHead"||G==="tableRow"?N:d;return X===N&&r.parser.lazy[r.now().line]?n(L):X(L)}function d(L){return e.enter("tableHead"),e.enter("tableRow"),f(L)}function f(L){return L===124||(l=!0,a+=1),p(L)}function p(L){return L===null?n(L):Ce(L)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),v):n(L):Be(L)?We(e,p,"whitespace")(L):(a+=1,l&&(l=!1,o+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(L)))}function m(L){return L===null||L===124||Je(L)?(e.exit("data"),p(L)):(e.consume(L),L===92?y:m)}function y(L){return L===92||L===124?(e.consume(L),m):m(L)}function v(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),l=!1,Be(L)?We(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):b(L))}function b(L){return L===45||L===58?C(L):L===124?(l=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),S):V(L)}function S(L){return Be(L)?We(e,C,"whitespace")(L):C(L)}function C(L){return L===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),E):L===45?(a+=1,E(L)):L===null||Ce(L)?O(L):V(L)}function E(L){return L===45?(e.enter("tableDelimiterFiller"),P(L)):V(L)}function P(L){return L===45?(e.consume(L),P):L===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(L))}function T(L){return Be(L)?We(e,O,"whitespace")(L):O(L)}function O(L){return L===124?b(L):L===null||Ce(L)?!l||o!==a?V(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):V(L)}function V(L){return n(L)}function N(L){return e.enter("tableRow"),D(L)}function D(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),D):L===null||Ce(L)?(e.exit("tableRow"),t(L)):Be(L)?We(e,D,"whitespace")(L):(e.enter("data"),H(L))}function H(L){return L===null||L===124||Je(L)?(e.exit("data"),D(L)):(e.consume(L),L===92?ee:H)}function ee(L){return L===92||L===124?(e.consume(L),H):H(L)}}function XF(e,t){let n=-1,r=!0,o=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,p,m;const y=new WF;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(c=!1,d!==0&&(lx(y,t,d,f,p),p=void 0,d=0),f={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",f,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",p,t]])),o=b.type==="tableDelimiterRow"?2:p?3:1):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=Eu(y,t,a,o,void 0,m),a=[0,0,0,0]),l[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],m=Eu(y,t,a,o,void 0,m)),a=l,l=[a[1],n,0,0])):b.type==="tableHead"?(c=!0,d=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],m=Eu(y,t,a,o,n,m)):l[1]!==0&&(m=Eu(y,t,l,o,n,m)),o=0):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&lx(y,t,d,f,p),y.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=GF(t.events,n))}return e}function Eu(e,t,n,r,o,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},Zs(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Zs(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=Zs(t.events,n[2]),p=Zs(t.events,n[3]),m={type:c,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const y=t.events[n[2]],v=t.events[n[3]];if(y[1].end=Object.assign({},v[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,S=n[3]-n[2]-1;e.add(b,S,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return o!==void 0&&(a.end=Object.assign({},Zs(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function lx(e,t,n,r,o){const a=[],l=Zs(t.events,n);o&&(o.end=Object.assign({},l),a.push(["exit",o,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Zs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const QF={name:"tasklistCheck",tokenize:ZF};function JF(){return{text:{91:QF}}}function ZF(e,t,n){const r=this;return o;function o(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return Je(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return Ce(d)?t(d):Be(d)?e.check({tokenize:e3},t,n)(d):n(d)}}function e3(e,t,n){return We(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function t3(e){return w1([IF(),LF(),HF(e),KF(),JF()])}const n3={};function r3(e){const t=this,n=e||n3,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(t3(n)),a.push(SF()),l.push(kF(n))}function i3(e){if(!e||typeof e!="string")return e;try{return e.replace(/```\s*([^\n\r]+?)\s*```/g,"`$1`")}catch{return e}}const s3=({node:e,inline:t,className:n,children:r,...o})=>{const[a,l]=I.useState(!1),c=Array.isArray(r)?r.join(""):String(r??""),d=/[\r\n]/.test(c);if(t||e&&e.type==="inlineCode"||!d)return w.jsx("code",{className:`font-mono text-[0.9em] px-1.5 py-0.5 rounded-md bg-gray-100 text-gray-900 border border-gray-200 dark:bg-gray-800/60 dark:text-gray-100 dark:border-gray-700 whitespace-pre-wrap break-words ${n||""}`,...o,children:r});const m=()=>{var v;const b=()=>{l(!0),setTimeout(()=>l(!1),1500)};try{(v=navigator==null?void 0:navigator.clipboard)!=null&&v.writeText?navigator.clipboard.writeText(c).then(b).catch(()=>y(c,b)):y(c,b)}catch{}},y=(v,b)=>{const S=document.createElement("textarea");S.value=v,S.style.position="fixed",S.style.opacity="0",document.body.appendChild(S),S.select();try{document.execCommand("copy")}catch{}document.body.removeChild(S),b()};return w.jsxs("div",{className:"relative group my-2",children:[w.jsx("button",{type:"button",onClick:m,className:"absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity text-xs px-2 py-1 rounded-md bg-gray-700/80 hover:bg-gray-700 text-white",children:a?"Copied":"Copy"}),w.jsx("pre",{className:"bg-gray-900 border border-gray-700/40 rounded-lg p-3 overflow-x-auto",children:w.jsx("code",{className:`text-gray-100 text-sm font-mono ${n||""}`,...o,children:r})})]})},o3={code:s3,blockquote:({children:e})=>w.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic my-2",children:e}),a:({href:e,children:t})=>w.jsx("a",{href:e,className:"text-blue-600 dark:text-blue-400 hover:underline",target:"_blank",rel:"noopener noreferrer",children:t}),p:({children:e})=>w.jsx("div",{className:"mb-2 last:mb-0 text-black",children:e})},lo=({children:e,className:t})=>{const n=i3(String(e??""));return w.jsx("div",{className:t,children:w.jsx(Hz,{remarkPlugins:[r3],components:o3,children:n})})};lo.displayName="MarkdownText";function Ua({text:e,isStreaming:t=!1}){return w.jsxs("div",{className:"w-full text-sm text-black",children:[w.jsx(lo,{children:e}),t&&w.jsx("span",{className:"inline-block w-2 h-4 bg-blue-600 dark:bg-blue-500 animate-pulse ml-1 align-middle",children:"▋"})]})}function cS({data:e,mediaType:t,name:n,maxWidth:r="400px",maxHeight:o="300px"}){const[a,l]=I.useState(!1),[c,d]=I.useState(!0),[f,p]=I.useState(!1),m=(e.startsWith("data:"),e);return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"w-full",children:[w.jsxs("div",{className:"relative inline-block rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 cursor-pointer hover:opacity-90 transition-opacity",onClick:()=>l(!0),style:{maxWidth:r,maxHeight:o},children:[c&&!f&&w.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:w.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 dark:border-gray-100"})}),f?w.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-red-600 dark:text-red-400",children:[w.jsx("span",{className:"text-4xl mb-2",children:"⚠️"}),w.jsx("span",{className:"text-sm",children:"Failed to load image"}),n&&w.jsx("span",{className:"text-xs mt-1",children:n})]}):w.jsx("img",{src:m,alt:n||"Image",className:"max-w-full max-h-full object-contain",style:{maxWidth:r,maxHeight:o},onLoad:()=>d(!1),onError:()=>{d(!1),p(!0)}})]}),n&&!f&&w.jsxs("div",{className:"mt-2 text-xs text-gray-600 dark:text-gray-400",children:["📷 ",n]})]}),a&&!f&&w.jsx("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-4",onClick:()=>l(!1),children:w.jsxs("div",{className:"relative max-w-[90vw] max-h-[90vh]",children:[w.jsx("button",{className:"absolute -top-10 right-0 text-white hover:text-gray-300 text-xl",onClick:()=>l(!1),children:"✕"}),w.jsx("img",{src:m,alt:n||"Image",className:"max-w-full max-h-[90vh] object-contain",onClick:y=>y.stopPropagation()}),n&&w.jsx("div",{className:"absolute -bottom-8 left-0 text-white text-sm",children:n})]})})]})}function Zp({data:e,mediaType:t,filename:n}){const r=p=>p.startsWith("application/pdf")?"📄":p.startsWith("application/vnd.openxmlformats-officedocument.spreadsheetml")?"📊":p.startsWith("application/vnd.openxmlformats-officedocument.wordprocessingml")?"📝":p.startsWith("application/vnd.openxmlformats-officedocument.presentationml")?"📽️":p.includes("zip")||p.includes("compressed")?"🗜️":p.startsWith("text/")?"📃":p.startsWith("video/")?"🎥":p.startsWith("audio/")?"🎵":"📎",o=()=>{if(n){const m=n.split(".").pop();if(m&&m!==n)return m.toUpperCase()}return{"application/pdf":"PDF","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.presentationml.presentation":"PPTX","application/zip":"ZIP","text/plain":"TXT","text/csv":"CSV","application/json":"JSON"}[t]||"FILE"},a=()=>{const p=document.createElement("a");p.href=e,p.download=n||`file.${o().toLowerCase()}`,document.body.appendChild(p),p.click(),document.body.removeChild(p)},l=()=>{if(e.startsWith("data:"))try{const p=e.split(",")[1];if(!p)return null;const m=Math.ceil(p.length*3/4);return m<1024?`${m} B`:m<1048576?`${(m/1024).toFixed(1)} KB`:`${(m/1048576).toFixed(1)} MB`}catch{return null}return null},c=r(t),d=o(),f=l();return w.jsx("div",{className:"w-full max-w-md",children:w.jsxs("div",{className:"flex items-center gap-3 p-3 border border-gray-200 dark:border-gray-700 rounded-lg bg-gray-50 dark:bg-gray-800/50 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",children:[w.jsx("div",{className:"text-3xl flex-shrink-0",children:c}),w.jsxs("div",{className:"flex-1 min-w-0",children:[w.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:n||`file.${d.toLowerCase()}`}),w.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-400 flex items-center gap-2",children:[w.jsx("span",{children:d}),f&&w.jsxs(w.Fragment,{children:[w.jsx("span",{children:"•"}),w.jsx("span",{children:f})]})]})]}),w.jsx("button",{onClick:a,className:"flex-shrink-0 px-3 py-1.5 text-xs font-medium text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 border border-blue-600 dark:border-blue-400 rounded hover:bg-blue-50 dark:hover:bg-blue-950/30 transition-colors",children:"Download"})]})})}function a3({message:e}){return w.jsx("div",{className:"chat-message user",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:"You",variant:"secondary",icon:w.jsx(f_,{className:"w-5 h-5 text-white"}),size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0 space-y-2",children:typeof e.content=="string"?w.jsx(Ua,{text:e.content}):e.content.map((t,n)=>{switch(t.type){case"text":return w.jsx(Ua,{text:t.text},n);case"image":return w.jsx(cS,{data:t.data,mediaType:t.mediaType,name:t.name},n);case"file":return w.jsx(Zp,{data:t.data,mediaType:t.mediaType,filename:t.filename},n);default:return null}})})]})})}function l3({reasoning:e,tokenCount:t,isStreaming:n=!1,defaultCollapsed:r=!0}){const[o,a]=I.useState(!r);return w.jsxs("div",{className:"w-full border border-purple-200 dark:border-purple-800 rounded-lg bg-purple-50 dark:bg-purple-950/30",children:[w.jsxs("button",{onClick:()=>a(!o),className:"w-full px-4 py-2 flex items-center justify-between text-sm font-medium text-purple-900 dark:text-purple-100 hover:bg-purple-100 dark:hover:bg-purple-900/30 transition-colors rounded-t-lg",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"💭"}),w.jsx("span",{children:"Thinking Process"}),t!==void 0&&w.jsxs("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:["(",t," tokens)"]})]}),w.jsx("span",{className:`transform transition-transform ${o?"rotate-180":""}`,children:"▼"})]}),o&&w.jsx("div",{className:"px-4 py-3 border-t border-purple-200 dark:border-purple-800",children:w.jsxs("div",{className:"text-sm text-purple-900 dark:text-purple-100",children:[w.jsx(lo,{children:e}),n&&w.jsx("span",{className:"inline-block w-2 h-4 bg-purple-600 dark:bg-purple-500 animate-pulse ml-1 align-middle",children:"▋"})]})})]})}function dS({id:e,name:t,input:n,defaultCollapsed:r=!1}){const[o,a]=I.useState(!r);return w.jsxs("div",{className:"w-full border border-blue-200 dark:border-blue-800 rounded-lg bg-blue-50 dark:bg-blue-950/30",children:[w.jsxs("button",{onClick:()=>a(!o),className:"w-full px-4 py-2 flex items-center justify-between text-sm font-medium text-blue-900 dark:text-blue-100 hover:bg-blue-100 dark:hover:bg-blue-900/30 transition-colors rounded-t-lg",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"🔧"}),w.jsx("span",{className:"font-mono",children:t}),w.jsx("span",{className:"text-xs text-blue-600 dark:text-blue-400",children:"(Tool Call)"})]}),w.jsx("span",{className:`transform transition-transform ${o?"rotate-180":""}`,children:"▼"})]}),o&&w.jsxs("div",{className:"px-4 py-3 border-t border-blue-200 dark:border-blue-800 space-y-3",children:[w.jsxs("div",{className:"text-xs text-blue-600 dark:text-blue-400",children:[w.jsx("span",{className:"font-medium",children:"ID:"})," ",w.jsx("span",{className:"font-mono",children:e})]}),w.jsxs("div",{children:[w.jsx("div",{className:"text-xs font-medium text-blue-900 dark:text-blue-100 mb-1",children:"Input Parameters:"}),w.jsx("div",{className:"bg-white dark:bg-gray-900 rounded border border-blue-200 dark:border-blue-800 p-3 overflow-x-auto",children:w.jsx("pre",{className:"text-xs text-blue-900 dark:text-blue-100 font-mono",children:JSON.stringify(n,null,2)})})]})]})]})}function ux({message:e,isStreaming:t=!1}){return w.jsx("div",{className:"chat-message assistant",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:"Agent",variant:"primary",icon:w.jsx(yw,{className:"w-5 h-5 text-white"}),size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0 space-y-2",children:typeof e.content=="string"?w.jsx(Ua,{text:e.content,isStreaming:t}):e.content.map((n,r)=>{const o=Array.isArray(e.content)&&r===e.content.length-1;switch(n.type){case"text":return w.jsx(Ua,{text:n.text,isStreaming:t&&o},r);case"thinking":return w.jsx(l3,{reasoning:n.reasoning,tokenCount:n.tokenCount,isStreaming:t&&o},r);case"tool-call":return w.jsx(dS,{id:n.id,name:n.name,input:n.input},r);case"file":return w.jsx(Zp,{data:n.data,mediaType:n.mediaType,filename:n.filename},r);default:return null}})})]})})}function u3({id:e,name:t,output:n,defaultCollapsed:r=!1}){const[o,a]=I.useState(!r),l=n.type==="error-text"||n.type==="error-json"||n.type==="execution-denied",d=l?"red":"green",f=()=>{switch(n.type){case"text":return w.jsx("div",{className:"text-sm text-gray-900 dark:text-gray-100",children:w.jsx(lo,{children:n.value})});case"json":return w.jsx("div",{className:"bg-white dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-700 p-3 overflow-x-auto",children:w.jsx("pre",{className:"text-xs text-gray-900 dark:text-gray-100 font-mono",children:JSON.stringify(n.value,null,2)})});case"error-text":return w.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:w.jsx(lo,{children:n.value})});case"error-json":return w.jsx("div",{className:"bg-red-50 dark:bg-red-950/30 rounded border border-red-200 dark:border-red-800 p-3 overflow-x-auto",children:w.jsx("pre",{className:"text-xs text-red-600 dark:text-red-400 font-mono",children:JSON.stringify(n.value,null,2)})});case"execution-denied":return w.jsxs("div",{className:"text-sm text-orange-600 dark:text-orange-400",children:["🚫 Execution denied",n.reason&&w.jsxs("div",{className:"mt-1 text-xs",children:["Reason: ",n.reason]})]});case"content":return w.jsx("div",{className:"space-y-3",children:n.value.map((p,m)=>p.type==="text"?w.jsx("div",{className:"text-sm text-gray-900 dark:text-gray-100",children:w.jsx(lo,{children:p.text})},m):p.type==="image"?w.jsx(cS,{data:p.data,mediaType:p.mediaType,name:p.name},m):p.type==="file"?w.jsx(Zp,{data:p.data,mediaType:p.mediaType,filename:p.filename},m):null)});default:return w.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Unknown output type"})}};return w.jsxs("div",{className:`w-full border border-${d}-200 dark:border-${d}-800 rounded-lg bg-${d}-50 dark:bg-${d}-950/30`,children:[w.jsxs("button",{onClick:()=>a(!o),className:`w-full px-4 py-2 flex items-center justify-between text-sm font-medium text-${d}-900 dark:text-${d}-100 hover:bg-${d}-100 dark:hover:bg-${d}-900/30 transition-colors rounded-t-lg`,children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:`text-${d}-600 dark:text-${d}-400`,children:l?"❌":"✅"}),w.jsx("span",{className:"font-mono",children:t}),w.jsxs("span",{className:`text-xs text-${d}-600 dark:text-${d}-400`,children:["(",l?"Error":"Result",")"]})]}),w.jsx("span",{className:`transform transition-transform ${o?"rotate-180":""}`,children:"▼"})]}),o&&w.jsxs("div",{className:`px-4 py-3 border-t border-${d}-200 dark:border-${d}-800 space-y-3`,children:[w.jsxs("div",{className:`text-xs text-${d}-600 dark:text-${d}-400`,children:[w.jsx("span",{className:"font-medium",children:"Call ID:"})," ",w.jsx("span",{className:"font-mono",children:e})]}),w.jsxs("div",{children:[w.jsx("div",{className:`text-xs font-medium text-${d}-900 dark:text-${d}-100 mb-1`,children:"Output:"}),f()]})]})]})}function c3({toolCall:e,toolResult:t,defaultExpanded:n=!1}){const[r,o]=I.useState(n),a=t?t.toolResult.output.type.includes("error")?"error":"success":"executing",c={executing:{icon:w.jsx(tv,{className:"w-4 h-4 animate-spin text-blue-500"}),bgColor:"bg-blue-50 dark:bg-blue-950/30",borderColor:"border-blue-200 dark:border-blue-800",textColor:"text-blue-900 dark:text-blue-100"},success:{icon:w.jsx("span",{className:"text-green-600 dark:text-green-400",children:"✅"}),bgColor:"bg-green-50 dark:bg-green-950/30",borderColor:"border-green-200 dark:border-green-800",textColor:"text-green-900 dark:text-green-100"},error:{icon:w.jsx("span",{className:"text-red-600 dark:text-red-400",children:"❌"}),bgColor:"bg-red-50 dark:bg-red-950/30",borderColor:"border-red-200 dark:border-red-800",textColor:"text-red-900 dark:text-red-100"}}[a],d=t&&e?((t.timestamp-e.timestamp)/1e3).toFixed(2):null;return w.jsx("div",{className:"chat-message tool-use",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:"Tool",variant:"primary",icon:w.jsx(h_,{className:"w-5 h-5 text-white"}),size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0",children:w.jsxs("div",{className:`w-full border ${c.borderColor} rounded-lg ${c.bgColor}`,children:[w.jsxs("button",{onClick:()=>o(!r),className:`w-full px-4 py-3 flex items-center justify-between ${c.textColor} hover:opacity-80 transition-opacity rounded-t-lg`,children:[w.jsxs("div",{className:"flex items-center gap-3",children:[c.icon,w.jsx("span",{className:"font-medium font-mono",children:e.toolCall.name}),d&&w.jsxs("span",{className:"text-xs opacity-70",children:["• ",d,"s"]}),a==="executing"&&w.jsx("span",{className:"text-xs opacity-70",children:"• Executing..."})]}),w.jsx(t_,{className:`w-4 h-4 transform transition-transform ${r?"rotate-180":""}`})]}),r&&w.jsxs("div",{className:`px-4 pb-4 pt-2 border-t ${c.borderColor} space-y-4`,children:[w.jsxs("div",{children:[w.jsx("div",{className:"text-xs font-medium opacity-70 mb-2 uppercase tracking-wide",children:"Input"}),w.jsx(dS,{id:e.toolCall.id,name:e.toolCall.name,input:e.toolCall.input})]}),t?w.jsxs("div",{children:[w.jsx("div",{className:"text-xs font-medium opacity-70 mb-2 uppercase tracking-wide",children:"Output"}),w.jsx(u3,{id:t.toolResult.id,name:t.toolResult.name,output:t.toolResult.output,defaultCollapsed:!1})]}):w.jsxs("div",{className:"flex items-center gap-2 text-blue-600 dark:text-blue-400 py-2",children:[w.jsx(tv,{className:"animate-spin w-4 h-4"}),w.jsx("span",{className:"text-sm",children:"Waiting for result..."})]}),w.jsxs("div",{className:"text-xs opacity-60 pt-2 border-t border-gray-200 dark:border-gray-700",children:[w.jsx("span",{className:"font-medium",children:"Call ID:"})," ",w.jsx("span",{className:"font-mono",children:e.toolCall.id})]})]})]})})]})})}function d3({message:e}){return w.jsx("div",{className:"chat-message system",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:"System",variant:"neutral",icon:w.jsx(i_,{className:"w-5 h-5 text-white"}),size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0",children:w.jsx("div",{className:"text-sm bg-gray-50 dark:bg-gray-800/50 border border-gray-200 dark:border-gray-700 rounded-lg p-3",children:w.jsx(Ua,{text:e.content})})})]})})}const f3={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}};function h3(e){const t=new Map,n=new Map,r=[];for(const a of e)a.subtype==="tool-call"?t.set(a.toolCall.id,a):a.subtype==="tool-result"?n.set(a.toolCallId,a):r.push(a);const o=[];for(const[a,l]of t.entries())o.push({type:"tool-use",toolCall:l,toolResult:n.get(a),timestamp:l.timestamp});return[...r,...o].sort((a,l)=>a.timestamp-l.timestamp)}function p3({messages:e,streamingText:t,className:n=""}){const r=I.useRef(null),o=[...e].sort((l,c)=>l.timestamp-c.timestamp),a=h3(o);return I.useEffect(()=>{r.current&&r.current.scrollIntoView({behavior:"smooth"})},[e.length,t]),e.length===0&&!t?w.jsx("div",{className:`flex-1 flex items-center justify-center ${n}`,children:w.jsxs("div",{className:"text-center px-4",children:[w.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100 mb-2",children:"Welcome to Deepractice Agent"}),w.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Type a message below to start a new conversation"})]})}):w.jsx("div",{className:`flex-1 overflow-y-auto overflow-x-hidden relative ${n}`,children:w.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-3 sm:py-4 space-y-3 sm:space-y-4",children:[a.map(l=>{if("type"in l&&l.type==="tool-use")return w.jsx(c3,{toolCall:l.toolCall,toolResult:l.toolResult},l.toolCall.id);const c=l;switch(c.subtype){case"user":return w.jsx(jp.div,{variants:f3,initial:"hidden",animate:"visible",transition:{duration:.2},children:w.jsx(a3,{message:c})},c.id);case"assistant":return w.jsx(ux,{message:c},c.id);case"system":return w.jsx(d3,{message:c},c.id);default:return null}}),t&&w.jsx(ux,{message:{id:"streaming",role:"assistant",subtype:"assistant",content:t,timestamp:Date.now()},isStreaming:!0}),w.jsx("div",{ref:r})]})})}function m3(e){switch(e){case"initializing":return"Initializing";case"queued":return"Queued";case"thinking":return"Thinking";case"responding":return"Responding";case"planning_tool":return"Planning tool use";case"awaiting_tool_result":return"Awaiting tool result";case"conversation_active":return"Processing";default:return""}}function g3({status:e,isLoading:t,onAbort:n,showAbortButton:r=!0,className:o=""}){const[a,l]=I.useState(0),[c,d]=I.useState(0);I.useEffect(()=>{if(!t){l(0);return}const m=Date.now(),y=setInterval(()=>{const v=Math.floor((Date.now()-m)/1e3);l(v)},1e3);return()=>clearInterval(y)},[t]),I.useEffect(()=>{if(!t)return;const m=setInterval(()=>{d(y=>(y+1)%4)},500);return()=>clearInterval(m)},[t]);const f=m3(e),p=["●","●","●","○"];return t?w.jsx("div",{className:`w-full ${o}`,children:w.jsxs("div",{className:"flex items-center justify-between max-w-4xl mx-auto bg-gray-900 dark:bg-gray-950 text-white rounded-lg shadow-lg px-4 py-3",children:[w.jsx("div",{className:"flex-1",children:w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"text-xl text-blue-400 flex items-center space-x-0.5",children:p.map((m,y)=>w.jsx("span",{className:`transition-opacity duration-200 ${y===c?"opacity-100":"opacity-30"}`,children:m},y))}),w.jsxs("div",{className:"flex-1",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs("span",{className:"font-medium text-sm",children:[f,"..."]}),w.jsxs("span",{className:"text-gray-400 text-sm",children:["(",a,"s)"]}),w.jsx("span",{className:"text-gray-400 hidden sm:inline",children:"·"}),w.jsx("span",{className:"text-gray-300 text-sm hidden sm:inline",children:"esc to interrupt"})]}),w.jsx("div",{className:"text-xs text-gray-400 sm:hidden mt-1",children:"esc to interrupt"})]})]})}),r&&n&&w.jsxs("button",{onClick:n,className:"ml-3 text-xs bg-red-600 hover:bg-red-700 text-white px-2.5 py-1 sm:px-3 sm:py-1.5 rounded-md transition-colors flex items-center gap-1.5 flex-shrink-0",children:[w.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),w.jsx("span",{className:"hidden sm:inline",children:"Stop"})]})]})}):null}function y3({error:e,showDetails:t=!1}){const n=(e==null?void 0:e.severity)||"error",r=(e==null?void 0:e.category)||"system",o=e==null?void 0:e.code,a=(e==null?void 0:e.message)||"Unknown error",l=(e==null?void 0:e.recoverable)??!0,c=e==null?void 0:e.cause,d={fatal:{bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-300 dark:border-red-700",text:"text-red-700 dark:text-red-300",icon:w.jsx(r_,{className:"w-5 h-5 text-white"}),label:"Fatal Error"},error:{bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-300 dark:border-red-700",text:"text-red-700 dark:text-red-300",icon:w.jsx(n_,{className:"w-5 h-5 text-white"}),label:"Error"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20",border:"border-yellow-300 dark:border-yellow-700",text:"text-yellow-700 dark:text-yellow-300",icon:w.jsx(c_,{className:"w-5 h-5 text-white"}),label:"Warning"}},f=d[n]??d.error,p={driver:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",llm:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900/30 dark:text-indigo-300",network:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",validation:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",system:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300"},m=p[r]??p.system;return w.jsx("div",{className:"chat-message error",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:f.label,variant:n==="warning"?"warning":"error",icon:f.icon,size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0",children:w.jsxs("div",{className:`text-sm ${f.bg} ${f.border} border rounded-lg p-3`,children:[w.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[w.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${m}`,children:r.toUpperCase()}),o&&w.jsx("span",{className:"text-xs font-mono text-gray-500 dark:text-gray-400",children:o}),!l&&w.jsx("span",{className:"text-xs font-semibold text-red-600 dark:text-red-400",children:"Non-recoverable"})]}),w.jsx("p",{className:`${f.text} font-medium`,children:a}),t&&c&&w.jsxs("details",{className:"mt-2",children:[w.jsx("summary",{className:"cursor-pointer text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",children:"Show details"}),w.jsx("pre",{className:"mt-2 text-xs bg-gray-900 dark:bg-gray-950 text-gray-100 rounded p-2 overflow-x-auto",children:c instanceof Error?`${c.name}: ${c.message}
227
+ `))}function d(v,b,S,C){const E=S.enter("tableCell"),P=S.enter("phrasing"),T=S.containerPhrasing(v,{...C,before:a,after:a});return P(),E(),T}function f(v,b){return RO(v,{align:b,alignDelimiters:r,padding:n,stringLength:o})}function p(v,b,S){const C=v.children;let E=-1;const P=[],T=b.enter("table");for(;++E<C.length;)P[E]=m(C[E],b,S);return T(),P}function m(v,b,S){const C=v.children;let E=-1;const P=[],T=b.enter("tableRow");for(;++E<C.length;)P[E]=d(C[E],v,b,S);return T(),P}function y(v,b,S){let C=tS.inlineCode(v,b,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function vF(){return{exit:{taskListCheckValueChecked:ax,taskListCheckValueUnchecked:ax,paragraph:wF}}}function xF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bF}}}function ax(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function wF(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let a=-1,l;for(;++a<o.length;){const c=o[a];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function bF(e,t,n,r){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(l);let d=tS.listItem(e,t,n,{...r,...c.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(p){return p+l}}function SF(){return[eO(),bO(),CO(),dF(),vF()]}function kF(e){return{extensions:[tO(),SO(e),IO(),yF(e),xF()]}}const EF={tokenize:AF,partial:!0},nS={tokenize:RF,partial:!0},rS={tokenize:NF,partial:!0},iS={tokenize:jF,partial:!0},CF={tokenize:MF,partial:!0},sS={name:"wwwAutolink",tokenize:_F,previous:aS},oS={name:"protocolAutolink",tokenize:PF,previous:lS},Kr={name:"emailAutolink",tokenize:TF,previous:uS},Tr={};function IF(){return{text:Tr}}let rs=48;for(;rs<123;)Tr[rs]=Kr,rs++,rs===58?rs=65:rs===91&&(rs=97);Tr[43]=Kr;Tr[45]=Kr;Tr[46]=Kr;Tr[95]=Kr;Tr[72]=[Kr,oS];Tr[104]=[Kr,oS];Tr[87]=[Kr,sS];Tr[119]=[Kr,sS];function TF(e,t,n){const r=this;let o,a;return l;function l(m){return!Fh(m)||!uS.call(r,r.previous)||Jp(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Fh(m)?(e.consume(m),c):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(CF,p,f)(m):m===45||m===95||Wt(m)?(a=!0,e.consume(m),d):p(m)}function f(m){return e.consume(m),o=!0,d}function p(m){return a&&o&&Jt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function _F(e,t,n){const r=this;return o;function o(l){return l!==87&&l!==119||!aS.call(r,r.previous)||Jp(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(EF,e.attempt(nS,e.attempt(rS,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function PF(e,t,n){const r=this;let o="",a=!1;return l;function l(m){return(m===72||m===104)&&lS.call(r,r.previous)&&!Jp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(Jt(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const y=o.toLowerCase();if(y==="http"||y==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?f:(a=!0,d)):n(m)}function f(m){return m===null||qu(m)||Qe(m)||gs(m)||cc(m)?n(m):e.attempt(nS,e.attempt(rS,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function AF(e,t,n){let r=0;return o;function o(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),o):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function RF(e,t,n){let r,o,a;return l;function l(f){return f===46||f===95?e.check(iS,d,c)(f):f===null||Qe(f)||gs(f)||f!==45&&cc(f)?d(f):(a=!0,e.consume(f),l)}function c(f){return f===95?r=!0:(o=r,r=void 0),e.consume(f),l}function d(f){return o||r||!a?n(f):t(f)}}function NF(e,t){let n=0,r=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(iS,t,a)(l):l===null||Qe(l)||gs(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&r++,e.consume(l),o}}function jF(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),o):c===60||c===null||Qe(c)||gs(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||Qe(c)||gs(c)?t(c):r(c)}function a(c){return Jt(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):Jt(c)?(e.consume(c),l):n(c)}}function MF(e,t,n){return r;function r(a){return e.consume(a),o}function o(a){return Wt(a)?n(a):t(a)}}function aS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qe(e)}function lS(e){return!Jt(e)}function uS(e){return!(e===47||Fh(e))}function Fh(e){return e===43||e===45||e===46||e===95||Wt(e)}function Jp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const DF={tokenize:UF,partial:!0};function LF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:VF,continuation:{tokenize:BF},exit:$F}},text:{91:{name:"gfmFootnoteCall",tokenize:FF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zF,resolveTo:OF}}}}function zF(e,t,n){const r=this;let o=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;o--;){const d=r.events[o][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const f=cr(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function OF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function FF(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(m){if(a>999||m===93&&!l||m===null||m===91||Qe(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return o.includes(cr(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Qe(m)||(l=!0),a++,e.consume(m),m===92?p:f}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}}function VF(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return d;function d(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(b)}function p(b){if(l>999||b===93&&!c||b===null||b===91||Qe(b))return n(b);if(b===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=cr(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Qe(b)||(c=!0),l++,e.consume(b),b===92?m:p}function m(b){return b===91||b===92||b===93?(e.consume(b),l++,p):p(b)}function y(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),o.includes(a)||o.push(a),He(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function BF(e,t,n){return e.check(Ja,t,e.attempt(DF,t,n))}function $F(e){e.exit("gfmFootnoteDefinition")}function UF(e,t,n){const r=this;return He(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function HF(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},y=[["enter",p,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",m,c]],v=c.parser.constructs.insideSpan.null;v&&En(y,y.length,0,dc(v,l.slice(f+1,d),c)),En(y,y.length,0,[["exit",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",p,c]]),En(l,f-1,d-f+3,y),d=f+y.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,c,d){const f=this.previous,p=this.events;let m=0;return y;function y(b){return f===126&&p[p.length-1][1].type!=="characterEscape"?d(b):(l.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const S=ho(f);if(b===126)return m>1?d(b):(l.consume(b),m++,v);if(m<2&&!n)return d(b);const C=l.exit("strikethroughSequenceTemporary"),E=ho(b);return C._open=!E||E===2&&!!S,C._close=!S||S===2&&!!E,c(b)}}}class WF{constructor(){this.map=[]}add(t,n,r){qF(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const a of o)t.push(a);o=r.pop()}this.map.length=0}}function qF(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function GF(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function KF(){return{flow:{null:{name:"table",tokenize:YF,resolveAll:XF}}}}function YF(e,t,n){const r=this;let o=0,a=0,l;return c;function c(L){let te=r.events.length-1;for(;te>-1;){const Q=r.events[te][1].type;if(Q==="lineEnding"||Q==="linePrefix")te--;else break}const G=te>-1?r.events[te][1].type:null,X=G==="tableHead"||G==="tableRow"?N:d;return X===N&&r.parser.lazy[r.now().line]?n(L):X(L)}function d(L){return e.enter("tableHead"),e.enter("tableRow"),f(L)}function f(L){return L===124||(l=!0,a+=1),p(L)}function p(L){return L===null?n(L):Ie(L)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),v):n(L):Ve(L)?He(e,p,"whitespace")(L):(a+=1,l&&(l=!1,o+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(L)))}function m(L){return L===null||L===124||Qe(L)?(e.exit("data"),p(L)):(e.consume(L),L===92?y:m)}function y(L){return L===92||L===124?(e.consume(L),m):m(L)}function v(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),l=!1,Ve(L)?He(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):b(L))}function b(L){return L===45||L===58?C(L):L===124?(l=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),S):V(L)}function S(L){return Ve(L)?He(e,C,"whitespace")(L):C(L)}function C(L){return L===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),E):L===45?(a+=1,E(L)):L===null||Ie(L)?O(L):V(L)}function E(L){return L===45?(e.enter("tableDelimiterFiller"),P(L)):V(L)}function P(L){return L===45?(e.consume(L),P):L===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(L))}function T(L){return Ve(L)?He(e,O,"whitespace")(L):O(L)}function O(L){return L===124?b(L):L===null||Ie(L)?!l||o!==a?V(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):V(L)}function V(L){return n(L)}function N(L){return e.enter("tableRow"),D(L)}function D(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),D):L===null||Ie(L)?(e.exit("tableRow"),t(L)):Ve(L)?He(e,D,"whitespace")(L):(e.enter("data"),H(L))}function H(L){return L===null||L===124||Qe(L)?(e.exit("data"),D(L)):(e.consume(L),L===92?ee:H)}function ee(L){return L===92||L===124?(e.consume(L),H):H(L)}}function XF(e,t){let n=-1,r=!0,o=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,p,m;const y=new WF;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(c=!1,d!==0&&(lx(y,t,d,f,p),p=void 0,d=0),f={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",f,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",p,t]])),o=b.type==="tableDelimiterRow"?2:p?3:1):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=Eu(y,t,a,o,void 0,m),a=[0,0,0,0]),l[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],m=Eu(y,t,a,o,void 0,m)),a=l,l=[a[1],n,0,0])):b.type==="tableHead"?(c=!0,d=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],m=Eu(y,t,a,o,n,m)):l[1]!==0&&(m=Eu(y,t,l,o,n,m)),o=0):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&lx(y,t,d,f,p),y.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=GF(t.events,n))}return e}function Eu(e,t,n,r,o,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},Zs(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Zs(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=Zs(t.events,n[2]),p=Zs(t.events,n[3]),m={type:c,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const y=t.events[n[2]],v=t.events[n[3]];if(y[1].end=Object.assign({},v[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,S=n[3]-n[2]-1;e.add(b,S,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return o!==void 0&&(a.end=Object.assign({},Zs(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function lx(e,t,n,r,o){const a=[],l=Zs(t.events,n);o&&(o.end=Object.assign({},l),a.push(["exit",o,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Zs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const QF={name:"tasklistCheck",tokenize:ZF};function JF(){return{text:{91:QF}}}function ZF(e,t,n){const r=this;return o;function o(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return Qe(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return Ie(d)?t(d):Ve(d)?e.check({tokenize:e3},t,n)(d):n(d)}}function e3(e,t,n){return He(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function t3(e){return w1([IF(),LF(),HF(e),KF(),JF()])}const n3={};function r3(e){const t=this,n=e||n3,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(t3(n)),a.push(SF()),l.push(kF(n))}function i3(e){if(!e||typeof e!="string")return e;try{return e.replace(/```\s*([^\n\r]+?)\s*```/g,"`$1`")}catch{return e}}const s3=({node:e,inline:t,className:n,children:r,...o})=>{const[a,l]=I.useState(!1),c=Array.isArray(r)?r.join(""):String(r??""),d=/[\r\n]/.test(c);if(t||e&&e.type==="inlineCode"||!d)return w.jsx("code",{className:`font-mono text-[0.9em] px-1.5 py-0.5 rounded-md bg-gray-100 text-gray-900 border border-gray-200 dark:bg-gray-800/60 dark:text-gray-100 dark:border-gray-700 whitespace-pre-wrap break-words ${n||""}`,...o,children:r});const m=()=>{var v;const b=()=>{l(!0),setTimeout(()=>l(!1),1500)};try{(v=navigator==null?void 0:navigator.clipboard)!=null&&v.writeText?navigator.clipboard.writeText(c).then(b).catch(()=>y(c,b)):y(c,b)}catch{}},y=(v,b)=>{const S=document.createElement("textarea");S.value=v,S.style.position="fixed",S.style.opacity="0",document.body.appendChild(S),S.select();try{document.execCommand("copy")}catch{}document.body.removeChild(S),b()};return w.jsxs("div",{className:"relative group my-2",children:[w.jsx("button",{type:"button",onClick:m,className:"absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity text-xs px-2 py-1 rounded-md bg-gray-700/80 hover:bg-gray-700 text-white",children:a?"Copied":"Copy"}),w.jsx("pre",{className:"bg-gray-900 border border-gray-700/40 rounded-lg p-3 overflow-x-auto",children:w.jsx("code",{className:`text-gray-100 text-sm font-mono ${n||""}`,...o,children:r})})]})},o3={code:s3,blockquote:({children:e})=>w.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic my-2",children:e}),a:({href:e,children:t})=>w.jsx("a",{href:e,className:"text-blue-600 dark:text-blue-400 hover:underline",target:"_blank",rel:"noopener noreferrer",children:t}),p:({children:e})=>w.jsx("div",{className:"mb-2 last:mb-0 text-black",children:e})},lo=({children:e,className:t})=>{const n=i3(String(e??""));return w.jsx("div",{className:t,children:w.jsx(Hz,{remarkPlugins:[r3],components:o3,children:n})})};lo.displayName="MarkdownText";function Ua({text:e,isStreaming:t=!1}){return w.jsxs("div",{className:"w-full text-sm text-black",children:[w.jsx(lo,{children:e}),t&&w.jsx("span",{className:"inline-block w-2 h-4 bg-blue-600 dark:bg-blue-500 animate-pulse ml-1 align-middle",children:"▋"})]})}function cS({data:e,mediaType:t,name:n,maxWidth:r="400px",maxHeight:o="300px"}){const[a,l]=I.useState(!1),[c,d]=I.useState(!0),[f,p]=I.useState(!1),m=(e.startsWith("data:"),e);return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"w-full",children:[w.jsxs("div",{className:"relative inline-block rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 cursor-pointer hover:opacity-90 transition-opacity",onClick:()=>l(!0),style:{maxWidth:r,maxHeight:o},children:[c&&!f&&w.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:w.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 dark:border-gray-100"})}),f?w.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-red-600 dark:text-red-400",children:[w.jsx("span",{className:"text-4xl mb-2",children:"⚠️"}),w.jsx("span",{className:"text-sm",children:"Failed to load image"}),n&&w.jsx("span",{className:"text-xs mt-1",children:n})]}):w.jsx("img",{src:m,alt:n||"Image",className:"max-w-full max-h-full object-contain",style:{maxWidth:r,maxHeight:o},onLoad:()=>d(!1),onError:()=>{d(!1),p(!0)}})]}),n&&!f&&w.jsxs("div",{className:"mt-2 text-xs text-gray-600 dark:text-gray-400",children:["📷 ",n]})]}),a&&!f&&w.jsx("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-4",onClick:()=>l(!1),children:w.jsxs("div",{className:"relative max-w-[90vw] max-h-[90vh]",children:[w.jsx("button",{className:"absolute -top-10 right-0 text-white hover:text-gray-300 text-xl",onClick:()=>l(!1),children:"✕"}),w.jsx("img",{src:m,alt:n||"Image",className:"max-w-full max-h-[90vh] object-contain",onClick:y=>y.stopPropagation()}),n&&w.jsx("div",{className:"absolute -bottom-8 left-0 text-white text-sm",children:n})]})})]})}function Zp({data:e,mediaType:t,filename:n}){const r=p=>p.startsWith("application/pdf")?"📄":p.startsWith("application/vnd.openxmlformats-officedocument.spreadsheetml")?"📊":p.startsWith("application/vnd.openxmlformats-officedocument.wordprocessingml")?"📝":p.startsWith("application/vnd.openxmlformats-officedocument.presentationml")?"📽️":p.includes("zip")||p.includes("compressed")?"🗜️":p.startsWith("text/")?"📃":p.startsWith("video/")?"🎥":p.startsWith("audio/")?"🎵":"📎",o=()=>{if(n){const m=n.split(".").pop();if(m&&m!==n)return m.toUpperCase()}return{"application/pdf":"PDF","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.presentationml.presentation":"PPTX","application/zip":"ZIP","text/plain":"TXT","text/csv":"CSV","application/json":"JSON"}[t]||"FILE"},a=()=>{const p=document.createElement("a");p.href=e,p.download=n||`file.${o().toLowerCase()}`,document.body.appendChild(p),p.click(),document.body.removeChild(p)},l=()=>{if(e.startsWith("data:"))try{const p=e.split(",")[1];if(!p)return null;const m=Math.ceil(p.length*3/4);return m<1024?`${m} B`:m<1048576?`${(m/1024).toFixed(1)} KB`:`${(m/1048576).toFixed(1)} MB`}catch{return null}return null},c=r(t),d=o(),f=l();return w.jsx("div",{className:"w-full max-w-md",children:w.jsxs("div",{className:"flex items-center gap-3 p-3 border border-gray-200 dark:border-gray-700 rounded-lg bg-gray-50 dark:bg-gray-800/50 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",children:[w.jsx("div",{className:"text-3xl flex-shrink-0",children:c}),w.jsxs("div",{className:"flex-1 min-w-0",children:[w.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:n||`file.${d.toLowerCase()}`}),w.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-400 flex items-center gap-2",children:[w.jsx("span",{children:d}),f&&w.jsxs(w.Fragment,{children:[w.jsx("span",{children:"•"}),w.jsx("span",{children:f})]})]})]}),w.jsx("button",{onClick:a,className:"flex-shrink-0 px-3 py-1.5 text-xs font-medium text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 border border-blue-600 dark:border-blue-400 rounded hover:bg-blue-50 dark:hover:bg-blue-950/30 transition-colors",children:"Download"})]})})}function a3({message:e}){return w.jsx("div",{className:"chat-message user",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:"You",variant:"secondary",icon:w.jsx(f_,{className:"w-5 h-5 text-white"}),size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0 space-y-2",children:typeof e.content=="string"?w.jsx(Ua,{text:e.content}):e.content.map((t,n)=>{switch(t.type){case"text":return w.jsx(Ua,{text:t.text},n);case"image":return w.jsx(cS,{data:t.data,mediaType:t.mediaType,name:t.name},n);case"file":return w.jsx(Zp,{data:t.data,mediaType:t.mediaType,filename:t.filename},n);default:return null}})})]})})}function l3({reasoning:e,tokenCount:t,isStreaming:n=!1,defaultCollapsed:r=!0}){const[o,a]=I.useState(!r);return w.jsxs("div",{className:"w-full border border-purple-200 dark:border-purple-800 rounded-lg bg-purple-50 dark:bg-purple-950/30",children:[w.jsxs("button",{onClick:()=>a(!o),className:"w-full px-4 py-2 flex items-center justify-between text-sm font-medium text-purple-900 dark:text-purple-100 hover:bg-purple-100 dark:hover:bg-purple-900/30 transition-colors rounded-t-lg",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"💭"}),w.jsx("span",{children:"Thinking Process"}),t!==void 0&&w.jsxs("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:["(",t," tokens)"]})]}),w.jsx("span",{className:`transform transition-transform ${o?"rotate-180":""}`,children:"▼"})]}),o&&w.jsx("div",{className:"px-4 py-3 border-t border-purple-200 dark:border-purple-800",children:w.jsxs("div",{className:"text-sm text-purple-900 dark:text-purple-100",children:[w.jsx(lo,{children:e}),n&&w.jsx("span",{className:"inline-block w-2 h-4 bg-purple-600 dark:bg-purple-500 animate-pulse ml-1 align-middle",children:"▋"})]})})]})}function dS({id:e,name:t,input:n,defaultCollapsed:r=!1}){const[o,a]=I.useState(!r);return w.jsxs("div",{className:"w-full border border-blue-200 dark:border-blue-800 rounded-lg bg-blue-50 dark:bg-blue-950/30",children:[w.jsxs("button",{onClick:()=>a(!o),className:"w-full px-4 py-2 flex items-center justify-between text-sm font-medium text-blue-900 dark:text-blue-100 hover:bg-blue-100 dark:hover:bg-blue-900/30 transition-colors rounded-t-lg",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"🔧"}),w.jsx("span",{className:"font-mono",children:t}),w.jsx("span",{className:"text-xs text-blue-600 dark:text-blue-400",children:"(Tool Call)"})]}),w.jsx("span",{className:`transform transition-transform ${o?"rotate-180":""}`,children:"▼"})]}),o&&w.jsxs("div",{className:"px-4 py-3 border-t border-blue-200 dark:border-blue-800 space-y-3",children:[w.jsxs("div",{className:"text-xs text-blue-600 dark:text-blue-400",children:[w.jsx("span",{className:"font-medium",children:"ID:"})," ",w.jsx("span",{className:"font-mono",children:e})]}),w.jsxs("div",{children:[w.jsx("div",{className:"text-xs font-medium text-blue-900 dark:text-blue-100 mb-1",children:"Input Parameters:"}),w.jsx("div",{className:"bg-white dark:bg-gray-900 rounded border border-blue-200 dark:border-blue-800 p-3 overflow-x-auto",children:w.jsx("pre",{className:"text-xs text-blue-900 dark:text-blue-100 font-mono",children:JSON.stringify(n,null,2)})})]})]})]})}function ux({message:e,isStreaming:t=!1}){return w.jsx("div",{className:"chat-message assistant",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:"Agent",variant:"primary",icon:w.jsx(yw,{className:"w-5 h-5 text-white"}),size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0 space-y-2",children:typeof e.content=="string"?w.jsx(Ua,{text:e.content,isStreaming:t}):e.content.map((n,r)=>{const o=Array.isArray(e.content)&&r===e.content.length-1;switch(n.type){case"text":return w.jsx(Ua,{text:n.text,isStreaming:t&&o},r);case"thinking":return w.jsx(l3,{reasoning:n.reasoning,tokenCount:n.tokenCount,isStreaming:t&&o},r);case"tool-call":return w.jsx(dS,{id:n.id,name:n.name,input:n.input},r);case"file":return w.jsx(Zp,{data:n.data,mediaType:n.mediaType,filename:n.filename},r);default:return null}})})]})})}function u3({id:e,name:t,output:n,defaultCollapsed:r=!1}){const[o,a]=I.useState(!r),l=n.type==="error-text"||n.type==="error-json"||n.type==="execution-denied",d=l?"red":"green",f=()=>{switch(n.type){case"text":return w.jsx("div",{className:"text-sm text-gray-900 dark:text-gray-100",children:w.jsx(lo,{children:n.value})});case"json":return w.jsx("div",{className:"bg-white dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-700 p-3 overflow-x-auto",children:w.jsx("pre",{className:"text-xs text-gray-900 dark:text-gray-100 font-mono",children:JSON.stringify(n.value,null,2)})});case"error-text":return w.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:w.jsx(lo,{children:n.value})});case"error-json":return w.jsx("div",{className:"bg-red-50 dark:bg-red-950/30 rounded border border-red-200 dark:border-red-800 p-3 overflow-x-auto",children:w.jsx("pre",{className:"text-xs text-red-600 dark:text-red-400 font-mono",children:JSON.stringify(n.value,null,2)})});case"execution-denied":return w.jsxs("div",{className:"text-sm text-orange-600 dark:text-orange-400",children:["🚫 Execution denied",n.reason&&w.jsxs("div",{className:"mt-1 text-xs",children:["Reason: ",n.reason]})]});case"content":return w.jsx("div",{className:"space-y-3",children:n.value.map((p,m)=>p.type==="text"?w.jsx("div",{className:"text-sm text-gray-900 dark:text-gray-100",children:w.jsx(lo,{children:p.text})},m):p.type==="image"?w.jsx(cS,{data:p.data,mediaType:p.mediaType,name:p.name},m):p.type==="file"?w.jsx(Zp,{data:p.data,mediaType:p.mediaType,filename:p.filename},m):null)});default:return w.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Unknown output type"})}};return w.jsxs("div",{className:`w-full border border-${d}-200 dark:border-${d}-800 rounded-lg bg-${d}-50 dark:bg-${d}-950/30`,children:[w.jsxs("button",{onClick:()=>a(!o),className:`w-full px-4 py-2 flex items-center justify-between text-sm font-medium text-${d}-900 dark:text-${d}-100 hover:bg-${d}-100 dark:hover:bg-${d}-900/30 transition-colors rounded-t-lg`,children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:`text-${d}-600 dark:text-${d}-400`,children:l?"❌":"✅"}),w.jsx("span",{className:"font-mono",children:t}),w.jsxs("span",{className:`text-xs text-${d}-600 dark:text-${d}-400`,children:["(",l?"Error":"Result",")"]})]}),w.jsx("span",{className:`transform transition-transform ${o?"rotate-180":""}`,children:"▼"})]}),o&&w.jsxs("div",{className:`px-4 py-3 border-t border-${d}-200 dark:border-${d}-800 space-y-3`,children:[w.jsxs("div",{className:`text-xs text-${d}-600 dark:text-${d}-400`,children:[w.jsx("span",{className:"font-medium",children:"Call ID:"})," ",w.jsx("span",{className:"font-mono",children:e})]}),w.jsxs("div",{children:[w.jsx("div",{className:`text-xs font-medium text-${d}-900 dark:text-${d}-100 mb-1`,children:"Output:"}),f()]})]})]})}function c3({toolCall:e,toolResult:t,defaultExpanded:n=!1}){const[r,o]=I.useState(n),a=t?t.toolResult.output.type.includes("error")?"error":"success":"executing",c={executing:{icon:w.jsx(tv,{className:"w-4 h-4 animate-spin text-blue-500"}),bgColor:"bg-blue-50 dark:bg-blue-950/30",borderColor:"border-blue-200 dark:border-blue-800",textColor:"text-blue-900 dark:text-blue-100"},success:{icon:w.jsx("span",{className:"text-green-600 dark:text-green-400",children:"✅"}),bgColor:"bg-green-50 dark:bg-green-950/30",borderColor:"border-green-200 dark:border-green-800",textColor:"text-green-900 dark:text-green-100"},error:{icon:w.jsx("span",{className:"text-red-600 dark:text-red-400",children:"❌"}),bgColor:"bg-red-50 dark:bg-red-950/30",borderColor:"border-red-200 dark:border-red-800",textColor:"text-red-900 dark:text-red-100"}}[a],d=t&&e?((t.timestamp-e.timestamp)/1e3).toFixed(2):null;return w.jsx("div",{className:"chat-message tool-use",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:"Tool",variant:"primary",icon:w.jsx(h_,{className:"w-5 h-5 text-white"}),size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0",children:w.jsxs("div",{className:`w-full border ${c.borderColor} rounded-lg ${c.bgColor}`,children:[w.jsxs("button",{onClick:()=>o(!r),className:`w-full px-4 py-3 flex items-center justify-between ${c.textColor} hover:opacity-80 transition-opacity rounded-t-lg`,children:[w.jsxs("div",{className:"flex items-center gap-3",children:[c.icon,w.jsx("span",{className:"font-medium font-mono",children:e.toolCall.name}),d&&w.jsxs("span",{className:"text-xs opacity-70",children:["• ",d,"s"]}),a==="executing"&&w.jsx("span",{className:"text-xs opacity-70",children:"• Executing..."})]}),w.jsx(t_,{className:`w-4 h-4 transform transition-transform ${r?"rotate-180":""}`})]}),r&&w.jsxs("div",{className:`px-4 pb-4 pt-2 border-t ${c.borderColor} space-y-4`,children:[w.jsxs("div",{children:[w.jsx("div",{className:"text-xs font-medium opacity-70 mb-2 uppercase tracking-wide",children:"Input"}),w.jsx(dS,{id:e.toolCall.id,name:e.toolCall.name,input:e.toolCall.input})]}),t?w.jsxs("div",{children:[w.jsx("div",{className:"text-xs font-medium opacity-70 mb-2 uppercase tracking-wide",children:"Output"}),w.jsx(u3,{id:t.toolResult.id,name:t.toolResult.name,output:t.toolResult.output,defaultCollapsed:!1})]}):w.jsxs("div",{className:"flex items-center gap-2 text-blue-600 dark:text-blue-400 py-2",children:[w.jsx(tv,{className:"animate-spin w-4 h-4"}),w.jsx("span",{className:"text-sm",children:"Waiting for result..."})]}),w.jsxs("div",{className:"text-xs opacity-60 pt-2 border-t border-gray-200 dark:border-gray-700",children:[w.jsx("span",{className:"font-medium",children:"Call ID:"})," ",w.jsx("span",{className:"font-mono",children:e.toolCall.id})]})]})]})})]})})}function d3({message:e}){return w.jsx("div",{className:"chat-message system",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:"System",variant:"neutral",icon:w.jsx(i_,{className:"w-5 h-5 text-white"}),size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0",children:w.jsx("div",{className:"text-sm bg-gray-50 dark:bg-gray-800/50 border border-gray-200 dark:border-gray-700 rounded-lg p-3",children:w.jsx(Ua,{text:e.content})})})]})})}const f3={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}};function h3(e){const t=new Map,n=new Map,r=[];for(const a of e)a.subtype==="tool-call"?t.set(a.toolCall.id,a):a.subtype==="tool-result"?n.set(a.toolCallId,a):r.push(a);const o=[];for(const[a,l]of t.entries())o.push({type:"tool-use",toolCall:l,toolResult:n.get(a),timestamp:l.timestamp});return[...r,...o].sort((a,l)=>a.timestamp-l.timestamp)}function p3({messages:e,streamingText:t,className:n=""}){const r=I.useRef(null),o=[...e].sort((l,c)=>l.timestamp-c.timestamp),a=h3(o);return I.useEffect(()=>{r.current&&r.current.scrollIntoView({behavior:"smooth"})},[e.length,t]),e.length===0&&!t?w.jsx("div",{className:`flex-1 flex items-center justify-center ${n}`,children:w.jsxs("div",{className:"text-center px-4",children:[w.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100 mb-2",children:"Welcome to Deepractice Agent"}),w.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Type a message below to start a new conversation"})]})}):w.jsx("div",{className:`flex-1 overflow-y-auto overflow-x-hidden relative ${n}`,children:w.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-3 sm:py-4 space-y-3 sm:space-y-4",children:[a.map(l=>{if("type"in l&&l.type==="tool-use")return w.jsx(c3,{toolCall:l.toolCall,toolResult:l.toolResult},l.toolCall.id);const c=l;switch(c.subtype){case"user":return w.jsx(jp.div,{variants:f3,initial:"hidden",animate:"visible",transition:{duration:.2},children:w.jsx(a3,{message:c})},c.id);case"assistant":return w.jsx(ux,{message:c},c.id);case"system":return w.jsx(d3,{message:c},c.id);default:return null}}),t&&w.jsx(ux,{message:{id:"streaming",role:"assistant",subtype:"assistant",content:t,timestamp:Date.now()},isStreaming:!0}),w.jsx("div",{ref:r})]})})}function m3(e){switch(e){case"initializing":return"Initializing";case"queued":return"Queued";case"thinking":return"Thinking";case"responding":return"Responding";case"planning_tool":return"Planning tool use";case"awaiting_tool_result":return"Awaiting tool result";case"conversation_active":return"Processing";default:return""}}function g3({status:e,isLoading:t,onAbort:n,showAbortButton:r=!0,className:o=""}){const[a,l]=I.useState(0),[c,d]=I.useState(0);I.useEffect(()=>{if(!t){l(0);return}const m=Date.now(),y=setInterval(()=>{const v=Math.floor((Date.now()-m)/1e3);l(v)},1e3);return()=>clearInterval(y)},[t]),I.useEffect(()=>{if(!t)return;const m=setInterval(()=>{d(y=>(y+1)%4)},500);return()=>clearInterval(m)},[t]);const f=m3(e),p=["●","●","●","○"];return t?w.jsx("div",{className:`w-full ${o}`,children:w.jsxs("div",{className:"flex items-center justify-between max-w-4xl mx-auto bg-gray-900 dark:bg-gray-950 text-white rounded-lg shadow-lg px-4 py-3",children:[w.jsx("div",{className:"flex-1",children:w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"text-xl text-blue-400 flex items-center space-x-0.5",children:p.map((m,y)=>w.jsx("span",{className:`transition-opacity duration-200 ${y===c?"opacity-100":"opacity-30"}`,children:m},y))}),w.jsxs("div",{className:"flex-1",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs("span",{className:"font-medium text-sm",children:[f,"..."]}),w.jsxs("span",{className:"text-gray-400 text-sm",children:["(",a,"s)"]}),w.jsx("span",{className:"text-gray-400 hidden sm:inline",children:"·"}),w.jsx("span",{className:"text-gray-300 text-sm hidden sm:inline",children:"esc to interrupt"})]}),w.jsx("div",{className:"text-xs text-gray-400 sm:hidden mt-1",children:"esc to interrupt"})]})]})}),r&&n&&w.jsxs("button",{onClick:n,className:"ml-3 text-xs bg-red-600 hover:bg-red-700 text-white px-2.5 py-1 sm:px-3 sm:py-1.5 rounded-md transition-colors flex items-center gap-1.5 flex-shrink-0",children:[w.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),w.jsx("span",{className:"hidden sm:inline",children:"Stop"})]})]})}):null}function y3({error:e,showDetails:t=!1}){const n=(e==null?void 0:e.severity)||"error",r=(e==null?void 0:e.category)||"system",o=e==null?void 0:e.code,a=(e==null?void 0:e.message)||"Unknown error",l=(e==null?void 0:e.recoverable)??!0,c=e==null?void 0:e.cause,d={fatal:{bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-300 dark:border-red-700",text:"text-red-700 dark:text-red-300",icon:w.jsx(r_,{className:"w-5 h-5 text-white"}),label:"Fatal Error"},error:{bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-300 dark:border-red-700",text:"text-red-700 dark:text-red-300",icon:w.jsx(n_,{className:"w-5 h-5 text-white"}),label:"Error"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20",border:"border-yellow-300 dark:border-yellow-700",text:"text-yellow-700 dark:text-yellow-300",icon:w.jsx(c_,{className:"w-5 h-5 text-white"}),label:"Warning"}},f=d[n]??d.error,p={driver:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",llm:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900/30 dark:text-indigo-300",network:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",validation:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",system:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300"},m=p[r]??p.system;return w.jsx("div",{className:"chat-message error",children:w.jsxs("div",{className:"w-full",children:[w.jsx(bo,{label:f.label,variant:n==="warning"?"warning":"error",icon:f.icon,size:"md"}),w.jsx("div",{className:"pl-3 sm:pl-0",children:w.jsxs("div",{className:`text-sm ${f.bg} ${f.border} border rounded-lg p-3`,children:[w.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[w.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${m}`,children:r.toUpperCase()}),o&&w.jsx("span",{className:"text-xs font-mono text-gray-500 dark:text-gray-400",children:o}),!l&&w.jsx("span",{className:"text-xs font-semibold text-red-600 dark:text-red-400",children:"Non-recoverable"})]}),w.jsx("p",{className:`${f.text} font-medium`,children:a}),t&&c&&w.jsxs("details",{className:"mt-2",children:[w.jsx("summary",{className:"cursor-pointer text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",children:"Show details"}),w.jsx("pre",{className:"mt-2 text-xs bg-gray-900 dark:bg-gray-950 text-gray-100 rounded p-2 overflow-x-auto",children:c instanceof Error?`${c.name}: ${c.message}
228
228
  ${c.stack||""}`:JSON.stringify(c,null,2)})]})]})})]})})}function v3({messages:e,streaming:t="",errors:n=[],status:r="idle",isLoading:o=!1,onAbort:a,className:l=""}){return w.jsxs("div",{className:`flex flex-col h-full ${l}`,children:[w.jsx("div",{className:"flex-1 min-h-0",children:w.jsx(p3,{messages:e,streamingText:t,className:"h-full"})}),o&&w.jsx("div",{className:"px-4 py-2 border-t border-border",children:w.jsx(g3,{status:r,isLoading:o,onAbort:a})}),n.length>0&&w.jsx("div",{className:"px-4 py-2 space-y-2 border-t border-border",children:n.map((c,d)=>w.jsx(y3,{error:c,showDetails:!0},`error-${d}`))})]})}function x3({definition:e,session:t,agentId:n,messages:r=[],streaming:o,errors:a=[],status:l,isLoading:c=!1,onAbort:d,className:f=""}){return c&&r.length===0&&!o?w.jsxs("div",{className:`h-full flex flex-col bg-background ${f}`,children:[e&&w.jsx(cx,{definition:e,session:t,agentId:n}),w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsxs("div",{className:"flex flex-col items-center text-center",children:[w.jsx("div",{className:"animate-pulse mb-4",children:w.jsx(yw,{className:"w-12 h-12 text-muted-foreground"})}),w.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting..."})]})})]}):w.jsxs("div",{className:`h-full flex flex-col bg-background ${f}`,children:[e&&w.jsx(cx,{definition:e,session:t,agentId:n}),w.jsx("div",{className:"flex-1 min-h-0 relative overflow-hidden",children:w.jsx(db,{mode:"wait",children:w.jsx(jp.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"absolute inset-0",children:w.jsx(v3,{messages:r,streaming:o,errors:a,status:l,isLoading:c,onAbort:d})},(t==null?void 0:t.sessionId)??"empty")})})]})}function cx({definition:e,agentId:t}){return w.jsx("div",{className:"flex items-center px-4 py-3 border-b border-border bg-background flex-shrink-0",children:w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center text-white text-sm font-semibold ${e.color||"bg-blue-500"}`,children:e.icon||e.name.charAt(0).toUpperCase()}),w.jsxs("div",{children:[w.jsx("span",{className:"text-sm font-semibold text-foreground",children:e.name}),t&&w.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:t})]})]})})}function w3({onSend:e,disabled:t=!1,placeholder:n="Type a message...",defaultValue:r="",className:o=""}){const[a,l]=I.useState(r),c=I.useRef(null),d=m=>{m&&m.preventDefault(),!(!a.trim()||t)&&(e(a.trim()),l(""))},f=m=>{m.key==="Enter"&&!m.shiftKey&&!m.nativeEvent.isComposing&&(m.preventDefault(),d())},p=m=>{l(m.target.value)};return w.jsxs("form",{onSubmit:d,className:`h-full relative ${o}`,children:[w.jsx("textarea",{ref:c,value:a,onChange:p,onKeyDown:f,placeholder:n,disabled:t,className:`w-full h-full bg-transparent resize-none focus:outline-none
229
229
  text-foreground placeholder:text-muted-foreground
230
230
  disabled:opacity-50 text-sm leading-6 px-3 py-3 pr-14
@@ -241,5 +241,5 @@ ${c.stack||""}`:JSON.stringify(c,null,2)})]})]})})]})})}function v3({messages:e,
241
241
  Copyright (c) 2018 Jed Watson.
242
242
  Licensed under the MIT License (MIT), see
243
243
  http://jedwatson.github.io/classnames
244
- */var Lf,hx,px,k3=(dx||(dx=1,Lf=fx,(function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var a=typeof o;if(a==="string"||a==="number")n.push(o);else if(Array.isArray(o)){if(o.length){var l=t.apply(null,o);l&&n.push(l)}}else if(a==="object")if(o.toString===Object.prototype.toString)for(var c in o)e.call(o,c)&&o[c]&&n.push(c);else n.push(o.toString())}}return n.join(" ")}Lf.exports?(t.default=t,Lf.exports=t):window.classNames=t})()),fx.exports),Vh=el(k3),mx,lr=el((function(){if(px)return hx;px=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,o=parseInt,a=Object.prototype.toString;function l(d){var f=typeof d;return!!d&&(f=="object"||f=="function")}function c(d){if(typeof d=="number")return d;if((function(m){return typeof m=="symbol"||(function(y){return!!y&&typeof y=="object"})(m)&&a.call(m)=="[object Symbol]"})(d))return NaN;if(l(d)){var f=typeof d.valueOf=="function"?d.valueOf():d;d=l(f)?f+"":f}if(typeof d!="string")return d===0?d:+d;d=d.replace(e,"");var p=n.test(d);return p||r.test(d)?o(d.slice(2),p?2:8):t.test(d)?NaN:+d}return hx=function(d,f,p){return p===void 0&&(p=f,f=void 0),p!==void 0&&(p=(p=c(p))==p?p:0),f!==void 0&&(f=(f=c(f))==f?f:0),(function(m,y,v){return m==m&&(v!==void 0&&(m=m<=v?m:v),y!==void 0&&(m=m>=y?m:y)),m})(c(d),f,p)}})()),zf={exports:{}},E3=(mx||(mx=1,(function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",d="[object Error]",f="[object Function]",p="[object Map]",m="[object Number]",y="[object Object]",v="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",E="[object Symbol]",P="[object WeakMap]",T="[object ArrayBuffer]",O="[object DataView]",V=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,D={};D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D[o]=D[a]=D[T]=D[l]=D[O]=D[c]=D[d]=D[f]=D[p]=D[m]=D[y]=D[b]=D[S]=D[C]=D[P]=!1;var H=typeof _i=="object"&&_i&&_i.Object===Object&&_i,ee=typeof self=="object"&&self&&self.Object===Object&&self,L=H||ee||Function("return this")(),te=t&&!t.nodeType&&t,G=te&&e&&!e.nodeType&&e,X=G&&G.exports===te,Q=X&&H.process,re=(function(){try{return Q&&Q.binding&&Q.binding("util")}catch{}})(),fe=re&&re.isTypedArray;function oe(F,q){for(var ce=-1,xe=F==null?0:F.length;++ce<xe;)if(q(F[ce],ce,F))return!0;return!1}function U(F){var q=-1,ce=Array(F.size);return F.forEach(function(xe,Xe){ce[++q]=[Xe,xe]}),ce}function se(F){var q=-1,ce=Array(F.size);return F.forEach(function(xe){ce[++q]=xe}),ce}var _,j,Y,A=Array.prototype,be=Function.prototype,Ie=Object.prototype,Se=L["__core-js_shared__"],Oe=be.toString,de=Ie.hasOwnProperty,he=(_=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+_:"",Re=Ie.toString,Ye=RegExp("^"+Oe.call(de).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mi=X?L.Buffer:void 0,Kn=L.Symbol,Yr=L.Uint8Array,Xr=Ie.propertyIsEnumerable,Di=A.splice,tn=Kn?Kn.toStringTag:void 0,Li=Object.getOwnPropertySymbols,Qr=Mi?Mi.isBuffer:void 0,fr=(j=Object.keys,Y=Object,function(F){return j(Y(F))}),Cn=Pr(L,"DataView"),Yn=Pr(L,"Map"),Jr=Pr(L,"Promise"),Zr=Pr(L,"Set"),ei=Pr(L,"WeakMap"),K=Pr(Object,"create"),ue=Ar(Cn),Te=Ar(Yn),ze=Ar(Jr),$e=Ar(Zr),kt=Ar(ei),In=Kn?Kn.prototype:void 0,zt=In?In.valueOf:void 0;function Ot(F){var q=-1,ce=F==null?0:F.length;for(this.clear();++q<ce;){var xe=F[q];this.set(xe[0],xe[1])}}function Nt(F){var q=-1,ce=F==null?0:F.length;for(this.clear();++q<ce;){var xe=F[q];this.set(xe[0],xe[1])}}function tt(F){var q=-1,ce=F==null?0:F.length;for(this.clear();++q<ce;){var xe=F[q];this.set(xe[0],xe[1])}}function Yt(F){var q=-1,ce=F==null?0:F.length;for(this.__data__=new tt;++q<ce;)this.add(F[q])}function ht(F){var q=this.__data__=new Nt(F);this.size=q.size}function Eo(F,q){var ce=Rr(F),xe=!ce&&vs(F),Xe=!ce&&!xe&&Fi(F),Fe=!ce&&!xe&&!Xe&&_o(F),st=ce||xe||Xe||Fe,Ne=st?(function(pt,Xt){for(var Xn=-1,Tt=Array(pt);++Xn<pt;)Tt[Xn]=Xt(Xn);return Tt})(F.length,String):[],mn=Ne.length;for(var ut in F)!de.call(F,ut)||st&&(ut=="length"||Xe&&(ut=="offset"||ut=="parent")||Fe&&(ut=="buffer"||ut=="byteLength"||ut=="byteOffset")||Oi(ut,mn))||Ne.push(ut);return Ne}function ti(F,q){for(var ce=F.length;ce--;)if(ri(F[ce][0],q))return ce;return-1}function Tn(F){return F==null?F===void 0?"[object Undefined]":"[object Null]":tn&&tn in Object(F)?(function(q){var ce=de.call(q,tn),xe=q[tn];try{q[tn]=void 0;var Xe=!0}catch{}var Fe=Re.call(q);return Xe&&(ce?q[tn]=xe:delete q[tn]),Fe})(F):(function(q){return Re.call(q)})(F)}function _r(F){return pn(F)&&Tn(F)==o}function Co(F,q,ce,xe,Xe){return F===q||(F==null||q==null||!pn(F)&&!pn(q)?F!=F&&q!=q:(function(Fe,st,Ne,mn,ut,pt){var Xt=Rr(Fe),Xn=Rr(st),Tt=Xt?a:_n(Fe),nn=Xn?a:_n(st),jt=(Tt=Tt==o?y:Tt)==y,xs=(nn=nn==o?y:nn)==y,_t=Tt==nn;if(_t&&Fi(Fe)){if(!Fi(st))return!1;Xt=!0,jt=!1}if(_t&&!jt)return pt||(pt=new ht),Xt||_o(Fe)?Io(Fe,st,Ne,mn,ut,pt):(function(Ge,Ue,Nr,hr,Po,Ft,Pn){switch(Nr){case O:if(Ge.byteLength!=Ue.byteLength||Ge.byteOffset!=Ue.byteOffset)return!1;Ge=Ge.buffer,Ue=Ue.buffer;case T:return!(Ge.byteLength!=Ue.byteLength||!Ft(new Yr(Ge),new Yr(Ue)));case l:case c:case m:return ri(+Ge,+Ue);case d:return Ge.name==Ue.name&&Ge.message==Ue.message;case b:case C:return Ge==Ue+"";case p:var An=U;case S:var Qn=1&hr;if(An||(An=se),Ge.size!=Ue.size&&!Qn)return!1;var bs=Pn.get(Ge);if(bs)return bs==Ue;hr|=2,Pn.set(Ge,Ue);var Bi=Io(An(Ge),An(Ue),hr,Po,Ft,Pn);return Pn.delete(Ge),Bi;case E:if(zt)return zt.call(Ge)==zt.call(Ue)}return!1})(Fe,st,Tt,Ne,mn,ut,pt);if(!(1&Ne)){var Vi=jt&&de.call(Fe,"__wrapped__"),al=xs&&de.call(st,"__wrapped__");if(Vi||al){var mc=Vi?Fe.value():Fe,ws=al?st.value():st;return pt||(pt=new ht),ut(mc,ws,Ne,mn,pt)}}return!!_t&&(pt||(pt=new ht),(function(Ge,Ue,Nr,hr,Po,Ft){var Pn=1&Nr,An=To(Ge),Qn=An.length,bs=To(Ue),Bi=bs.length;if(Qn!=Bi&&!Pn)return!1;for(var He=Qn;He--;){var pr=An[He];if(!(Pn?pr in Ue:de.call(Ue,pr)))return!1}var Ao=Ft.get(Ge);if(Ao&&Ft.get(Ue))return Ao==Ue;var ii=!0;Ft.set(Ge,Ue),Ft.set(Ue,Ge);for(var Ss=Pn;++He<Qn;){var $i=Ge[pr=An[He]],Ui=Ue[pr];if(hr)var ks=Pn?hr(Ui,$i,pr,Ue,Ge,Ft):hr($i,Ui,pr,Ge,Ue,Ft);if(!(ks===void 0?$i===Ui||Po($i,Ui,Nr,hr,Ft):ks)){ii=!1;break}Ss||(Ss=pr=="constructor")}if(ii&&!Ss){var jr=Ge.constructor,gn=Ue.constructor;jr==gn||!("constructor"in Ge)||!("constructor"in Ue)||typeof jr=="function"&&jr instanceof jr&&typeof gn=="function"&&gn instanceof gn||(ii=!1)}return Ft.delete(Ge),Ft.delete(Ue),ii})(Fe,st,Ne,mn,ut,pt))})(F,q,ce,xe,Co,Xe))}function tl(F){return!(!sl(F)||(function(q){return!!he&&he in q})(F))&&(rl(F)?Ye:V).test(Ar(F))}function nl(F){if(ce=(q=F)&&q.constructor,xe=typeof ce=="function"&&ce.prototype||Ie,q!==xe)return fr(F);var q,ce,xe,Xe=[];for(var Fe in Object(F))de.call(F,Fe)&&Fe!="constructor"&&Xe.push(Fe);return Xe}function Io(F,q,ce,xe,Xe,Fe){var st=1&ce,Ne=F.length,mn=q.length;if(Ne!=mn&&!(st&&mn>Ne))return!1;var ut=Fe.get(F);if(ut&&Fe.get(q))return ut==q;var pt=-1,Xt=!0,Xn=2&ce?new Yt:void 0;for(Fe.set(F,q),Fe.set(q,F);++pt<Ne;){var Tt=F[pt],nn=q[pt];if(xe)var jt=st?xe(nn,Tt,pt,q,F,Fe):xe(Tt,nn,pt,F,q,Fe);if(jt!==void 0){if(jt)continue;Xt=!1;break}if(Xn){if(!oe(q,function(xs,_t){if(Vi=_t,!Xn.has(Vi)&&(Tt===xs||Xe(Tt,xs,ce,xe,Fe)))return Xn.push(_t);var Vi})){Xt=!1;break}}else if(Tt!==nn&&!Xe(Tt,nn,ce,xe,Fe)){Xt=!1;break}}return Fe.delete(F),Fe.delete(q),Xt}function To(F){return(function(q,ce,xe){var Xe=ce(q);return Rr(q)?Xe:(function(Fe,st){for(var Ne=-1,mn=st.length,ut=Fe.length;++Ne<mn;)Fe[ut+Ne]=st[Ne];return Fe})(Xe,xe(q))})(F,ol,zi)}function ni(F,q){var ce,xe,Xe=F.__data__;return((xe=typeof(ce=q))=="string"||xe=="number"||xe=="symbol"||xe=="boolean"?ce!=="__proto__":ce===null)?Xe[typeof q=="string"?"string":"hash"]:Xe.map}function Pr(F,q){var ce=(function(xe,Xe){return xe==null?void 0:xe[Xe]})(F,q);return tl(ce)?ce:void 0}Ot.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},Ot.prototype.delete=function(F){var q=this.has(F)&&delete this.__data__[F];return this.size-=q?1:0,q},Ot.prototype.get=function(F){var q=this.__data__;if(K){var ce=q[F];return ce===n?void 0:ce}return de.call(q,F)?q[F]:void 0},Ot.prototype.has=function(F){var q=this.__data__;return K?q[F]!==void 0:de.call(q,F)},Ot.prototype.set=function(F,q){var ce=this.__data__;return this.size+=this.has(F)?0:1,ce[F]=K&&q===void 0?n:q,this},Nt.prototype.clear=function(){this.__data__=[],this.size=0},Nt.prototype.delete=function(F){var q=this.__data__,ce=ti(q,F);return!(ce<0||(ce==q.length-1?q.pop():Di.call(q,ce,1),--this.size,0))},Nt.prototype.get=function(F){var q=this.__data__,ce=ti(q,F);return ce<0?void 0:q[ce][1]},Nt.prototype.has=function(F){return ti(this.__data__,F)>-1},Nt.prototype.set=function(F,q){var ce=this.__data__,xe=ti(ce,F);return xe<0?(++this.size,ce.push([F,q])):ce[xe][1]=q,this},tt.prototype.clear=function(){this.size=0,this.__data__={hash:new Ot,map:new(Yn||Nt),string:new Ot}},tt.prototype.delete=function(F){var q=ni(this,F).delete(F);return this.size-=q?1:0,q},tt.prototype.get=function(F){return ni(this,F).get(F)},tt.prototype.has=function(F){return ni(this,F).has(F)},tt.prototype.set=function(F,q){var ce=ni(this,F),xe=ce.size;return ce.set(F,q),this.size+=ce.size==xe?0:1,this},Yt.prototype.add=Yt.prototype.push=function(F){return this.__data__.set(F,n),this},Yt.prototype.has=function(F){return this.__data__.has(F)},ht.prototype.clear=function(){this.__data__=new Nt,this.size=0},ht.prototype.delete=function(F){var q=this.__data__,ce=q.delete(F);return this.size=q.size,ce},ht.prototype.get=function(F){return this.__data__.get(F)},ht.prototype.has=function(F){return this.__data__.has(F)},ht.prototype.set=function(F,q){var ce=this.__data__;if(ce instanceof Nt){var xe=ce.__data__;if(!Yn||xe.length<199)return xe.push([F,q]),this.size=++ce.size,this;ce=this.__data__=new tt(xe)}return ce.set(F,q),this.size=ce.size,this};var zi=Li?function(F){return F==null?[]:(F=Object(F),(function(q,ce){for(var xe=-1,Xe=q==null?0:q.length,Fe=0,st=[];++xe<Xe;){var Ne=q[xe];ce(Ne,xe,q)&&(st[Fe++]=Ne)}return st})(Li(F),function(q){return Xr.call(F,q)}))}:function(){return[]},_n=Tn;function Oi(F,q){return!!(q=q??r)&&(typeof F=="number"||N.test(F))&&F>-1&&F%1==0&&F<q}function Ar(F){if(F!=null){try{return Oe.call(F)}catch{}try{return F+""}catch{}}return""}function ri(F,q){return F===q||F!=F&&q!=q}(Cn&&_n(new Cn(new ArrayBuffer(1)))!=O||Yn&&_n(new Yn)!=p||Jr&&_n(Jr.resolve())!=v||Zr&&_n(new Zr)!=S||ei&&_n(new ei)!=P)&&(_n=function(F){var q=Tn(F),ce=q==y?F.constructor:void 0,xe=ce?Ar(ce):"";if(xe)switch(xe){case ue:return O;case Te:return p;case ze:return v;case $e:return S;case kt:return P}return q});var vs=_r((function(){return arguments})())?_r:function(F){return pn(F)&&de.call(F,"callee")&&!Xr.call(F,"callee")},Rr=Array.isArray,Fi=Qr||function(){return!1};function rl(F){if(!sl(F))return!1;var q=Tn(F);return q==f||q=="[object GeneratorFunction]"||q=="[object AsyncFunction]"||q=="[object Proxy]"}function il(F){return typeof F=="number"&&F>-1&&F%1==0&&F<=r}function sl(F){var q=typeof F;return F!=null&&(q=="object"||q=="function")}function pn(F){return F!=null&&typeof F=="object"}var _o=fe?(function(F){return function(q){return F(q)}})(fe):function(F){return pn(F)&&il(F.length)&&!!D[Tn(F)]};function ol(F){return(q=F)!=null&&il(q.length)&&!rl(q)?Eo(F):nl(F);var q}e.exports=function(F,q){return Co(F,q)}})(zf,zf.exports)),zf.exports),C3=el(E3);function gx(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function I3(e){e===void 0&&(e={});var t=e.onResize,n=I.useRef(void 0);n.current=t;var r=e.round||Math.round,o=I.useRef(),a=I.useState({width:void 0,height:void 0}),l=a[0],c=a[1],d=I.useRef(!1);I.useEffect(function(){return d.current=!1,function(){d.current=!0}},[]);var f=I.useRef({width:void 0,height:void 0}),p=(function(m,y){var v=I.useRef(null),b=I.useRef(null);b.current=y;var S=I.useRef(null);I.useEffect(function(){C()});var C=I.useCallback(function(){var E=S.current,P=b.current,T=E||(P?P instanceof Element?P:P.current:null);v.current&&v.current.element===T&&v.current.subscriber===m||(v.current&&v.current.cleanup&&v.current.cleanup(),v.current={element:T,subscriber:m,cleanup:T?m(T):void 0})},[m]);return I.useEffect(function(){return function(){v.current&&v.current.cleanup&&(v.current.cleanup(),v.current=null)}},[]),I.useCallback(function(E){S.current=E,C()},[C])})(I.useCallback(function(m){return o.current&&o.current.box===e.box&&o.current.round===r||(o.current={box:e.box,round:r,instance:new ResizeObserver(function(y){var v=y[0],b=e.box==="border-box"?"borderBoxSize":e.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",S=gx(v,b,"inlineSize"),C=gx(v,b,"blockSize"),E=S?r(S):void 0,P=C?r(C):void 0;if(f.current.width!==E||f.current.height!==P){var T={width:E,height:P};f.current.width=E,f.current.height=P,n.current?n.current(T):d.current||c(T)}})}),o.current.instance.observe(m,{box:e.box}),function(){o.current&&o.current.instance.unobserve(m)}},[e.box,r]),e.ref);return I.useMemo(function(){return{ref:p,width:l.width,height:l.height}},[p,l.width,l.height])}var T3="allotment-module_splitView__L-yRc",_3="allotment-module_sashContainer__fzwJF",P3="allotment-module_splitViewContainer__rQnVa",fS="allotment-module_splitViewView__MGZ6O",A3="allotment-module_vertical__WSwwa",R3="allotment-module_horizontal__7doS8",N3="allotment-module_separatorBorder__x-rDS";let xa,hS=!1,pS=!1;typeof navigator=="object"&&(xa=navigator.userAgent,pS=xa.indexOf("Macintosh")>=0,hS=(xa.indexOf("Macintosh")>=0||xa.indexOf("iPad")>=0||xa.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const mS=hS,j3=pS,yx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?I.useLayoutEffect:I.useEffect;class M3{constructor(){this._size=void 0}getSize(){return this._size}setSize(t){this._size=t}}function Cu(e,t){const n=e.length,r=n-t.length;return r>=0&&e.slice(r,n)===t}var vx,xx={exports:{}},wx,bx,D3=(vx||(vx=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new o(p,m||d,y),b=n?n+f:f;return d._events[b]?d._events[b].fn?d._events[b]=[d._events[b],v]:d._events[b].push(v):(d._events[b]=v,d._eventsCount++),d}function l(d,f){--d._eventsCount==0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1)),c.prototype.eventNames=function(){var d,f,p=[];if(this._eventsCount===0)return p;for(f in d=this._events)t.call(d,f)&&p.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(d)):p},c.prototype.listeners=function(d){var f=n?n+d:d,p=this._events[f];if(!p)return[];if(p.fn)return[p.fn];for(var m=0,y=p.length,v=new Array(y);m<y;m++)v[m]=p[m].fn;return v},c.prototype.listenerCount=function(d){var f=n?n+d:d,p=this._events[f];return p?p.fn?1:p.length:0},c.prototype.emit=function(d,f,p,m,y,v){var b=n?n+d:d;if(!this._events[b])return!1;var S,C,E=this._events[b],P=arguments.length;if(E.fn){switch(E.once&&this.removeListener(d,E.fn,void 0,!0),P){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,f),!0;case 3:return E.fn.call(E.context,f,p),!0;case 4:return E.fn.call(E.context,f,p,m),!0;case 5:return E.fn.call(E.context,f,p,m,y),!0;case 6:return E.fn.call(E.context,f,p,m,y,v),!0}for(C=1,S=new Array(P-1);C<P;C++)S[C-1]=arguments[C];E.fn.apply(E.context,S)}else{var T,O=E.length;for(C=0;C<O;C++)switch(E[C].once&&this.removeListener(d,E[C].fn,void 0,!0),P){case 1:E[C].fn.call(E[C].context);break;case 2:E[C].fn.call(E[C].context,f);break;case 3:E[C].fn.call(E[C].context,f,p);break;case 4:E[C].fn.call(E[C].context,f,p,m);break;default:if(!S)for(T=1,S=new Array(P-1);T<P;T++)S[T-1]=arguments[T];E[C].fn.apply(E[C].context,S)}}return!0},c.prototype.on=function(d,f,p){return a(this,d,f,p,!1)},c.prototype.once=function(d,f,p){return a(this,d,f,p,!0)},c.prototype.removeListener=function(d,f,p,m){var y=n?n+d:d;if(!this._events[y])return this;if(!f)return l(this,y),this;var v=this._events[y];if(v.fn)v.fn!==f||m&&!v.once||p&&v.context!==p||l(this,y);else{for(var b=0,S=[],C=v.length;b<C;b++)(v[b].fn!==f||m&&!v[b].once||p&&v[b].context!==p)&&S.push(v[b]);S.length?this._events[y]=S.length===1?S[0]:S:l(this,y)}return this},c.prototype.removeAllListeners=function(d){var f;return d?(f=n?n+d:d,this._events[f]&&l(this,f)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(xx)),xx.exports),em=el(D3);function Sx(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.unshift(t))}function Of(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))}function On(e,t,n=1){const r=Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);let a=-1;for(;++a<r;)o[a]=e+a*n;return o}var L3=el((function(){if(bx)return wx;bx=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,o=parseInt,a=typeof _i=="object"&&_i&&_i.Object===Object&&_i,l=typeof self=="object"&&self&&self.Object===Object&&self,c=a||l||Function("return this")(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return c.Date.now()};function y(b){var S=typeof b;return!!b&&(S=="object"||S=="function")}function v(b){if(typeof b=="number")return b;if((function(E){return typeof E=="symbol"||(function(P){return!!P&&typeof P=="object"})(E)&&d.call(E)=="[object Symbol]"})(b))return NaN;if(y(b)){var S=typeof b.valueOf=="function"?b.valueOf():b;b=y(S)?S+"":S}if(typeof b!="string")return b===0?b:+b;b=b.replace(e,"");var C=n.test(b);return C||r.test(b)?o(b.slice(2),C?2:8):t.test(b)?NaN:+b}return wx=function(b,S,C){var E,P,T,O,V,N,D=0,H=!1,ee=!1,L=!0;if(typeof b!="function")throw new TypeError("Expected a function");function te(fe){var oe=E,U=P;return E=P=void 0,D=fe,O=b.apply(U,oe)}function G(fe){var oe=fe-N;return N===void 0||oe>=S||oe<0||ee&&fe-D>=T}function X(){var fe=m();if(G(fe))return Q(fe);V=setTimeout(X,(function(oe){var U=S-(oe-N);return ee?p(U,T-(oe-D)):U})(fe))}function Q(fe){return V=void 0,L&&E?te(fe):(E=P=void 0,O)}function re(){var fe=m(),oe=G(fe);if(E=arguments,P=this,N=fe,oe){if(V===void 0)return(function(U){return D=U,V=setTimeout(X,S),H?te(U):O})(N);if(ee)return V=setTimeout(X,S),te(N)}return V===void 0&&(V=setTimeout(X,S)),O}return S=v(S)||0,y(C)&&(H=!!C.leading,T=(ee="maxWait"in C)?f(v(C.maxWait)||0,S):T,L="trailing"in C?!!C.trailing:L),re.cancel=function(){V!==void 0&&clearTimeout(V),D=0,E=N=P=V=void 0},re.flush=function(){return V===void 0?O:Q(m())},re}})()),z3="sash-module_sash__K-9lB",O3="sash-module_disabled__Hm-wx",F3="sash-module_mac__Jf6OJ",kx="sash-module_vertical__pB-rs",V3="sash-module_minimum__-UKxp",B3="sash-module_maximum__TCWxD",Ex="sash-module_horizontal__kFbiw",Ff="sash-module_hover__80W6I",Vf="sash-module_active__bJspD";let Hn=(function(e){return e.Vertical="VERTICAL",e.Horizontal="HORIZONTAL",e})({}),kn=(function(e){return e.Disabled="DISABLED",e.Minimum="MINIMUM",e.Maximum="MAXIMUM",e.Enabled="ENABLED",e})({}),gS=mS?20:8;const yS=new em;class Cx extends em{get state(){return this._state}set state(t){this._state!==t&&(this.el.classList.toggle(O3,t===kn.Disabled),this.el.classList.toggle("sash-disabled",t===kn.Disabled),this.el.classList.toggle(V3,t===kn.Minimum),this.el.classList.toggle("sash-minimum",t===kn.Minimum),this.el.classList.toggle(B3,t===kn.Maximum),this.el.classList.toggle("sash-maximum",t===kn.Maximum),this._state=t,this.emit("enablementChange",t))}constructor(t,n,r){var o;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=L3(a=>a.classList.add("sash-hover",Ff),this.hoverDelay),this._state=kn.Enabled,this.onPointerStart=a=>{const l=a.pageX,c=a.pageY,d={startX:l,currentX:l,startY:c,currentY:c};this.el.classList.add("sash-active",Vf),this.emit("start",d),this.el.setPointerCapture(a.pointerId);const f=m=>{m.preventDefault();const y={startX:l,currentX:m.pageX,startY:c,currentY:m.pageY};this.emit("change",y)},p=m=>{m.preventDefault(),this.el.classList.remove("sash-active",Vf),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(m.pointerId),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",p)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",p)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(Vf)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",Ff)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",Ff)},this.el=document.createElement("div"),this.el.classList.add("sash",z3),this.el.dataset.testid="sash",t.append(this.el),j3&&this.el.classList.add("sash-mac",F3),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),typeof r.size=="number"?(this.size=r.size,r.orientation===Hn.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=gS,yS.on("onDidChangeGlobalSize",a=>{this.size=a,this.layout()})),this.layoutProvider=n,this.orientation=(o=r.orientation)!=null?o:Hn.Vertical,this.orientation===Hn.Horizontal?(this.el.classList.add("sash-horizontal",Ex),this.el.classList.remove("sash-vertical",kx)):(this.el.classList.remove("sash-horizontal",Ex),this.el.classList.add("sash-vertical",kx)),this.layout()}layout(){if(this.orientation===Hn.Vertical){const t=this.layoutProvider;this.el.style.left=t.getVerticalSashLeft(this)-this.size/2+"px",t.getVerticalSashTop&&(this.el.style.top=t.getVerticalSashTop(this)+"px"),t.getVerticalSashHeight&&(this.el.style.height=t.getVerticalSashHeight(this)+"px")}else{const t=this.layoutProvider;this.el.style.top=t.getHorizontalSashTop(this)-this.size/2+"px",t.getHorizontalSashLeft&&(this.el.style.left=t.getHorizontalSashLeft(this)+"px"),t.getHorizontalSashWidth&&(this.el.style.width=t.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}let Xu;var Bf;(Bf=Xu||(Xu={})).Distribute={type:"distribute"},Bf.Split=function(e){return{type:"split",index:e}},Bf.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};let Bn=(function(e){return e.Normal="NORMAL",e.Low="LOW",e.High="HIGH",e})({});class vS{constructor(t,n,r){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=t,this.view=n,this.container.classList.add("split-view-view",fS),this.container.dataset.testid="split-view-view",typeof r=="number"?(this._size=r,this._cachedVisibleSize=void 0,t.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=r.cachedVisibleSize)}set size(t){this._size=t}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return this._cachedVisibleSize===void 0}setVisible(t,n){t!==this.visible&&(t?(this.size=lr(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof n=="number"?n:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",t),this.view.setVisible&&this.view.setVisible(t))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(t){this.container.style.pointerEvents=t?"":"none"}layout(t){this.layoutContainer(t),this.view.layout(this.size,t)}}class $3 extends vS{layoutContainer(t){this.container.style.left=`${t}px`,this.container.style.width=`${this.size}px`}}class U3 extends vS{layoutContainer(t){this.container.style.top=`${t}px`,this.container.style.height=`${this.size}px`}}class H3 extends em{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}constructor(t,n={},r,o,a){var l,c;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=d=>{this.emit("sashchange",d),this.saveProportions();for(const f of this.viewItems)f.enabled=!0},this.orientation=(l=n.orientation)!=null?l:Hn.Vertical,this.proportionalLayout=(c=n.proportionalLayout)!=null?c:!0,this.getSashOrthogonalSize=n.getSashOrthogonalSize,r&&(this.onDidChange=r),o&&(this.onDidDragStart=o),a&&(this.onDidDragEnd=a),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container",_3),t.prepend(this.sashContainer),n.descriptor){this.size=n.descriptor.size;for(const[d,f]of n.descriptor.views.entries()){const p=f.size,m=f.container,y=f.view;this.addView(m,y,p,d,!0)}this.contentSize=this.viewItems.reduce((d,f)=>d+f.size,0),this.saveProportions()}}addView(t,n,r,o=this.viewItems.length,a){let l;l=typeof r=="number"?r:r.type==="split"?this.getViewSize(r.index)/2:r.type==="invisible"?{cachedVisibleSize:r.cachedVisibleSize}:n.minimumSize;const c=this.orientation===Hn.Vertical?new U3(t,n,l):new $3(t,n,l);if(this.viewItems.splice(o,0,c),this.viewItems.length>1){const d=this.orientation===Hn.Vertical?new Cx(this.sashContainer,{getHorizontalSashTop:m=>this.getSashPosition(m),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:Hn.Horizontal}):new Cx(this.sashContainer,{getVerticalSashLeft:m=>this.getSashPosition(m),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:Hn.Vertical}),f=this.orientation===Hn.Vertical?m=>({sash:d,start:m.startY,current:m.currentY}):m=>({sash:d,start:m.startX,current:m.currentX});d.on("start",m=>{var y;this.emit("sashDragStart"),this.onSashStart(f(m));const v=this.viewItems.map(b=>b.size);(y=this.onDidDragStart)==null||y.call(this,v)}),d.on("change",m=>this.onSashChange(f(m))),d.on("end",()=>{var m;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(v=>v.sash===d));const y=this.viewItems.map(v=>v.size);(m=this.onDidDragEnd)==null||m.call(this,y)}),d.on("reset",()=>{const m=this.sashItems.findIndex(C=>C.sash===d),y=On(m,-1,-1),v=On(m+1,this.viewItems.length),b=this.findFirstSnapIndex(y),S=this.findFirstSnapIndex(v);(typeof b!="number"||this.viewItems[b].visible)&&(typeof S!="number"||this.viewItems[S].visible)&&this.emit("sashreset",m)});const p={sash:d};this.sashItems.splice(o-1,0,p)}a||this.relayout(),a||typeof r=="number"||r.type!=="distribute"||this.distributeViewSizes()}removeView(t,n){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");const r=this.viewItems.splice(t,1)[0].view;if(this.viewItems.length>=1){const o=Math.max(t-1,0);this.sashItems.splice(o,1)[0].sash.dispose()}return this.relayout(),n&&n.type==="distribute"&&this.distributeViewSizes(),r}moveView(t,n,r){const o=this.getViewCachedVisibleSize(n),a=o===void 0?this.getViewSize(n):Xu.Invisible(o),l=this.removeView(n);this.addView(t,l,a,r)}getViewCachedVisibleSize(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].cachedVisibleSize}layout(t=this.size){const n=Math.max(this.size,this.contentSize);if(this.size=t,this.proportions)for(let r=0;r<this.viewItems.length;r++){const o=this.viewItems[r];o.size=lr(Math.round(this.proportions[r]*t),o.minimumSize,o.maximumSize)}else{const r=On(0,this.viewItems.length),o=r.filter(l=>this.viewItems[l].priority===Bn.Low),a=r.filter(l=>this.viewItems[l].priority===Bn.High);this.resize(this.viewItems.length-1,t-n,void 0,o,a)}this.distributeEmptySpace(),this.layoutViews()}resizeView(t,n){if(t<0||t>=this.viewItems.length)return;const r=On(0,this.viewItems.length).filter(c=>c!==t),o=[...r.filter(c=>this.viewItems[c].priority===Bn.Low),t],a=r.filter(c=>this.viewItems[c].priority===Bn.High),l=this.viewItems[t];n=Math.round(n),n=lr(n,l.minimumSize,Math.min(l.maximumSize,this.size)),l.size=n,this.relayout(o,a)}resizeViews(t){for(let n=0;n<t.length;n++){const r=this.viewItems[n];let o=t[n];o=Math.round(o),o=lr(o,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=o}this.contentSize=this.viewItems.reduce((n,r)=>n+r.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}isViewVisible(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].visible}setViewVisible(t,n){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[t].setVisible(n),this.distributeEmptySpace(t),this.layoutViews(),this.saveProportions()}distributeViewSizes(){const t=[];let n=0;for(const c of this.viewItems)c.maximumSize-c.minimumSize>0&&(t.push(c),n+=c.size);const r=Math.floor(n/t.length);for(const c of t)c.size=lr(r,c.minimumSize,c.maximumSize);const o=On(0,this.viewItems.length),a=o.filter(c=>this.viewItems[c].priority===Bn.Low),l=o.filter(c=>this.viewItems[c].priority===Bn.High);this.relayout(a,l)}dispose(){this.sashItems.forEach(t=>t.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(t,n){const r=this.viewItems.reduce((o,a)=>o+a.size,0);this.resize(this.viewItems.length-1,this.size-r,void 0,t,n),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:t,start:n}){const r=this.sashItems.findIndex(o=>o.sash===t);(o=>{const a=this.viewItems.map(P=>P.size);let l,c,d=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY;const p=On(r,-1,-1),m=On(r+1,this.viewItems.length),y=p.reduce((P,T)=>P+(this.viewItems[T].minimumSize-a[T]),0),v=p.reduce((P,T)=>P+(this.viewItems[T].viewMaximumSize-a[T]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((P,T)=>P+(a[T]-this.viewItems[T].minimumSize),0),S=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((P,T)=>P+(a[T]-this.viewItems[T].viewMaximumSize),0);d=Math.max(y,S),f=Math.min(b,v);const C=this.findFirstSnapIndex(p),E=this.findFirstSnapIndex(m);if(typeof C=="number"){const P=this.viewItems[C],T=Math.floor(P.viewMinimumSize/2);l={index:C,limitDelta:P.visible?d-T:d+T,size:P.size}}if(typeof E=="number"){const P=this.viewItems[E],T=Math.floor(P.viewMinimumSize/2);c={index:E,limitDelta:P.visible?f+T:f-T,size:P.size}}this.sashDragState={start:o,current:o,index:r,sizes:a,minDelta:d,maxDelta:f,snapBefore:l,snapAfter:c}})(n)}onSashChange({current:t}){const{index:n,start:r,sizes:o,minDelta:a,maxDelta:l,snapBefore:c,snapAfter:d}=this.sashDragState;this.sashDragState.current=t;const f=t-r;this.resize(n,f,o,void 0,void 0,a,l,c,d),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(t){let n=0;for(let r=0;r<this.sashItems.length;r++)if(n+=this.viewItems[r].size,this.sashItems[r].sash===t)return n;return 0}resize(t,n,r=this.viewItems.map(p=>p.size),o,a,l=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,d,f){if(t<0||t>=this.viewItems.length)return 0;const p=On(t,-1,-1),m=On(t+1,this.viewItems.length);if(a)for(const D of a)Sx(p,D),Sx(m,D);if(o)for(const D of o)Of(p,D),Of(m,D);const y=p.map(D=>this.viewItems[D]),v=p.map(D=>r[D]),b=m.map(D=>this.viewItems[D]),S=m.map(D=>r[D]),C=p.reduce((D,H)=>D+(this.viewItems[H].minimumSize-r[H]),0),E=p.reduce((D,H)=>D+(this.viewItems[H].maximumSize-r[H]),0),P=m.length===0?Number.POSITIVE_INFINITY:m.reduce((D,H)=>D+(r[H]-this.viewItems[H].minimumSize),0),T=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((D,H)=>D+(r[H]-this.viewItems[H].maximumSize),0),O=Math.max(C,T,l),V=Math.min(P,E,c);let N=!1;if(d){const D=this.viewItems[d.index],H=n>=d.limitDelta;N=H!==D.visible,D.setVisible(H,d.size)}if(!N&&f){const D=this.viewItems[f.index],H=n<f.limitDelta;N=H!==D.visible,D.setVisible(H,f.size)}if(N)return this.resize(t,n,r,o,a,l,c);for(let D=0,H=n=lr(n,O,V);D<y.length;D++){const ee=y[D],L=lr(v[D]+H,ee.minimumSize,ee.maximumSize);H-=L-v[D],ee.size=L}for(let D=0,H=n;D<b.length;D++){const ee=b[D],L=lr(S[D]-H,ee.minimumSize,ee.maximumSize);H+=L-S[D],ee.size=L}return n}distributeEmptySpace(t){const n=this.viewItems.reduce((f,p)=>f+p.size,0);let r=this.size-n;const o=On(0,this.viewItems.length),a=[],l=o.filter(f=>this.viewItems[f].priority===Bn.Low),c=o.filter(f=>this.viewItems[f].priority===Bn.Normal),d=o.filter(f=>this.viewItems[f].priority===Bn.High);a.push(...d,...c,...l),typeof t=="number"&&Of(a,t);for(let f=0;r!==0&&f<a.length;f++){const p=this.viewItems[a[f]],m=lr(p.size+r,p.minimumSize,p.maximumSize);r-=m-p.size,p.size=m}}layoutViews(){var t;this.contentSize=this.viewItems.reduce((r,o)=>r+o.size,0);let n=0;for(const r of this.viewItems)r.layout(n),n+=r.size;(t=this.onDidChange)!=null&&t.call(this,this.viewItems.map(r=>r.size)),this.sashItems.forEach(r=>r.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(t=>t.size/this.contentSize))}updateSashEnablement(){let t=!1;const n=this.viewItems.map(d=>t=d.size-d.minimumSize>0||t);t=!1;const r=this.viewItems.map(d=>t=d.maximumSize-d.size>0||t),o=[...this.viewItems].reverse();t=!1;const a=o.map(d=>t=d.size-d.minimumSize>0||t).reverse();t=!1;const l=o.map(d=>t=d.maximumSize-d.size>0||t).reverse();let c=0;for(let d=0;d<this.sashItems.length;d++){const{sash:f}=this.sashItems[d];c+=this.viewItems[d].size;const p=!(n[d]&&l[d+1]),m=!(r[d]&&a[d+1]);if(p&&m){const y=On(d,-1,-1),v=On(d+1,this.viewItems.length),b=this.findFirstSnapIndex(y),S=this.findFirstSnapIndex(v),C=typeof b=="number"&&!this.viewItems[b].visible,E=typeof S=="number"&&!this.viewItems[S].visible;C&&a[d]&&(c>0||this.startSnappingEnabled)?f.state=kn.Minimum:E&&n[d]&&(c<this.contentSize||this.endSnappingEnabled)?f.state=kn.Maximum:f.state=kn.Disabled}else f.state=p&&!m?kn.Minimum:!p&&m?kn.Maximum:kn.Enabled}}findFirstSnapIndex(t){for(const n of t){const r=this.viewItems[n];if(r.visible&&r.snap)return n}for(const n of t){const r=this.viewItems[n];if(r.visible&&r.maximumSize-r.minimumSize>0)return;if(!r.visible&&r.snap)return n}}}class Qs{constructor(t){this.size=void 0,this.size=t}getPreferredSize(){return this.size}}class Ix{constructor(t,n){this.proportion=void 0,this.layoutService=void 0,this.proportion=t,this.layoutService=n}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class Iu{getPreferredSize(){}}class Tx{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(t){if(typeof t=="number")this.layoutStrategy=new Qs(t);else if(typeof t=="string"){const n=t.trim();if(Cu(n,"%")){const r=Number(n.slice(0,-1))/100;this.layoutStrategy=new Ix(r,this.layoutService)}else if(Cu(n,"px")){const r=Number(n.slice(0,-2))/100;this.layoutStrategy=new Qs(r)}else if(typeof Number.parseFloat(n)=="number"){const r=Number.parseFloat(n);this.layoutStrategy=new Qs(r)}else this.layoutStrategy=new Iu}else this.layoutStrategy=new Iu}constructor(t,n){var r;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=t,this.element=n.element,this.minimumSize=typeof n.minimumSize=="number"?n.minimumSize:30,this.maximumSize=typeof n.maximumSize=="number"?n.maximumSize:Number.POSITIVE_INFINITY,typeof n.preferredSize=="number")this.layoutStrategy=new Qs(n.preferredSize);else if(typeof n.preferredSize=="string"){const o=n.preferredSize.trim();if(Cu(o,"%")){const a=Number(o.slice(0,-1))/100;this.layoutStrategy=new Ix(a,this.layoutService)}else if(Cu(o,"px")){const a=Number(o.slice(0,-2));this.layoutStrategy=new Qs(a)}else if(typeof Number.parseFloat(o)=="number"){const a=Number.parseFloat(o);this.layoutStrategy=new Qs(a)}else this.layoutStrategy=new Iu}else this.layoutStrategy=new Iu;this.priority=(r=n.priority)!=null?r:Bn.Normal,this.snap=typeof n.snap=="boolean"&&n.snap}layout(t){}}function _x(e){return e.minSize!==void 0||e.maxSize!==void 0||e.preferredSize!==void 0||e.priority!==void 0||e.visible!==void 0}const tm=I.forwardRef(({className:e,children:t},n)=>wr.createElement("div",{ref:n,className:Vh("split-view-view",fS,e)},t));tm.displayName="Allotment.Pane";const xS=I.forwardRef(({children:e,className:t,id:n,maxSize:r=1/0,minSize:o=30,proportionalLayout:a=!0,separator:l=!0,sizes:c,defaultSizes:d=c,snap:f=!1,vertical:p=!1,onChange:m,onReset:y,onVisibleChange:v,onDragStart:b,onDragEnd:S},C)=>{const E=I.useRef(null),P=I.useRef([]),T=I.useRef(new Map),O=I.useRef(null),V=I.useRef(new Map),N=I.useRef(new M3),D=I.useRef([]),[H,ee]=I.useState(!1),L=I.useMemo(()=>wr.Children.toArray(e).filter(wr.isValidElement),[e]),te=I.useCallback(G=>{var X,Q;const re=(X=D.current)==null?void 0:X[G];return typeof(re==null?void 0:re.preferredSize)=="number"&&((Q=O.current)!=null&&Q.resizeView(G,Math.round(re.preferredSize)),!0)},[]);return I.useImperativeHandle(C,()=>({reset:()=>{if(y)y();else{var G;(G=O.current)==null||G.distributeViewSizes();for(let X=0;X<D.current.length;X++)te(X)}},resize:G=>{var X;(X=O.current)==null||X.resizeViews(G)}})),yx(()=>{let G=!0;d&&V.current.size!==d.length&&(G=!1,console.warn(`Expected ${d.length} children based on defaultSizes but found ${V.current.size}`)),G&&d&&(P.current=L.map(re=>re.key));const X=Ra({orientation:p?Hn.Vertical:Hn.Horizontal,proportionalLayout:a},G&&d&&{descriptor:{size:d.reduce((re,fe)=>re+fe,0),views:d.map((re,fe)=>{var oe,U,se,_;const j=T.current.get(P.current[fe]),Y=new Tx(N.current,Ra({element:document.createElement("div"),minimumSize:(oe=j==null?void 0:j.minSize)!=null?oe:o,maximumSize:(U=j==null?void 0:j.maxSize)!=null?U:r,priority:(se=j==null?void 0:j.priority)!=null?se:Bn.Normal},(j==null?void 0:j.preferredSize)&&{preferredSize:j==null?void 0:j.preferredSize},{snap:(_=j==null?void 0:j.snap)!=null?_:f}));return D.current.push(Y),{container:[...V.current.values()][fe],size:re,view:Y}})}});O.current=new H3(E.current,X,m,b,S),O.current.on("sashDragStart",()=>{var re;(re=E.current)==null||re.classList.add("split-view-sash-dragging")}),O.current.on("sashDragEnd",()=>{var re;(re=E.current)==null||re.classList.remove("split-view-sash-dragging")}),O.current.on("sashchange",re=>{if(v&&O.current){const fe=L.map(oe=>oe.key);for(let oe=0;oe<fe.length;oe++){const U=T.current.get(fe[oe]);(U==null?void 0:U.visible)!==void 0&&U.visible!==O.current.isViewVisible(oe)&&v(oe,O.current.isViewVisible(oe))}}}),O.current.on("sashreset",re=>{if(y)y();else{var fe;if(te(re)||te(re+1))return;(fe=O.current)==null||fe.distributeViewSizes()}});const Q=O.current;return()=>{Q.dispose()}},[]),yx(()=>{if(H){const A=L.map(de=>de.key),be=[...P.current],Ie=A.filter(de=>!P.current.includes(de)),Se=A.filter(de=>P.current.includes(de)),Oe=P.current.map(de=>!A.includes(de));for(let de=Oe.length-1;de>=0;de--){var G;Oe[de]&&((G=O.current)!=null&&G.removeView(de),be.splice(de,1),D.current.splice(de,1))}for(const de of Ie){var X,Q,re,fe,oe;const he=T.current.get(de),Re=new Tx(N.current,Ra({element:document.createElement("div"),minimumSize:(X=he==null?void 0:he.minSize)!=null?X:o,maximumSize:(Q=he==null?void 0:he.maxSize)!=null?Q:r,priority:(re=he==null?void 0:he.priority)!=null?re:Bn.Normal},(he==null?void 0:he.preferredSize)&&{preferredSize:he==null?void 0:he.preferredSize},{snap:(fe=he==null?void 0:he.snap)!=null?fe:f}));(oe=O.current)!=null&&oe.addView(V.current.get(de),Re,Xu.Distribute,A.findIndex(Ye=>Ye===de)),be.splice(A.findIndex(Ye=>Ye===de),0,de),D.current.splice(A.findIndex(Ye=>Ye===de),0,Re)}for(;!C3(A,be);)for(const[de,he]of A.entries()){const Re=be.findIndex(Ye=>Ye===he);if(Re!==de){var U;(U=O.current)==null||U.moveView(V.current.get(he),Re,de);const Ye=be[Re];be.splice(Re,1),be.splice(de,0,Ye);break}}for(const de of Ie){var se;const he=A.findIndex(Ye=>Ye===de),Re=D.current[he].preferredSize;Re!==void 0&&((se=O.current)==null||se.resizeView(he,Re))}for(const de of[...Ie,...Se]){var _,j;const he=T.current.get(de),Re=A.findIndex(Ye=>Ye===de);he&&_x(he)&&he.visible!==void 0&&((_=O.current)==null?void 0:_.isViewVisible(Re))!==he.visible&&((j=O.current)==null||j.setViewVisible(Re,he.visible))}for(const de of Se){const he=T.current.get(de),Re=A.findIndex(Ye=>Ye===de);if(he&&_x(he)){var Y;he.preferredSize!==void 0&&D.current[Re].preferredSize!==he.preferredSize&&(D.current[Re].preferredSize=he.preferredSize);let Ye=!1;he.minSize!==void 0&&D.current[Re].minimumSize!==he.minSize&&(D.current[Re].minimumSize=he.minSize,Ye=!0),he.maxSize!==void 0&&D.current[Re].maximumSize!==he.maxSize&&(D.current[Re].maximumSize=he.maxSize,Ye=!0),Ye&&((Y=O.current)==null||Y.layout())}}(Ie.length>0||Oe.length>0)&&(P.current=A)}},[L,H,r,o,f]),I.useEffect(()=>{O.current&&(O.current.onDidChange=m)},[m]),I.useEffect(()=>{O.current&&(O.current.onDidDragStart=b)},[b]),I.useEffect(()=>{O.current&&(O.current.onDidDragEnd=S)},[S]),I3({ref:E,onResize:({width:G,height:X})=>{var Q;G&&X&&((Q=O.current)!=null&&Q.layout(p?X:G),N.current.setSize(p?X:G),ee(!0))}}),I.useEffect(()=>{mS&&W3(20)},[]),wr.createElement("div",{ref:E,className:Vh("split-view",p?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":l},T3,p?A3:R3,{[N3]:l},t),id:n},wr.createElement("div",{className:Vh("split-view-container",P3)},wr.Children.toArray(e).map(G=>{if(!wr.isValidElement(G))return null;const X=G.key;return G.type.displayName==="Allotment.Pane"?(T.current.set(X,G.props),wr.cloneElement(G,{key:X,ref:Q=>{const re=G.ref;re&&(re.current=Q),Q?V.current.set(X,Q):V.current.delete(X)}})):wr.createElement(tm,{key:X,ref:Q=>{Q?V.current.set(X,Q):V.current.delete(X)}},G)})))});function W3(e){const t=lr(e,4,20),n=lr(e,1,8);document.documentElement.style.setProperty("--sash-size",t+"px"),document.documentElement.style.setProperty("--sash-hover-size",n+"px"),(function(r){gS=r,yS.emit("onDidChangeGlobalSize",r)})(t)}xS.displayName="Allotment";var is=Object.assign(xS,{Pane:tm});const wS=I.forwardRef(({position:e="left",className:t,children:n,...r},o)=>w.jsx("div",{ref:o,className:Ae("h-full w-full flex flex-col","bg-muted/30 border-border",e==="left"?"border-r":"border-l",t),...r,children:n}));wS.displayName="Sidebar";const bS=I.forwardRef(({className:e,children:t,...n},r)=>w.jsx("div",{ref:r,className:Ae("h-full w-full flex flex-col bg-background",e),...n,children:t}));bS.displayName="MainContent";var Ur=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT",e))(Ur||{}),q3=["agent_initializing","agent_ready","agent_destroyed","conversation_queued","conversation_start","conversation_thinking","conversation_responding","conversation_end","conversation_interrupted","tool_planned","tool_executing","tool_completed","tool_failed","error_occurred"];new Set(q3);var G3=["user_message","assistant_message","tool_call_message","tool_result_message"];new Set(G3);var K3=["error"];new Set(K3);var Y3=["turn_request","turn_response"];new Set(Y3);var X3=["message_start","message_delta","message_stop","text_content_block_start","text_delta","text_content_block_stop","tool_use_content_block_start","input_json_delta","tool_use_content_block_stop","tool_call","tool_result","interrupted"];new Set(X3);var Q3=Object.defineProperty,J3=(e,t,n)=>t in e?Q3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ds=(e,t,n)=>J3(e,typeof t!="symbol"?t+"":t,n),SS=class Bh{constructor(t,n={}){ds(this,"name"),ds(this,"level"),ds(this,"colors"),ds(this,"timestamps"),this.name=t,this.level=n.level??Ur.INFO,this.colors=n.colors??this.isNodeEnvironment(),this.timestamps=n.timestamps??!0}debug(t,n){this.isDebugEnabled()&&this.log("DEBUG",t,n)}info(t,n){this.isInfoEnabled()&&this.log("INFO",t,n)}warn(t,n){this.isWarnEnabled()&&this.log("WARN",t,n)}error(t,n){this.isErrorEnabled()&&(t instanceof Error?this.log("ERROR",t.message,{...n,stack:t.stack}):this.log("ERROR",t,n))}isDebugEnabled(){return this.level<=Ur.DEBUG}isInfoEnabled(){return this.level<=Ur.INFO}isWarnEnabled(){return this.level<=Ur.WARN}isErrorEnabled(){return this.level<=Ur.ERROR}log(t,n,r){const o=[];if(this.timestamps&&o.push(new Date().toISOString()),this.colors){const c=Bh.COLORS[t];o.push(`${c}${t.padEnd(5)}${Bh.COLORS.RESET}`)}else o.push(t.padEnd(5));o.push(`[${this.name}]`),o.push(n);const a=o.join(" "),l=this.getConsoleMethod(t);r&&Object.keys(r).length>0?l(a,r):l(a)}getConsoleMethod(t){switch(t){case"DEBUG":return console.debug.bind(console);case"INFO":return console.info.bind(console);case"WARN":return console.warn.bind(console);case"ERROR":return console.error.bind(console);default:return console.log.bind(console)}}isNodeEnvironment(){var t;return typeof process<"u"&&((t=process.versions)==null?void 0:t.node)!==void 0}};ds(SS,"COLORS",{DEBUG:"\x1B[36m",INFO:"\x1B[32m",WARN:"\x1B[33m",ERROR:"\x1B[31m",RESET:"\x1B[0m"});var Z3=SS,$f=null,nm=class{static getLogger(e){const t=typeof e=="string"?e:e.name;if(this.loggers.has(t))return this.loggers.get(t);const n=this.createLazyLogger(t);return this.loggers.set(t,n),n}static configure(e){this.config={...this.config,...e}}static reset(){this.loggers.clear(),this.config={defaultLevel:Ur.INFO},$f=null}static createLazyLogger(e){let t=null;const n=()=>(t||(t=this.createLogger(e)),t);return{name:e,level:this.config.defaultLevel||Ur.INFO,debug:(r,o)=>n().debug(r,o),info:(r,o)=>n().info(r,o),warn:(r,o)=>n().warn(r,o),error:(r,o)=>n().error(r,o),isDebugEnabled:()=>n().isDebugEnabled(),isInfoEnabled:()=>n().isInfoEnabled(),isWarnEnabled:()=>n().isWarnEnabled(),isErrorEnabled:()=>n().isErrorEnabled()}}static createLogger(e){return $f?$f.getLogger(e):this.config.defaultImplementation?this.config.defaultImplementation(e):new Z3(e,{level:this.config.defaultLevel,...this.config.consoleOptions})}};ds(nm,"loggers",new Map);ds(nm,"config",{defaultLevel:Ur.INFO});function e4(e){return nm.getLogger(e)}const Fn=e4("ui/Studio");function t4({agentx:e,userId:t,containerId:n,definitions:r,onSessionChange:o,onDefinitionChange:a,className:l=""}){const[c,d]=I.useState(r[0]??null),{sessions:f,currentSession:p,selectSession:m,createSession:y,deleteSession:v,isLoading:b}=QT(e,t,{onSessionChange:U=>{o==null||o(U)}}),[S,C]=I.useState(null),[E,P]=I.useState([]);I.useEffect(()=>()=>{var U;S&&(Fn.debug("Cleaning up agent on unmount",{agentId:S.agentId}),(U=S.destroy)==null||U.call(S).catch(se=>Fn.error("Failed to destroy agent",{error:se})))},[S]);const{messages:T,streaming:O,errors:V,send:N,status:D,interrupt:H,isLoading:ee}=XT(S),L=[...E,...T],te=I.useCallback(async()=>{var U;S&&(Fn.debug("Destroying current agent",{agentId:S.agentId}),await((U=S.destroy)==null?void 0:U.call(S)),C(null),P([]))},[S]),G=I.useCallback(async U=>{Fn.debug("Selecting definition",{name:U.name}),await te(),d(U),a==null||a(U),m(null)},[te,m,a]),X=I.useCallback(async U=>{Fn.info("Selecting existing session",{sessionId:U.sessionId}),await te();try{const se=await e.sessions.get(U.sessionId);if(!se){Fn.error("Session not found",{sessionId:U.sessionId});return}const _=await se.getMessages();P(_);const j=await se.resume({containerId:n});C(j),m(U),Fn.info("Session selected and agent resumed",{sessionId:U.sessionId,agentId:j.agentId})}catch(se){Fn.error("Failed to select session",{sessionId:U.sessionId,error:se})}},[e,n,te,m]),Q=I.useCallback(async U=>{if(!c)return null;Fn.info("Creating new session",{definition:c.name}),await te();try{const se=await e.images.getMetaImage(c.name);if(!se)return Fn.error("MetaImage not found",{definition:c.name}),null;const _=await y(se.imageId,`New Chat ${f.length+1}`),j=await e.images.run(se.imageId,{containerId:n}),Y=await e.sessions.get(_.sessionId);return Y&&Y.collect(j),FC.flushSync(()=>{P([]),C(j)}),m(_),Fn.info("Session created and agent started",{sessionId:_.sessionId,agentId:j.agentId}),U&&j.receive(U),j}catch(se){return Fn.error("Failed to create session",{error:se}),null}},[e,c,n,y,f.length,te,m]),re=I.useCallback(async U=>{(p==null?void 0:p.sessionId)===U&&await te(),await v(U)},[p==null?void 0:p.sessionId,te,v]),fe=I.useCallback(async U=>{p?N(U):await Q(U)},[p,Q,N]),oe=b||ee;return w.jsx("div",{className:`h-full bg-background ${l}`,children:w.jsxs(is,{children:[w.jsx(is.Pane,{minSize:56,maxSize:56,children:w.jsx("div",{className:"h-full bg-muted/30 border-r border-border",children:w.jsx(y_,{definitions:r,current:c,onSelect:G,onSettings:()=>{console.log("Open settings")}})})}),w.jsx(is.Pane,{minSize:200,maxSize:400,preferredSize:280,children:w.jsx(wS,{children:w.jsx(ej,{sessions:f,current:p,agentName:c==null?void 0:c.name,onSelect:X,onCreate:Q,onDelete:re})})}),w.jsx(is.Pane,{children:w.jsx(bS,{children:w.jsxs(is,{vertical:!0,children:[w.jsx(is.Pane,{children:w.jsx(x3,{definition:c,session:p,agentId:S==null?void 0:S.agentId,messages:L,streaming:O,errors:V,status:D,isLoading:oe,onAbort:H,onCreateSession:Q})}),w.jsx(is.Pane,{minSize:150,maxSize:600,preferredSize:220,children:w.jsx(S3,{onSend:fe,disabled:oe},(p==null?void 0:p.sessionId)??"new")})]})})})]})})}const n4=I.forwardRef(({items:e,bottomItems:t,activeId:n,onItemClick:r,position:o="left",className:a,...l},c)=>{const d=f=>{const p=f.id===n;return w.jsxs("button",{type:"button",onClick:()=>r==null?void 0:r(f.id),className:Ae("relative w-12 h-12 flex items-center justify-center","text-muted-foreground hover:text-foreground","transition-colors duration-200","group",p&&["text-foreground",o==="left"?"border-l-2 border-primary":"border-r-2 border-primary"]),title:f.label,"aria-label":f.label,"aria-current":p?"page":void 0,children:[w.jsx("div",{className:"w-6 h-6 flex items-center justify-center",children:f.icon}),f.badge&&w.jsx("span",{className:Ae("absolute top-1 right-1","min-w-[16px] h-4 px-1","flex items-center justify-center","text-[10px] font-semibold","bg-primary text-primary-foreground","rounded-full"),children:f.badge}),w.jsx("div",{className:Ae("absolute inset-0 bg-accent/0 group-hover:bg-accent/50","transition-colors duration-200")})]},f.id)};return w.jsxs("div",{ref:c,className:Ae("flex flex-col bg-muted/30 border-border",o==="left"?"border-r":"border-l",a),...l,children:[w.jsx("div",{className:"flex-1 flex flex-col",children:e.map(d)}),t&&t.length>0&&w.jsx("div",{className:"flex flex-col border-t border-border",children:t.map(d)})]})});n4.displayName="ActivityBar";const r4=I.forwardRef(({left:e,center:t,right:n,height:r=56,className:o,children:a,...l},c)=>w.jsxs("div",{ref:c,className:Ae("w-full flex items-center","bg-background border-b border-border","px-4",o),style:{height:`${r}px`,minHeight:`${r}px`},...l,children:[e&&w.jsx("div",{className:"flex items-center gap-3 flex-shrink-0",children:e}),t&&w.jsx("div",{className:"flex-1 flex items-center justify-center px-4",children:t}),n&&w.jsx("div",{className:"flex items-center gap-3 flex-shrink-0",children:n}),!e&&!t&&!n&&a]}));r4.displayName="Header";const i4=I.forwardRef(({height:e=200,minHeight:t=100,maxHeight:n=500,className:r,children:o,...a},l)=>w.jsx("div",{ref:l,className:Ae("w-full flex flex-col","bg-muted/30 border-t border-border",r),style:{height:`${e}px`,minHeight:`${t}px`,maxHeight:`${n}px`},...a,children:o}));i4.displayName="Panel";const s4=I.forwardRef(({width:e=300,minWidth:t=200,maxWidth:n=600,className:r,children:o,...a},l)=>w.jsx("div",{ref:l,className:Ae("h-full flex flex-col","bg-muted/30 border-l border-border",r),style:{width:`${e}px`,minWidth:`${t}px`,maxWidth:`${n}px`},...a,children:o}));s4.displayName="RightSidebar";const o4=I.forwardRef(({icon:e,children:t,clickable:n=!1,className:r,...o},a)=>w.jsxs("div",{ref:a,className:Ae("flex items-center gap-1.5 px-2 py-0.5 text-xs",n&&"hover:bg-accent cursor-pointer rounded",r),...o,children:[e&&w.jsx("span",{className:"flex items-center",children:e}),w.jsx("span",{children:t})]}));o4.displayName="StatusBarItem";const a4=I.forwardRef(({align:e="left",children:t,className:n,...r},o)=>w.jsx("div",{ref:o,className:Ae("flex items-center gap-1",e==="left"&&"justify-start",e==="center"&&"justify-center flex-1",e==="right"&&"justify-end",n),...r,children:t}));a4.displayName="StatusBarSection";const l4=I.forwardRef(({height:e=24,children:t,className:n,...r},o)=>w.jsx("div",{ref:o,className:Ae("w-full flex items-center","bg-primary text-primary-foreground","px-2",n),style:{height:`${e}px`,minHeight:`${e}px`},...r,children:t}));l4.displayName="StatusBar";const u4=uc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),rm=I.forwardRef(({className:e,variant:t,size:n,...r},o)=>w.jsx("button",{className:Ae(u4({variant:t,size:n,className:e})),ref:o,...r}));rm.displayName="Button";const kS=I.forwardRef(({children:e,className:t,...n},r)=>w.jsx("div",{ref:r,className:Ae("flex gap-2",t),...n,children:e}));kS.displayName="ActionBar";const ES=I.forwardRef(({children:e,loading:t=!1,variant:n="default",size:r="sm",className:o,disabled:a,...l},c)=>w.jsx(rm,{ref:c,variant:n,size:r,className:Ae("flex-1 h-8 text-xs transition-all duration-200",o),disabled:a||t,...l,children:t?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"w-3.5 h-3.5 mr-1.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),"Loading..."]}):e}));ES.displayName="ActionBar.Primary";const CS=I.forwardRef(({children:e,loading:t=!1,variant:n="outline",size:r="sm",className:o,disabled:a,...l},c)=>w.jsx(rm,{ref:c,variant:n,size:r,className:Ae("h-8 w-8 px-0 transition-colors duration-200 group",o),disabled:a||t,...l,children:t?w.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):e}));CS.displayName="ActionBar.Icon";const IS=I.forwardRef(({children:e,className:t,...n},r)=>w.jsx("div",{ref:r,className:Ae("flex gap-2",t),...n,children:e}));IS.displayName="ActionBar.Group";Object.assign(kS,{Primary:ES,Icon:CS,Group:IS});const c4=I.forwardRef(({className:e,src:t="/icons/agent-ai-icon.svg",alt:n="Agent",...r},o)=>w.jsx("img",{ref:o,src:t,alt:n,className:Ae("w-5 h-5",e),...r}));c4.displayName="AgentLogo";const d4=I.forwardRef(({logo:e,title:t,subtitle:n,actions:r,showBorder:o=!0,isMobile:a=!1,isPWA:l=!1,className:c,...d},f)=>w.jsx("div",{ref:f,className:Ae("p-4",o&&"border-b border-border",a&&"md:hidden p-3",!a&&"hidden md:block",c),style:l&&a?{paddingTop:"16px"}:void 0,...d,children:w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[e&&w.jsx("div",{className:Ae("bg-primary rounded-lg flex items-center justify-center text-primary-foreground",a?"w-8 h-8":"w-8 h-8 shadow-sm"),children:e}),w.jsxs("div",{children:[w.jsx("h1",{className:Ae("font-bold text-foreground",a?"text-lg font-semibold":"text-lg"),children:t}),n&&w.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n})]})]}),r&&w.jsx("div",{className:"flex items-center gap-2",children:r})]})}));d4.displayName="AppHeader";const f4=I.forwardRef(({icon:e,title:t,description:n,action:r,spacing:o="md",className:a,...l},c)=>{const d={sm:"py-8",md:"py-12",lg:"py-16"},f={sm:"mb-3",md:"mb-4",lg:"mb-6"},p={sm:"mb-1",md:"mb-2",lg:"mb-3"},m={sm:"mt-3",md:"mt-4",lg:"mt-6"};return w.jsxs("div",{ref:c,className:Ae("text-center px-4",d[o],a),...l,children:[e&&w.jsx("div",{className:Ae("w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto text-muted-foreground",f[o]),children:e}),w.jsx("h3",{className:Ae("text-base font-medium text-foreground",p[o]),children:t}),n&&w.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:n}),r&&w.jsx("div",{className:Ae(m[o]),children:r})]})});f4.displayName="EmptyState";const h4=I.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:Ae("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));h4.displayName="Input";const p4=I.forwardRef(({selected:e=!1,active:t=!1,showActiveIndicator:n=!1,leading:r,title:o,subtitle:a,trailing:l,actions:c,variant:d="default",isMobile:f=!1,onClick:p,className:m,...y},v)=>{const b=d==="compact",S=!!p;return w.jsxs("div",{ref:v,className:Ae("group relative",m),...y,children:[n&&t&&w.jsx("div",{className:"absolute left-2 top-1/2 transform -translate-y-1/2 z-10",children:w.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})}),f&&w.jsx("div",{className:Ae("p-3 mx-3 my-1 rounded-lg bg-card border border-border/50 active:scale-[0.98] transition-all duration-150",e&&"bg-primary/5 border-primary/20",t&&!e&&"border-green-500/30 bg-green-50/5 dark:bg-green-900/5",S&&"cursor-pointer"),onClick:p,children:w.jsxs("div",{className:"flex items-center gap-2",children:[r&&w.jsx("div",{className:"flex-shrink-0",children:r}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsx("div",{className:Ae("font-medium truncate text-foreground","text-xs"),children:o}),a&&w.jsx("div",{className:"flex items-center gap-1 mt-0.5",children:a})]}),l&&w.jsx("div",{className:"flex-shrink-0",children:l}),c&&w.jsx("div",{className:"flex items-center gap-1 ml-1",children:c})]})}),!f&&w.jsxs(w.Fragment,{children:[w.jsx("div",{className:Ae("w-full p-2 rounded-md transition-colors duration-200",S&&"cursor-pointer hover:bg-accent/50",e&&"bg-accent text-accent-foreground",!S&&!e&&"pointer-events-none"),onClick:p,children:w.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[r&&w.jsx("div",{className:"flex-shrink-0 mt-0.5",children:r}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsx("div",{className:Ae("font-medium truncate text-foreground","text-xs"),children:o}),a&&w.jsx("div",{className:"flex items-center gap-1 mt-0.5",children:a})]}),l&&w.jsx("div",{className:"flex-shrink-0 ml-auto",children:l})]})}),c&&w.jsx("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-all duration-200",children:c})]})]})});p4.displayName="ListItem";const m4=I.forwardRef(({icon:e,title:t,description:n,spacing:r="md",showSpinner:o=!0,className:a,...l},c)=>{const d={sm:"py-8",md:"py-12",lg:"py-16"},f={sm:"mb-3",md:"mb-4",lg:"mb-6"},p={sm:"mb-1",md:"mb-2",lg:"mb-3"},m={sm:"w-5 h-5",md:"w-6 h-6",lg:"w-8 h-8"},v=e||(o?w.jsx("div",{className:Ae("animate-spin rounded-full border-2 border-muted-foreground border-t-transparent",m[r])}):null);return w.jsxs("div",{ref:c,className:Ae("text-center px-4",d[r],a),...l,children:[v&&w.jsx("div",{className:Ae("w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto",f[r]),children:v}),t&&w.jsx("h3",{className:Ae("text-base font-medium text-foreground",p[r]),children:t}),n&&w.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:n})]})});m4.displayName="LoadingState";const g4=I.forwardRef(({title:e,subtitle:t,leading:n,trailing:r,showBorder:o=!0,isMobile:a=!1,className:l,...c},d)=>w.jsx("div",{ref:d,className:Ae("flex-shrink-0",o&&"border-b border-border",a?"p-3":"p-4","bg-card",l),...c,children:w.jsxs("div",{className:"flex items-center justify-between gap-3",children:[w.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0 flex-1",children:[n&&w.jsx("div",{className:"flex-shrink-0",children:n}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsx("h1",{className:Ae("font-semibold text-foreground truncate",a?"text-base":"text-base sm:text-lg"),children:e}),t&&w.jsx("p",{className:Ae("text-xs text-muted-foreground truncate",a?"mt-0":"mt-0.5"),children:t})]})]}),r&&w.jsx("div",{className:"flex-shrink-0 hidden sm:block",children:r})]})}));g4.displayName="PageHeader";I.createContext(void 0);const y4=I.forwardRef(({className:e,children:t,...n},r)=>w.jsx("div",{ref:r,className:Ae("relative overflow-hidden",e),...n,children:w.jsx("div",{className:"h-full w-full rounded-[inherit] overflow-auto",style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:t})}));y4.displayName="ScrollArea";const v4=I.forwardRef(({value:e,onChange:t,onClear:n,showSearchIcon:r=!0,showClearButton:o=!0,searchIcon:a,clearIcon:l,placeholder:c="Search...",className:d,...f},p)=>{const m=b=>{t(b.target.value)},y=()=>{n?n():t("")},v=e&&e.length>0;return w.jsxs("div",{className:"relative",children:[r&&w.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground pointer-events-none",children:a||w.jsx(vw,{className:"w-4 h-4"})}),w.jsx("input",{ref:p,type:"text",value:e,onChange:m,placeholder:c,className:Ae("w-full h-9 rounded-md border border-input bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0","disabled:cursor-not-allowed disabled:opacity-50","transition-colors",r&&"pl-9",v&&o&&"pr-9",d),...f}),v&&o&&w.jsx("button",{type:"button",onClick:y,className:Ae("absolute right-2 top-1/2 transform -translate-y-1/2","p-1 rounded hover:bg-accent transition-colors","text-muted-foreground hover:text-foreground"),"aria-label":"Clear search",children:l||w.jsx(p_,{className:"w-3 h-3"})})]})});v4.displayName="SearchInput";const x4=uc("inline-flex items-center justify-center rounded-lg p-1",{variants:{variant:{pills:"bg-muted",underline:"border-b border-border bg-transparent p-0"}},defaultVariants:{variant:"pills"}}),w4=uc("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{pills:"",underline:"rounded-none border-b-2 border-transparent"},active:{true:"",false:""}},compoundVariants:[{variant:"pills",active:!0,className:"bg-background text-foreground shadow-sm"},{variant:"pills",active:!1,className:"text-muted-foreground hover:text-foreground hover:bg-background/50"},{variant:"underline",active:!0,className:"border-primary text-foreground"},{variant:"underline",active:!1,className:"text-muted-foreground hover:text-foreground hover:border-border"}],defaultVariants:{variant:"pills",active:!1}}),b4=I.forwardRef(({tabs:e,activeTab:t,onTabChange:n,variant:r="pills",iconOnlyMobile:o=!1,className:a,...l},c)=>w.jsx("div",{ref:c,role:"tablist",className:Ae(x4({variant:r}),a),...l,children:e.map(d=>{const f=d.id===t;return w.jsxs("button",{role:"tab",type:"button","aria-selected":f,"aria-controls":`tabpanel-${d.id}`,disabled:d.disabled,onClick:()=>!d.disabled&&n(d.id),className:Ae(w4({variant:r,active:f})),children:[d.icon&&w.jsx("span",{className:"flex items-center justify-center w-4 h-4",children:d.icon}),d.label&&w.jsx("span",{className:Ae(d.icon&&"ml-1.5",o&&"hidden sm:inline"),children:d.label})]},d.id)})}));b4.displayName="TabNavigation";function S4(e,t=new Date){const n=typeof e=="string"?new Date(e):e;if(isNaN(n.getTime()))return"Unknown";const r=t.getTime()-n.getTime(),o=Math.floor(r/1e3),a=Math.floor(r/(1e3*60)),l=Math.floor(r/(1e3*60*60)),c=Math.floor(r/(1e3*60*60*24));return o<60?"Just now":a===1?"1 min ago":a<60?`${a} mins ago`:l===1?"1 hour ago":l<24?`${l} hours ago`:c===1?"1 day ago":c<7?`${c} days ago`:n.toLocaleDateString()}const k4=I.forwardRef(({date:e,updateInterval:t=6e4,showTooltip:n=!0,className:r,...o},a)=>{const[l,c]=I.useState(new Date);I.useEffect(()=>{if(t<=0)return;const p=setInterval(()=>{c(new Date)},t);return()=>clearInterval(p)},[t]);const d=S4(e,l),f=I.useMemo(()=>{const p=typeof e=="string"?new Date(e):e;if(!isNaN(p.getTime()))return p.toLocaleString()},[e]);return w.jsx("span",{ref:a,className:Ae("inline-block",r),title:n?f:void 0,...o,children:d})});k4.displayName="TimeAgo";function E4(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}class C4{constructor(){Zy(this,"emitter"),Zy(this,"debugMode",!1),this.emitter=E4()}emit(t,n){this.debugMode&&console.log("[EventBus]",t,n),this.emitter.emit(t,n)}on(t,n){this.emitter.on(t,n)}off(t,n){this.emitter.off(t,n)}onAll(t){this.emitter.on("*",t)}clear(){this.emitter.all.clear()}enableDebug(){this.debugMode=!0,typeof console<"u"&&console.log("[EventBus] Debug mode enabled")}disableDebug(){this.debugMode=!1,typeof console<"u"&&console.log("[EventBus] Debug mode disabled")}}new C4;typeof window<"u"&&setTimeout(()=>{},0);const Px="/agentx",I4=[{name:"Assistant",description:"AI Assistant powered by Claude",icon:"A",color:"bg-primary",isOnline:!0}];function T4(){return w.jsx("div",{className:"h-screen bg-background flex items-center justify-center",children:w.jsxs("div",{className:"text-center",children:[w.jsx("div",{className:"text-4xl mb-4 animate-pulse text-muted-foreground",children:"..."}),w.jsx("p",{className:"text-muted-foreground",children:"Connecting to server..."})]})})}function Ax({message:e,onRetry:t}){return w.jsx("div",{className:"h-screen bg-background flex items-center justify-center",children:w.jsxs("div",{className:"text-center p-8 max-w-md",children:[w.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Connection Error"}),w.jsx("p",{className:"text-muted-foreground mb-4",children:e}),w.jsx("button",{onClick:t,className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"Retry"})]})})}function _4({onLogout:e}){return w.jsxs("div",{className:"h-12 bg-card border-b border-border flex items-center justify-between px-4",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"text-lg font-semibold text-foreground",children:"Portagent"}),w.jsx("span",{className:"text-xs text-muted-foreground",children:"AgentX Portal"})]}),w.jsx("button",{onClick:e,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Sign Out"})]})}function P4(){const{user:e,logout:t}=nc(),[n,r]=I.useState(null),[o,a]=I.useState(null),[l,c]=I.useState(!0);I.useEffect(()=>{let f=!0;return(async()=>{try{const m=HC();if(!m){a("Not authenticated");return}if(!(await fetch(`${Px}/info`,{headers:{Authorization:`Bearer ${m}`}})).ok)throw new Error("Server returned error");if(!f)return;const v=FT(GT({serverUrl:Px,headers:{Authorization:`Bearer ${m}`},sseParams:{token:m}}));if(!f)return;r(v),a(null)}catch(m){if(!f)return;console.error("Connection error:",m),a("Cannot connect to server")}finally{f&&c(!1)}})(),()=>{f=!1}},[]);const d=()=>{c(!0),a(null),window.location.reload()};return l?w.jsx(T4,{}):o?w.jsx(Ax,{message:o,onRetry:d}):!n||!e?w.jsx(Ax,{message:"Failed to initialize",onRetry:d}):w.jsxs("div",{className:"h-screen flex flex-col bg-background",children:[w.jsx(_4,{onLogout:t}),w.jsx("div",{className:"flex-1 overflow-hidden",children:w.jsx(t4,{agentx:n,userId:e.userId,containerId:e.containerId,definitions:I4})})]})}function A4({children:e}){const{isAuthenticated:t,isLoading:n}=nc();return n?w.jsx("div",{className:"h-screen flex items-center justify-center bg-slate-900",children:w.jsx("div",{className:"text-slate-400",children:"Loading..."})}):t?w.jsx(w.Fragment,{children:e}):w.jsx(Hf,{to:"/login",replace:!0})}function R4(){return w.jsx(UC,{children:w.jsxs(oC,{children:[w.jsx(Js,{path:"/login",element:w.jsx(WC,{})}),w.jsx(Js,{path:"/register",element:w.jsx(qC,{})}),w.jsx(Js,{path:"/studio",element:w.jsx(A4,{children:w.jsx(P4,{})})}),w.jsx(Js,{path:"/",element:w.jsx(Hf,{to:"/studio",replace:!0})}),w.jsx(Js,{path:"*",element:w.jsx(Hf,{to:"/studio",replace:!0})})]})})}mE.createRoot(document.getElementById("root")).render(w.jsx(wr.StrictMode,{children:w.jsx(PC,{children:w.jsx(R4,{})})}));
245
- //# sourceMappingURL=index-BEpPZXDY.js.map
244
+ */var Lf,hx,px,k3=(dx||(dx=1,Lf=fx,(function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var a=typeof o;if(a==="string"||a==="number")n.push(o);else if(Array.isArray(o)){if(o.length){var l=t.apply(null,o);l&&n.push(l)}}else if(a==="object")if(o.toString===Object.prototype.toString)for(var c in o)e.call(o,c)&&o[c]&&n.push(c);else n.push(o.toString())}}return n.join(" ")}Lf.exports?(t.default=t,Lf.exports=t):window.classNames=t})()),fx.exports),Vh=el(k3),mx,lr=el((function(){if(px)return hx;px=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,o=parseInt,a=Object.prototype.toString;function l(d){var f=typeof d;return!!d&&(f=="object"||f=="function")}function c(d){if(typeof d=="number")return d;if((function(m){return typeof m=="symbol"||(function(y){return!!y&&typeof y=="object"})(m)&&a.call(m)=="[object Symbol]"})(d))return NaN;if(l(d)){var f=typeof d.valueOf=="function"?d.valueOf():d;d=l(f)?f+"":f}if(typeof d!="string")return d===0?d:+d;d=d.replace(e,"");var p=n.test(d);return p||r.test(d)?o(d.slice(2),p?2:8):t.test(d)?NaN:+d}return hx=function(d,f,p){return p===void 0&&(p=f,f=void 0),p!==void 0&&(p=(p=c(p))==p?p:0),f!==void 0&&(f=(f=c(f))==f?f:0),(function(m,y,v){return m==m&&(v!==void 0&&(m=m<=v?m:v),y!==void 0&&(m=m>=y?m:y)),m})(c(d),f,p)}})()),zf={exports:{}},E3=(mx||(mx=1,(function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",d="[object Error]",f="[object Function]",p="[object Map]",m="[object Number]",y="[object Object]",v="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",E="[object Symbol]",P="[object WeakMap]",T="[object ArrayBuffer]",O="[object DataView]",V=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,D={};D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D[o]=D[a]=D[T]=D[l]=D[O]=D[c]=D[d]=D[f]=D[p]=D[m]=D[y]=D[b]=D[S]=D[C]=D[P]=!1;var H=typeof _i=="object"&&_i&&_i.Object===Object&&_i,ee=typeof self=="object"&&self&&self.Object===Object&&self,L=H||ee||Function("return this")(),te=t&&!t.nodeType&&t,G=te&&e&&!e.nodeType&&e,X=G&&G.exports===te,Q=X&&H.process,re=(function(){try{return Q&&Q.binding&&Q.binding("util")}catch{}})(),fe=re&&re.isTypedArray;function oe(F,q){for(var ce=-1,we=F==null?0:F.length;++ce<we;)if(q(F[ce],ce,F))return!0;return!1}function U(F){var q=-1,ce=Array(F.size);return F.forEach(function(we,Ye){ce[++q]=[Ye,we]}),ce}function se(F){var q=-1,ce=Array(F.size);return F.forEach(function(we){ce[++q]=we}),ce}var _,j,Y,A=Array.prototype,Se=Function.prototype,Te=Object.prototype,ke=L["__core-js_shared__"],ze=Se.toString,de=Te.hasOwnProperty,he=(_=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||""))?"Symbol(src)_1."+_:"",Ne=Te.toString,Ke=RegExp("^"+ze.call(de).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mi=X?L.Buffer:void 0,Kn=L.Symbol,Yr=L.Uint8Array,Xr=Te.propertyIsEnumerable,Di=A.splice,en=Kn?Kn.toStringTag:void 0,Li=Object.getOwnPropertySymbols,Qr=Mi?Mi.isBuffer:void 0,fr=(j=Object.keys,Y=Object,function(F){return j(Y(F))}),Cn=Pr(L,"DataView"),Yn=Pr(L,"Map"),Jr=Pr(L,"Promise"),Zr=Pr(L,"Set"),ei=Pr(L,"WeakMap"),K=Pr(Object,"create"),ue=Ar(Cn),_e=Ar(Yn),Le=Ar(Jr),Be=Ar(Zr),St=Ar(ei),In=Kn?Kn.prototype:void 0,Lt=In?In.valueOf:void 0;function zt(F){var q=-1,ce=F==null?0:F.length;for(this.clear();++q<ce;){var we=F[q];this.set(we[0],we[1])}}function Rt(F){var q=-1,ce=F==null?0:F.length;for(this.clear();++q<ce;){var we=F[q];this.set(we[0],we[1])}}function et(F){var q=-1,ce=F==null?0:F.length;for(this.clear();++q<ce;){var we=F[q];this.set(we[0],we[1])}}function Kt(F){var q=-1,ce=F==null?0:F.length;for(this.__data__=new et;++q<ce;)this.add(F[q])}function ft(F){var q=this.__data__=new Rt(F);this.size=q.size}function Eo(F,q){var ce=Rr(F),we=!ce&&vs(F),Ye=!ce&&!we&&Fi(F),Oe=!ce&&!we&&!Ye&&_o(F),it=ce||we||Ye||Oe,je=it?(function(ht,Yt){for(var Xn=-1,It=Array(ht);++Xn<ht;)It[Xn]=Yt(Xn);return It})(F.length,String):[],pn=je.length;for(var lt in F)!de.call(F,lt)||it&&(lt=="length"||Ye&&(lt=="offset"||lt=="parent")||Oe&&(lt=="buffer"||lt=="byteLength"||lt=="byteOffset")||Oi(lt,pn))||je.push(lt);return je}function ti(F,q){for(var ce=F.length;ce--;)if(ri(F[ce][0],q))return ce;return-1}function Tn(F){return F==null?F===void 0?"[object Undefined]":"[object Null]":en&&en in Object(F)?(function(q){var ce=de.call(q,en),we=q[en];try{q[en]=void 0;var Ye=!0}catch{}var Oe=Ne.call(q);return Ye&&(ce?q[en]=we:delete q[en]),Oe})(F):(function(q){return Ne.call(q)})(F)}function _r(F){return hn(F)&&Tn(F)==o}function Co(F,q,ce,we,Ye){return F===q||(F==null||q==null||!hn(F)&&!hn(q)?F!=F&&q!=q:(function(Oe,it,je,pn,lt,ht){var Yt=Rr(Oe),Xn=Rr(it),It=Yt?a:_n(Oe),tn=Xn?a:_n(it),Nt=(It=It==o?y:It)==y,xs=(tn=tn==o?y:tn)==y,Tt=It==tn;if(Tt&&Fi(Oe)){if(!Fi(it))return!1;Yt=!0,Nt=!1}if(Tt&&!Nt)return ht||(ht=new ft),Yt||_o(Oe)?Io(Oe,it,je,pn,lt,ht):(function(qe,$e,Nr,hr,Po,Ot,Pn){switch(Nr){case O:if(qe.byteLength!=$e.byteLength||qe.byteOffset!=$e.byteOffset)return!1;qe=qe.buffer,$e=$e.buffer;case T:return!(qe.byteLength!=$e.byteLength||!Ot(new Yr(qe),new Yr($e)));case l:case c:case m:return ri(+qe,+$e);case d:return qe.name==$e.name&&qe.message==$e.message;case b:case C:return qe==$e+"";case p:var An=U;case S:var Qn=1&hr;if(An||(An=se),qe.size!=$e.size&&!Qn)return!1;var bs=Pn.get(qe);if(bs)return bs==$e;hr|=2,Pn.set(qe,$e);var Bi=Io(An(qe),An($e),hr,Po,Ot,Pn);return Pn.delete(qe),Bi;case E:if(Lt)return Lt.call(qe)==Lt.call($e)}return!1})(Oe,it,It,je,pn,lt,ht);if(!(1&je)){var Vi=Nt&&de.call(Oe,"__wrapped__"),al=xs&&de.call(it,"__wrapped__");if(Vi||al){var mc=Vi?Oe.value():Oe,ws=al?it.value():it;return ht||(ht=new ft),lt(mc,ws,je,pn,ht)}}return!!Tt&&(ht||(ht=new ft),(function(qe,$e,Nr,hr,Po,Ot){var Pn=1&Nr,An=To(qe),Qn=An.length,bs=To($e),Bi=bs.length;if(Qn!=Bi&&!Pn)return!1;for(var Ue=Qn;Ue--;){var pr=An[Ue];if(!(Pn?pr in $e:de.call($e,pr)))return!1}var Ao=Ot.get(qe);if(Ao&&Ot.get($e))return Ao==$e;var ii=!0;Ot.set(qe,$e),Ot.set($e,qe);for(var Ss=Pn;++Ue<Qn;){var $i=qe[pr=An[Ue]],Ui=$e[pr];if(hr)var ks=Pn?hr(Ui,$i,pr,$e,qe,Ot):hr($i,Ui,pr,qe,$e,Ot);if(!(ks===void 0?$i===Ui||Po($i,Ui,Nr,hr,Ot):ks)){ii=!1;break}Ss||(Ss=pr=="constructor")}if(ii&&!Ss){var jr=qe.constructor,mn=$e.constructor;jr==mn||!("constructor"in qe)||!("constructor"in $e)||typeof jr=="function"&&jr instanceof jr&&typeof mn=="function"&&mn instanceof mn||(ii=!1)}return Ot.delete(qe),Ot.delete($e),ii})(Oe,it,je,pn,lt,ht))})(F,q,ce,we,Co,Ye))}function tl(F){return!(!sl(F)||(function(q){return!!he&&he in q})(F))&&(rl(F)?Ke:V).test(Ar(F))}function nl(F){if(ce=(q=F)&&q.constructor,we=typeof ce=="function"&&ce.prototype||Te,q!==we)return fr(F);var q,ce,we,Ye=[];for(var Oe in Object(F))de.call(F,Oe)&&Oe!="constructor"&&Ye.push(Oe);return Ye}function Io(F,q,ce,we,Ye,Oe){var it=1&ce,je=F.length,pn=q.length;if(je!=pn&&!(it&&pn>je))return!1;var lt=Oe.get(F);if(lt&&Oe.get(q))return lt==q;var ht=-1,Yt=!0,Xn=2&ce?new Kt:void 0;for(Oe.set(F,q),Oe.set(q,F);++ht<je;){var It=F[ht],tn=q[ht];if(we)var Nt=it?we(tn,It,ht,q,F,Oe):we(It,tn,ht,F,q,Oe);if(Nt!==void 0){if(Nt)continue;Yt=!1;break}if(Xn){if(!oe(q,function(xs,Tt){if(Vi=Tt,!Xn.has(Vi)&&(It===xs||Ye(It,xs,ce,we,Oe)))return Xn.push(Tt);var Vi})){Yt=!1;break}}else if(It!==tn&&!Ye(It,tn,ce,we,Oe)){Yt=!1;break}}return Oe.delete(F),Oe.delete(q),Yt}function To(F){return(function(q,ce,we){var Ye=ce(q);return Rr(q)?Ye:(function(Oe,it){for(var je=-1,pn=it.length,lt=Oe.length;++je<pn;)Oe[lt+je]=it[je];return Oe})(Ye,we(q))})(F,ol,zi)}function ni(F,q){var ce,we,Ye=F.__data__;return((we=typeof(ce=q))=="string"||we=="number"||we=="symbol"||we=="boolean"?ce!=="__proto__":ce===null)?Ye[typeof q=="string"?"string":"hash"]:Ye.map}function Pr(F,q){var ce=(function(we,Ye){return we==null?void 0:we[Ye]})(F,q);return tl(ce)?ce:void 0}zt.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},zt.prototype.delete=function(F){var q=this.has(F)&&delete this.__data__[F];return this.size-=q?1:0,q},zt.prototype.get=function(F){var q=this.__data__;if(K){var ce=q[F];return ce===n?void 0:ce}return de.call(q,F)?q[F]:void 0},zt.prototype.has=function(F){var q=this.__data__;return K?q[F]!==void 0:de.call(q,F)},zt.prototype.set=function(F,q){var ce=this.__data__;return this.size+=this.has(F)?0:1,ce[F]=K&&q===void 0?n:q,this},Rt.prototype.clear=function(){this.__data__=[],this.size=0},Rt.prototype.delete=function(F){var q=this.__data__,ce=ti(q,F);return!(ce<0||(ce==q.length-1?q.pop():Di.call(q,ce,1),--this.size,0))},Rt.prototype.get=function(F){var q=this.__data__,ce=ti(q,F);return ce<0?void 0:q[ce][1]},Rt.prototype.has=function(F){return ti(this.__data__,F)>-1},Rt.prototype.set=function(F,q){var ce=this.__data__,we=ti(ce,F);return we<0?(++this.size,ce.push([F,q])):ce[we][1]=q,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new zt,map:new(Yn||Rt),string:new zt}},et.prototype.delete=function(F){var q=ni(this,F).delete(F);return this.size-=q?1:0,q},et.prototype.get=function(F){return ni(this,F).get(F)},et.prototype.has=function(F){return ni(this,F).has(F)},et.prototype.set=function(F,q){var ce=ni(this,F),we=ce.size;return ce.set(F,q),this.size+=ce.size==we?0:1,this},Kt.prototype.add=Kt.prototype.push=function(F){return this.__data__.set(F,n),this},Kt.prototype.has=function(F){return this.__data__.has(F)},ft.prototype.clear=function(){this.__data__=new Rt,this.size=0},ft.prototype.delete=function(F){var q=this.__data__,ce=q.delete(F);return this.size=q.size,ce},ft.prototype.get=function(F){return this.__data__.get(F)},ft.prototype.has=function(F){return this.__data__.has(F)},ft.prototype.set=function(F,q){var ce=this.__data__;if(ce instanceof Rt){var we=ce.__data__;if(!Yn||we.length<199)return we.push([F,q]),this.size=++ce.size,this;ce=this.__data__=new et(we)}return ce.set(F,q),this.size=ce.size,this};var zi=Li?function(F){return F==null?[]:(F=Object(F),(function(q,ce){for(var we=-1,Ye=q==null?0:q.length,Oe=0,it=[];++we<Ye;){var je=q[we];ce(je,we,q)&&(it[Oe++]=je)}return it})(Li(F),function(q){return Xr.call(F,q)}))}:function(){return[]},_n=Tn;function Oi(F,q){return!!(q=q??r)&&(typeof F=="number"||N.test(F))&&F>-1&&F%1==0&&F<q}function Ar(F){if(F!=null){try{return ze.call(F)}catch{}try{return F+""}catch{}}return""}function ri(F,q){return F===q||F!=F&&q!=q}(Cn&&_n(new Cn(new ArrayBuffer(1)))!=O||Yn&&_n(new Yn)!=p||Jr&&_n(Jr.resolve())!=v||Zr&&_n(new Zr)!=S||ei&&_n(new ei)!=P)&&(_n=function(F){var q=Tn(F),ce=q==y?F.constructor:void 0,we=ce?Ar(ce):"";if(we)switch(we){case ue:return O;case _e:return p;case Le:return v;case Be:return S;case St:return P}return q});var vs=_r((function(){return arguments})())?_r:function(F){return hn(F)&&de.call(F,"callee")&&!Xr.call(F,"callee")},Rr=Array.isArray,Fi=Qr||function(){return!1};function rl(F){if(!sl(F))return!1;var q=Tn(F);return q==f||q=="[object GeneratorFunction]"||q=="[object AsyncFunction]"||q=="[object Proxy]"}function il(F){return typeof F=="number"&&F>-1&&F%1==0&&F<=r}function sl(F){var q=typeof F;return F!=null&&(q=="object"||q=="function")}function hn(F){return F!=null&&typeof F=="object"}var _o=fe?(function(F){return function(q){return F(q)}})(fe):function(F){return hn(F)&&il(F.length)&&!!D[Tn(F)]};function ol(F){return(q=F)!=null&&il(q.length)&&!rl(q)?Eo(F):nl(F);var q}e.exports=function(F,q){return Co(F,q)}})(zf,zf.exports)),zf.exports),C3=el(E3);function gx(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function I3(e){e===void 0&&(e={});var t=e.onResize,n=I.useRef(void 0);n.current=t;var r=e.round||Math.round,o=I.useRef(),a=I.useState({width:void 0,height:void 0}),l=a[0],c=a[1],d=I.useRef(!1);I.useEffect(function(){return d.current=!1,function(){d.current=!0}},[]);var f=I.useRef({width:void 0,height:void 0}),p=(function(m,y){var v=I.useRef(null),b=I.useRef(null);b.current=y;var S=I.useRef(null);I.useEffect(function(){C()});var C=I.useCallback(function(){var E=S.current,P=b.current,T=E||(P?P instanceof Element?P:P.current:null);v.current&&v.current.element===T&&v.current.subscriber===m||(v.current&&v.current.cleanup&&v.current.cleanup(),v.current={element:T,subscriber:m,cleanup:T?m(T):void 0})},[m]);return I.useEffect(function(){return function(){v.current&&v.current.cleanup&&(v.current.cleanup(),v.current=null)}},[]),I.useCallback(function(E){S.current=E,C()},[C])})(I.useCallback(function(m){return o.current&&o.current.box===e.box&&o.current.round===r||(o.current={box:e.box,round:r,instance:new ResizeObserver(function(y){var v=y[0],b=e.box==="border-box"?"borderBoxSize":e.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",S=gx(v,b,"inlineSize"),C=gx(v,b,"blockSize"),E=S?r(S):void 0,P=C?r(C):void 0;if(f.current.width!==E||f.current.height!==P){var T={width:E,height:P};f.current.width=E,f.current.height=P,n.current?n.current(T):d.current||c(T)}})}),o.current.instance.observe(m,{box:e.box}),function(){o.current&&o.current.instance.unobserve(m)}},[e.box,r]),e.ref);return I.useMemo(function(){return{ref:p,width:l.width,height:l.height}},[p,l.width,l.height])}var T3="allotment-module_splitView__L-yRc",_3="allotment-module_sashContainer__fzwJF",P3="allotment-module_splitViewContainer__rQnVa",fS="allotment-module_splitViewView__MGZ6O",A3="allotment-module_vertical__WSwwa",R3="allotment-module_horizontal__7doS8",N3="allotment-module_separatorBorder__x-rDS";let xa,hS=!1,pS=!1;typeof navigator=="object"&&(xa=navigator.userAgent,pS=xa.indexOf("Macintosh")>=0,hS=(xa.indexOf("Macintosh")>=0||xa.indexOf("iPad")>=0||xa.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const mS=hS,j3=pS,yx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?I.useLayoutEffect:I.useEffect;class M3{constructor(){this._size=void 0}getSize(){return this._size}setSize(t){this._size=t}}function Cu(e,t){const n=e.length,r=n-t.length;return r>=0&&e.slice(r,n)===t}var vx,xx={exports:{}},wx,bx,D3=(vx||(vx=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new o(p,m||d,y),b=n?n+f:f;return d._events[b]?d._events[b].fn?d._events[b]=[d._events[b],v]:d._events[b].push(v):(d._events[b]=v,d._eventsCount++),d}function l(d,f){--d._eventsCount==0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1)),c.prototype.eventNames=function(){var d,f,p=[];if(this._eventsCount===0)return p;for(f in d=this._events)t.call(d,f)&&p.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(d)):p},c.prototype.listeners=function(d){var f=n?n+d:d,p=this._events[f];if(!p)return[];if(p.fn)return[p.fn];for(var m=0,y=p.length,v=new Array(y);m<y;m++)v[m]=p[m].fn;return v},c.prototype.listenerCount=function(d){var f=n?n+d:d,p=this._events[f];return p?p.fn?1:p.length:0},c.prototype.emit=function(d,f,p,m,y,v){var b=n?n+d:d;if(!this._events[b])return!1;var S,C,E=this._events[b],P=arguments.length;if(E.fn){switch(E.once&&this.removeListener(d,E.fn,void 0,!0),P){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,f),!0;case 3:return E.fn.call(E.context,f,p),!0;case 4:return E.fn.call(E.context,f,p,m),!0;case 5:return E.fn.call(E.context,f,p,m,y),!0;case 6:return E.fn.call(E.context,f,p,m,y,v),!0}for(C=1,S=new Array(P-1);C<P;C++)S[C-1]=arguments[C];E.fn.apply(E.context,S)}else{var T,O=E.length;for(C=0;C<O;C++)switch(E[C].once&&this.removeListener(d,E[C].fn,void 0,!0),P){case 1:E[C].fn.call(E[C].context);break;case 2:E[C].fn.call(E[C].context,f);break;case 3:E[C].fn.call(E[C].context,f,p);break;case 4:E[C].fn.call(E[C].context,f,p,m);break;default:if(!S)for(T=1,S=new Array(P-1);T<P;T++)S[T-1]=arguments[T];E[C].fn.apply(E[C].context,S)}}return!0},c.prototype.on=function(d,f,p){return a(this,d,f,p,!1)},c.prototype.once=function(d,f,p){return a(this,d,f,p,!0)},c.prototype.removeListener=function(d,f,p,m){var y=n?n+d:d;if(!this._events[y])return this;if(!f)return l(this,y),this;var v=this._events[y];if(v.fn)v.fn!==f||m&&!v.once||p&&v.context!==p||l(this,y);else{for(var b=0,S=[],C=v.length;b<C;b++)(v[b].fn!==f||m&&!v[b].once||p&&v[b].context!==p)&&S.push(v[b]);S.length?this._events[y]=S.length===1?S[0]:S:l(this,y)}return this},c.prototype.removeAllListeners=function(d){var f;return d?(f=n?n+d:d,this._events[f]&&l(this,f)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(xx)),xx.exports),em=el(D3);function Sx(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.unshift(t))}function Of(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))}function On(e,t,n=1){const r=Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);let a=-1;for(;++a<r;)o[a]=e+a*n;return o}var L3=el((function(){if(bx)return wx;bx=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,o=parseInt,a=typeof _i=="object"&&_i&&_i.Object===Object&&_i,l=typeof self=="object"&&self&&self.Object===Object&&self,c=a||l||Function("return this")(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return c.Date.now()};function y(b){var S=typeof b;return!!b&&(S=="object"||S=="function")}function v(b){if(typeof b=="number")return b;if((function(E){return typeof E=="symbol"||(function(P){return!!P&&typeof P=="object"})(E)&&d.call(E)=="[object Symbol]"})(b))return NaN;if(y(b)){var S=typeof b.valueOf=="function"?b.valueOf():b;b=y(S)?S+"":S}if(typeof b!="string")return b===0?b:+b;b=b.replace(e,"");var C=n.test(b);return C||r.test(b)?o(b.slice(2),C?2:8):t.test(b)?NaN:+b}return wx=function(b,S,C){var E,P,T,O,V,N,D=0,H=!1,ee=!1,L=!0;if(typeof b!="function")throw new TypeError("Expected a function");function te(fe){var oe=E,U=P;return E=P=void 0,D=fe,O=b.apply(U,oe)}function G(fe){var oe=fe-N;return N===void 0||oe>=S||oe<0||ee&&fe-D>=T}function X(){var fe=m();if(G(fe))return Q(fe);V=setTimeout(X,(function(oe){var U=S-(oe-N);return ee?p(U,T-(oe-D)):U})(fe))}function Q(fe){return V=void 0,L&&E?te(fe):(E=P=void 0,O)}function re(){var fe=m(),oe=G(fe);if(E=arguments,P=this,N=fe,oe){if(V===void 0)return(function(U){return D=U,V=setTimeout(X,S),H?te(U):O})(N);if(ee)return V=setTimeout(X,S),te(N)}return V===void 0&&(V=setTimeout(X,S)),O}return S=v(S)||0,y(C)&&(H=!!C.leading,T=(ee="maxWait"in C)?f(v(C.maxWait)||0,S):T,L="trailing"in C?!!C.trailing:L),re.cancel=function(){V!==void 0&&clearTimeout(V),D=0,E=N=P=V=void 0},re.flush=function(){return V===void 0?O:Q(m())},re}})()),z3="sash-module_sash__K-9lB",O3="sash-module_disabled__Hm-wx",F3="sash-module_mac__Jf6OJ",kx="sash-module_vertical__pB-rs",V3="sash-module_minimum__-UKxp",B3="sash-module_maximum__TCWxD",Ex="sash-module_horizontal__kFbiw",Ff="sash-module_hover__80W6I",Vf="sash-module_active__bJspD";let Hn=(function(e){return e.Vertical="VERTICAL",e.Horizontal="HORIZONTAL",e})({}),kn=(function(e){return e.Disabled="DISABLED",e.Minimum="MINIMUM",e.Maximum="MAXIMUM",e.Enabled="ENABLED",e})({}),gS=mS?20:8;const yS=new em;class Cx extends em{get state(){return this._state}set state(t){this._state!==t&&(this.el.classList.toggle(O3,t===kn.Disabled),this.el.classList.toggle("sash-disabled",t===kn.Disabled),this.el.classList.toggle(V3,t===kn.Minimum),this.el.classList.toggle("sash-minimum",t===kn.Minimum),this.el.classList.toggle(B3,t===kn.Maximum),this.el.classList.toggle("sash-maximum",t===kn.Maximum),this._state=t,this.emit("enablementChange",t))}constructor(t,n,r){var o;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=L3(a=>a.classList.add("sash-hover",Ff),this.hoverDelay),this._state=kn.Enabled,this.onPointerStart=a=>{const l=a.pageX,c=a.pageY,d={startX:l,currentX:l,startY:c,currentY:c};this.el.classList.add("sash-active",Vf),this.emit("start",d),this.el.setPointerCapture(a.pointerId);const f=m=>{m.preventDefault();const y={startX:l,currentX:m.pageX,startY:c,currentY:m.pageY};this.emit("change",y)},p=m=>{m.preventDefault(),this.el.classList.remove("sash-active",Vf),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(m.pointerId),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",p)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",p)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(Vf)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",Ff)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",Ff)},this.el=document.createElement("div"),this.el.classList.add("sash",z3),this.el.dataset.testid="sash",t.append(this.el),j3&&this.el.classList.add("sash-mac",F3),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),typeof r.size=="number"?(this.size=r.size,r.orientation===Hn.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=gS,yS.on("onDidChangeGlobalSize",a=>{this.size=a,this.layout()})),this.layoutProvider=n,this.orientation=(o=r.orientation)!=null?o:Hn.Vertical,this.orientation===Hn.Horizontal?(this.el.classList.add("sash-horizontal",Ex),this.el.classList.remove("sash-vertical",kx)):(this.el.classList.remove("sash-horizontal",Ex),this.el.classList.add("sash-vertical",kx)),this.layout()}layout(){if(this.orientation===Hn.Vertical){const t=this.layoutProvider;this.el.style.left=t.getVerticalSashLeft(this)-this.size/2+"px",t.getVerticalSashTop&&(this.el.style.top=t.getVerticalSashTop(this)+"px"),t.getVerticalSashHeight&&(this.el.style.height=t.getVerticalSashHeight(this)+"px")}else{const t=this.layoutProvider;this.el.style.top=t.getHorizontalSashTop(this)-this.size/2+"px",t.getHorizontalSashLeft&&(this.el.style.left=t.getHorizontalSashLeft(this)+"px"),t.getHorizontalSashWidth&&(this.el.style.width=t.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}let Xu;var Bf;(Bf=Xu||(Xu={})).Distribute={type:"distribute"},Bf.Split=function(e){return{type:"split",index:e}},Bf.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};let Bn=(function(e){return e.Normal="NORMAL",e.Low="LOW",e.High="HIGH",e})({});class vS{constructor(t,n,r){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=t,this.view=n,this.container.classList.add("split-view-view",fS),this.container.dataset.testid="split-view-view",typeof r=="number"?(this._size=r,this._cachedVisibleSize=void 0,t.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=r.cachedVisibleSize)}set size(t){this._size=t}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return this._cachedVisibleSize===void 0}setVisible(t,n){t!==this.visible&&(t?(this.size=lr(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof n=="number"?n:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",t),this.view.setVisible&&this.view.setVisible(t))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(t){this.container.style.pointerEvents=t?"":"none"}layout(t){this.layoutContainer(t),this.view.layout(this.size,t)}}class $3 extends vS{layoutContainer(t){this.container.style.left=`${t}px`,this.container.style.width=`${this.size}px`}}class U3 extends vS{layoutContainer(t){this.container.style.top=`${t}px`,this.container.style.height=`${this.size}px`}}class H3 extends em{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}constructor(t,n={},r,o,a){var l,c;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=d=>{this.emit("sashchange",d),this.saveProportions();for(const f of this.viewItems)f.enabled=!0},this.orientation=(l=n.orientation)!=null?l:Hn.Vertical,this.proportionalLayout=(c=n.proportionalLayout)!=null?c:!0,this.getSashOrthogonalSize=n.getSashOrthogonalSize,r&&(this.onDidChange=r),o&&(this.onDidDragStart=o),a&&(this.onDidDragEnd=a),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container",_3),t.prepend(this.sashContainer),n.descriptor){this.size=n.descriptor.size;for(const[d,f]of n.descriptor.views.entries()){const p=f.size,m=f.container,y=f.view;this.addView(m,y,p,d,!0)}this.contentSize=this.viewItems.reduce((d,f)=>d+f.size,0),this.saveProportions()}}addView(t,n,r,o=this.viewItems.length,a){let l;l=typeof r=="number"?r:r.type==="split"?this.getViewSize(r.index)/2:r.type==="invisible"?{cachedVisibleSize:r.cachedVisibleSize}:n.minimumSize;const c=this.orientation===Hn.Vertical?new U3(t,n,l):new $3(t,n,l);if(this.viewItems.splice(o,0,c),this.viewItems.length>1){const d=this.orientation===Hn.Vertical?new Cx(this.sashContainer,{getHorizontalSashTop:m=>this.getSashPosition(m),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:Hn.Horizontal}):new Cx(this.sashContainer,{getVerticalSashLeft:m=>this.getSashPosition(m),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:Hn.Vertical}),f=this.orientation===Hn.Vertical?m=>({sash:d,start:m.startY,current:m.currentY}):m=>({sash:d,start:m.startX,current:m.currentX});d.on("start",m=>{var y;this.emit("sashDragStart"),this.onSashStart(f(m));const v=this.viewItems.map(b=>b.size);(y=this.onDidDragStart)==null||y.call(this,v)}),d.on("change",m=>this.onSashChange(f(m))),d.on("end",()=>{var m;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(v=>v.sash===d));const y=this.viewItems.map(v=>v.size);(m=this.onDidDragEnd)==null||m.call(this,y)}),d.on("reset",()=>{const m=this.sashItems.findIndex(C=>C.sash===d),y=On(m,-1,-1),v=On(m+1,this.viewItems.length),b=this.findFirstSnapIndex(y),S=this.findFirstSnapIndex(v);(typeof b!="number"||this.viewItems[b].visible)&&(typeof S!="number"||this.viewItems[S].visible)&&this.emit("sashreset",m)});const p={sash:d};this.sashItems.splice(o-1,0,p)}a||this.relayout(),a||typeof r=="number"||r.type!=="distribute"||this.distributeViewSizes()}removeView(t,n){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");const r=this.viewItems.splice(t,1)[0].view;if(this.viewItems.length>=1){const o=Math.max(t-1,0);this.sashItems.splice(o,1)[0].sash.dispose()}return this.relayout(),n&&n.type==="distribute"&&this.distributeViewSizes(),r}moveView(t,n,r){const o=this.getViewCachedVisibleSize(n),a=o===void 0?this.getViewSize(n):Xu.Invisible(o),l=this.removeView(n);this.addView(t,l,a,r)}getViewCachedVisibleSize(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].cachedVisibleSize}layout(t=this.size){const n=Math.max(this.size,this.contentSize);if(this.size=t,this.proportions)for(let r=0;r<this.viewItems.length;r++){const o=this.viewItems[r];o.size=lr(Math.round(this.proportions[r]*t),o.minimumSize,o.maximumSize)}else{const r=On(0,this.viewItems.length),o=r.filter(l=>this.viewItems[l].priority===Bn.Low),a=r.filter(l=>this.viewItems[l].priority===Bn.High);this.resize(this.viewItems.length-1,t-n,void 0,o,a)}this.distributeEmptySpace(),this.layoutViews()}resizeView(t,n){if(t<0||t>=this.viewItems.length)return;const r=On(0,this.viewItems.length).filter(c=>c!==t),o=[...r.filter(c=>this.viewItems[c].priority===Bn.Low),t],a=r.filter(c=>this.viewItems[c].priority===Bn.High),l=this.viewItems[t];n=Math.round(n),n=lr(n,l.minimumSize,Math.min(l.maximumSize,this.size)),l.size=n,this.relayout(o,a)}resizeViews(t){for(let n=0;n<t.length;n++){const r=this.viewItems[n];let o=t[n];o=Math.round(o),o=lr(o,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=o}this.contentSize=this.viewItems.reduce((n,r)=>n+r.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}isViewVisible(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].visible}setViewVisible(t,n){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[t].setVisible(n),this.distributeEmptySpace(t),this.layoutViews(),this.saveProportions()}distributeViewSizes(){const t=[];let n=0;for(const c of this.viewItems)c.maximumSize-c.minimumSize>0&&(t.push(c),n+=c.size);const r=Math.floor(n/t.length);for(const c of t)c.size=lr(r,c.minimumSize,c.maximumSize);const o=On(0,this.viewItems.length),a=o.filter(c=>this.viewItems[c].priority===Bn.Low),l=o.filter(c=>this.viewItems[c].priority===Bn.High);this.relayout(a,l)}dispose(){this.sashItems.forEach(t=>t.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(t,n){const r=this.viewItems.reduce((o,a)=>o+a.size,0);this.resize(this.viewItems.length-1,this.size-r,void 0,t,n),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:t,start:n}){const r=this.sashItems.findIndex(o=>o.sash===t);(o=>{const a=this.viewItems.map(P=>P.size);let l,c,d=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY;const p=On(r,-1,-1),m=On(r+1,this.viewItems.length),y=p.reduce((P,T)=>P+(this.viewItems[T].minimumSize-a[T]),0),v=p.reduce((P,T)=>P+(this.viewItems[T].viewMaximumSize-a[T]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((P,T)=>P+(a[T]-this.viewItems[T].minimumSize),0),S=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((P,T)=>P+(a[T]-this.viewItems[T].viewMaximumSize),0);d=Math.max(y,S),f=Math.min(b,v);const C=this.findFirstSnapIndex(p),E=this.findFirstSnapIndex(m);if(typeof C=="number"){const P=this.viewItems[C],T=Math.floor(P.viewMinimumSize/2);l={index:C,limitDelta:P.visible?d-T:d+T,size:P.size}}if(typeof E=="number"){const P=this.viewItems[E],T=Math.floor(P.viewMinimumSize/2);c={index:E,limitDelta:P.visible?f+T:f-T,size:P.size}}this.sashDragState={start:o,current:o,index:r,sizes:a,minDelta:d,maxDelta:f,snapBefore:l,snapAfter:c}})(n)}onSashChange({current:t}){const{index:n,start:r,sizes:o,minDelta:a,maxDelta:l,snapBefore:c,snapAfter:d}=this.sashDragState;this.sashDragState.current=t;const f=t-r;this.resize(n,f,o,void 0,void 0,a,l,c,d),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(t){let n=0;for(let r=0;r<this.sashItems.length;r++)if(n+=this.viewItems[r].size,this.sashItems[r].sash===t)return n;return 0}resize(t,n,r=this.viewItems.map(p=>p.size),o,a,l=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,d,f){if(t<0||t>=this.viewItems.length)return 0;const p=On(t,-1,-1),m=On(t+1,this.viewItems.length);if(a)for(const D of a)Sx(p,D),Sx(m,D);if(o)for(const D of o)Of(p,D),Of(m,D);const y=p.map(D=>this.viewItems[D]),v=p.map(D=>r[D]),b=m.map(D=>this.viewItems[D]),S=m.map(D=>r[D]),C=p.reduce((D,H)=>D+(this.viewItems[H].minimumSize-r[H]),0),E=p.reduce((D,H)=>D+(this.viewItems[H].maximumSize-r[H]),0),P=m.length===0?Number.POSITIVE_INFINITY:m.reduce((D,H)=>D+(r[H]-this.viewItems[H].minimumSize),0),T=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((D,H)=>D+(r[H]-this.viewItems[H].maximumSize),0),O=Math.max(C,T,l),V=Math.min(P,E,c);let N=!1;if(d){const D=this.viewItems[d.index],H=n>=d.limitDelta;N=H!==D.visible,D.setVisible(H,d.size)}if(!N&&f){const D=this.viewItems[f.index],H=n<f.limitDelta;N=H!==D.visible,D.setVisible(H,f.size)}if(N)return this.resize(t,n,r,o,a,l,c);for(let D=0,H=n=lr(n,O,V);D<y.length;D++){const ee=y[D],L=lr(v[D]+H,ee.minimumSize,ee.maximumSize);H-=L-v[D],ee.size=L}for(let D=0,H=n;D<b.length;D++){const ee=b[D],L=lr(S[D]-H,ee.minimumSize,ee.maximumSize);H+=L-S[D],ee.size=L}return n}distributeEmptySpace(t){const n=this.viewItems.reduce((f,p)=>f+p.size,0);let r=this.size-n;const o=On(0,this.viewItems.length),a=[],l=o.filter(f=>this.viewItems[f].priority===Bn.Low),c=o.filter(f=>this.viewItems[f].priority===Bn.Normal),d=o.filter(f=>this.viewItems[f].priority===Bn.High);a.push(...d,...c,...l),typeof t=="number"&&Of(a,t);for(let f=0;r!==0&&f<a.length;f++){const p=this.viewItems[a[f]],m=lr(p.size+r,p.minimumSize,p.maximumSize);r-=m-p.size,p.size=m}}layoutViews(){var t;this.contentSize=this.viewItems.reduce((r,o)=>r+o.size,0);let n=0;for(const r of this.viewItems)r.layout(n),n+=r.size;(t=this.onDidChange)!=null&&t.call(this,this.viewItems.map(r=>r.size)),this.sashItems.forEach(r=>r.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(t=>t.size/this.contentSize))}updateSashEnablement(){let t=!1;const n=this.viewItems.map(d=>t=d.size-d.minimumSize>0||t);t=!1;const r=this.viewItems.map(d=>t=d.maximumSize-d.size>0||t),o=[...this.viewItems].reverse();t=!1;const a=o.map(d=>t=d.size-d.minimumSize>0||t).reverse();t=!1;const l=o.map(d=>t=d.maximumSize-d.size>0||t).reverse();let c=0;for(let d=0;d<this.sashItems.length;d++){const{sash:f}=this.sashItems[d];c+=this.viewItems[d].size;const p=!(n[d]&&l[d+1]),m=!(r[d]&&a[d+1]);if(p&&m){const y=On(d,-1,-1),v=On(d+1,this.viewItems.length),b=this.findFirstSnapIndex(y),S=this.findFirstSnapIndex(v),C=typeof b=="number"&&!this.viewItems[b].visible,E=typeof S=="number"&&!this.viewItems[S].visible;C&&a[d]&&(c>0||this.startSnappingEnabled)?f.state=kn.Minimum:E&&n[d]&&(c<this.contentSize||this.endSnappingEnabled)?f.state=kn.Maximum:f.state=kn.Disabled}else f.state=p&&!m?kn.Minimum:!p&&m?kn.Maximum:kn.Enabled}}findFirstSnapIndex(t){for(const n of t){const r=this.viewItems[n];if(r.visible&&r.snap)return n}for(const n of t){const r=this.viewItems[n];if(r.visible&&r.maximumSize-r.minimumSize>0)return;if(!r.visible&&r.snap)return n}}}class Qs{constructor(t){this.size=void 0,this.size=t}getPreferredSize(){return this.size}}class Ix{constructor(t,n){this.proportion=void 0,this.layoutService=void 0,this.proportion=t,this.layoutService=n}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class Iu{getPreferredSize(){}}class Tx{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(t){if(typeof t=="number")this.layoutStrategy=new Qs(t);else if(typeof t=="string"){const n=t.trim();if(Cu(n,"%")){const r=Number(n.slice(0,-1))/100;this.layoutStrategy=new Ix(r,this.layoutService)}else if(Cu(n,"px")){const r=Number(n.slice(0,-2))/100;this.layoutStrategy=new Qs(r)}else if(typeof Number.parseFloat(n)=="number"){const r=Number.parseFloat(n);this.layoutStrategy=new Qs(r)}else this.layoutStrategy=new Iu}else this.layoutStrategy=new Iu}constructor(t,n){var r;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=t,this.element=n.element,this.minimumSize=typeof n.minimumSize=="number"?n.minimumSize:30,this.maximumSize=typeof n.maximumSize=="number"?n.maximumSize:Number.POSITIVE_INFINITY,typeof n.preferredSize=="number")this.layoutStrategy=new Qs(n.preferredSize);else if(typeof n.preferredSize=="string"){const o=n.preferredSize.trim();if(Cu(o,"%")){const a=Number(o.slice(0,-1))/100;this.layoutStrategy=new Ix(a,this.layoutService)}else if(Cu(o,"px")){const a=Number(o.slice(0,-2));this.layoutStrategy=new Qs(a)}else if(typeof Number.parseFloat(o)=="number"){const a=Number.parseFloat(o);this.layoutStrategy=new Qs(a)}else this.layoutStrategy=new Iu}else this.layoutStrategy=new Iu;this.priority=(r=n.priority)!=null?r:Bn.Normal,this.snap=typeof n.snap=="boolean"&&n.snap}layout(t){}}function _x(e){return e.minSize!==void 0||e.maxSize!==void 0||e.preferredSize!==void 0||e.priority!==void 0||e.visible!==void 0}const tm=I.forwardRef(({className:e,children:t},n)=>wr.createElement("div",{ref:n,className:Vh("split-view-view",fS,e)},t));tm.displayName="Allotment.Pane";const xS=I.forwardRef(({children:e,className:t,id:n,maxSize:r=1/0,minSize:o=30,proportionalLayout:a=!0,separator:l=!0,sizes:c,defaultSizes:d=c,snap:f=!1,vertical:p=!1,onChange:m,onReset:y,onVisibleChange:v,onDragStart:b,onDragEnd:S},C)=>{const E=I.useRef(null),P=I.useRef([]),T=I.useRef(new Map),O=I.useRef(null),V=I.useRef(new Map),N=I.useRef(new M3),D=I.useRef([]),[H,ee]=I.useState(!1),L=I.useMemo(()=>wr.Children.toArray(e).filter(wr.isValidElement),[e]),te=I.useCallback(G=>{var X,Q;const re=(X=D.current)==null?void 0:X[G];return typeof(re==null?void 0:re.preferredSize)=="number"&&((Q=O.current)!=null&&Q.resizeView(G,Math.round(re.preferredSize)),!0)},[]);return I.useImperativeHandle(C,()=>({reset:()=>{if(y)y();else{var G;(G=O.current)==null||G.distributeViewSizes();for(let X=0;X<D.current.length;X++)te(X)}},resize:G=>{var X;(X=O.current)==null||X.resizeViews(G)}})),yx(()=>{let G=!0;d&&V.current.size!==d.length&&(G=!1,console.warn(`Expected ${d.length} children based on defaultSizes but found ${V.current.size}`)),G&&d&&(P.current=L.map(re=>re.key));const X=Ra({orientation:p?Hn.Vertical:Hn.Horizontal,proportionalLayout:a},G&&d&&{descriptor:{size:d.reduce((re,fe)=>re+fe,0),views:d.map((re,fe)=>{var oe,U,se,_;const j=T.current.get(P.current[fe]),Y=new Tx(N.current,Ra({element:document.createElement("div"),minimumSize:(oe=j==null?void 0:j.minSize)!=null?oe:o,maximumSize:(U=j==null?void 0:j.maxSize)!=null?U:r,priority:(se=j==null?void 0:j.priority)!=null?se:Bn.Normal},(j==null?void 0:j.preferredSize)&&{preferredSize:j==null?void 0:j.preferredSize},{snap:(_=j==null?void 0:j.snap)!=null?_:f}));return D.current.push(Y),{container:[...V.current.values()][fe],size:re,view:Y}})}});O.current=new H3(E.current,X,m,b,S),O.current.on("sashDragStart",()=>{var re;(re=E.current)==null||re.classList.add("split-view-sash-dragging")}),O.current.on("sashDragEnd",()=>{var re;(re=E.current)==null||re.classList.remove("split-view-sash-dragging")}),O.current.on("sashchange",re=>{if(v&&O.current){const fe=L.map(oe=>oe.key);for(let oe=0;oe<fe.length;oe++){const U=T.current.get(fe[oe]);(U==null?void 0:U.visible)!==void 0&&U.visible!==O.current.isViewVisible(oe)&&v(oe,O.current.isViewVisible(oe))}}}),O.current.on("sashreset",re=>{if(y)y();else{var fe;if(te(re)||te(re+1))return;(fe=O.current)==null||fe.distributeViewSizes()}});const Q=O.current;return()=>{Q.dispose()}},[]),yx(()=>{if(H){const A=L.map(de=>de.key),Se=[...P.current],Te=A.filter(de=>!P.current.includes(de)),ke=A.filter(de=>P.current.includes(de)),ze=P.current.map(de=>!A.includes(de));for(let de=ze.length-1;de>=0;de--){var G;ze[de]&&((G=O.current)!=null&&G.removeView(de),Se.splice(de,1),D.current.splice(de,1))}for(const de of Te){var X,Q,re,fe,oe;const he=T.current.get(de),Ne=new Tx(N.current,Ra({element:document.createElement("div"),minimumSize:(X=he==null?void 0:he.minSize)!=null?X:o,maximumSize:(Q=he==null?void 0:he.maxSize)!=null?Q:r,priority:(re=he==null?void 0:he.priority)!=null?re:Bn.Normal},(he==null?void 0:he.preferredSize)&&{preferredSize:he==null?void 0:he.preferredSize},{snap:(fe=he==null?void 0:he.snap)!=null?fe:f}));(oe=O.current)!=null&&oe.addView(V.current.get(de),Ne,Xu.Distribute,A.findIndex(Ke=>Ke===de)),Se.splice(A.findIndex(Ke=>Ke===de),0,de),D.current.splice(A.findIndex(Ke=>Ke===de),0,Ne)}for(;!C3(A,Se);)for(const[de,he]of A.entries()){const Ne=Se.findIndex(Ke=>Ke===he);if(Ne!==de){var U;(U=O.current)==null||U.moveView(V.current.get(he),Ne,de);const Ke=Se[Ne];Se.splice(Ne,1),Se.splice(de,0,Ke);break}}for(const de of Te){var se;const he=A.findIndex(Ke=>Ke===de),Ne=D.current[he].preferredSize;Ne!==void 0&&((se=O.current)==null||se.resizeView(he,Ne))}for(const de of[...Te,...ke]){var _,j;const he=T.current.get(de),Ne=A.findIndex(Ke=>Ke===de);he&&_x(he)&&he.visible!==void 0&&((_=O.current)==null?void 0:_.isViewVisible(Ne))!==he.visible&&((j=O.current)==null||j.setViewVisible(Ne,he.visible))}for(const de of ke){const he=T.current.get(de),Ne=A.findIndex(Ke=>Ke===de);if(he&&_x(he)){var Y;he.preferredSize!==void 0&&D.current[Ne].preferredSize!==he.preferredSize&&(D.current[Ne].preferredSize=he.preferredSize);let Ke=!1;he.minSize!==void 0&&D.current[Ne].minimumSize!==he.minSize&&(D.current[Ne].minimumSize=he.minSize,Ke=!0),he.maxSize!==void 0&&D.current[Ne].maximumSize!==he.maxSize&&(D.current[Ne].maximumSize=he.maxSize,Ke=!0),Ke&&((Y=O.current)==null||Y.layout())}}(Te.length>0||ze.length>0)&&(P.current=A)}},[L,H,r,o,f]),I.useEffect(()=>{O.current&&(O.current.onDidChange=m)},[m]),I.useEffect(()=>{O.current&&(O.current.onDidDragStart=b)},[b]),I.useEffect(()=>{O.current&&(O.current.onDidDragEnd=S)},[S]),I3({ref:E,onResize:({width:G,height:X})=>{var Q;G&&X&&((Q=O.current)!=null&&Q.layout(p?X:G),N.current.setSize(p?X:G),ee(!0))}}),I.useEffect(()=>{mS&&W3(20)},[]),wr.createElement("div",{ref:E,className:Vh("split-view",p?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":l},T3,p?A3:R3,{[N3]:l},t),id:n},wr.createElement("div",{className:Vh("split-view-container",P3)},wr.Children.toArray(e).map(G=>{if(!wr.isValidElement(G))return null;const X=G.key;return G.type.displayName==="Allotment.Pane"?(T.current.set(X,G.props),wr.cloneElement(G,{key:X,ref:Q=>{const re=G.ref;re&&(re.current=Q),Q?V.current.set(X,Q):V.current.delete(X)}})):wr.createElement(tm,{key:X,ref:Q=>{Q?V.current.set(X,Q):V.current.delete(X)}},G)})))});function W3(e){const t=lr(e,4,20),n=lr(e,1,8);document.documentElement.style.setProperty("--sash-size",t+"px"),document.documentElement.style.setProperty("--sash-hover-size",n+"px"),(function(r){gS=r,yS.emit("onDidChangeGlobalSize",r)})(t)}xS.displayName="Allotment";var is=Object.assign(xS,{Pane:tm});const wS=I.forwardRef(({position:e="left",className:t,children:n,...r},o)=>w.jsx("div",{ref:o,className:Re("h-full w-full flex flex-col","bg-muted/30 border-border",e==="left"?"border-r":"border-l",t),...r,children:n}));wS.displayName="Sidebar";const bS=I.forwardRef(({className:e,children:t,...n},r)=>w.jsx("div",{ref:r,className:Re("h-full w-full flex flex-col bg-background",e),...n,children:t}));bS.displayName="MainContent";var Ur=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT",e))(Ur||{}),q3=["agent_initializing","agent_ready","agent_destroyed","conversation_queued","conversation_start","conversation_thinking","conversation_responding","conversation_end","conversation_interrupted","tool_planned","tool_executing","tool_completed","tool_failed","error_occurred"];new Set(q3);var G3=["user_message","assistant_message","tool_call_message","tool_result_message"];new Set(G3);var K3=["error"];new Set(K3);var Y3=["turn_request","turn_response"];new Set(Y3);var X3=["message_start","message_delta","message_stop","text_content_block_start","text_delta","text_content_block_stop","tool_use_content_block_start","input_json_delta","tool_use_content_block_stop","tool_call","tool_result","interrupted"];new Set(X3);var Q3=Object.defineProperty,J3=(e,t,n)=>t in e?Q3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ds=(e,t,n)=>J3(e,typeof t!="symbol"?t+"":t,n),SS=class Bh{constructor(t,n={}){ds(this,"name"),ds(this,"level"),ds(this,"colors"),ds(this,"timestamps"),this.name=t,this.level=n.level??Ur.INFO,this.colors=n.colors??this.isNodeEnvironment(),this.timestamps=n.timestamps??!0}debug(t,n){this.isDebugEnabled()&&this.log("DEBUG",t,n)}info(t,n){this.isInfoEnabled()&&this.log("INFO",t,n)}warn(t,n){this.isWarnEnabled()&&this.log("WARN",t,n)}error(t,n){this.isErrorEnabled()&&(t instanceof Error?this.log("ERROR",t.message,{...n,stack:t.stack}):this.log("ERROR",t,n))}isDebugEnabled(){return this.level<=Ur.DEBUG}isInfoEnabled(){return this.level<=Ur.INFO}isWarnEnabled(){return this.level<=Ur.WARN}isErrorEnabled(){return this.level<=Ur.ERROR}log(t,n,r){const o=[];if(this.timestamps&&o.push(new Date().toISOString()),this.colors){const c=Bh.COLORS[t];o.push(`${c}${t.padEnd(5)}${Bh.COLORS.RESET}`)}else o.push(t.padEnd(5));o.push(`[${this.name}]`),o.push(n);const a=o.join(" "),l=this.getConsoleMethod(t);r&&Object.keys(r).length>0?l(a,r):l(a)}getConsoleMethod(t){switch(t){case"DEBUG":return console.debug.bind(console);case"INFO":return console.info.bind(console);case"WARN":return console.warn.bind(console);case"ERROR":return console.error.bind(console);default:return console.log.bind(console)}}isNodeEnvironment(){var t;return typeof process<"u"&&((t=process.versions)==null?void 0:t.node)!==void 0}};ds(SS,"COLORS",{DEBUG:"\x1B[36m",INFO:"\x1B[32m",WARN:"\x1B[33m",ERROR:"\x1B[31m",RESET:"\x1B[0m"});var Z3=SS,$f=null,nm=class{static getLogger(e){const t=typeof e=="string"?e:e.name;if(this.loggers.has(t))return this.loggers.get(t);const n=this.createLazyLogger(t);return this.loggers.set(t,n),n}static configure(e){this.config={...this.config,...e}}static reset(){this.loggers.clear(),this.config={defaultLevel:Ur.INFO},$f=null}static createLazyLogger(e){let t=null;const n=()=>(t||(t=this.createLogger(e)),t);return{name:e,level:this.config.defaultLevel||Ur.INFO,debug:(r,o)=>n().debug(r,o),info:(r,o)=>n().info(r,o),warn:(r,o)=>n().warn(r,o),error:(r,o)=>n().error(r,o),isDebugEnabled:()=>n().isDebugEnabled(),isInfoEnabled:()=>n().isInfoEnabled(),isWarnEnabled:()=>n().isWarnEnabled(),isErrorEnabled:()=>n().isErrorEnabled()}}static createLogger(e){return $f?$f.getLogger(e):this.config.defaultImplementation?this.config.defaultImplementation(e):new Z3(e,{level:this.config.defaultLevel,...this.config.consoleOptions})}};ds(nm,"loggers",new Map);ds(nm,"config",{defaultLevel:Ur.INFO});function e4(e){return nm.getLogger(e)}const Fn=e4("ui/Studio");function t4({agentx:e,userId:t,containerId:n,definitions:r,onSessionChange:o,onDefinitionChange:a,className:l=""}){const[c,d]=I.useState(r[0]??null),{sessions:f,currentSession:p,selectSession:m,createSession:y,deleteSession:v,isLoading:b}=QT(e,t,{onSessionChange:U=>{o==null||o(U)}}),[S,C]=I.useState(null),[E,P]=I.useState([]);I.useEffect(()=>()=>{var U;S&&(Fn.debug("Cleaning up agent on unmount",{agentId:S.agentId}),(U=S.destroy)==null||U.call(S).catch(se=>Fn.error("Failed to destroy agent",{error:se})))},[S]);const{messages:T,streaming:O,errors:V,send:N,status:D,interrupt:H,isLoading:ee}=XT(S),L=[...E,...T],te=I.useCallback(async()=>{var U;S&&(Fn.debug("Destroying current agent",{agentId:S.agentId}),await((U=S.destroy)==null?void 0:U.call(S)),C(null),P([]))},[S]),G=I.useCallback(async U=>{Fn.debug("Selecting definition",{name:U.name}),await te(),d(U),a==null||a(U),m(null)},[te,m,a]),X=I.useCallback(async U=>{Fn.info("Selecting existing session",{sessionId:U.sessionId}),await te();try{const se=await e.sessions.get(U.sessionId);if(!se){Fn.error("Session not found",{sessionId:U.sessionId});return}const _=await se.getMessages();P(_);const j=await se.resume({containerId:n});C(j),m(U),Fn.info("Session selected and agent resumed",{sessionId:U.sessionId,agentId:j.agentId})}catch(se){Fn.error("Failed to select session",{sessionId:U.sessionId,error:se})}},[e,n,te,m]),Q=I.useCallback(async U=>{if(!c)return null;Fn.info("Creating new session",{definition:c.name}),await te();try{const se=await e.images.getMetaImage(c.name);if(!se)return Fn.error("MetaImage not found",{definition:c.name}),null;const _=await y(se.imageId,`New Chat ${f.length+1}`),j=await e.images.run(se.imageId,{containerId:n}),Y=await e.sessions.get(_.sessionId);return Y&&Y.collect(j),FC.flushSync(()=>{P([]),C(j)}),m(_),Fn.info("Session created and agent started",{sessionId:_.sessionId,agentId:j.agentId}),U&&j.receive(U),j}catch(se){return Fn.error("Failed to create session",{error:se}),null}},[e,c,n,y,f.length,te,m]),re=I.useCallback(async U=>{(p==null?void 0:p.sessionId)===U&&await te(),await v(U)},[p==null?void 0:p.sessionId,te,v]),fe=I.useCallback(async U=>{p?N(U):await Q(U)},[p,Q,N]),oe=b||ee;return w.jsx("div",{className:`h-full bg-background ${l}`,children:w.jsxs(is,{children:[w.jsx(is.Pane,{minSize:56,maxSize:56,children:w.jsx("div",{className:"h-full bg-muted/30 border-r border-border",children:w.jsx(y_,{definitions:r,current:c,onSelect:G,onSettings:()=>{console.log("Open settings")}})})}),w.jsx(is.Pane,{minSize:200,maxSize:400,preferredSize:280,children:w.jsx(wS,{children:w.jsx(ej,{sessions:f,current:p,agentName:c==null?void 0:c.name,onSelect:X,onCreate:Q,onDelete:re})})}),w.jsx(is.Pane,{children:w.jsx(bS,{children:w.jsxs(is,{vertical:!0,children:[w.jsx(is.Pane,{children:w.jsx(x3,{definition:c,session:p,agentId:S==null?void 0:S.agentId,messages:L,streaming:O,errors:V,status:D,isLoading:oe,onAbort:H,onCreateSession:Q})}),w.jsx(is.Pane,{minSize:150,maxSize:600,preferredSize:220,children:w.jsx(S3,{onSend:fe,disabled:oe},(p==null?void 0:p.sessionId)??"new")})]})})})]})})}const n4=I.forwardRef(({items:e,bottomItems:t,activeId:n,onItemClick:r,position:o="left",className:a,...l},c)=>{const d=f=>{const p=f.id===n;return w.jsxs("button",{type:"button",onClick:()=>r==null?void 0:r(f.id),className:Re("relative w-12 h-12 flex items-center justify-center","text-muted-foreground hover:text-foreground","transition-colors duration-200","group",p&&["text-foreground",o==="left"?"border-l-2 border-primary":"border-r-2 border-primary"]),title:f.label,"aria-label":f.label,"aria-current":p?"page":void 0,children:[w.jsx("div",{className:"w-6 h-6 flex items-center justify-center",children:f.icon}),f.badge&&w.jsx("span",{className:Re("absolute top-1 right-1","min-w-[16px] h-4 px-1","flex items-center justify-center","text-[10px] font-semibold","bg-primary text-primary-foreground","rounded-full"),children:f.badge}),w.jsx("div",{className:Re("absolute inset-0 bg-accent/0 group-hover:bg-accent/50","transition-colors duration-200")})]},f.id)};return w.jsxs("div",{ref:c,className:Re("flex flex-col bg-muted/30 border-border",o==="left"?"border-r":"border-l",a),...l,children:[w.jsx("div",{className:"flex-1 flex flex-col",children:e.map(d)}),t&&t.length>0&&w.jsx("div",{className:"flex flex-col border-t border-border",children:t.map(d)})]})});n4.displayName="ActivityBar";const r4=I.forwardRef(({left:e,center:t,right:n,height:r=56,className:o,children:a,...l},c)=>w.jsxs("div",{ref:c,className:Re("w-full flex items-center","bg-background border-b border-border","px-4",o),style:{height:`${r}px`,minHeight:`${r}px`},...l,children:[e&&w.jsx("div",{className:"flex items-center gap-3 flex-shrink-0",children:e}),t&&w.jsx("div",{className:"flex-1 flex items-center justify-center px-4",children:t}),n&&w.jsx("div",{className:"flex items-center gap-3 flex-shrink-0",children:n}),!e&&!t&&!n&&a]}));r4.displayName="Header";const i4=I.forwardRef(({height:e=200,minHeight:t=100,maxHeight:n=500,className:r,children:o,...a},l)=>w.jsx("div",{ref:l,className:Re("w-full flex flex-col","bg-muted/30 border-t border-border",r),style:{height:`${e}px`,minHeight:`${t}px`,maxHeight:`${n}px`},...a,children:o}));i4.displayName="Panel";const s4=I.forwardRef(({width:e=300,minWidth:t=200,maxWidth:n=600,className:r,children:o,...a},l)=>w.jsx("div",{ref:l,className:Re("h-full flex flex-col","bg-muted/30 border-l border-border",r),style:{width:`${e}px`,minWidth:`${t}px`,maxWidth:`${n}px`},...a,children:o}));s4.displayName="RightSidebar";const o4=I.forwardRef(({icon:e,children:t,clickable:n=!1,className:r,...o},a)=>w.jsxs("div",{ref:a,className:Re("flex items-center gap-1.5 px-2 py-0.5 text-xs",n&&"hover:bg-accent cursor-pointer rounded",r),...o,children:[e&&w.jsx("span",{className:"flex items-center",children:e}),w.jsx("span",{children:t})]}));o4.displayName="StatusBarItem";const a4=I.forwardRef(({align:e="left",children:t,className:n,...r},o)=>w.jsx("div",{ref:o,className:Re("flex items-center gap-1",e==="left"&&"justify-start",e==="center"&&"justify-center flex-1",e==="right"&&"justify-end",n),...r,children:t}));a4.displayName="StatusBarSection";const l4=I.forwardRef(({height:e=24,children:t,className:n,...r},o)=>w.jsx("div",{ref:o,className:Re("w-full flex items-center","bg-primary text-primary-foreground","px-2",n),style:{height:`${e}px`,minHeight:`${e}px`},...r,children:t}));l4.displayName="StatusBar";const u4=uc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),rm=I.forwardRef(({className:e,variant:t,size:n,...r},o)=>w.jsx("button",{className:Re(u4({variant:t,size:n,className:e})),ref:o,...r}));rm.displayName="Button";const kS=I.forwardRef(({children:e,className:t,...n},r)=>w.jsx("div",{ref:r,className:Re("flex gap-2",t),...n,children:e}));kS.displayName="ActionBar";const ES=I.forwardRef(({children:e,loading:t=!1,variant:n="default",size:r="sm",className:o,disabled:a,...l},c)=>w.jsx(rm,{ref:c,variant:n,size:r,className:Re("flex-1 h-8 text-xs transition-all duration-200",o),disabled:a||t,...l,children:t?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"w-3.5 h-3.5 mr-1.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),"Loading..."]}):e}));ES.displayName="ActionBar.Primary";const CS=I.forwardRef(({children:e,loading:t=!1,variant:n="outline",size:r="sm",className:o,disabled:a,...l},c)=>w.jsx(rm,{ref:c,variant:n,size:r,className:Re("h-8 w-8 px-0 transition-colors duration-200 group",o),disabled:a||t,...l,children:t?w.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):e}));CS.displayName="ActionBar.Icon";const IS=I.forwardRef(({children:e,className:t,...n},r)=>w.jsx("div",{ref:r,className:Re("flex gap-2",t),...n,children:e}));IS.displayName="ActionBar.Group";Object.assign(kS,{Primary:ES,Icon:CS,Group:IS});const c4=I.forwardRef(({className:e,src:t="/icons/agent-ai-icon.svg",alt:n="Agent",...r},o)=>w.jsx("img",{ref:o,src:t,alt:n,className:Re("w-5 h-5",e),...r}));c4.displayName="AgentLogo";const d4=I.forwardRef(({logo:e,title:t,subtitle:n,actions:r,showBorder:o=!0,isMobile:a=!1,isPWA:l=!1,className:c,...d},f)=>w.jsx("div",{ref:f,className:Re("p-4",o&&"border-b border-border",a&&"md:hidden p-3",!a&&"hidden md:block",c),style:l&&a?{paddingTop:"16px"}:void 0,...d,children:w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[e&&w.jsx("div",{className:Re("bg-primary rounded-lg flex items-center justify-center text-primary-foreground",a?"w-8 h-8":"w-8 h-8 shadow-sm"),children:e}),w.jsxs("div",{children:[w.jsx("h1",{className:Re("font-bold text-foreground",a?"text-lg font-semibold":"text-lg"),children:t}),n&&w.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n})]})]}),r&&w.jsx("div",{className:"flex items-center gap-2",children:r})]})}));d4.displayName="AppHeader";const f4=I.forwardRef(({icon:e,title:t,description:n,action:r,spacing:o="md",className:a,...l},c)=>{const d={sm:"py-8",md:"py-12",lg:"py-16"},f={sm:"mb-3",md:"mb-4",lg:"mb-6"},p={sm:"mb-1",md:"mb-2",lg:"mb-3"},m={sm:"mt-3",md:"mt-4",lg:"mt-6"};return w.jsxs("div",{ref:c,className:Re("text-center px-4",d[o],a),...l,children:[e&&w.jsx("div",{className:Re("w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto text-muted-foreground",f[o]),children:e}),w.jsx("h3",{className:Re("text-base font-medium text-foreground",p[o]),children:t}),n&&w.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:n}),r&&w.jsx("div",{className:Re(m[o]),children:r})]})});f4.displayName="EmptyState";const h4=I.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:Re("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));h4.displayName="Input";const p4=I.forwardRef(({selected:e=!1,active:t=!1,showActiveIndicator:n=!1,leading:r,title:o,subtitle:a,trailing:l,actions:c,variant:d="default",isMobile:f=!1,onClick:p,className:m,...y},v)=>{const b=d==="compact",S=!!p;return w.jsxs("div",{ref:v,className:Re("group relative",m),...y,children:[n&&t&&w.jsx("div",{className:"absolute left-2 top-1/2 transform -translate-y-1/2 z-10",children:w.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})}),f&&w.jsx("div",{className:Re("p-3 mx-3 my-1 rounded-lg bg-card border border-border/50 active:scale-[0.98] transition-all duration-150",e&&"bg-primary/5 border-primary/20",t&&!e&&"border-green-500/30 bg-green-50/5 dark:bg-green-900/5",S&&"cursor-pointer"),onClick:p,children:w.jsxs("div",{className:"flex items-center gap-2",children:[r&&w.jsx("div",{className:"flex-shrink-0",children:r}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsx("div",{className:Re("font-medium truncate text-foreground","text-xs"),children:o}),a&&w.jsx("div",{className:"flex items-center gap-1 mt-0.5",children:a})]}),l&&w.jsx("div",{className:"flex-shrink-0",children:l}),c&&w.jsx("div",{className:"flex items-center gap-1 ml-1",children:c})]})}),!f&&w.jsxs(w.Fragment,{children:[w.jsx("div",{className:Re("w-full p-2 rounded-md transition-colors duration-200",S&&"cursor-pointer hover:bg-accent/50",e&&"bg-accent text-accent-foreground",!S&&!e&&"pointer-events-none"),onClick:p,children:w.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[r&&w.jsx("div",{className:"flex-shrink-0 mt-0.5",children:r}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsx("div",{className:Re("font-medium truncate text-foreground","text-xs"),children:o}),a&&w.jsx("div",{className:"flex items-center gap-1 mt-0.5",children:a})]}),l&&w.jsx("div",{className:"flex-shrink-0 ml-auto",children:l})]})}),c&&w.jsx("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-all duration-200",children:c})]})]})});p4.displayName="ListItem";const m4=I.forwardRef(({icon:e,title:t,description:n,spacing:r="md",showSpinner:o=!0,className:a,...l},c)=>{const d={sm:"py-8",md:"py-12",lg:"py-16"},f={sm:"mb-3",md:"mb-4",lg:"mb-6"},p={sm:"mb-1",md:"mb-2",lg:"mb-3"},m={sm:"w-5 h-5",md:"w-6 h-6",lg:"w-8 h-8"},v=e||(o?w.jsx("div",{className:Re("animate-spin rounded-full border-2 border-muted-foreground border-t-transparent",m[r])}):null);return w.jsxs("div",{ref:c,className:Re("text-center px-4",d[r],a),...l,children:[v&&w.jsx("div",{className:Re("w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto",f[r]),children:v}),t&&w.jsx("h3",{className:Re("text-base font-medium text-foreground",p[r]),children:t}),n&&w.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:n})]})});m4.displayName="LoadingState";const g4=I.forwardRef(({title:e,subtitle:t,leading:n,trailing:r,showBorder:o=!0,isMobile:a=!1,className:l,...c},d)=>w.jsx("div",{ref:d,className:Re("flex-shrink-0",o&&"border-b border-border",a?"p-3":"p-4","bg-card",l),...c,children:w.jsxs("div",{className:"flex items-center justify-between gap-3",children:[w.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0 flex-1",children:[n&&w.jsx("div",{className:"flex-shrink-0",children:n}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsx("h1",{className:Re("font-semibold text-foreground truncate",a?"text-base":"text-base sm:text-lg"),children:e}),t&&w.jsx("p",{className:Re("text-xs text-muted-foreground truncate",a?"mt-0":"mt-0.5"),children:t})]})]}),r&&w.jsx("div",{className:"flex-shrink-0 hidden sm:block",children:r})]})}));g4.displayName="PageHeader";I.createContext(void 0);const y4=I.forwardRef(({className:e,children:t,...n},r)=>w.jsx("div",{ref:r,className:Re("relative overflow-hidden",e),...n,children:w.jsx("div",{className:"h-full w-full rounded-[inherit] overflow-auto",style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:t})}));y4.displayName="ScrollArea";const v4=I.forwardRef(({value:e,onChange:t,onClear:n,showSearchIcon:r=!0,showClearButton:o=!0,searchIcon:a,clearIcon:l,placeholder:c="Search...",className:d,...f},p)=>{const m=b=>{t(b.target.value)},y=()=>{n?n():t("")},v=e&&e.length>0;return w.jsxs("div",{className:"relative",children:[r&&w.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground pointer-events-none",children:a||w.jsx(vw,{className:"w-4 h-4"})}),w.jsx("input",{ref:p,type:"text",value:e,onChange:m,placeholder:c,className:Re("w-full h-9 rounded-md border border-input bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0","disabled:cursor-not-allowed disabled:opacity-50","transition-colors",r&&"pl-9",v&&o&&"pr-9",d),...f}),v&&o&&w.jsx("button",{type:"button",onClick:y,className:Re("absolute right-2 top-1/2 transform -translate-y-1/2","p-1 rounded hover:bg-accent transition-colors","text-muted-foreground hover:text-foreground"),"aria-label":"Clear search",children:l||w.jsx(p_,{className:"w-3 h-3"})})]})});v4.displayName="SearchInput";const x4=uc("inline-flex items-center justify-center rounded-lg p-1",{variants:{variant:{pills:"bg-muted",underline:"border-b border-border bg-transparent p-0"}},defaultVariants:{variant:"pills"}}),w4=uc("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{pills:"",underline:"rounded-none border-b-2 border-transparent"},active:{true:"",false:""}},compoundVariants:[{variant:"pills",active:!0,className:"bg-background text-foreground shadow-sm"},{variant:"pills",active:!1,className:"text-muted-foreground hover:text-foreground hover:bg-background/50"},{variant:"underline",active:!0,className:"border-primary text-foreground"},{variant:"underline",active:!1,className:"text-muted-foreground hover:text-foreground hover:border-border"}],defaultVariants:{variant:"pills",active:!1}}),b4=I.forwardRef(({tabs:e,activeTab:t,onTabChange:n,variant:r="pills",iconOnlyMobile:o=!1,className:a,...l},c)=>w.jsx("div",{ref:c,role:"tablist",className:Re(x4({variant:r}),a),...l,children:e.map(d=>{const f=d.id===t;return w.jsxs("button",{role:"tab",type:"button","aria-selected":f,"aria-controls":`tabpanel-${d.id}`,disabled:d.disabled,onClick:()=>!d.disabled&&n(d.id),className:Re(w4({variant:r,active:f})),children:[d.icon&&w.jsx("span",{className:"flex items-center justify-center w-4 h-4",children:d.icon}),d.label&&w.jsx("span",{className:Re(d.icon&&"ml-1.5",o&&"hidden sm:inline"),children:d.label})]},d.id)})}));b4.displayName="TabNavigation";function S4(e,t=new Date){const n=typeof e=="string"?new Date(e):e;if(isNaN(n.getTime()))return"Unknown";const r=t.getTime()-n.getTime(),o=Math.floor(r/1e3),a=Math.floor(r/(1e3*60)),l=Math.floor(r/(1e3*60*60)),c=Math.floor(r/(1e3*60*60*24));return o<60?"Just now":a===1?"1 min ago":a<60?`${a} mins ago`:l===1?"1 hour ago":l<24?`${l} hours ago`:c===1?"1 day ago":c<7?`${c} days ago`:n.toLocaleDateString()}const k4=I.forwardRef(({date:e,updateInterval:t=6e4,showTooltip:n=!0,className:r,...o},a)=>{const[l,c]=I.useState(new Date);I.useEffect(()=>{if(t<=0)return;const p=setInterval(()=>{c(new Date)},t);return()=>clearInterval(p)},[t]);const d=S4(e,l),f=I.useMemo(()=>{const p=typeof e=="string"?new Date(e):e;if(!isNaN(p.getTime()))return p.toLocaleString()},[e]);return w.jsx("span",{ref:a,className:Re("inline-block",r),title:n?f:void 0,...o,children:d})});k4.displayName="TimeAgo";function E4(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}class C4{constructor(){Zy(this,"emitter"),Zy(this,"debugMode",!1),this.emitter=E4()}emit(t,n){this.debugMode&&console.log("[EventBus]",t,n),this.emitter.emit(t,n)}on(t,n){this.emitter.on(t,n)}off(t,n){this.emitter.off(t,n)}onAll(t){this.emitter.on("*",t)}clear(){this.emitter.all.clear()}enableDebug(){this.debugMode=!0,typeof console<"u"&&console.log("[EventBus] Debug mode enabled")}disableDebug(){this.debugMode=!1,typeof console<"u"&&console.log("[EventBus] Debug mode disabled")}}new C4;typeof window<"u"&&setTimeout(()=>{},0);const Px="/agentx",I4=[{name:"Assistant",description:"AI Assistant powered by Claude",icon:"A",color:"bg-primary",isOnline:!0}];function T4(){return w.jsx("div",{className:"h-screen bg-background flex items-center justify-center",children:w.jsxs("div",{className:"text-center",children:[w.jsx("div",{className:"text-4xl mb-4 animate-pulse text-muted-foreground",children:"..."}),w.jsx("p",{className:"text-muted-foreground",children:"Connecting to server..."})]})})}function Ax({message:e,onRetry:t}){return w.jsx("div",{className:"h-screen bg-background flex items-center justify-center",children:w.jsxs("div",{className:"text-center p-8 max-w-md",children:[w.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Connection Error"}),w.jsx("p",{className:"text-muted-foreground mb-4",children:e}),w.jsx("button",{onClick:t,className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"Retry"})]})})}function _4({onLogout:e}){return w.jsxs("div",{className:"h-12 bg-card border-b border-border flex items-center justify-between px-4",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"text-lg font-semibold text-foreground",children:"Portagent"}),w.jsx("span",{className:"text-xs text-muted-foreground",children:"AgentX Portal"})]}),w.jsx("button",{onClick:e,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Sign Out"})]})}function P4(){const{user:e,logout:t}=nc(),[n,r]=I.useState(null),[o,a]=I.useState(null),[l,c]=I.useState(!0);I.useEffect(()=>{let f=!0;return(async()=>{try{const m=HC();if(!m){a("Not authenticated");return}if(!(await fetch(`${Px}/info`,{headers:{Authorization:`Bearer ${m}`}})).ok)throw new Error("Server returned error");if(!f)return;const v=FT(GT({serverUrl:Px,headers:{Authorization:`Bearer ${m}`},sseParams:{token:m}}));if(!f)return;r(v),a(null)}catch(m){if(!f)return;console.error("Connection error:",m),a("Cannot connect to server")}finally{f&&c(!1)}})(),()=>{f=!1}},[]);const d=()=>{c(!0),a(null),window.location.reload()};return l?w.jsx(T4,{}):o?w.jsx(Ax,{message:o,onRetry:d}):!n||!e?w.jsx(Ax,{message:"Failed to initialize",onRetry:d}):w.jsxs("div",{className:"h-screen flex flex-col bg-background",children:[w.jsx(_4,{onLogout:t}),w.jsx("div",{className:"flex-1 overflow-hidden",children:w.jsx(t4,{agentx:n,userId:e.userId,containerId:e.containerId,definitions:I4})})]})}function A4({children:e}){const{isAuthenticated:t,isLoading:n}=nc();return n?w.jsx("div",{className:"h-screen flex items-center justify-center bg-slate-900",children:w.jsx("div",{className:"text-slate-400",children:"Loading..."})}):t?w.jsx(w.Fragment,{children:e}):w.jsx(Hf,{to:"/login",replace:!0})}function R4(){return w.jsx(UC,{children:w.jsxs(oC,{children:[w.jsx(Js,{path:"/login",element:w.jsx(WC,{})}),w.jsx(Js,{path:"/register",element:w.jsx(qC,{})}),w.jsx(Js,{path:"/studio",element:w.jsx(A4,{children:w.jsx(P4,{})})}),w.jsx(Js,{path:"/",element:w.jsx(Hf,{to:"/studio",replace:!0})}),w.jsx(Js,{path:"*",element:w.jsx(Hf,{to:"/studio",replace:!0})})]})})}mE.createRoot(document.getElementById("root")).render(w.jsx(wr.StrictMode,{children:w.jsx(PC,{children:w.jsx(R4,{})})}));
245
+ //# sourceMappingURL=index-CRtZvfg5.js.map