@dendelion/paper-camp 0.17.0 → 0.17.1

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.
Files changed (29) hide show
  1. package/dist/app/assets/{index-CjPmPsf0.js → index-BXRfFWnQ.js} +3 -3
  2. package/dist/app/assets/{index-CjPmPsf0.js.map → index-BXRfFWnQ.js.map} +1 -1
  3. package/dist/app/assets/{index-6xeWffZg.js → index-BrriNOla.js} +2 -2
  4. package/dist/app/assets/{index-6xeWffZg.js.map → index-BrriNOla.js.map} +1 -1
  5. package/dist/app/assets/{index-CYxk5mrY.js → index-C4T8Gzjs.js} +2 -2
  6. package/dist/app/assets/{index-CYxk5mrY.js.map → index-C4T8Gzjs.js.map} +1 -1
  7. package/dist/app/assets/{index-DLgVuxp-.js → index-CSl9MOCi.js} +3 -3
  8. package/dist/app/assets/{index-DLgVuxp-.js.map → index-CSl9MOCi.js.map} +1 -1
  9. package/dist/app/assets/{index-B_yczIPZ.js → index-D0gBw6x1.js} +3 -3
  10. package/dist/app/assets/{index-B_yczIPZ.js.map → index-D0gBw6x1.js.map} +1 -1
  11. package/dist/app/assets/index-DJwR0UyW.js +2 -0
  12. package/dist/app/assets/index-DJwR0UyW.js.map +1 -0
  13. package/dist/app/assets/index-_tpcAf-k.js +2 -0
  14. package/dist/app/assets/index-_tpcAf-k.js.map +1 -0
  15. package/dist/app/assets/{main-DR2ma6V-.js → main-Zb7gEID9.js} +20 -20
  16. package/dist/app/assets/main-Zb7gEID9.js.map +1 -0
  17. package/dist/app/assets/{sidebar-section-DKgV3XAx.js → sidebar-section-DxUjM4Rm.js} +2 -2
  18. package/dist/app/assets/{sidebar-section-DKgV3XAx.js.map → sidebar-section-DxUjM4Rm.js.map} +1 -1
  19. package/dist/app/index.html +1 -1
  20. package/dist/app/toolbar.js +3889 -3974
  21. package/dist/app/toolbar.js.map +1 -1
  22. package/dist/cli/index.js +1 -0
  23. package/dist/cli/index.js.map +1 -1
  24. package/package.json +1 -1
  25. package/dist/app/assets/index-CASIH0vL.js +0 -2
  26. package/dist/app/assets/index-CASIH0vL.js.map +0 -1
  27. package/dist/app/assets/index-CnD1dVCC.js +0 -2
  28. package/dist/app/assets/index-CnD1dVCC.js.map +0 -1
  29. package/dist/app/assets/main-DR2ma6V-.js.map +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CYxk5mrY.js","./sidebar-section-DKgV3XAx.js","./index-CnD1dVCC.js","./tokens-C3C44lLs.js","./index-B_yczIPZ.js","./index-CASIH0vL.js"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var ec=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hv={exports:{}},Yc={},Gv={exports:{}},re={};/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-C4T8Gzjs.js","./sidebar-section-DxUjM4Rm.js","./index-_tpcAf-k.js","./tokens-C3C44lLs.js","./index-D0gBw6x1.js","./index-DJwR0UyW.js"])))=>i.map(i=>d[i]);
2
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var ec=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hv={exports:{}},Yc={},Gv={exports:{}},se={};/**
3
3
  * @license React
4
4
  * react.production.min.js
5
5
  *
@@ -7,7 +7,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CYxk5mrY.js","
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var pa=Symbol.for("react.element"),mC=Symbol.for("react.portal"),gC=Symbol.for("react.fragment"),yC=Symbol.for("react.strict_mode"),xC=Symbol.for("react.profiler"),vC=Symbol.for("react.provider"),wC=Symbol.for("react.context"),bC=Symbol.for("react.forward_ref"),kC=Symbol.for("react.suspense"),_C=Symbol.for("react.memo"),SC=Symbol.for("react.lazy"),ug=Symbol.iterator;function CC(e){return e===null||typeof e!="object"?null:(e=ug&&e[ug]||e["@@iterator"],typeof e=="function"?e:null)}var Kv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qv=Object.assign,qv={};function Li(e,t,n){this.props=e,this.context=t,this.refs=qv,this.updater=n||Kv}Li.prototype.isReactComponent={};Li.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Li.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yv(){}Yv.prototype=Li.prototype;function tp(e,t,n){this.props=e,this.context=t,this.refs=qv,this.updater=n||Kv}var np=tp.prototype=new Yv;np.constructor=tp;Qv(np,Li.prototype);np.isPureReactComponent=!0;var dg=Array.isArray,Xv=Object.prototype.hasOwnProperty,rp={current:null},Jv={key:!0,ref:!0,__self:!0,__source:!0};function Zv(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Xv.call(t,r)&&!Jv.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:pa,type:e,key:i,ref:o,props:s,_owner:rp.current}}function PC(e,t){return{$$typeof:pa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function sp(e){return typeof e=="object"&&e!==null&&e.$$typeof===pa}function jC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var fg=/\/+/g;function Ou(e,t){return typeof e=="object"&&e!==null&&e.key!=null?jC(""+e.key):t.toString(36)}function Cl(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case pa:case mC:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Ou(o,0):r,dg(s)?(n="",e!=null&&(n=e.replace(fg,"$&/")+"/"),Cl(s,t,n,"",function(c){return c})):s!=null&&(sp(s)&&(s=PC(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(fg,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",dg(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Ou(i,a);o+=Cl(i,t,n,l,s)}else if(l=CC(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Ou(i,a++),o+=Cl(i,t,n,l,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Da(e,t,n){if(e==null)return e;var r=[],s=0;return Cl(e,r,"","",function(i){return t.call(n,i,s++)}),r}function EC(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var dt={current:null},Pl={transition:null},TC={ReactCurrentDispatcher:dt,ReactCurrentBatchConfig:Pl,ReactCurrentOwner:rp};function e1(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:Da,forEach:function(e,t,n){Da(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Da(e,function(){t++}),t},toArray:function(e){return Da(e,function(t){return t})||[]},only:function(e){if(!sp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=Li;re.Fragment=gC;re.Profiler=xC;re.PureComponent=tp;re.StrictMode=yC;re.Suspense=kC;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TC;re.act=e1;re.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Qv({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=rp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Xv.call(t,l)&&!Jv.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:pa,type:e.type,key:s,ref:i,props:r,_owner:o}};re.createContext=function(e){return e={$$typeof:wC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vC,_context:e},e.Consumer=e};re.createElement=Zv;re.createFactory=function(e){var t=Zv.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:bC,render:e}};re.isValidElement=sp;re.lazy=function(e){return{$$typeof:SC,_payload:{_status:-1,_result:e},_init:EC}};re.memo=function(e,t){return{$$typeof:_C,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=Pl.transition;Pl.transition={};try{e()}finally{Pl.transition=t}};re.unstable_act=e1;re.useCallback=function(e,t){return dt.current.useCallback(e,t)};re.useContext=function(e){return dt.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return dt.current.useDeferredValue(e)};re.useEffect=function(e,t){return dt.current.useEffect(e,t)};re.useId=function(){return dt.current.useId()};re.useImperativeHandle=function(e,t,n){return dt.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return dt.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return dt.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return dt.current.useMemo(e,t)};re.useReducer=function(e,t,n){return dt.current.useReducer(e,t,n)};re.useRef=function(e){return dt.current.useRef(e)};re.useState=function(e){return dt.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return dt.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return dt.current.useTransition()};re.version="18.3.1";Gv.exports=re;var _=Gv.exports;const bi=qc(_);/**
10
+ */var pa=Symbol.for("react.element"),mC=Symbol.for("react.portal"),gC=Symbol.for("react.fragment"),yC=Symbol.for("react.strict_mode"),xC=Symbol.for("react.profiler"),vC=Symbol.for("react.provider"),wC=Symbol.for("react.context"),bC=Symbol.for("react.forward_ref"),kC=Symbol.for("react.suspense"),_C=Symbol.for("react.memo"),SC=Symbol.for("react.lazy"),ug=Symbol.iterator;function CC(e){return e===null||typeof e!="object"?null:(e=ug&&e[ug]||e["@@iterator"],typeof e=="function"?e:null)}var Kv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qv=Object.assign,qv={};function Li(e,t,n){this.props=e,this.context=t,this.refs=qv,this.updater=n||Kv}Li.prototype.isReactComponent={};Li.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Li.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yv(){}Yv.prototype=Li.prototype;function tp(e,t,n){this.props=e,this.context=t,this.refs=qv,this.updater=n||Kv}var np=tp.prototype=new Yv;np.constructor=tp;Qv(np,Li.prototype);np.isPureReactComponent=!0;var dg=Array.isArray,Xv=Object.prototype.hasOwnProperty,rp={current:null},Jv={key:!0,ref:!0,__self:!0,__source:!0};function Zv(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Xv.call(t,r)&&!Jv.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:pa,type:e,key:i,ref:o,props:s,_owner:rp.current}}function PC(e,t){return{$$typeof:pa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function sp(e){return typeof e=="object"&&e!==null&&e.$$typeof===pa}function jC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var fg=/\/+/g;function Ou(e,t){return typeof e=="object"&&e!==null&&e.key!=null?jC(""+e.key):t.toString(36)}function Cl(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case pa:case mC:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Ou(o,0):r,dg(s)?(n="",e!=null&&(n=e.replace(fg,"$&/")+"/"),Cl(s,t,n,"",function(c){return c})):s!=null&&(sp(s)&&(s=PC(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(fg,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",dg(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Ou(i,a);o+=Cl(i,t,n,l,s)}else if(l=CC(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Ou(i,a++),o+=Cl(i,t,n,l,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Da(e,t,n){if(e==null)return e;var r=[],s=0;return Cl(e,r,"","",function(i){return t.call(n,i,s++)}),r}function EC(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var dt={current:null},Pl={transition:null},TC={ReactCurrentDispatcher:dt,ReactCurrentBatchConfig:Pl,ReactCurrentOwner:rp};function e1(){throw Error("act(...) is not supported in production builds of React.")}se.Children={map:Da,forEach:function(e,t,n){Da(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Da(e,function(){t++}),t},toArray:function(e){return Da(e,function(t){return t})||[]},only:function(e){if(!sp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Component=Li;se.Fragment=gC;se.Profiler=xC;se.PureComponent=tp;se.StrictMode=yC;se.Suspense=kC;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TC;se.act=e1;se.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Qv({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=rp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Xv.call(t,l)&&!Jv.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:pa,type:e.type,key:s,ref:i,props:r,_owner:o}};se.createContext=function(e){return e={$$typeof:wC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vC,_context:e},e.Consumer=e};se.createElement=Zv;se.createFactory=function(e){var t=Zv.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:bC,render:e}};se.isValidElement=sp;se.lazy=function(e){return{$$typeof:SC,_payload:{_status:-1,_result:e},_init:EC}};se.memo=function(e,t){return{$$typeof:_C,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=Pl.transition;Pl.transition={};try{e()}finally{Pl.transition=t}};se.unstable_act=e1;se.useCallback=function(e,t){return dt.current.useCallback(e,t)};se.useContext=function(e){return dt.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return dt.current.useDeferredValue(e)};se.useEffect=function(e,t){return dt.current.useEffect(e,t)};se.useId=function(){return dt.current.useId()};se.useImperativeHandle=function(e,t,n){return dt.current.useImperativeHandle(e,t,n)};se.useInsertionEffect=function(e,t){return dt.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return dt.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return dt.current.useMemo(e,t)};se.useReducer=function(e,t,n){return dt.current.useReducer(e,t,n)};se.useRef=function(e){return dt.current.useRef(e)};se.useState=function(e){return dt.current.useState(e)};se.useSyncExternalStore=function(e,t,n){return dt.current.useSyncExternalStore(e,t,n)};se.useTransition=function(){return dt.current.useTransition()};se.version="18.3.1";Gv.exports=se;var _=Gv.exports;const bi=qc(_);/**
11
11
  * @license React
12
12
  * react-jsx-runtime.production.min.js
13
13
  *
@@ -23,7 +23,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CYxk5mrY.js","
23
23
  *
24
24
  * This source code is licensed under the MIT license found in the
25
25
  * LICENSE file in the root directory of this source tree.
26
- */(function(e){function t(A,B){var C=A.length;A.push(B);e:for(;0<C;){var $=C-1>>>1,Q=A[$];if(0<s(Q,B))A[$]=B,A[C]=Q,C=$;else break e}}function n(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var B=A[0],C=A.pop();if(C!==B){A[0]=C;e:for(var $=0,Q=A.length,N=Q>>>1;$<N;){var le=2*($+1)-1,fe=A[le],ue=le+1,jt=A[ue];if(0>s(fe,C))ue<Q&&0>s(jt,fe)?(A[$]=jt,A[ue]=C,$=ue):(A[$]=fe,A[le]=C,$=le);else if(ue<Q&&0>s(jt,C))A[$]=jt,A[ue]=C,$=ue;else break e}}return B}function s(A,B){var C=A.sortIndex-B.sortIndex;return C!==0?C:A.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,h=3,p=!1,m=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(A){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=A)r(c),B.sortIndex=B.expirationTime,t(l,B);else break;B=n(c)}}function b(A){if(y=!1,v(A),!m)if(n(l)!==null)m=!0,F(S);else{var B=n(c);B!==null&&V(b,B.startTime-A)}}function S(A,B){m=!1,y&&(y=!1,g(P),P=-1),p=!0;var C=h;try{for(v(B),d=n(l);d!==null&&(!(d.expirationTime>B)||A&&!I());){var $=d.callback;if(typeof $=="function"){d.callback=null,h=d.priorityLevel;var Q=$(d.expirationTime<=B);B=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(l)&&r(l),v(B)}else r(l);d=n(l)}if(d!==null)var N=!0;else{var le=n(c);le!==null&&V(b,le.startTime-B),N=!1}return N}finally{d=null,h=C,p=!1}}var k=!1,T=null,P=-1,R=5,j=-1;function I(){return!(e.unstable_now()-j<R)}function M(){if(T!==null){var A=e.unstable_now();j=A;var B=!0;try{B=T(!0,A)}finally{B?O():(k=!1,T=null)}}else k=!1}var O;if(typeof x=="function")O=function(){x(M)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,E=z.port2;z.port1.onmessage=M,O=function(){E.postMessage(null)}}else O=function(){w(M,0)};function F(A){T=A,k||(k=!0,O())}function V(A,B){P=w(function(){A(e.unstable_now())},B)}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(A){A.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,F(S))},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(A){switch(h){case 1:case 2:case 3:var B=3;break;default:B=h}var C=h;h=B;try{return A()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(A,B){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var C=h;h=A;try{return B()}finally{h=C}},e.unstable_scheduleCallback=function(A,B,C){var $=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?$+C:$):C=$,A){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=C+Q,A={id:u++,callback:B,priorityLevel:A,startTime:C,expirationTime:Q,sortIndex:-1},C>$?(A.sortIndex=C,t(c,A),n(l)===null&&A===n(c)&&(y?(g(P),P=-1):y=!0,V(b,C-$))):(A.sortIndex=Q,t(l,A),m||p||(m=!0,F(S))),A},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(A){var B=h;return function(){var C=h;h=B;try{return A.apply(this,arguments)}finally{h=C}}}})(s1);r1.exports=s1;var DC=r1.exports;/**
26
+ */(function(e){function t(A,B){var C=A.length;A.push(B);e:for(;0<C;){var $=C-1>>>1,q=A[$];if(0<s(q,B))A[$]=B,A[C]=q,C=$;else break e}}function n(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var B=A[0],C=A.pop();if(C!==B){A[0]=C;e:for(var $=0,q=A.length,N=q>>>1;$<N;){var ce=2*($+1)-1,he=A[ce],de=ce+1,jt=A[de];if(0>s(he,C))de<q&&0>s(jt,he)?(A[$]=jt,A[de]=C,$=de):(A[$]=he,A[ce]=C,$=ce);else if(de<q&&0>s(jt,C))A[$]=jt,A[de]=C,$=de;else break e}}return B}function s(A,B){var C=A.sortIndex-B.sortIndex;return C!==0?C:A.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,h=3,p=!1,m=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(A){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=A)r(c),B.sortIndex=B.expirationTime,t(l,B);else break;B=n(c)}}function b(A){if(y=!1,v(A),!m)if(n(l)!==null)m=!0,F(S);else{var B=n(c);B!==null&&V(b,B.startTime-A)}}function S(A,B){m=!1,y&&(y=!1,g(P),P=-1),p=!0;var C=h;try{for(v(B),d=n(l);d!==null&&(!(d.expirationTime>B)||A&&!I());){var $=d.callback;if(typeof $=="function"){d.callback=null,h=d.priorityLevel;var q=$(d.expirationTime<=B);B=e.unstable_now(),typeof q=="function"?d.callback=q:d===n(l)&&r(l),v(B)}else r(l);d=n(l)}if(d!==null)var N=!0;else{var ce=n(c);ce!==null&&V(b,ce.startTime-B),N=!1}return N}finally{d=null,h=C,p=!1}}var k=!1,T=null,P=-1,R=5,j=-1;function I(){return!(e.unstable_now()-j<R)}function M(){if(T!==null){var A=e.unstable_now();j=A;var B=!0;try{B=T(!0,A)}finally{B?O():(k=!1,T=null)}}else k=!1}var O;if(typeof x=="function")O=function(){x(M)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,E=z.port2;z.port1.onmessage=M,O=function(){E.postMessage(null)}}else O=function(){w(M,0)};function F(A){T=A,k||(k=!0,O())}function V(A,B){P=w(function(){A(e.unstable_now())},B)}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(A){A.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,F(S))},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(A){switch(h){case 1:case 2:case 3:var B=3;break;default:B=h}var C=h;h=B;try{return A()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(A,B){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var C=h;h=A;try{return B()}finally{h=C}},e.unstable_scheduleCallback=function(A,B,C){var $=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?$+C:$):C=$,A){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=C+q,A={id:u++,callback:B,priorityLevel:A,startTime:C,expirationTime:q,sortIndex:-1},C>$?(A.sortIndex=C,t(c,A),n(l)===null&&A===n(c)&&(y?(g(P),P=-1):y=!0,V(b,C-$))):(A.sortIndex=q,t(l,A),m||p||(m=!0,F(S))),A},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(A){var B=h;return function(){var C=h;h=B;try{return A.apply(this,arguments)}finally{h=C}}}})(s1);r1.exports=s1;var DC=r1.exports;/**
27
27
  * @license React
28
28
  * react-dom.production.min.js
29
29
  *
@@ -31,14 +31,14 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CYxk5mrY.js","
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
34
- */var FC=_,Ft=DC;function U(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i1=new Set,Vo={};function Ns(e,t){ki(e,t),ki(e+"Capture",t)}function ki(e,t){for(Vo[e]=t,e=0;e<t.length;e++)i1.add(t[e])}var tr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pf=Object.prototype.hasOwnProperty,OC=/^[: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]*$/,hg={},pg={};function zC(e){return pf.call(pg,e)?!0:pf.call(hg,e)?!1:OC.test(e)?pg[e]=!0:(hg[e]=!0,!1)}function $C(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function BC(e,t,n,r){if(t===null||typeof t>"u"||$C(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ft(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Je[e]=new ft(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Je[t]=new ft(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Je[e]=new ft(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Je[e]=new ft(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Je[e]=new ft(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Je[e]=new ft(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Je[e]=new ft(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Je[e]=new ft(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Je[e]=new ft(e,5,!1,e.toLowerCase(),null,!1,!1)});var ip=/[\-:]([a-z])/g;function op(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ip,op);Je[t]=new ft(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ip,op);Je[t]=new ft(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ip,op);Je[t]=new ft(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Je[e]=new ft(e,1,!1,e.toLowerCase(),null,!1,!1)});Je.xlinkHref=new ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Je[e]=new ft(e,1,!1,e.toLowerCase(),null,!0,!0)});function ap(e,t,n,r){var s=Je.hasOwnProperty(t)?Je[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(BC(t,n,s,r)&&(n=null),r||s===null?zC(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var or=FC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fa=Symbol.for("react.element"),Ys=Symbol.for("react.portal"),Xs=Symbol.for("react.fragment"),lp=Symbol.for("react.strict_mode"),mf=Symbol.for("react.profiler"),o1=Symbol.for("react.provider"),a1=Symbol.for("react.context"),cp=Symbol.for("react.forward_ref"),gf=Symbol.for("react.suspense"),yf=Symbol.for("react.suspense_list"),up=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),l1=Symbol.for("react.offscreen"),mg=Symbol.iterator;function Xi(e){return e===null||typeof e!="object"?null:(e=mg&&e[mg]||e["@@iterator"],typeof e=="function"?e:null)}var Re=Object.assign,zu;function vo(e){if(zu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zu=t&&t[1]||""}return`
34
+ */var FC=_,Ft=DC;function U(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i1=new Set,Vo={};function Ns(e,t){ki(e,t),ki(e+"Capture",t)}function ki(e,t){for(Vo[e]=t,e=0;e<t.length;e++)i1.add(t[e])}var tr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pf=Object.prototype.hasOwnProperty,OC=/^[: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]*$/,hg={},pg={};function zC(e){return pf.call(pg,e)?!0:pf.call(hg,e)?!1:OC.test(e)?pg[e]=!0:(hg[e]=!0,!1)}function $C(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function BC(e,t,n,r){if(t===null||typeof t>"u"||$C(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ft(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ze[e]=new ft(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ze[t]=new ft(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ze[e]=new ft(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ze[e]=new ft(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ze[e]=new ft(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ze[e]=new ft(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ze[e]=new ft(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ze[e]=new ft(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ze[e]=new ft(e,5,!1,e.toLowerCase(),null,!1,!1)});var ip=/[\-:]([a-z])/g;function op(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ip,op);Ze[t]=new ft(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ip,op);Ze[t]=new ft(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ip,op);Ze[t]=new ft(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ze[e]=new ft(e,1,!1,e.toLowerCase(),null,!1,!1)});Ze.xlinkHref=new ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ze[e]=new ft(e,1,!1,e.toLowerCase(),null,!0,!0)});function ap(e,t,n,r){var s=Ze.hasOwnProperty(t)?Ze[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(BC(t,n,s,r)&&(n=null),r||s===null?zC(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var or=FC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fa=Symbol.for("react.element"),Ys=Symbol.for("react.portal"),Xs=Symbol.for("react.fragment"),lp=Symbol.for("react.strict_mode"),mf=Symbol.for("react.profiler"),o1=Symbol.for("react.provider"),a1=Symbol.for("react.context"),cp=Symbol.for("react.forward_ref"),gf=Symbol.for("react.suspense"),yf=Symbol.for("react.suspense_list"),up=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),l1=Symbol.for("react.offscreen"),mg=Symbol.iterator;function Xi(e){return e===null||typeof e!="object"?null:(e=mg&&e[mg]||e["@@iterator"],typeof e=="function"?e:null)}var Ne=Object.assign,zu;function vo(e){if(zu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zu=t&&t[1]||""}return`
35
35
  `+zu+e}var $u=!1;function Bu(e,t){if(!e||$u)return"";$u=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
36
36
  `),i=r.stack.split(`
37
37
  `),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
38
- `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{$u=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?vo(e):""}function VC(e){switch(e.tag){case 5:return vo(e.type);case 16:return vo("Lazy");case 13:return vo("Suspense");case 19:return vo("SuspenseList");case 0:case 2:case 15:return e=Bu(e.type,!1),e;case 11:return e=Bu(e.type.render,!1),e;case 1:return e=Bu(e.type,!0),e;default:return""}}function xf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Xs:return"Fragment";case Ys:return"Portal";case mf:return"Profiler";case lp:return"StrictMode";case gf:return"Suspense";case yf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a1:return(e.displayName||"Context")+".Consumer";case o1:return(e._context.displayName||"Context")+".Provider";case cp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case up:return t=e.displayName||null,t!==null?t:xf(e.type)||"Memo";case wr:t=e._payload,e=e._init;try{return xf(e(t))}catch{}}return null}function UC(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xf(t);case 8:return t===lp?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function c1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function WC(e){var t=c1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oa(e){e._valueTracker||(e._valueTracker=WC(e))}function u1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=c1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function tc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function vf(e,t){var n=t.checked;return Re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function d1(e,t){t=t.checked,t!=null&&ap(e,"checked",t,!1)}function wf(e,t){d1(e,t);var n=Vr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?bf(e,t.type,n):t.hasOwnProperty("defaultValue")&&bf(e,t.type,Vr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yg(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function bf(e,t,n){(t!=="number"||tc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wo=Array.isArray;function fi(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function kf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return Re({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function xg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(U(92));if(wo(n)){if(1<n.length)throw Error(U(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vr(n)}}function f1(e,t){var n=Vr(t.value),r=Vr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function vg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function h1(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function _f(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?h1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var za,p1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(za=za||document.createElement("div"),za.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=za.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Uo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Co={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},HC=["Webkit","ms","Moz","O"];Object.keys(Co).forEach(function(e){HC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Co[t]=Co[e]})});function m1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Co.hasOwnProperty(e)&&Co[e]?(""+t).trim():t+"px"}function g1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=m1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var GC=Re({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 Sf(e,t){if(t){if(GC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function Cf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pf=null;function dp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jf=null,hi=null,pi=null;function wg(e){if(e=ya(e)){if(typeof jf!="function")throw Error(U(280));var t=e.stateNode;t&&(t=tu(t),jf(e.stateNode,e.type,t))}}function y1(e){hi?pi?pi.push(e):pi=[e]:hi=e}function x1(){if(hi){var e=hi,t=pi;if(pi=hi=null,wg(e),t)for(e=0;e<t.length;e++)wg(t[e])}}function v1(e,t){return e(t)}function w1(){}var Vu=!1;function b1(e,t,n){if(Vu)return e(t,n);Vu=!0;try{return v1(e,t,n)}finally{Vu=!1,(hi!==null||pi!==null)&&(w1(),x1())}}function Wo(e,t){var n=e.stateNode;if(n===null)return null;var r=tu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(U(231,t,typeof n));return n}var Ef=!1;if(tr)try{var Ji={};Object.defineProperty(Ji,"passive",{get:function(){Ef=!0}}),window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{Ef=!1}function KC(e,t,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Po=!1,nc=null,rc=!1,Tf=null,QC={onError:function(e){Po=!0,nc=e}};function qC(e,t,n,r,s,i,o,a,l){Po=!1,nc=null,KC.apply(QC,arguments)}function YC(e,t,n,r,s,i,o,a,l){if(qC.apply(this,arguments),Po){if(Po){var c=nc;Po=!1,nc=null}else throw Error(U(198));rc||(rc=!0,Tf=c)}}function Is(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function k1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function bg(e){if(Is(e)!==e)throw Error(U(188))}function XC(e){var t=e.alternate;if(!t){if(t=Is(e),t===null)throw Error(U(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return bg(s),e;if(i===r)return bg(s),t;i=i.sibling}throw Error(U(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?e:t}function _1(e){return e=XC(e),e!==null?S1(e):null}function S1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=S1(e);if(t!==null)return t;e=e.sibling}return null}var C1=Ft.unstable_scheduleCallback,kg=Ft.unstable_cancelCallback,JC=Ft.unstable_shouldYield,ZC=Ft.unstable_requestPaint,Le=Ft.unstable_now,eP=Ft.unstable_getCurrentPriorityLevel,fp=Ft.unstable_ImmediatePriority,P1=Ft.unstable_UserBlockingPriority,sc=Ft.unstable_NormalPriority,tP=Ft.unstable_LowPriority,j1=Ft.unstable_IdlePriority,Xc=null,In=null;function nP(e){if(In&&typeof In.onCommitFiberRoot=="function")try{In.onCommitFiberRoot(Xc,e,void 0,(e.current.flags&128)===128)}catch{}}var mn=Math.clz32?Math.clz32:iP,rP=Math.log,sP=Math.LN2;function iP(e){return e>>>=0,e===0?32:31-(rP(e)/sP|0)|0}var $a=64,Ba=4194304;function bo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ic(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=bo(a):(i&=o,i!==0&&(r=bo(i)))}else o=n&~s,o!==0?r=bo(o):i!==0&&(r=bo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-mn(t),s=1<<n,r|=e[n],t&=~s;return r}function oP(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 aP(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-mn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=oP(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Rf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function E1(){var e=$a;return $a<<=1,!($a&4194240)&&($a=64),e}function Uu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ma(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mn(t),e[t]=n}function lP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-mn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function hp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-mn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ce=0;function T1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var R1,pp,N1,I1,M1,Nf=!1,Va=[],Ir=null,Mr=null,Ar=null,Ho=new Map,Go=new Map,_r=[],cP="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 _g(e,t){switch(e){case"focusin":case"focusout":Ir=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":Ho.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(t.pointerId)}}function Zi(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=ya(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function uP(e,t,n,r,s){switch(t){case"focusin":return Ir=Zi(Ir,e,t,n,r,s),!0;case"dragenter":return Mr=Zi(Mr,e,t,n,r,s),!0;case"mouseover":return Ar=Zi(Ar,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Ho.set(i,Zi(Ho.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Go.set(i,Zi(Go.get(i)||null,e,t,n,r,s)),!0}return!1}function A1(e){var t=ds(e.target);if(t!==null){var n=Is(t);if(n!==null){if(t=n.tag,t===13){if(t=k1(n),t!==null){e.blockedOn=t,M1(e.priority,function(){N1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=If(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Pf=r,n.target.dispatchEvent(r),Pf=null}else return t=ya(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function Sg(e,t,n){jl(e)&&n.delete(t)}function dP(){Nf=!1,Ir!==null&&jl(Ir)&&(Ir=null),Mr!==null&&jl(Mr)&&(Mr=null),Ar!==null&&jl(Ar)&&(Ar=null),Ho.forEach(Sg),Go.forEach(Sg)}function eo(e,t){e.blockedOn===t&&(e.blockedOn=null,Nf||(Nf=!0,Ft.unstable_scheduleCallback(Ft.unstable_NormalPriority,dP)))}function Ko(e){function t(s){return eo(s,e)}if(0<Va.length){eo(Va[0],e);for(var n=1;n<Va.length;n++){var r=Va[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ir!==null&&eo(Ir,e),Mr!==null&&eo(Mr,e),Ar!==null&&eo(Ar,e),Ho.forEach(t),Go.forEach(t),n=0;n<_r.length;n++)r=_r[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<_r.length&&(n=_r[0],n.blockedOn===null);)A1(n),n.blockedOn===null&&_r.shift()}var mi=or.ReactCurrentBatchConfig,oc=!0;function fP(e,t,n,r){var s=ce,i=mi.transition;mi.transition=null;try{ce=1,mp(e,t,n,r)}finally{ce=s,mi.transition=i}}function hP(e,t,n,r){var s=ce,i=mi.transition;mi.transition=null;try{ce=4,mp(e,t,n,r)}finally{ce=s,mi.transition=i}}function mp(e,t,n,r){if(oc){var s=If(e,t,n,r);if(s===null)Zu(e,t,r,ac,n),_g(e,r);else if(uP(s,e,t,n,r))r.stopPropagation();else if(_g(e,r),t&4&&-1<cP.indexOf(e)){for(;s!==null;){var i=ya(s);if(i!==null&&R1(i),i=If(e,t,n,r),i===null&&Zu(e,t,r,ac,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Zu(e,t,r,null,n)}}var ac=null;function If(e,t,n,r){if(ac=null,e=dp(r),e=ds(e),e!==null)if(t=Is(e),t===null)e=null;else if(n=t.tag,n===13){if(e=k1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ac=e,null}function L1(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(eP()){case fp:return 1;case P1:return 4;case sc:case tP:return 16;case j1:return 536870912;default:return 16}default:return 16}}var Cr=null,gp=null,El=null;function D1(){if(El)return El;var e,t=gp,n=t.length,r,s="value"in Cr?Cr.value:Cr.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return El=s.slice(e,1<r?1-r:void 0)}function Tl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ua(){return!0}function Cg(){return!1}function zt(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ua:Cg,this.isPropagationStopped=Cg,this}return Re(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ua)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ua)},persist:function(){},isPersistent:Ua}),t}var Di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yp=zt(Di),ga=Re({},Di,{view:0,detail:0}),pP=zt(ga),Wu,Hu,to,Jc=Re({},ga,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==to&&(to&&e.type==="mousemove"?(Wu=e.screenX-to.screenX,Hu=e.screenY-to.screenY):Hu=Wu=0,to=e),Wu)},movementY:function(e){return"movementY"in e?e.movementY:Hu}}),Pg=zt(Jc),mP=Re({},Jc,{dataTransfer:0}),gP=zt(mP),yP=Re({},ga,{relatedTarget:0}),Gu=zt(yP),xP=Re({},Di,{animationName:0,elapsedTime:0,pseudoElement:0}),vP=zt(xP),wP=Re({},Di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bP=zt(wP),kP=Re({},Di,{data:0}),jg=zt(kP),_P={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SP={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"},CP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function PP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=CP[e])?!!t[e]:!1}function xp(){return PP}var jP=Re({},ga,{key:function(e){if(e.key){var t=_P[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Tl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?SP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xp,charCode:function(e){return e.type==="keypress"?Tl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Tl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),EP=zt(jP),TP=Re({},Jc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Eg=zt(TP),RP=Re({},ga,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xp}),NP=zt(RP),IP=Re({},Di,{propertyName:0,elapsedTime:0,pseudoElement:0}),MP=zt(IP),AP=Re({},Jc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),LP=zt(AP),DP=[9,13,27,32],vp=tr&&"CompositionEvent"in window,jo=null;tr&&"documentMode"in document&&(jo=document.documentMode);var FP=tr&&"TextEvent"in window&&!jo,F1=tr&&(!vp||jo&&8<jo&&11>=jo),Tg=" ",Rg=!1;function O1(e,t){switch(e){case"keyup":return DP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function z1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Js=!1;function OP(e,t){switch(e){case"compositionend":return z1(t);case"keypress":return t.which!==32?null:(Rg=!0,Tg);case"textInput":return e=t.data,e===Tg&&Rg?null:e;default:return null}}function zP(e,t){if(Js)return e==="compositionend"||!vp&&O1(e,t)?(e=D1(),El=gp=Cr=null,Js=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return F1&&t.locale!=="ko"?null:t.data;default:return null}}var $P={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 Ng(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$P[e.type]:t==="textarea"}function $1(e,t,n,r){y1(r),t=lc(t,"onChange"),0<t.length&&(n=new yp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Eo=null,Qo=null;function BP(e){X1(e,0)}function Zc(e){var t=ti(e);if(u1(t))return e}function VP(e,t){if(e==="change")return t}var B1=!1;if(tr){var Ku;if(tr){var Qu="oninput"in document;if(!Qu){var Ig=document.createElement("div");Ig.setAttribute("oninput","return;"),Qu=typeof Ig.oninput=="function"}Ku=Qu}else Ku=!1;B1=Ku&&(!document.documentMode||9<document.documentMode)}function Mg(){Eo&&(Eo.detachEvent("onpropertychange",V1),Qo=Eo=null)}function V1(e){if(e.propertyName==="value"&&Zc(Qo)){var t=[];$1(t,Qo,e,dp(e)),b1(BP,t)}}function UP(e,t,n){e==="focusin"?(Mg(),Eo=t,Qo=n,Eo.attachEvent("onpropertychange",V1)):e==="focusout"&&Mg()}function WP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zc(Qo)}function HP(e,t){if(e==="click")return Zc(t)}function GP(e,t){if(e==="input"||e==="change")return Zc(t)}function KP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xn=typeof Object.is=="function"?Object.is:KP;function qo(e,t){if(xn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!pf.call(t,s)||!xn(e[s],t[s]))return!1}return!0}function Ag(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lg(e,t){var n=Ag(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ag(n)}}function U1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?U1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function W1(){for(var e=window,t=tc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=tc(e.document)}return t}function wp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function QP(e){var t=W1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&U1(n.ownerDocument.documentElement,n)){if(r!==null&&wp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Lg(n,i);var o=Lg(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qP=tr&&"documentMode"in document&&11>=document.documentMode,Zs=null,Mf=null,To=null,Af=!1;function Dg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Af||Zs==null||Zs!==tc(r)||(r=Zs,"selectionStart"in r&&wp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),To&&qo(To,r)||(To=r,r=lc(Mf,"onSelect"),0<r.length&&(t=new yp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zs)))}function Wa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ei={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionend:Wa("Transition","TransitionEnd")},qu={},H1={};tr&&(H1=document.createElement("div").style,"AnimationEvent"in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),"TransitionEvent"in window||delete ei.transitionend.transition);function eu(e){if(qu[e])return qu[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in H1)return qu[e]=t[n];return e}var G1=eu("animationend"),K1=eu("animationiteration"),Q1=eu("animationstart"),q1=eu("transitionend"),Y1=new Map,Fg="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 Kr(e,t){Y1.set(e,t),Ns(t,[e])}for(var Yu=0;Yu<Fg.length;Yu++){var Xu=Fg[Yu],YP=Xu.toLowerCase(),XP=Xu[0].toUpperCase()+Xu.slice(1);Kr(YP,"on"+XP)}Kr(G1,"onAnimationEnd");Kr(K1,"onAnimationIteration");Kr(Q1,"onAnimationStart");Kr("dblclick","onDoubleClick");Kr("focusin","onFocus");Kr("focusout","onBlur");Kr(q1,"onTransitionEnd");ki("onMouseEnter",["mouseout","mouseover"]);ki("onMouseLeave",["mouseout","mouseover"]);ki("onPointerEnter",["pointerout","pointerover"]);ki("onPointerLeave",["pointerout","pointerover"]);Ns("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ns("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ns("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ns("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ns("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ns("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ko="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(" "),JP=new Set("cancel close invalid load scroll toggle".split(" ").concat(ko));function Og(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,YC(r,t,void 0,e),e.currentTarget=null}function X1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;Og(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;Og(s,a,c),i=l}}}if(rc)throw e=Tf,rc=!1,Tf=null,e}function be(e,t){var n=t[zf];n===void 0&&(n=t[zf]=new Set);var r=e+"__bubble";n.has(r)||(J1(t,e,2,!1),n.add(r))}function Ju(e,t,n){var r=0;t&&(r|=4),J1(n,e,r,t)}var Ha="_reactListening"+Math.random().toString(36).slice(2);function Yo(e){if(!e[Ha]){e[Ha]=!0,i1.forEach(function(n){n!=="selectionchange"&&(JP.has(n)||Ju(n,!1,e),Ju(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ha]||(t[Ha]=!0,Ju("selectionchange",!1,t))}}function J1(e,t,n,r){switch(L1(t)){case 1:var s=fP;break;case 4:s=hP;break;default:s=mp}n=s.bind(null,t,n,e),s=void 0,!Ef||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Zu(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=ds(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}b1(function(){var c=i,u=dp(n),d=[];e:{var h=Y1.get(e);if(h!==void 0){var p=yp,m=e;switch(e){case"keypress":if(Tl(n)===0)break e;case"keydown":case"keyup":p=EP;break;case"focusin":m="focus",p=Gu;break;case"focusout":m="blur",p=Gu;break;case"beforeblur":case"afterblur":p=Gu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Pg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=gP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=NP;break;case G1:case K1:case Q1:p=vP;break;case q1:p=MP;break;case"scroll":p=pP;break;case"wheel":p=LP;break;case"copy":case"cut":case"paste":p=bP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Eg}var y=(t&4)!==0,w=!y&&e==="scroll",g=y?h!==null?h+"Capture":null:h;y=[];for(var x=c,v;x!==null;){v=x;var b=v.stateNode;if(v.tag===5&&b!==null&&(v=b,g!==null&&(b=Wo(x,g),b!=null&&y.push(Xo(x,b,v)))),w)break;x=x.return}0<y.length&&(h=new p(h,m,null,n,u),d.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Pf&&(m=n.relatedTarget||n.fromElement)&&(ds(m)||m[nr]))break e;if((p||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?ds(m):null,m!==null&&(w=Is(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(y=Pg,b="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=Eg,b="onPointerLeave",g="onPointerEnter",x="pointer"),w=p==null?h:ti(p),v=m==null?h:ti(m),h=new y(b,x+"leave",p,n,u),h.target=w,h.relatedTarget=v,b=null,ds(u)===c&&(y=new y(g,x+"enter",m,n,u),y.target=v,y.relatedTarget=w,b=y),w=b,p&&m)t:{for(y=p,g=m,x=0,v=y;v;v=zs(v))x++;for(v=0,b=g;b;b=zs(b))v++;for(;0<x-v;)y=zs(y),x--;for(;0<v-x;)g=zs(g),v--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=zs(y),g=zs(g)}y=null}else y=null;p!==null&&zg(d,h,p,y,!1),m!==null&&w!==null&&zg(d,w,m,y,!0)}}e:{if(h=c?ti(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=VP;else if(Ng(h))if(B1)S=GP;else{S=WP;var k=UP}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=HP);if(S&&(S=S(e,c))){$1(d,S,n,u);break e}k&&k(e,h,c),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&bf(h,"number",h.value)}switch(k=c?ti(c):window,e){case"focusin":(Ng(k)||k.contentEditable==="true")&&(Zs=k,Mf=c,To=null);break;case"focusout":To=Mf=Zs=null;break;case"mousedown":Af=!0;break;case"contextmenu":case"mouseup":case"dragend":Af=!1,Dg(d,n,u);break;case"selectionchange":if(qP)break;case"keydown":case"keyup":Dg(d,n,u)}var T;if(vp)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Js?O1(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(F1&&n.locale!=="ko"&&(Js||P!=="onCompositionStart"?P==="onCompositionEnd"&&Js&&(T=D1()):(Cr=u,gp="value"in Cr?Cr.value:Cr.textContent,Js=!0)),k=lc(c,P),0<k.length&&(P=new jg(P,e,null,n,u),d.push({event:P,listeners:k}),T?P.data=T:(T=z1(n),T!==null&&(P.data=T)))),(T=FP?OP(e,n):zP(e,n))&&(c=lc(c,"onBeforeInput"),0<c.length&&(u=new jg("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=T))}X1(d,t)})}function Xo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function lc(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Wo(e,n),i!=null&&r.unshift(Xo(e,i,s)),i=Wo(e,t),i!=null&&r.push(Xo(e,i,s))),e=e.return}return r}function zs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function zg(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=Wo(n,i),l!=null&&o.unshift(Xo(n,l,a))):s||(l=Wo(n,i),l!=null&&o.push(Xo(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ZP=/\r\n?/g,ej=/\u0000|\uFFFD/g;function $g(e){return(typeof e=="string"?e:""+e).replace(ZP,`
39
- `).replace(ej,"")}function Ga(e,t,n){if(t=$g(t),$g(e)!==t&&n)throw Error(U(425))}function cc(){}var Lf=null,Df=null;function Ff(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Of=typeof setTimeout=="function"?setTimeout:void 0,tj=typeof clearTimeout=="function"?clearTimeout:void 0,Bg=typeof Promise=="function"?Promise:void 0,nj=typeof queueMicrotask=="function"?queueMicrotask:typeof Bg<"u"?function(e){return Bg.resolve(null).then(e).catch(rj)}:Of;function rj(e){setTimeout(function(){throw e})}function ed(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Ko(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Ko(t)}function Lr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Vg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Fi=Math.random().toString(36).slice(2),Rn="__reactFiber$"+Fi,Jo="__reactProps$"+Fi,nr="__reactContainer$"+Fi,zf="__reactEvents$"+Fi,sj="__reactListeners$"+Fi,ij="__reactHandles$"+Fi;function ds(e){var t=e[Rn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nr]||n[Rn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Vg(e);e!==null;){if(n=e[Rn])return n;e=Vg(e)}return t}e=n,n=e.parentNode}return null}function ya(e){return e=e[Rn]||e[nr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ti(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function tu(e){return e[Jo]||null}var $f=[],ni=-1;function Qr(e){return{current:e}}function ke(e){0>ni||(e.current=$f[ni],$f[ni]=null,ni--)}function xe(e,t){ni++,$f[ni]=e.current,e.current=t}var Ur={},it=Qr(Ur),xt=Qr(!1),Cs=Ur;function _i(e,t){var n=e.type.contextTypes;if(!n)return Ur;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function vt(e){return e=e.childContextTypes,e!=null}function uc(){ke(xt),ke(it)}function Ug(e,t,n){if(it.current!==Ur)throw Error(U(168));xe(it,t),xe(xt,n)}function Z1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(U(108,UC(e)||"Unknown",s));return Re({},n,r)}function dc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ur,Cs=it.current,xe(it,e),xe(xt,xt.current),!0}function Wg(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=Z1(e,t,Cs),r.__reactInternalMemoizedMergedChildContext=e,ke(xt),ke(it),xe(it,e)):ke(xt),xe(xt,n)}var Kn=null,nu=!1,td=!1;function ew(e){Kn===null?Kn=[e]:Kn.push(e)}function oj(e){nu=!0,ew(e)}function qr(){if(!td&&Kn!==null){td=!0;var e=0,t=ce;try{var n=Kn;for(ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Kn=null,nu=!1}catch(s){throw Kn!==null&&(Kn=Kn.slice(e+1)),C1(fp,qr),s}finally{ce=t,td=!1}}return null}var ri=[],si=0,fc=null,hc=0,Gt=[],Kt=0,Ps=null,Xn=1,Jn="";function os(e,t){ri[si++]=hc,ri[si++]=fc,fc=e,hc=t}function tw(e,t,n){Gt[Kt++]=Xn,Gt[Kt++]=Jn,Gt[Kt++]=Ps,Ps=e;var r=Xn;e=Jn;var s=32-mn(r)-1;r&=~(1<<s),n+=1;var i=32-mn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Xn=1<<32-mn(t)+s|n<<s|r,Jn=i+e}else Xn=1<<i|n<<s|r,Jn=e}function bp(e){e.return!==null&&(os(e,1),tw(e,1,0))}function kp(e){for(;e===fc;)fc=ri[--si],ri[si]=null,hc=ri[--si],ri[si]=null;for(;e===Ps;)Ps=Gt[--Kt],Gt[Kt]=null,Jn=Gt[--Kt],Gt[Kt]=null,Xn=Gt[--Kt],Gt[Kt]=null}var Lt=null,Mt=null,Ce=!1,pn=null;function nw(e,t){var n=qt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Hg(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Lt=e,Mt=Lr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Lt=e,Mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ps!==null?{id:Xn,overflow:Jn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=qt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Lt=e,Mt=null,!0):!1;default:return!1}}function Bf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vf(e){if(Ce){var t=Mt;if(t){var n=t;if(!Hg(e,t)){if(Bf(e))throw Error(U(418));t=Lr(n.nextSibling);var r=Lt;t&&Hg(e,t)?nw(r,n):(e.flags=e.flags&-4097|2,Ce=!1,Lt=e)}}else{if(Bf(e))throw Error(U(418));e.flags=e.flags&-4097|2,Ce=!1,Lt=e}}}function Gg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Lt=e}function Ka(e){if(e!==Lt)return!1;if(!Ce)return Gg(e),Ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ff(e.type,e.memoizedProps)),t&&(t=Mt)){if(Bf(e))throw rw(),Error(U(418));for(;t;)nw(e,t),t=Lr(t.nextSibling)}if(Gg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Mt=Lr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mt=null}}else Mt=Lt?Lr(e.stateNode.nextSibling):null;return!0}function rw(){for(var e=Mt;e;)e=Lr(e.nextSibling)}function Si(){Mt=Lt=null,Ce=!1}function _p(e){pn===null?pn=[e]:pn.push(e)}var aj=or.ReactCurrentBatchConfig;function no(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(U(309));var r=n.stateNode}if(!r)throw Error(U(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,e))}return e}function Qa(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Kg(e){var t=e._init;return t(e._payload)}function sw(e){function t(g,x){if(e){var v=g.deletions;v===null?(g.deletions=[x],g.flags|=16):v.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function s(g,x){return g=zr(g,x),g.index=0,g.sibling=null,g}function i(g,x,v){return g.index=v,e?(v=g.alternate,v!==null?(v=v.index,v<x?(g.flags|=2,x):v):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,x,v,b){return x===null||x.tag!==6?(x=ld(v,g.mode,b),x.return=g,x):(x=s(x,v),x.return=g,x)}function l(g,x,v,b){var S=v.type;return S===Xs?u(g,x,v.props.children,b,v.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&Kg(S)===x.type)?(b=s(x,v.props),b.ref=no(g,x,v),b.return=g,b):(b=Dl(v.type,v.key,v.props,null,g.mode,b),b.ref=no(g,x,v),b.return=g,b)}function c(g,x,v,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=cd(v,g.mode,b),x.return=g,x):(x=s(x,v.children||[]),x.return=g,x)}function u(g,x,v,b,S){return x===null||x.tag!==7?(x=xs(v,g.mode,b,S),x.return=g,x):(x=s(x,v),x.return=g,x)}function d(g,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=ld(""+x,g.mode,v),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Fa:return v=Dl(x.type,x.key,x.props,null,g.mode,v),v.ref=no(g,null,x),v.return=g,v;case Ys:return x=cd(x,g.mode,v),x.return=g,x;case wr:var b=x._init;return d(g,b(x._payload),v)}if(wo(x)||Xi(x))return x=xs(x,g.mode,v,null),x.return=g,x;Qa(g,x)}return null}function h(g,x,v,b){var S=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return S!==null?null:a(g,x,""+v,b);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Fa:return v.key===S?l(g,x,v,b):null;case Ys:return v.key===S?c(g,x,v,b):null;case wr:return S=v._init,h(g,x,S(v._payload),b)}if(wo(v)||Xi(v))return S!==null?null:u(g,x,v,b,null);Qa(g,v)}return null}function p(g,x,v,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(v)||null,a(x,g,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Fa:return g=g.get(b.key===null?v:b.key)||null,l(x,g,b,S);case Ys:return g=g.get(b.key===null?v:b.key)||null,c(x,g,b,S);case wr:var k=b._init;return p(g,x,v,k(b._payload),S)}if(wo(b)||Xi(b))return g=g.get(v)||null,u(x,g,b,S,null);Qa(x,b)}return null}function m(g,x,v,b){for(var S=null,k=null,T=x,P=x=0,R=null;T!==null&&P<v.length;P++){T.index>P?(R=T,T=null):R=T.sibling;var j=h(g,T,v[P],b);if(j===null){T===null&&(T=R);break}e&&T&&j.alternate===null&&t(g,T),x=i(j,x,P),k===null?S=j:k.sibling=j,k=j,T=R}if(P===v.length)return n(g,T),Ce&&os(g,P),S;if(T===null){for(;P<v.length;P++)T=d(g,v[P],b),T!==null&&(x=i(T,x,P),k===null?S=T:k.sibling=T,k=T);return Ce&&os(g,P),S}for(T=r(g,T);P<v.length;P++)R=p(T,g,P,v[P],b),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?P:R.key),x=i(R,x,P),k===null?S=R:k.sibling=R,k=R);return e&&T.forEach(function(I){return t(g,I)}),Ce&&os(g,P),S}function y(g,x,v,b){var S=Xi(v);if(typeof S!="function")throw Error(U(150));if(v=S.call(v),v==null)throw Error(U(151));for(var k=S=null,T=x,P=x=0,R=null,j=v.next();T!==null&&!j.done;P++,j=v.next()){T.index>P?(R=T,T=null):R=T.sibling;var I=h(g,T,j.value,b);if(I===null){T===null&&(T=R);break}e&&T&&I.alternate===null&&t(g,T),x=i(I,x,P),k===null?S=I:k.sibling=I,k=I,T=R}if(j.done)return n(g,T),Ce&&os(g,P),S;if(T===null){for(;!j.done;P++,j=v.next())j=d(g,j.value,b),j!==null&&(x=i(j,x,P),k===null?S=j:k.sibling=j,k=j);return Ce&&os(g,P),S}for(T=r(g,T);!j.done;P++,j=v.next())j=p(T,g,P,j.value,b),j!==null&&(e&&j.alternate!==null&&T.delete(j.key===null?P:j.key),x=i(j,x,P),k===null?S=j:k.sibling=j,k=j);return e&&T.forEach(function(M){return t(g,M)}),Ce&&os(g,P),S}function w(g,x,v,b){if(typeof v=="object"&&v!==null&&v.type===Xs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Fa:e:{for(var S=v.key,k=x;k!==null;){if(k.key===S){if(S=v.type,S===Xs){if(k.tag===7){n(g,k.sibling),x=s(k,v.props.children),x.return=g,g=x;break e}}else if(k.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&Kg(S)===k.type){n(g,k.sibling),x=s(k,v.props),x.ref=no(g,k,v),x.return=g,g=x;break e}n(g,k);break}else t(g,k);k=k.sibling}v.type===Xs?(x=xs(v.props.children,g.mode,b,v.key),x.return=g,g=x):(b=Dl(v.type,v.key,v.props,null,g.mode,b),b.ref=no(g,x,v),b.return=g,g=b)}return o(g);case Ys:e:{for(k=v.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(g,x.sibling),x=s(x,v.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=cd(v,g.mode,b),x.return=g,g=x}return o(g);case wr:return k=v._init,w(g,x,k(v._payload),b)}if(wo(v))return m(g,x,v,b);if(Xi(v))return y(g,x,v,b);Qa(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(g,x.sibling),x=s(x,v),x.return=g,g=x):(n(g,x),x=ld(v,g.mode,b),x.return=g,g=x),o(g)):n(g,x)}return w}var Ci=sw(!0),iw=sw(!1),pc=Qr(null),mc=null,ii=null,Sp=null;function Cp(){Sp=ii=mc=null}function Pp(e){var t=pc.current;ke(pc),e._currentValue=t}function Uf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function gi(e,t){mc=e,Sp=ii=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gt=!0),e.firstContext=null)}function en(e){var t=e._currentValue;if(Sp!==e)if(e={context:e,memoizedValue:t,next:null},ii===null){if(mc===null)throw Error(U(308));ii=e,mc.dependencies={lanes:0,firstContext:e}}else ii=ii.next=e;return t}var fs=null;function jp(e){fs===null?fs=[e]:fs.push(e)}function ow(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,jp(t)):(n.next=s.next,s.next=n),t.interleaved=n,rr(e,r)}function rr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var br=!1;function Ep(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function aw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Zn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,rr(e,n)}return s=r.interleaved,s===null?(t.next=t,jp(r)):(t.next=s.next,s.next=t),r.interleaved=t,rr(e,n)}function Rl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hp(e,n)}}function Qg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function gc(e,t,n,r){var s=e.updateQueue;br=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;o=0,u=c=l=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(h=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){d=m.call(p,d,h);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(p,d,h):m,h==null)break e;d=Re({},d,h);break e;case 2:br=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(u===null&&(l=d),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Es|=o,e.lanes=o,e.memoizedState=d}}function qg(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(U(191,s));s.call(r)}}}var xa={},Mn=Qr(xa),Zo=Qr(xa),ea=Qr(xa);function hs(e){if(e===xa)throw Error(U(174));return e}function Tp(e,t){switch(xe(ea,t),xe(Zo,e),xe(Mn,xa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:_f(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=_f(t,e)}ke(Mn),xe(Mn,t)}function Pi(){ke(Mn),ke(Zo),ke(ea)}function lw(e){hs(ea.current);var t=hs(Mn.current),n=_f(t,e.type);t!==n&&(xe(Zo,e),xe(Mn,n))}function Rp(e){Zo.current===e&&(ke(Mn),ke(Zo))}var Pe=Qr(0);function yc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var nd=[];function Np(){for(var e=0;e<nd.length;e++)nd[e]._workInProgressVersionPrimary=null;nd.length=0}var Nl=or.ReactCurrentDispatcher,rd=or.ReactCurrentBatchConfig,js=0,je=null,Be=null,Ge=null,xc=!1,Ro=!1,ta=0,lj=0;function et(){throw Error(U(321))}function Ip(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xn(e[n],t[n]))return!1;return!0}function Mp(e,t,n,r,s,i){if(js=i,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Nl.current=e===null||e.memoizedState===null?fj:hj,e=n(r,s),Ro){i=0;do{if(Ro=!1,ta=0,25<=i)throw Error(U(301));i+=1,Ge=Be=null,t.updateQueue=null,Nl.current=pj,e=n(r,s)}while(Ro)}if(Nl.current=vc,t=Be!==null&&Be.next!==null,js=0,Ge=Be=je=null,xc=!1,t)throw Error(U(300));return e}function Ap(){var e=ta!==0;return ta=0,e}function Cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?je.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function tn(){if(Be===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Be.next;var t=Ge===null?je.memoizedState:Ge.next;if(t!==null)Ge=t,Be=e;else{if(e===null)throw Error(U(310));Be=e,e={memoizedState:Be.memoizedState,baseState:Be.baseState,baseQueue:Be.baseQueue,queue:Be.queue,next:null},Ge===null?je.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function na(e,t){return typeof t=="function"?t(e):t}function sd(e){var t=tn(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=Be,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,c=i;do{var u=c.lane;if((js&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,je.lanes|=u,Es|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,xn(r,t.memoizedState)||(gt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,je.lanes|=i,Es|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function id(e){var t=tn(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);xn(i,t.memoizedState)||(gt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function cw(){}function uw(e,t){var n=je,r=tn(),s=t(),i=!xn(r.memoizedState,s);if(i&&(r.memoizedState=s,gt=!0),r=r.queue,Lp(hw.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ge!==null&&Ge.memoizedState.tag&1){if(n.flags|=2048,ra(9,fw.bind(null,n,r,s,t),void 0,null),Ke===null)throw Error(U(349));js&30||dw(n,t,s)}return s}function dw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fw(e,t,n,r){t.value=n,t.getSnapshot=r,pw(t)&&mw(e)}function hw(e,t,n){return n(function(){pw(t)&&mw(e)})}function pw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xn(e,n)}catch{return!0}}function mw(e){var t=rr(e,1);t!==null&&gn(t,e,1,-1)}function Yg(e){var t=Cn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:e},t.queue=e,e=e.dispatch=dj.bind(null,je,e),[t.memoizedState,e]}function ra(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function gw(){return tn().memoizedState}function Il(e,t,n,r){var s=Cn();je.flags|=e,s.memoizedState=ra(1|t,n,void 0,r===void 0?null:r)}function ru(e,t,n,r){var s=tn();r=r===void 0?null:r;var i=void 0;if(Be!==null){var o=Be.memoizedState;if(i=o.destroy,r!==null&&Ip(r,o.deps)){s.memoizedState=ra(t,n,i,r);return}}je.flags|=e,s.memoizedState=ra(1|t,n,i,r)}function Xg(e,t){return Il(8390656,8,e,t)}function Lp(e,t){return ru(2048,8,e,t)}function yw(e,t){return ru(4,2,e,t)}function xw(e,t){return ru(4,4,e,t)}function vw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ww(e,t,n){return n=n!=null?n.concat([e]):null,ru(4,4,vw.bind(null,t,e),n)}function Dp(){}function bw(e,t){var n=tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ip(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function kw(e,t){var n=tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ip(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function _w(e,t,n){return js&21?(xn(n,t)||(n=E1(),je.lanes|=n,Es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,gt=!0),e.memoizedState=n)}function cj(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var r=rd.transition;rd.transition={};try{e(!1),t()}finally{ce=n,rd.transition=r}}function Sw(){return tn().memoizedState}function uj(e,t,n){var r=Or(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cw(e))Pw(t,n);else if(n=ow(e,t,n,r),n!==null){var s=ut();gn(n,e,r,s),jw(n,t,r)}}function dj(e,t,n){var r=Or(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cw(e))Pw(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,xn(a,o)){var l=t.interleaved;l===null?(s.next=s,jp(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=ow(e,t,s,r),n!==null&&(s=ut(),gn(n,e,r,s),jw(n,t,r))}}function Cw(e){var t=e.alternate;return e===je||t!==null&&t===je}function Pw(e,t){Ro=xc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hp(e,n)}}var vc={readContext:en,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},fj={readContext:en,useCallback:function(e,t){return Cn().memoizedState=[e,t===void 0?null:t],e},useContext:en,useEffect:Xg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Il(4194308,4,vw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Il(4194308,4,e,t)},useInsertionEffect:function(e,t){return Il(4,2,e,t)},useMemo:function(e,t){var n=Cn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=uj.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=Cn();return e={current:e},t.memoizedState=e},useState:Yg,useDebugValue:Dp,useDeferredValue:function(e){return Cn().memoizedState=e},useTransition:function(){var e=Yg(!1),t=e[0];return e=cj.bind(null,e[1]),Cn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,s=Cn();if(Ce){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),Ke===null)throw Error(U(349));js&30||dw(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Xg(hw.bind(null,r,i,e),[e]),r.flags|=2048,ra(9,fw.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Cn(),t=Ke.identifierPrefix;if(Ce){var n=Jn,r=Xn;n=(r&~(1<<32-mn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ta++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=lj++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hj={readContext:en,useCallback:bw,useContext:en,useEffect:Lp,useImperativeHandle:ww,useInsertionEffect:yw,useLayoutEffect:xw,useMemo:kw,useReducer:sd,useRef:gw,useState:function(){return sd(na)},useDebugValue:Dp,useDeferredValue:function(e){var t=tn();return _w(t,Be.memoizedState,e)},useTransition:function(){var e=sd(na)[0],t=tn().memoizedState;return[e,t]},useMutableSource:cw,useSyncExternalStore:uw,useId:Sw,unstable_isNewReconciler:!1},pj={readContext:en,useCallback:bw,useContext:en,useEffect:Lp,useImperativeHandle:ww,useInsertionEffect:yw,useLayoutEffect:xw,useMemo:kw,useReducer:id,useRef:gw,useState:function(){return id(na)},useDebugValue:Dp,useDeferredValue:function(e){var t=tn();return Be===null?t.memoizedState=e:_w(t,Be.memoizedState,e)},useTransition:function(){var e=id(na)[0],t=tn().memoizedState;return[e,t]},useMutableSource:cw,useSyncExternalStore:uw,useId:Sw,unstable_isNewReconciler:!1};function fn(e,t){if(e&&e.defaultProps){t=Re({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Wf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Re({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var su={isMounted:function(e){return(e=e._reactInternals)?Is(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ut(),s=Or(e),i=Zn(r,s);i.payload=t,n!=null&&(i.callback=n),t=Dr(e,i,s),t!==null&&(gn(t,e,s,r),Rl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ut(),s=Or(e),i=Zn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Dr(e,i,s),t!==null&&(gn(t,e,s,r),Rl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ut(),r=Or(e),s=Zn(n,r);s.tag=2,t!=null&&(s.callback=t),t=Dr(e,s,r),t!==null&&(gn(t,e,r,n),Rl(t,e,r))}};function Jg(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!qo(n,r)||!qo(s,i):!0}function Ew(e,t,n){var r=!1,s=Ur,i=t.contextType;return typeof i=="object"&&i!==null?i=en(i):(s=vt(t)?Cs:it.current,r=t.contextTypes,i=(r=r!=null)?_i(e,s):Ur),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=su,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Zg(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&su.enqueueReplaceState(t,t.state,null)}function Hf(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Ep(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=en(i):(i=vt(t)?Cs:it.current,s.context=_i(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Wf(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&su.enqueueReplaceState(s,s.state,null),gc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ji(e,t){try{var n="",r=t;do n+=VC(r),r=r.return;while(r);var s=n}catch(i){s=`
38
+ `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{$u=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?vo(e):""}function VC(e){switch(e.tag){case 5:return vo(e.type);case 16:return vo("Lazy");case 13:return vo("Suspense");case 19:return vo("SuspenseList");case 0:case 2:case 15:return e=Bu(e.type,!1),e;case 11:return e=Bu(e.type.render,!1),e;case 1:return e=Bu(e.type,!0),e;default:return""}}function xf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Xs:return"Fragment";case Ys:return"Portal";case mf:return"Profiler";case lp:return"StrictMode";case gf:return"Suspense";case yf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a1:return(e.displayName||"Context")+".Consumer";case o1:return(e._context.displayName||"Context")+".Provider";case cp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case up:return t=e.displayName||null,t!==null?t:xf(e.type)||"Memo";case wr:t=e._payload,e=e._init;try{return xf(e(t))}catch{}}return null}function UC(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xf(t);case 8:return t===lp?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function c1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function WC(e){var t=c1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oa(e){e._valueTracker||(e._valueTracker=WC(e))}function u1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=c1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function tc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function vf(e,t){var n=t.checked;return Ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function d1(e,t){t=t.checked,t!=null&&ap(e,"checked",t,!1)}function wf(e,t){d1(e,t);var n=Vr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?bf(e,t.type,n):t.hasOwnProperty("defaultValue")&&bf(e,t.type,Vr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yg(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function bf(e,t,n){(t!=="number"||tc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wo=Array.isArray;function fi(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function kf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return Ne({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function xg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(U(92));if(wo(n)){if(1<n.length)throw Error(U(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vr(n)}}function f1(e,t){var n=Vr(t.value),r=Vr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function vg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function h1(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function _f(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?h1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var za,p1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(za=za||document.createElement("div"),za.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=za.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Uo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Co={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},HC=["Webkit","ms","Moz","O"];Object.keys(Co).forEach(function(e){HC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Co[t]=Co[e]})});function m1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Co.hasOwnProperty(e)&&Co[e]?(""+t).trim():t+"px"}function g1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=m1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var GC=Ne({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 Sf(e,t){if(t){if(GC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function Cf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pf=null;function dp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jf=null,hi=null,pi=null;function wg(e){if(e=ya(e)){if(typeof jf!="function")throw Error(U(280));var t=e.stateNode;t&&(t=tu(t),jf(e.stateNode,e.type,t))}}function y1(e){hi?pi?pi.push(e):pi=[e]:hi=e}function x1(){if(hi){var e=hi,t=pi;if(pi=hi=null,wg(e),t)for(e=0;e<t.length;e++)wg(t[e])}}function v1(e,t){return e(t)}function w1(){}var Vu=!1;function b1(e,t,n){if(Vu)return e(t,n);Vu=!0;try{return v1(e,t,n)}finally{Vu=!1,(hi!==null||pi!==null)&&(w1(),x1())}}function Wo(e,t){var n=e.stateNode;if(n===null)return null;var r=tu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(U(231,t,typeof n));return n}var Ef=!1;if(tr)try{var Ji={};Object.defineProperty(Ji,"passive",{get:function(){Ef=!0}}),window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{Ef=!1}function KC(e,t,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Po=!1,nc=null,rc=!1,Tf=null,QC={onError:function(e){Po=!0,nc=e}};function qC(e,t,n,r,s,i,o,a,l){Po=!1,nc=null,KC.apply(QC,arguments)}function YC(e,t,n,r,s,i,o,a,l){if(qC.apply(this,arguments),Po){if(Po){var c=nc;Po=!1,nc=null}else throw Error(U(198));rc||(rc=!0,Tf=c)}}function Is(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function k1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function bg(e){if(Is(e)!==e)throw Error(U(188))}function XC(e){var t=e.alternate;if(!t){if(t=Is(e),t===null)throw Error(U(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return bg(s),e;if(i===r)return bg(s),t;i=i.sibling}throw Error(U(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?e:t}function _1(e){return e=XC(e),e!==null?S1(e):null}function S1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=S1(e);if(t!==null)return t;e=e.sibling}return null}var C1=Ft.unstable_scheduleCallback,kg=Ft.unstable_cancelCallback,JC=Ft.unstable_shouldYield,ZC=Ft.unstable_requestPaint,De=Ft.unstable_now,eP=Ft.unstable_getCurrentPriorityLevel,fp=Ft.unstable_ImmediatePriority,P1=Ft.unstable_UserBlockingPriority,sc=Ft.unstable_NormalPriority,tP=Ft.unstable_LowPriority,j1=Ft.unstable_IdlePriority,Xc=null,In=null;function nP(e){if(In&&typeof In.onCommitFiberRoot=="function")try{In.onCommitFiberRoot(Xc,e,void 0,(e.current.flags&128)===128)}catch{}}var mn=Math.clz32?Math.clz32:iP,rP=Math.log,sP=Math.LN2;function iP(e){return e>>>=0,e===0?32:31-(rP(e)/sP|0)|0}var $a=64,Ba=4194304;function bo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ic(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=bo(a):(i&=o,i!==0&&(r=bo(i)))}else o=n&~s,o!==0?r=bo(o):i!==0&&(r=bo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-mn(t),s=1<<n,r|=e[n],t&=~s;return r}function oP(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 aP(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-mn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=oP(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Rf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function E1(){var e=$a;return $a<<=1,!($a&4194240)&&($a=64),e}function Uu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ma(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mn(t),e[t]=n}function lP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-mn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function hp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-mn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ue=0;function T1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var R1,pp,N1,I1,M1,Nf=!1,Va=[],Ir=null,Mr=null,Ar=null,Ho=new Map,Go=new Map,_r=[],cP="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 _g(e,t){switch(e){case"focusin":case"focusout":Ir=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":Ho.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(t.pointerId)}}function Zi(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=ya(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function uP(e,t,n,r,s){switch(t){case"focusin":return Ir=Zi(Ir,e,t,n,r,s),!0;case"dragenter":return Mr=Zi(Mr,e,t,n,r,s),!0;case"mouseover":return Ar=Zi(Ar,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Ho.set(i,Zi(Ho.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Go.set(i,Zi(Go.get(i)||null,e,t,n,r,s)),!0}return!1}function A1(e){var t=ds(e.target);if(t!==null){var n=Is(t);if(n!==null){if(t=n.tag,t===13){if(t=k1(n),t!==null){e.blockedOn=t,M1(e.priority,function(){N1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=If(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Pf=r,n.target.dispatchEvent(r),Pf=null}else return t=ya(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function Sg(e,t,n){jl(e)&&n.delete(t)}function dP(){Nf=!1,Ir!==null&&jl(Ir)&&(Ir=null),Mr!==null&&jl(Mr)&&(Mr=null),Ar!==null&&jl(Ar)&&(Ar=null),Ho.forEach(Sg),Go.forEach(Sg)}function eo(e,t){e.blockedOn===t&&(e.blockedOn=null,Nf||(Nf=!0,Ft.unstable_scheduleCallback(Ft.unstable_NormalPriority,dP)))}function Ko(e){function t(s){return eo(s,e)}if(0<Va.length){eo(Va[0],e);for(var n=1;n<Va.length;n++){var r=Va[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ir!==null&&eo(Ir,e),Mr!==null&&eo(Mr,e),Ar!==null&&eo(Ar,e),Ho.forEach(t),Go.forEach(t),n=0;n<_r.length;n++)r=_r[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<_r.length&&(n=_r[0],n.blockedOn===null);)A1(n),n.blockedOn===null&&_r.shift()}var mi=or.ReactCurrentBatchConfig,oc=!0;function fP(e,t,n,r){var s=ue,i=mi.transition;mi.transition=null;try{ue=1,mp(e,t,n,r)}finally{ue=s,mi.transition=i}}function hP(e,t,n,r){var s=ue,i=mi.transition;mi.transition=null;try{ue=4,mp(e,t,n,r)}finally{ue=s,mi.transition=i}}function mp(e,t,n,r){if(oc){var s=If(e,t,n,r);if(s===null)Zu(e,t,r,ac,n),_g(e,r);else if(uP(s,e,t,n,r))r.stopPropagation();else if(_g(e,r),t&4&&-1<cP.indexOf(e)){for(;s!==null;){var i=ya(s);if(i!==null&&R1(i),i=If(e,t,n,r),i===null&&Zu(e,t,r,ac,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Zu(e,t,r,null,n)}}var ac=null;function If(e,t,n,r){if(ac=null,e=dp(r),e=ds(e),e!==null)if(t=Is(e),t===null)e=null;else if(n=t.tag,n===13){if(e=k1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ac=e,null}function L1(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(eP()){case fp:return 1;case P1:return 4;case sc:case tP:return 16;case j1:return 536870912;default:return 16}default:return 16}}var Cr=null,gp=null,El=null;function D1(){if(El)return El;var e,t=gp,n=t.length,r,s="value"in Cr?Cr.value:Cr.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return El=s.slice(e,1<r?1-r:void 0)}function Tl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ua(){return!0}function Cg(){return!1}function zt(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ua:Cg,this.isPropagationStopped=Cg,this}return Ne(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ua)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ua)},persist:function(){},isPersistent:Ua}),t}var Di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yp=zt(Di),ga=Ne({},Di,{view:0,detail:0}),pP=zt(ga),Wu,Hu,to,Jc=Ne({},ga,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==to&&(to&&e.type==="mousemove"?(Wu=e.screenX-to.screenX,Hu=e.screenY-to.screenY):Hu=Wu=0,to=e),Wu)},movementY:function(e){return"movementY"in e?e.movementY:Hu}}),Pg=zt(Jc),mP=Ne({},Jc,{dataTransfer:0}),gP=zt(mP),yP=Ne({},ga,{relatedTarget:0}),Gu=zt(yP),xP=Ne({},Di,{animationName:0,elapsedTime:0,pseudoElement:0}),vP=zt(xP),wP=Ne({},Di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bP=zt(wP),kP=Ne({},Di,{data:0}),jg=zt(kP),_P={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SP={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"},CP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function PP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=CP[e])?!!t[e]:!1}function xp(){return PP}var jP=Ne({},ga,{key:function(e){if(e.key){var t=_P[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Tl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?SP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xp,charCode:function(e){return e.type==="keypress"?Tl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Tl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),EP=zt(jP),TP=Ne({},Jc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Eg=zt(TP),RP=Ne({},ga,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xp}),NP=zt(RP),IP=Ne({},Di,{propertyName:0,elapsedTime:0,pseudoElement:0}),MP=zt(IP),AP=Ne({},Jc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),LP=zt(AP),DP=[9,13,27,32],vp=tr&&"CompositionEvent"in window,jo=null;tr&&"documentMode"in document&&(jo=document.documentMode);var FP=tr&&"TextEvent"in window&&!jo,F1=tr&&(!vp||jo&&8<jo&&11>=jo),Tg=" ",Rg=!1;function O1(e,t){switch(e){case"keyup":return DP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function z1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Js=!1;function OP(e,t){switch(e){case"compositionend":return z1(t);case"keypress":return t.which!==32?null:(Rg=!0,Tg);case"textInput":return e=t.data,e===Tg&&Rg?null:e;default:return null}}function zP(e,t){if(Js)return e==="compositionend"||!vp&&O1(e,t)?(e=D1(),El=gp=Cr=null,Js=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return F1&&t.locale!=="ko"?null:t.data;default:return null}}var $P={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 Ng(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$P[e.type]:t==="textarea"}function $1(e,t,n,r){y1(r),t=lc(t,"onChange"),0<t.length&&(n=new yp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Eo=null,Qo=null;function BP(e){X1(e,0)}function Zc(e){var t=ti(e);if(u1(t))return e}function VP(e,t){if(e==="change")return t}var B1=!1;if(tr){var Ku;if(tr){var Qu="oninput"in document;if(!Qu){var Ig=document.createElement("div");Ig.setAttribute("oninput","return;"),Qu=typeof Ig.oninput=="function"}Ku=Qu}else Ku=!1;B1=Ku&&(!document.documentMode||9<document.documentMode)}function Mg(){Eo&&(Eo.detachEvent("onpropertychange",V1),Qo=Eo=null)}function V1(e){if(e.propertyName==="value"&&Zc(Qo)){var t=[];$1(t,Qo,e,dp(e)),b1(BP,t)}}function UP(e,t,n){e==="focusin"?(Mg(),Eo=t,Qo=n,Eo.attachEvent("onpropertychange",V1)):e==="focusout"&&Mg()}function WP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zc(Qo)}function HP(e,t){if(e==="click")return Zc(t)}function GP(e,t){if(e==="input"||e==="change")return Zc(t)}function KP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xn=typeof Object.is=="function"?Object.is:KP;function qo(e,t){if(xn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!pf.call(t,s)||!xn(e[s],t[s]))return!1}return!0}function Ag(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lg(e,t){var n=Ag(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ag(n)}}function U1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?U1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function W1(){for(var e=window,t=tc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=tc(e.document)}return t}function wp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function QP(e){var t=W1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&U1(n.ownerDocument.documentElement,n)){if(r!==null&&wp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Lg(n,i);var o=Lg(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qP=tr&&"documentMode"in document&&11>=document.documentMode,Zs=null,Mf=null,To=null,Af=!1;function Dg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Af||Zs==null||Zs!==tc(r)||(r=Zs,"selectionStart"in r&&wp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),To&&qo(To,r)||(To=r,r=lc(Mf,"onSelect"),0<r.length&&(t=new yp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zs)))}function Wa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ei={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionend:Wa("Transition","TransitionEnd")},qu={},H1={};tr&&(H1=document.createElement("div").style,"AnimationEvent"in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),"TransitionEvent"in window||delete ei.transitionend.transition);function eu(e){if(qu[e])return qu[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in H1)return qu[e]=t[n];return e}var G1=eu("animationend"),K1=eu("animationiteration"),Q1=eu("animationstart"),q1=eu("transitionend"),Y1=new Map,Fg="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 Kr(e,t){Y1.set(e,t),Ns(t,[e])}for(var Yu=0;Yu<Fg.length;Yu++){var Xu=Fg[Yu],YP=Xu.toLowerCase(),XP=Xu[0].toUpperCase()+Xu.slice(1);Kr(YP,"on"+XP)}Kr(G1,"onAnimationEnd");Kr(K1,"onAnimationIteration");Kr(Q1,"onAnimationStart");Kr("dblclick","onDoubleClick");Kr("focusin","onFocus");Kr("focusout","onBlur");Kr(q1,"onTransitionEnd");ki("onMouseEnter",["mouseout","mouseover"]);ki("onMouseLeave",["mouseout","mouseover"]);ki("onPointerEnter",["pointerout","pointerover"]);ki("onPointerLeave",["pointerout","pointerover"]);Ns("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ns("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ns("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ns("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ns("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ns("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ko="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(" "),JP=new Set("cancel close invalid load scroll toggle".split(" ").concat(ko));function Og(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,YC(r,t,void 0,e),e.currentTarget=null}function X1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;Og(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;Og(s,a,c),i=l}}}if(rc)throw e=Tf,rc=!1,Tf=null,e}function ke(e,t){var n=t[zf];n===void 0&&(n=t[zf]=new Set);var r=e+"__bubble";n.has(r)||(J1(t,e,2,!1),n.add(r))}function Ju(e,t,n){var r=0;t&&(r|=4),J1(n,e,r,t)}var Ha="_reactListening"+Math.random().toString(36).slice(2);function Yo(e){if(!e[Ha]){e[Ha]=!0,i1.forEach(function(n){n!=="selectionchange"&&(JP.has(n)||Ju(n,!1,e),Ju(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ha]||(t[Ha]=!0,Ju("selectionchange",!1,t))}}function J1(e,t,n,r){switch(L1(t)){case 1:var s=fP;break;case 4:s=hP;break;default:s=mp}n=s.bind(null,t,n,e),s=void 0,!Ef||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Zu(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=ds(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}b1(function(){var c=i,u=dp(n),d=[];e:{var h=Y1.get(e);if(h!==void 0){var p=yp,m=e;switch(e){case"keypress":if(Tl(n)===0)break e;case"keydown":case"keyup":p=EP;break;case"focusin":m="focus",p=Gu;break;case"focusout":m="blur",p=Gu;break;case"beforeblur":case"afterblur":p=Gu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Pg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=gP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=NP;break;case G1:case K1:case Q1:p=vP;break;case q1:p=MP;break;case"scroll":p=pP;break;case"wheel":p=LP;break;case"copy":case"cut":case"paste":p=bP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Eg}var y=(t&4)!==0,w=!y&&e==="scroll",g=y?h!==null?h+"Capture":null:h;y=[];for(var x=c,v;x!==null;){v=x;var b=v.stateNode;if(v.tag===5&&b!==null&&(v=b,g!==null&&(b=Wo(x,g),b!=null&&y.push(Xo(x,b,v)))),w)break;x=x.return}0<y.length&&(h=new p(h,m,null,n,u),d.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Pf&&(m=n.relatedTarget||n.fromElement)&&(ds(m)||m[nr]))break e;if((p||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?ds(m):null,m!==null&&(w=Is(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(y=Pg,b="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=Eg,b="onPointerLeave",g="onPointerEnter",x="pointer"),w=p==null?h:ti(p),v=m==null?h:ti(m),h=new y(b,x+"leave",p,n,u),h.target=w,h.relatedTarget=v,b=null,ds(u)===c&&(y=new y(g,x+"enter",m,n,u),y.target=v,y.relatedTarget=w,b=y),w=b,p&&m)t:{for(y=p,g=m,x=0,v=y;v;v=zs(v))x++;for(v=0,b=g;b;b=zs(b))v++;for(;0<x-v;)y=zs(y),x--;for(;0<v-x;)g=zs(g),v--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=zs(y),g=zs(g)}y=null}else y=null;p!==null&&zg(d,h,p,y,!1),m!==null&&w!==null&&zg(d,w,m,y,!0)}}e:{if(h=c?ti(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=VP;else if(Ng(h))if(B1)S=GP;else{S=WP;var k=UP}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=HP);if(S&&(S=S(e,c))){$1(d,S,n,u);break e}k&&k(e,h,c),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&bf(h,"number",h.value)}switch(k=c?ti(c):window,e){case"focusin":(Ng(k)||k.contentEditable==="true")&&(Zs=k,Mf=c,To=null);break;case"focusout":To=Mf=Zs=null;break;case"mousedown":Af=!0;break;case"contextmenu":case"mouseup":case"dragend":Af=!1,Dg(d,n,u);break;case"selectionchange":if(qP)break;case"keydown":case"keyup":Dg(d,n,u)}var T;if(vp)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Js?O1(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(F1&&n.locale!=="ko"&&(Js||P!=="onCompositionStart"?P==="onCompositionEnd"&&Js&&(T=D1()):(Cr=u,gp="value"in Cr?Cr.value:Cr.textContent,Js=!0)),k=lc(c,P),0<k.length&&(P=new jg(P,e,null,n,u),d.push({event:P,listeners:k}),T?P.data=T:(T=z1(n),T!==null&&(P.data=T)))),(T=FP?OP(e,n):zP(e,n))&&(c=lc(c,"onBeforeInput"),0<c.length&&(u=new jg("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=T))}X1(d,t)})}function Xo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function lc(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Wo(e,n),i!=null&&r.unshift(Xo(e,i,s)),i=Wo(e,t),i!=null&&r.push(Xo(e,i,s))),e=e.return}return r}function zs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function zg(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=Wo(n,i),l!=null&&o.unshift(Xo(n,l,a))):s||(l=Wo(n,i),l!=null&&o.push(Xo(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ZP=/\r\n?/g,ej=/\u0000|\uFFFD/g;function $g(e){return(typeof e=="string"?e:""+e).replace(ZP,`
39
+ `).replace(ej,"")}function Ga(e,t,n){if(t=$g(t),$g(e)!==t&&n)throw Error(U(425))}function cc(){}var Lf=null,Df=null;function Ff(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Of=typeof setTimeout=="function"?setTimeout:void 0,tj=typeof clearTimeout=="function"?clearTimeout:void 0,Bg=typeof Promise=="function"?Promise:void 0,nj=typeof queueMicrotask=="function"?queueMicrotask:typeof Bg<"u"?function(e){return Bg.resolve(null).then(e).catch(rj)}:Of;function rj(e){setTimeout(function(){throw e})}function ed(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Ko(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Ko(t)}function Lr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Vg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Fi=Math.random().toString(36).slice(2),Rn="__reactFiber$"+Fi,Jo="__reactProps$"+Fi,nr="__reactContainer$"+Fi,zf="__reactEvents$"+Fi,sj="__reactListeners$"+Fi,ij="__reactHandles$"+Fi;function ds(e){var t=e[Rn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nr]||n[Rn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Vg(e);e!==null;){if(n=e[Rn])return n;e=Vg(e)}return t}e=n,n=e.parentNode}return null}function ya(e){return e=e[Rn]||e[nr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ti(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function tu(e){return e[Jo]||null}var $f=[],ni=-1;function Qr(e){return{current:e}}function _e(e){0>ni||(e.current=$f[ni],$f[ni]=null,ni--)}function ve(e,t){ni++,$f[ni]=e.current,e.current=t}var Ur={},it=Qr(Ur),xt=Qr(!1),Cs=Ur;function _i(e,t){var n=e.type.contextTypes;if(!n)return Ur;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function vt(e){return e=e.childContextTypes,e!=null}function uc(){_e(xt),_e(it)}function Ug(e,t,n){if(it.current!==Ur)throw Error(U(168));ve(it,t),ve(xt,n)}function Z1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(U(108,UC(e)||"Unknown",s));return Ne({},n,r)}function dc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ur,Cs=it.current,ve(it,e),ve(xt,xt.current),!0}function Wg(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=Z1(e,t,Cs),r.__reactInternalMemoizedMergedChildContext=e,_e(xt),_e(it),ve(it,e)):_e(xt),ve(xt,n)}var Kn=null,nu=!1,td=!1;function ew(e){Kn===null?Kn=[e]:Kn.push(e)}function oj(e){nu=!0,ew(e)}function qr(){if(!td&&Kn!==null){td=!0;var e=0,t=ue;try{var n=Kn;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Kn=null,nu=!1}catch(s){throw Kn!==null&&(Kn=Kn.slice(e+1)),C1(fp,qr),s}finally{ue=t,td=!1}}return null}var ri=[],si=0,fc=null,hc=0,Gt=[],Kt=0,Ps=null,Xn=1,Jn="";function os(e,t){ri[si++]=hc,ri[si++]=fc,fc=e,hc=t}function tw(e,t,n){Gt[Kt++]=Xn,Gt[Kt++]=Jn,Gt[Kt++]=Ps,Ps=e;var r=Xn;e=Jn;var s=32-mn(r)-1;r&=~(1<<s),n+=1;var i=32-mn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Xn=1<<32-mn(t)+s|n<<s|r,Jn=i+e}else Xn=1<<i|n<<s|r,Jn=e}function bp(e){e.return!==null&&(os(e,1),tw(e,1,0))}function kp(e){for(;e===fc;)fc=ri[--si],ri[si]=null,hc=ri[--si],ri[si]=null;for(;e===Ps;)Ps=Gt[--Kt],Gt[Kt]=null,Jn=Gt[--Kt],Gt[Kt]=null,Xn=Gt[--Kt],Gt[Kt]=null}var Lt=null,Mt=null,Pe=!1,pn=null;function nw(e,t){var n=qt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Hg(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Lt=e,Mt=Lr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Lt=e,Mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ps!==null?{id:Xn,overflow:Jn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=qt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Lt=e,Mt=null,!0):!1;default:return!1}}function Bf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vf(e){if(Pe){var t=Mt;if(t){var n=t;if(!Hg(e,t)){if(Bf(e))throw Error(U(418));t=Lr(n.nextSibling);var r=Lt;t&&Hg(e,t)?nw(r,n):(e.flags=e.flags&-4097|2,Pe=!1,Lt=e)}}else{if(Bf(e))throw Error(U(418));e.flags=e.flags&-4097|2,Pe=!1,Lt=e}}}function Gg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Lt=e}function Ka(e){if(e!==Lt)return!1;if(!Pe)return Gg(e),Pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ff(e.type,e.memoizedProps)),t&&(t=Mt)){if(Bf(e))throw rw(),Error(U(418));for(;t;)nw(e,t),t=Lr(t.nextSibling)}if(Gg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Mt=Lr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mt=null}}else Mt=Lt?Lr(e.stateNode.nextSibling):null;return!0}function rw(){for(var e=Mt;e;)e=Lr(e.nextSibling)}function Si(){Mt=Lt=null,Pe=!1}function _p(e){pn===null?pn=[e]:pn.push(e)}var aj=or.ReactCurrentBatchConfig;function no(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(U(309));var r=n.stateNode}if(!r)throw Error(U(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,e))}return e}function Qa(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Kg(e){var t=e._init;return t(e._payload)}function sw(e){function t(g,x){if(e){var v=g.deletions;v===null?(g.deletions=[x],g.flags|=16):v.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function s(g,x){return g=zr(g,x),g.index=0,g.sibling=null,g}function i(g,x,v){return g.index=v,e?(v=g.alternate,v!==null?(v=v.index,v<x?(g.flags|=2,x):v):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,x,v,b){return x===null||x.tag!==6?(x=ld(v,g.mode,b),x.return=g,x):(x=s(x,v),x.return=g,x)}function l(g,x,v,b){var S=v.type;return S===Xs?u(g,x,v.props.children,b,v.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&Kg(S)===x.type)?(b=s(x,v.props),b.ref=no(g,x,v),b.return=g,b):(b=Dl(v.type,v.key,v.props,null,g.mode,b),b.ref=no(g,x,v),b.return=g,b)}function c(g,x,v,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=cd(v,g.mode,b),x.return=g,x):(x=s(x,v.children||[]),x.return=g,x)}function u(g,x,v,b,S){return x===null||x.tag!==7?(x=xs(v,g.mode,b,S),x.return=g,x):(x=s(x,v),x.return=g,x)}function d(g,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=ld(""+x,g.mode,v),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Fa:return v=Dl(x.type,x.key,x.props,null,g.mode,v),v.ref=no(g,null,x),v.return=g,v;case Ys:return x=cd(x,g.mode,v),x.return=g,x;case wr:var b=x._init;return d(g,b(x._payload),v)}if(wo(x)||Xi(x))return x=xs(x,g.mode,v,null),x.return=g,x;Qa(g,x)}return null}function h(g,x,v,b){var S=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return S!==null?null:a(g,x,""+v,b);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Fa:return v.key===S?l(g,x,v,b):null;case Ys:return v.key===S?c(g,x,v,b):null;case wr:return S=v._init,h(g,x,S(v._payload),b)}if(wo(v)||Xi(v))return S!==null?null:u(g,x,v,b,null);Qa(g,v)}return null}function p(g,x,v,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(v)||null,a(x,g,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Fa:return g=g.get(b.key===null?v:b.key)||null,l(x,g,b,S);case Ys:return g=g.get(b.key===null?v:b.key)||null,c(x,g,b,S);case wr:var k=b._init;return p(g,x,v,k(b._payload),S)}if(wo(b)||Xi(b))return g=g.get(v)||null,u(x,g,b,S,null);Qa(x,b)}return null}function m(g,x,v,b){for(var S=null,k=null,T=x,P=x=0,R=null;T!==null&&P<v.length;P++){T.index>P?(R=T,T=null):R=T.sibling;var j=h(g,T,v[P],b);if(j===null){T===null&&(T=R);break}e&&T&&j.alternate===null&&t(g,T),x=i(j,x,P),k===null?S=j:k.sibling=j,k=j,T=R}if(P===v.length)return n(g,T),Pe&&os(g,P),S;if(T===null){for(;P<v.length;P++)T=d(g,v[P],b),T!==null&&(x=i(T,x,P),k===null?S=T:k.sibling=T,k=T);return Pe&&os(g,P),S}for(T=r(g,T);P<v.length;P++)R=p(T,g,P,v[P],b),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?P:R.key),x=i(R,x,P),k===null?S=R:k.sibling=R,k=R);return e&&T.forEach(function(I){return t(g,I)}),Pe&&os(g,P),S}function y(g,x,v,b){var S=Xi(v);if(typeof S!="function")throw Error(U(150));if(v=S.call(v),v==null)throw Error(U(151));for(var k=S=null,T=x,P=x=0,R=null,j=v.next();T!==null&&!j.done;P++,j=v.next()){T.index>P?(R=T,T=null):R=T.sibling;var I=h(g,T,j.value,b);if(I===null){T===null&&(T=R);break}e&&T&&I.alternate===null&&t(g,T),x=i(I,x,P),k===null?S=I:k.sibling=I,k=I,T=R}if(j.done)return n(g,T),Pe&&os(g,P),S;if(T===null){for(;!j.done;P++,j=v.next())j=d(g,j.value,b),j!==null&&(x=i(j,x,P),k===null?S=j:k.sibling=j,k=j);return Pe&&os(g,P),S}for(T=r(g,T);!j.done;P++,j=v.next())j=p(T,g,P,j.value,b),j!==null&&(e&&j.alternate!==null&&T.delete(j.key===null?P:j.key),x=i(j,x,P),k===null?S=j:k.sibling=j,k=j);return e&&T.forEach(function(M){return t(g,M)}),Pe&&os(g,P),S}function w(g,x,v,b){if(typeof v=="object"&&v!==null&&v.type===Xs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Fa:e:{for(var S=v.key,k=x;k!==null;){if(k.key===S){if(S=v.type,S===Xs){if(k.tag===7){n(g,k.sibling),x=s(k,v.props.children),x.return=g,g=x;break e}}else if(k.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&Kg(S)===k.type){n(g,k.sibling),x=s(k,v.props),x.ref=no(g,k,v),x.return=g,g=x;break e}n(g,k);break}else t(g,k);k=k.sibling}v.type===Xs?(x=xs(v.props.children,g.mode,b,v.key),x.return=g,g=x):(b=Dl(v.type,v.key,v.props,null,g.mode,b),b.ref=no(g,x,v),b.return=g,g=b)}return o(g);case Ys:e:{for(k=v.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(g,x.sibling),x=s(x,v.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=cd(v,g.mode,b),x.return=g,g=x}return o(g);case wr:return k=v._init,w(g,x,k(v._payload),b)}if(wo(v))return m(g,x,v,b);if(Xi(v))return y(g,x,v,b);Qa(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(g,x.sibling),x=s(x,v),x.return=g,g=x):(n(g,x),x=ld(v,g.mode,b),x.return=g,g=x),o(g)):n(g,x)}return w}var Ci=sw(!0),iw=sw(!1),pc=Qr(null),mc=null,ii=null,Sp=null;function Cp(){Sp=ii=mc=null}function Pp(e){var t=pc.current;_e(pc),e._currentValue=t}function Uf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function gi(e,t){mc=e,Sp=ii=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gt=!0),e.firstContext=null)}function en(e){var t=e._currentValue;if(Sp!==e)if(e={context:e,memoizedValue:t,next:null},ii===null){if(mc===null)throw Error(U(308));ii=e,mc.dependencies={lanes:0,firstContext:e}}else ii=ii.next=e;return t}var fs=null;function jp(e){fs===null?fs=[e]:fs.push(e)}function ow(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,jp(t)):(n.next=s.next,s.next=n),t.interleaved=n,rr(e,r)}function rr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var br=!1;function Ep(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function aw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Zn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,rr(e,n)}return s=r.interleaved,s===null?(t.next=t,jp(r)):(t.next=s.next,s.next=t),r.interleaved=t,rr(e,n)}function Rl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hp(e,n)}}function Qg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function gc(e,t,n,r){var s=e.updateQueue;br=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;o=0,u=c=l=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(h=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){d=m.call(p,d,h);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(p,d,h):m,h==null)break e;d=Ne({},d,h);break e;case 2:br=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(u===null&&(l=d),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Es|=o,e.lanes=o,e.memoizedState=d}}function qg(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(U(191,s));s.call(r)}}}var xa={},Mn=Qr(xa),Zo=Qr(xa),ea=Qr(xa);function hs(e){if(e===xa)throw Error(U(174));return e}function Tp(e,t){switch(ve(ea,t),ve(Zo,e),ve(Mn,xa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:_f(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=_f(t,e)}_e(Mn),ve(Mn,t)}function Pi(){_e(Mn),_e(Zo),_e(ea)}function lw(e){hs(ea.current);var t=hs(Mn.current),n=_f(t,e.type);t!==n&&(ve(Zo,e),ve(Mn,n))}function Rp(e){Zo.current===e&&(_e(Mn),_e(Zo))}var je=Qr(0);function yc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var nd=[];function Np(){for(var e=0;e<nd.length;e++)nd[e]._workInProgressVersionPrimary=null;nd.length=0}var Nl=or.ReactCurrentDispatcher,rd=or.ReactCurrentBatchConfig,js=0,Ee=null,Ve=null,Ke=null,xc=!1,Ro=!1,ta=0,lj=0;function et(){throw Error(U(321))}function Ip(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xn(e[n],t[n]))return!1;return!0}function Mp(e,t,n,r,s,i){if(js=i,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Nl.current=e===null||e.memoizedState===null?fj:hj,e=n(r,s),Ro){i=0;do{if(Ro=!1,ta=0,25<=i)throw Error(U(301));i+=1,Ke=Ve=null,t.updateQueue=null,Nl.current=pj,e=n(r,s)}while(Ro)}if(Nl.current=vc,t=Ve!==null&&Ve.next!==null,js=0,Ke=Ve=Ee=null,xc=!1,t)throw Error(U(300));return e}function Ap(){var e=ta!==0;return ta=0,e}function Cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?Ee.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function tn(){if(Ve===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=Ke===null?Ee.memoizedState:Ke.next;if(t!==null)Ke=t,Ve=e;else{if(e===null)throw Error(U(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},Ke===null?Ee.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function na(e,t){return typeof t=="function"?t(e):t}function sd(e){var t=tn(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=Ve,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,c=i;do{var u=c.lane;if((js&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,Ee.lanes|=u,Es|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,xn(r,t.memoizedState)||(gt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Ee.lanes|=i,Es|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function id(e){var t=tn(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);xn(i,t.memoizedState)||(gt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function cw(){}function uw(e,t){var n=Ee,r=tn(),s=t(),i=!xn(r.memoizedState,s);if(i&&(r.memoizedState=s,gt=!0),r=r.queue,Lp(hw.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ke!==null&&Ke.memoizedState.tag&1){if(n.flags|=2048,ra(9,fw.bind(null,n,r,s,t),void 0,null),Qe===null)throw Error(U(349));js&30||dw(n,t,s)}return s}function dw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fw(e,t,n,r){t.value=n,t.getSnapshot=r,pw(t)&&mw(e)}function hw(e,t,n){return n(function(){pw(t)&&mw(e)})}function pw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xn(e,n)}catch{return!0}}function mw(e){var t=rr(e,1);t!==null&&gn(t,e,1,-1)}function Yg(e){var t=Cn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:e},t.queue=e,e=e.dispatch=dj.bind(null,Ee,e),[t.memoizedState,e]}function ra(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function gw(){return tn().memoizedState}function Il(e,t,n,r){var s=Cn();Ee.flags|=e,s.memoizedState=ra(1|t,n,void 0,r===void 0?null:r)}function ru(e,t,n,r){var s=tn();r=r===void 0?null:r;var i=void 0;if(Ve!==null){var o=Ve.memoizedState;if(i=o.destroy,r!==null&&Ip(r,o.deps)){s.memoizedState=ra(t,n,i,r);return}}Ee.flags|=e,s.memoizedState=ra(1|t,n,i,r)}function Xg(e,t){return Il(8390656,8,e,t)}function Lp(e,t){return ru(2048,8,e,t)}function yw(e,t){return ru(4,2,e,t)}function xw(e,t){return ru(4,4,e,t)}function vw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ww(e,t,n){return n=n!=null?n.concat([e]):null,ru(4,4,vw.bind(null,t,e),n)}function Dp(){}function bw(e,t){var n=tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ip(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function kw(e,t){var n=tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ip(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function _w(e,t,n){return js&21?(xn(n,t)||(n=E1(),Ee.lanes|=n,Es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,gt=!0),e.memoizedState=n)}function cj(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=rd.transition;rd.transition={};try{e(!1),t()}finally{ue=n,rd.transition=r}}function Sw(){return tn().memoizedState}function uj(e,t,n){var r=Or(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cw(e))Pw(t,n);else if(n=ow(e,t,n,r),n!==null){var s=ut();gn(n,e,r,s),jw(n,t,r)}}function dj(e,t,n){var r=Or(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cw(e))Pw(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,xn(a,o)){var l=t.interleaved;l===null?(s.next=s,jp(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=ow(e,t,s,r),n!==null&&(s=ut(),gn(n,e,r,s),jw(n,t,r))}}function Cw(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Pw(e,t){Ro=xc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hp(e,n)}}var vc={readContext:en,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},fj={readContext:en,useCallback:function(e,t){return Cn().memoizedState=[e,t===void 0?null:t],e},useContext:en,useEffect:Xg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Il(4194308,4,vw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Il(4194308,4,e,t)},useInsertionEffect:function(e,t){return Il(4,2,e,t)},useMemo:function(e,t){var n=Cn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=uj.bind(null,Ee,e),[r.memoizedState,e]},useRef:function(e){var t=Cn();return e={current:e},t.memoizedState=e},useState:Yg,useDebugValue:Dp,useDeferredValue:function(e){return Cn().memoizedState=e},useTransition:function(){var e=Yg(!1),t=e[0];return e=cj.bind(null,e[1]),Cn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ee,s=Cn();if(Pe){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),Qe===null)throw Error(U(349));js&30||dw(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Xg(hw.bind(null,r,i,e),[e]),r.flags|=2048,ra(9,fw.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Cn(),t=Qe.identifierPrefix;if(Pe){var n=Jn,r=Xn;n=(r&~(1<<32-mn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ta++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=lj++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hj={readContext:en,useCallback:bw,useContext:en,useEffect:Lp,useImperativeHandle:ww,useInsertionEffect:yw,useLayoutEffect:xw,useMemo:kw,useReducer:sd,useRef:gw,useState:function(){return sd(na)},useDebugValue:Dp,useDeferredValue:function(e){var t=tn();return _w(t,Ve.memoizedState,e)},useTransition:function(){var e=sd(na)[0],t=tn().memoizedState;return[e,t]},useMutableSource:cw,useSyncExternalStore:uw,useId:Sw,unstable_isNewReconciler:!1},pj={readContext:en,useCallback:bw,useContext:en,useEffect:Lp,useImperativeHandle:ww,useInsertionEffect:yw,useLayoutEffect:xw,useMemo:kw,useReducer:id,useRef:gw,useState:function(){return id(na)},useDebugValue:Dp,useDeferredValue:function(e){var t=tn();return Ve===null?t.memoizedState=e:_w(t,Ve.memoizedState,e)},useTransition:function(){var e=id(na)[0],t=tn().memoizedState;return[e,t]},useMutableSource:cw,useSyncExternalStore:uw,useId:Sw,unstable_isNewReconciler:!1};function fn(e,t){if(e&&e.defaultProps){t=Ne({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Wf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ne({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var su={isMounted:function(e){return(e=e._reactInternals)?Is(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ut(),s=Or(e),i=Zn(r,s);i.payload=t,n!=null&&(i.callback=n),t=Dr(e,i,s),t!==null&&(gn(t,e,s,r),Rl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ut(),s=Or(e),i=Zn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Dr(e,i,s),t!==null&&(gn(t,e,s,r),Rl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ut(),r=Or(e),s=Zn(n,r);s.tag=2,t!=null&&(s.callback=t),t=Dr(e,s,r),t!==null&&(gn(t,e,r,n),Rl(t,e,r))}};function Jg(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!qo(n,r)||!qo(s,i):!0}function Ew(e,t,n){var r=!1,s=Ur,i=t.contextType;return typeof i=="object"&&i!==null?i=en(i):(s=vt(t)?Cs:it.current,r=t.contextTypes,i=(r=r!=null)?_i(e,s):Ur),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=su,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Zg(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&su.enqueueReplaceState(t,t.state,null)}function Hf(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Ep(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=en(i):(i=vt(t)?Cs:it.current,s.context=_i(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Wf(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&su.enqueueReplaceState(s,s.state,null),gc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ji(e,t){try{var n="",r=t;do n+=VC(r),r=r.return;while(r);var s=n}catch(i){s=`
40
40
  Error generating stack: `+i.message+`
41
- `+i.stack}return{value:e,source:t,stack:s,digest:null}}function od(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var mj=typeof WeakMap=="function"?WeakMap:Map;function Tw(e,t,n){n=Zn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){bc||(bc=!0,nh=r),Gf(e,t)},n}function Rw(e,t,n){n=Zn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Gf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Gf(e,t),typeof r!="function"&&(Fr===null?Fr=new Set([this]):Fr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function ey(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new mj;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Tj.bind(null,e,t,n),t.then(e,e))}function ty(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ny(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Zn(-1,1),t.tag=2,Dr(n,t,1))),n.lanes|=1),e)}var gj=or.ReactCurrentOwner,gt=!1;function at(e,t,n,r){t.child=e===null?iw(t,null,n,r):Ci(t,e.child,n,r)}function ry(e,t,n,r,s){n=n.render;var i=t.ref;return gi(t,s),r=Mp(e,t,n,r,i,s),n=Ap(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sr(e,t,s)):(Ce&&n&&bp(t),t.flags|=1,at(e,t,r,s),t.child)}function sy(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Wp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Nw(e,t,i,r,s)):(e=Dl(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:qo,n(o,r)&&e.ref===t.ref)return sr(e,t,s)}return t.flags|=1,e=zr(i,r),e.ref=t.ref,e.return=t,t.child=e}function Nw(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(qo(i,r)&&e.ref===t.ref)if(gt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(gt=!0);else return t.lanes=e.lanes,sr(e,t,s)}return Kf(e,t,n,r,s)}function Iw(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},xe(ai,It),It|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,xe(ai,It),It|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,xe(ai,It),It|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,xe(ai,It),It|=r;return at(e,t,s,n),t.child}function Mw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Kf(e,t,n,r,s){var i=vt(n)?Cs:it.current;return i=_i(t,i),gi(t,s),n=Mp(e,t,n,r,i,s),r=Ap(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sr(e,t,s)):(Ce&&r&&bp(t),t.flags|=1,at(e,t,n,s),t.child)}function iy(e,t,n,r,s){if(vt(n)){var i=!0;dc(t)}else i=!1;if(gi(t,s),t.stateNode===null)Ml(e,t),Ew(t,n,r),Hf(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=en(c):(c=vt(n)?Cs:it.current,c=_i(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Zg(t,o,r,c),br=!1;var h=t.memoizedState;o.state=h,gc(t,r,o,s),l=t.memoizedState,a!==r||h!==l||xt.current||br?(typeof u=="function"&&(Wf(t,n,u,r),l=t.memoizedState),(a=br||Jg(t,n,a,r,h,l,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,aw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:fn(t.type,a),o.props=c,d=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=en(l):(l=vt(n)?Cs:it.current,l=_i(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&Zg(t,o,r,l),br=!1,h=t.memoizedState,o.state=h,gc(t,r,o,s);var m=t.memoizedState;a!==d||h!==m||xt.current||br?(typeof p=="function"&&(Wf(t,n,p,r),m=t.memoizedState),(c=br||Jg(t,n,c,r,h,m,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Qf(e,t,n,r,i,s)}function Qf(e,t,n,r,s,i){Mw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&Wg(t,n,!1),sr(e,t,i);r=t.stateNode,gj.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ci(t,e.child,null,i),t.child=Ci(t,null,a,i)):at(e,t,a,i),t.memoizedState=r.state,s&&Wg(t,n,!0),t.child}function Aw(e){var t=e.stateNode;t.pendingContext?Ug(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ug(e,t.context,!1),Tp(e,t.containerInfo)}function oy(e,t,n,r,s){return Si(),_p(s),t.flags|=256,at(e,t,n,r),t.child}var qf={dehydrated:null,treeContext:null,retryLane:0};function Yf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Lw(e,t,n){var r=t.pendingProps,s=Pe.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),xe(Pe,s&1),e===null)return Vf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=au(o,r,0,null),e=xs(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Yf(n),t.memoizedState=qf,e):Fp(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return yj(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=zr(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=zr(a,i):(i=xs(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Yf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=qf,r}return i=e.child,e=i.sibling,r=zr(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Fp(e,t){return t=au({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function qa(e,t,n,r){return r!==null&&_p(r),Ci(t,e.child,null,n),e=Fp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yj(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=od(Error(U(422))),qa(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=au({mode:"visible",children:r.children},s,0,null),i=xs(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ci(t,e.child,null,o),t.child.memoizedState=Yf(o),t.memoizedState=qf,i);if(!(t.mode&1))return qa(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(U(419)),r=od(i,r,void 0),qa(e,t,o,r)}if(a=(o&e.childLanes)!==0,gt||a){if(r=Ke,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,rr(e,s),gn(r,e,s,-1))}return Up(),r=od(Error(U(421))),qa(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Rj.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Mt=Lr(s.nextSibling),Lt=t,Ce=!0,pn=null,e!==null&&(Gt[Kt++]=Xn,Gt[Kt++]=Jn,Gt[Kt++]=Ps,Xn=e.id,Jn=e.overflow,Ps=t),t=Fp(t,r.children),t.flags|=4096,t)}function ay(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Uf(e.return,t,n)}function ad(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function Dw(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(at(e,t,r.children,n),r=Pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ay(e,n,t);else if(e.tag===19)ay(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(xe(Pe,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&yc(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),ad(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&yc(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}ad(t,!0,n,null,i);break;case"together":ad(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ml(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,n=zr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xj(e,t,n){switch(t.tag){case 3:Aw(t),Si();break;case 5:lw(t);break;case 1:vt(t.type)&&dc(t);break;case 4:Tp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;xe(pc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(xe(Pe,Pe.current&1),t.flags|=128,null):n&t.child.childLanes?Lw(e,t,n):(xe(Pe,Pe.current&1),e=sr(e,t,n),e!==null?e.sibling:null);xe(Pe,Pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Dw(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),xe(Pe,Pe.current),r)break;return null;case 22:case 23:return t.lanes=0,Iw(e,t,n)}return sr(e,t,n)}var Fw,Xf,Ow,zw;Fw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Xf=function(){};Ow=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,hs(Mn.current);var i=null;switch(n){case"input":s=vf(e,s),r=vf(e,r),i=[];break;case"select":s=Re({},s,{value:void 0}),r=Re({},r,{value:void 0}),i=[];break;case"textarea":s=kf(e,s),r=kf(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=cc)}Sf(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Vo.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Vo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&be("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};zw=function(e,t,n,r){n!==r&&(t.flags|=4)};function ro(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vj(e,t,n){var r=t.pendingProps;switch(kp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return vt(t.type)&&uc(),tt(t),null;case 3:return r=t.stateNode,Pi(),ke(xt),ke(it),Np(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ka(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pn!==null&&(ih(pn),pn=null))),Xf(e,t),tt(t),null;case 5:Rp(t);var s=hs(ea.current);if(n=t.type,e!==null&&t.stateNode!=null)Ow(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return tt(t),null}if(e=hs(Mn.current),Ka(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rn]=t,r[Jo]=i,e=(t.mode&1)!==0,n){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(s=0;s<ko.length;s++)be(ko[s],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":gg(r,i),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},be("invalid",r);break;case"textarea":xg(r,i),be("invalid",r)}Sf(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ga(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ga(r.textContent,a,e),s=["children",""+a]):Vo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&be("scroll",r)}switch(n){case"input":Oa(r),yg(r,i,!0);break;case"textarea":Oa(r),vg(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=cc)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=h1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Rn]=t,e[Jo]=r,Fw(e,t,!1,!1),t.stateNode=e;e:{switch(o=Cf(n,r),n){case"dialog":be("cancel",e),be("close",e),s=r;break;case"iframe":case"object":case"embed":be("load",e),s=r;break;case"video":case"audio":for(s=0;s<ko.length;s++)be(ko[s],e);s=r;break;case"source":be("error",e),s=r;break;case"img":case"image":case"link":be("error",e),be("load",e),s=r;break;case"details":be("toggle",e),s=r;break;case"input":gg(e,r),s=vf(e,r),be("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Re({},r,{value:void 0}),be("invalid",e);break;case"textarea":xg(e,r),s=kf(e,r),be("invalid",e);break;default:s=r}Sf(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?g1(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&p1(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Uo(e,l):typeof l=="number"&&Uo(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Vo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&be("scroll",e):l!=null&&ap(e,i,l,o))}switch(n){case"input":Oa(e),yg(e,r,!1);break;case"textarea":Oa(e),vg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?fi(e,!!r.multiple,i,!1):r.defaultValue!=null&&fi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=cc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tt(t),null;case 6:if(e&&t.stateNode!=null)zw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(n=hs(ea.current),hs(Mn.current),Ka(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rn]=t,(i=r.nodeValue!==n)&&(e=Lt,e!==null))switch(e.tag){case 3:Ga(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ga(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rn]=t,t.stateNode=r}return tt(t),null;case 13:if(ke(Pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ce&&Mt!==null&&t.mode&1&&!(t.flags&128))rw(),Si(),t.flags|=98560,i=!1;else if(i=Ka(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(U(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(U(317));i[Rn]=t}else Si(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else pn!==null&&(ih(pn),pn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Pe.current&1?Ve===0&&(Ve=3):Up())),t.updateQueue!==null&&(t.flags|=4),tt(t),null);case 4:return Pi(),Xf(e,t),e===null&&Yo(t.stateNode.containerInfo),tt(t),null;case 10:return Pp(t.type._context),tt(t),null;case 17:return vt(t.type)&&uc(),tt(t),null;case 19:if(ke(Pe),i=t.memoizedState,i===null)return tt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)ro(i,!1);else{if(Ve!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=yc(e),o!==null){for(t.flags|=128,ro(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return xe(Pe,Pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&Le()>Ei&&(t.flags|=128,r=!0,ro(i,!1),t.lanes=4194304)}else{if(!r)if(e=yc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ro(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ce)return tt(t),null}else 2*Le()-i.renderingStartTime>Ei&&n!==1073741824&&(t.flags|=128,r=!0,ro(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Le(),t.sibling=null,n=Pe.current,xe(Pe,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return Vp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?It&1073741824&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function wj(e,t){switch(kp(t),t.tag){case 1:return vt(t.type)&&uc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pi(),ke(xt),ke(it),Np(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Rp(t),null;case 13:if(ke(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));Si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Pe),null;case 4:return Pi(),null;case 10:return Pp(t.type._context),null;case 22:case 23:return Vp(),null;case 24:return null;default:return null}}var Ya=!1,rt=!1,bj=typeof WeakSet=="function"?WeakSet:Set,G=null;function oi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Me(e,t,r)}else n.current=null}function Jf(e,t,n){try{n()}catch(r){Me(e,t,r)}}var ly=!1;function kj(e,t){if(Lf=oc,e=W1(),wp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,d=e,h=null;t:for(;;){for(var p;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++c===s&&(a=o),h===i&&++u===r&&(l=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Df={focusedElem:e,selectionRange:n},oc=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,w=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:fn(t.type,y),w);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(b){Me(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return m=ly,ly=!1,m}function No(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Jf(t,n,i)}s=s.next}while(s!==r)}}function iu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Zf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function $w(e){var t=e.alternate;t!==null&&(e.alternate=null,$w(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rn],delete t[Jo],delete t[zf],delete t[sj],delete t[ij])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Bw(e){return e.tag===5||e.tag===3||e.tag===4}function cy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function eh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=cc));else if(r!==4&&(e=e.child,e!==null))for(eh(e,t,n),e=e.sibling;e!==null;)eh(e,t,n),e=e.sibling}function th(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(th(e,t,n),e=e.sibling;e!==null;)th(e,t,n),e=e.sibling}var Qe=null,hn=!1;function lr(e,t,n){for(n=n.child;n!==null;)Vw(e,t,n),n=n.sibling}function Vw(e,t,n){if(In&&typeof In.onCommitFiberUnmount=="function")try{In.onCommitFiberUnmount(Xc,n)}catch{}switch(n.tag){case 5:rt||oi(n,t);case 6:var r=Qe,s=hn;Qe=null,lr(e,t,n),Qe=r,hn=s,Qe!==null&&(hn?(e=Qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Qe.removeChild(n.stateNode));break;case 18:Qe!==null&&(hn?(e=Qe,n=n.stateNode,e.nodeType===8?ed(e.parentNode,n):e.nodeType===1&&ed(e,n),Ko(e)):ed(Qe,n.stateNode));break;case 4:r=Qe,s=hn,Qe=n.stateNode.containerInfo,hn=!0,lr(e,t,n),Qe=r,hn=s;break;case 0:case 11:case 14:case 15:if(!rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Jf(n,t,o),s=s.next}while(s!==r)}lr(e,t,n);break;case 1:if(!rt&&(oi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Me(n,t,a)}lr(e,t,n);break;case 21:lr(e,t,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,lr(e,t,n),rt=r):lr(e,t,n);break;default:lr(e,t,n)}}function uy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new bj),t.forEach(function(r){var s=Nj.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function on(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Qe=a.stateNode,hn=!1;break e;case 3:Qe=a.stateNode.containerInfo,hn=!0;break e;case 4:Qe=a.stateNode.containerInfo,hn=!0;break e}a=a.return}if(Qe===null)throw Error(U(160));Vw(i,o,s),Qe=null,hn=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Me(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Uw(t,e),t=t.sibling}function Uw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(on(t,e),bn(e),r&4){try{No(3,e,e.return),iu(3,e)}catch(y){Me(e,e.return,y)}try{No(5,e,e.return)}catch(y){Me(e,e.return,y)}}break;case 1:on(t,e),bn(e),r&512&&n!==null&&oi(n,n.return);break;case 5:if(on(t,e),bn(e),r&512&&n!==null&&oi(n,n.return),e.flags&32){var s=e.stateNode;try{Uo(s,"")}catch(y){Me(e,e.return,y)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&d1(s,i),Cf(a,o);var c=Cf(a,i);for(o=0;o<l.length;o+=2){var u=l[o],d=l[o+1];u==="style"?g1(s,d):u==="dangerouslySetInnerHTML"?p1(s,d):u==="children"?Uo(s,d):ap(s,u,d,c)}switch(a){case"input":wf(s,i);break;case"textarea":f1(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?fi(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?fi(s,!!i.multiple,i.defaultValue,!0):fi(s,!!i.multiple,i.multiple?[]:"",!1))}s[Jo]=i}catch(y){Me(e,e.return,y)}}break;case 6:if(on(t,e),bn(e),r&4){if(e.stateNode===null)throw Error(U(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){Me(e,e.return,y)}}break;case 3:if(on(t,e),bn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ko(t.containerInfo)}catch(y){Me(e,e.return,y)}break;case 4:on(t,e),bn(e);break;case 13:on(t,e),bn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||($p=Le())),r&4&&uy(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(rt=(c=rt)||u,on(t,e),rt=c):on(t,e),bn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(G=e,u=e.child;u!==null;){for(d=G=u;G!==null;){switch(h=G,p=h.child,h.tag){case 0:case 11:case 14:case 15:No(4,h,h.return);break;case 1:oi(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(y){Me(r,n,y)}}break;case 5:oi(h,h.return);break;case 22:if(h.memoizedState!==null){fy(d);continue}}p!==null?(p.return=h,G=p):fy(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=m1("display",o))}catch(y){Me(e,e.return,y)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(y){Me(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:on(t,e),bn(e),r&4&&uy(e);break;case 21:break;default:on(t,e),bn(e)}}function bn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Bw(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Uo(s,""),r.flags&=-33);var i=cy(e);th(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=cy(e);eh(e,a,o);break;default:throw Error(U(161))}}catch(l){Me(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _j(e,t,n){G=e,Ww(e)}function Ww(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var s=G,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Ya;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||rt;a=Ya;var c=rt;if(Ya=o,(rt=l)&&!c)for(G=s;G!==null;)o=G,l=o.child,o.tag===22&&o.memoizedState!==null?hy(s):l!==null?(l.return=o,G=l):hy(s);for(;i!==null;)G=i,Ww(i),i=i.sibling;G=s,Ya=a,rt=c}dy(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,G=i):dy(e)}}function dy(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rt||iu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!rt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:fn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&qg(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qg(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Ko(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}rt||t.flags&512&&Zf(t)}catch(h){Me(t,t.return,h)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function fy(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function hy(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{iu(4,t)}catch(l){Me(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Me(t,s,l)}}var i=t.return;try{Zf(t)}catch(l){Me(t,i,l)}break;case 5:var o=t.return;try{Zf(t)}catch(l){Me(t,o,l)}}}catch(l){Me(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var Sj=Math.ceil,wc=or.ReactCurrentDispatcher,Op=or.ReactCurrentOwner,Xt=or.ReactCurrentBatchConfig,oe=0,Ke=null,ze=null,Xe=0,It=0,ai=Qr(0),Ve=0,sa=null,Es=0,ou=0,zp=0,Io=null,mt=null,$p=0,Ei=1/0,Gn=null,bc=!1,nh=null,Fr=null,Xa=!1,Pr=null,kc=0,Mo=0,rh=null,Al=-1,Ll=0;function ut(){return oe&6?Le():Al!==-1?Al:Al=Le()}function Or(e){return e.mode&1?oe&2&&Xe!==0?Xe&-Xe:aj.transition!==null?(Ll===0&&(Ll=E1()),Ll):(e=ce,e!==0||(e=window.event,e=e===void 0?16:L1(e.type)),e):1}function gn(e,t,n,r){if(50<Mo)throw Mo=0,rh=null,Error(U(185));ma(e,n,r),(!(oe&2)||e!==Ke)&&(e===Ke&&(!(oe&2)&&(ou|=n),Ve===4&&Sr(e,Xe)),wt(e,r),n===1&&oe===0&&!(t.mode&1)&&(Ei=Le()+500,nu&&qr()))}function wt(e,t){var n=e.callbackNode;aP(e,t);var r=ic(e,e===Ke?Xe:0);if(r===0)n!==null&&kg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&kg(n),t===1)e.tag===0?oj(py.bind(null,e)):ew(py.bind(null,e)),nj(function(){!(oe&6)&&qr()}),n=null;else{switch(T1(r)){case 1:n=fp;break;case 4:n=P1;break;case 16:n=sc;break;case 536870912:n=j1;break;default:n=sc}n=Jw(n,Hw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Hw(e,t){if(Al=-1,Ll=0,oe&6)throw Error(U(327));var n=e.callbackNode;if(yi()&&e.callbackNode!==n)return null;var r=ic(e,e===Ke?Xe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=_c(e,r);else{t=r;var s=oe;oe|=2;var i=Kw();(Ke!==e||Xe!==t)&&(Gn=null,Ei=Le()+500,ys(e,t));do try{jj();break}catch(a){Gw(e,a)}while(!0);Cp(),wc.current=i,oe=s,ze!==null?t=0:(Ke=null,Xe=0,t=Ve)}if(t!==0){if(t===2&&(s=Rf(e),s!==0&&(r=s,t=sh(e,s))),t===1)throw n=sa,ys(e,0),Sr(e,r),wt(e,Le()),n;if(t===6)Sr(e,r);else{if(s=e.current.alternate,!(r&30)&&!Cj(s)&&(t=_c(e,r),t===2&&(i=Rf(e),i!==0&&(r=i,t=sh(e,i))),t===1))throw n=sa,ys(e,0),Sr(e,r),wt(e,Le()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:as(e,mt,Gn);break;case 3:if(Sr(e,r),(r&130023424)===r&&(t=$p+500-Le(),10<t)){if(ic(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ut(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Of(as.bind(null,e,mt,Gn),t);break}as(e,mt,Gn);break;case 4:if(Sr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-mn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sj(r/1960))-r,10<r){e.timeoutHandle=Of(as.bind(null,e,mt,Gn),r);break}as(e,mt,Gn);break;case 5:as(e,mt,Gn);break;default:throw Error(U(329))}}}return wt(e,Le()),e.callbackNode===n?Hw.bind(null,e):null}function sh(e,t){var n=Io;return e.current.memoizedState.isDehydrated&&(ys(e,t).flags|=256),e=_c(e,t),e!==2&&(t=mt,mt=n,t!==null&&ih(t)),e}function ih(e){mt===null?mt=e:mt.push.apply(mt,e)}function Cj(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!xn(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Sr(e,t){for(t&=~zp,t&=~ou,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-mn(t),r=1<<n;e[n]=-1,t&=~r}}function py(e){if(oe&6)throw Error(U(327));yi();var t=ic(e,0);if(!(t&1))return wt(e,Le()),null;var n=_c(e,t);if(e.tag!==0&&n===2){var r=Rf(e);r!==0&&(t=r,n=sh(e,r))}if(n===1)throw n=sa,ys(e,0),Sr(e,t),wt(e,Le()),n;if(n===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,as(e,mt,Gn),wt(e,Le()),null}function Bp(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(Ei=Le()+500,nu&&qr())}}function Ts(e){Pr!==null&&Pr.tag===0&&!(oe&6)&&yi();var t=oe;oe|=1;var n=Xt.transition,r=ce;try{if(Xt.transition=null,ce=1,e)return e()}finally{ce=r,Xt.transition=n,oe=t,!(oe&6)&&qr()}}function Vp(){It=ai.current,ke(ai)}function ys(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,tj(n)),ze!==null)for(n=ze.return;n!==null;){var r=n;switch(kp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&uc();break;case 3:Pi(),ke(xt),ke(it),Np();break;case 5:Rp(r);break;case 4:Pi();break;case 13:ke(Pe);break;case 19:ke(Pe);break;case 10:Pp(r.type._context);break;case 22:case 23:Vp()}n=n.return}if(Ke=e,ze=e=zr(e.current,null),Xe=It=t,Ve=0,sa=null,zp=ou=Es=0,mt=Io=null,fs!==null){for(t=0;t<fs.length;t++)if(n=fs[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}fs=null}return e}function Gw(e,t){do{var n=ze;try{if(Cp(),Nl.current=vc,xc){for(var r=je.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}xc=!1}if(js=0,Ge=Be=je=null,Ro=!1,ta=0,Op.current=null,n===null||n.return===null){Ve=1,sa=t,ze=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Xe,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=ty(o);if(p!==null){p.flags&=-257,ny(p,o,a,i,t),p.mode&1&&ey(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var y=new Set;y.add(l),t.updateQueue=y}else m.add(l);break e}else{if(!(t&1)){ey(i,c,t),Up();break e}l=Error(U(426))}}else if(Ce&&a.mode&1){var w=ty(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),ny(w,o,a,i,t),_p(ji(l,a));break e}}i=l=ji(l,a),Ve!==4&&(Ve=2),Io===null?Io=[i]:Io.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=Tw(i,l,t);Qg(i,g);break e;case 1:a=l;var x=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Fr===null||!Fr.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=Rw(i,a,t);Qg(i,b);break e}}i=i.return}while(i!==null)}qw(n)}catch(S){t=S,ze===n&&n!==null&&(ze=n=n.return);continue}break}while(!0)}function Kw(){var e=wc.current;return wc.current=vc,e===null?vc:e}function Up(){(Ve===0||Ve===3||Ve===2)&&(Ve=4),Ke===null||!(Es&268435455)&&!(ou&268435455)||Sr(Ke,Xe)}function _c(e,t){var n=oe;oe|=2;var r=Kw();(Ke!==e||Xe!==t)&&(Gn=null,ys(e,t));do try{Pj();break}catch(s){Gw(e,s)}while(!0);if(Cp(),oe=n,wc.current=r,ze!==null)throw Error(U(261));return Ke=null,Xe=0,Ve}function Pj(){for(;ze!==null;)Qw(ze)}function jj(){for(;ze!==null&&!JC();)Qw(ze)}function Qw(e){var t=Xw(e.alternate,e,It);e.memoizedProps=e.pendingProps,t===null?qw(e):ze=t,Op.current=null}function qw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=wj(n,t),n!==null){n.flags&=32767,ze=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ve=6,ze=null;return}}else if(n=vj(n,t,It),n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);Ve===0&&(Ve=5)}function as(e,t,n){var r=ce,s=Xt.transition;try{Xt.transition=null,ce=1,Ej(e,t,n,r)}finally{Xt.transition=s,ce=r}return null}function Ej(e,t,n,r){do yi();while(Pr!==null);if(oe&6)throw Error(U(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(lP(e,i),e===Ke&&(ze=Ke=null,Xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xa||(Xa=!0,Jw(sc,function(){return yi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Xt.transition,Xt.transition=null;var o=ce;ce=1;var a=oe;oe|=4,Op.current=null,kj(e,n),Uw(n,e),QP(Df),oc=!!Lf,Df=Lf=null,e.current=n,_j(n),ZC(),oe=a,ce=o,Xt.transition=i}else e.current=n;if(Xa&&(Xa=!1,Pr=e,kc=s),i=e.pendingLanes,i===0&&(Fr=null),nP(n.stateNode),wt(e,Le()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(bc)throw bc=!1,e=nh,nh=null,e;return kc&1&&e.tag!==0&&yi(),i=e.pendingLanes,i&1?e===rh?Mo++:(Mo=0,rh=e):Mo=0,qr(),null}function yi(){if(Pr!==null){var e=T1(kc),t=Xt.transition,n=ce;try{if(Xt.transition=null,ce=16>e?16:e,Pr===null)var r=!1;else{if(e=Pr,Pr=null,kc=0,oe&6)throw Error(U(331));var s=oe;for(oe|=4,G=e.current;G!==null;){var i=G,o=i.child;if(G.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(G=c;G!==null;){var u=G;switch(u.tag){case 0:case 11:case 15:No(8,u,i)}var d=u.child;if(d!==null)d.return=u,G=d;else for(;G!==null;){u=G;var h=u.sibling,p=u.return;if($w(u),u===c){G=null;break}if(h!==null){h.return=p,G=h;break}G=p}}}var m=i.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var w=y.sibling;y.sibling=null,y=w}while(y!==null)}}G=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,G=o;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:No(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,G=g;break e}G=i.return}}var x=e.current;for(G=x;G!==null;){o=G;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,G=v;else e:for(o=x;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:iu(9,a)}}catch(S){Me(a,a.return,S)}if(a===o){G=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,G=b;break e}G=a.return}}if(oe=s,qr(),In&&typeof In.onPostCommitFiberRoot=="function")try{In.onPostCommitFiberRoot(Xc,e)}catch{}r=!0}return r}finally{ce=n,Xt.transition=t}}return!1}function my(e,t,n){t=ji(n,t),t=Tw(e,t,1),e=Dr(e,t,1),t=ut(),e!==null&&(ma(e,1,t),wt(e,t))}function Me(e,t,n){if(e.tag===3)my(e,e,n);else for(;t!==null;){if(t.tag===3){my(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fr===null||!Fr.has(r))){e=ji(n,e),e=Rw(t,e,1),t=Dr(t,e,1),e=ut(),t!==null&&(ma(t,1,e),wt(t,e));break}}t=t.return}}function Tj(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ut(),e.pingedLanes|=e.suspendedLanes&n,Ke===e&&(Xe&n)===n&&(Ve===4||Ve===3&&(Xe&130023424)===Xe&&500>Le()-$p?ys(e,0):zp|=n),wt(e,t)}function Yw(e,t){t===0&&(e.mode&1?(t=Ba,Ba<<=1,!(Ba&130023424)&&(Ba=4194304)):t=1);var n=ut();e=rr(e,t),e!==null&&(ma(e,t,n),wt(e,n))}function Rj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yw(e,n)}function Nj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),Yw(e,n)}var Xw;Xw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||xt.current)gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return gt=!1,xj(e,t,n);gt=!!(e.flags&131072)}else gt=!1,Ce&&t.flags&1048576&&tw(t,hc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ml(e,t),e=t.pendingProps;var s=_i(t,it.current);gi(t,n),s=Mp(null,t,r,e,s,n);var i=Ap();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vt(r)?(i=!0,dc(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ep(t),s.updater=su,t.stateNode=s,s._reactInternals=t,Hf(t,r,e,n),t=Qf(null,t,r,!0,i,n)):(t.tag=0,Ce&&i&&bp(t),at(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ml(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Mj(r),e=fn(r,e),s){case 0:t=Kf(null,t,r,e,n);break e;case 1:t=iy(null,t,r,e,n);break e;case 11:t=ry(null,t,r,e,n);break e;case 14:t=sy(null,t,r,fn(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),Kf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),iy(e,t,r,s,n);case 3:e:{if(Aw(t),e===null)throw Error(U(387));r=t.pendingProps,i=t.memoizedState,s=i.element,aw(e,t),gc(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=ji(Error(U(423)),t),t=oy(e,t,r,n,s);break e}else if(r!==s){s=ji(Error(U(424)),t),t=oy(e,t,r,n,s);break e}else for(Mt=Lr(t.stateNode.containerInfo.firstChild),Lt=t,Ce=!0,pn=null,n=iw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Si(),r===s){t=sr(e,t,n);break e}at(e,t,r,n)}t=t.child}return t;case 5:return lw(t),e===null&&Vf(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Ff(r,s)?o=null:i!==null&&Ff(r,i)&&(t.flags|=32),Mw(e,t),at(e,t,o,n),t.child;case 6:return e===null&&Vf(t),null;case 13:return Lw(e,t,n);case 4:return Tp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ci(t,null,r,n):at(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),ry(e,t,r,s,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,xe(pc,r._currentValue),r._currentValue=o,i!==null)if(xn(i.value,o)){if(i.children===s.children&&!xt.current){t=sr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Zn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Uf(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(U(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Uf(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}at(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,gi(t,n),s=en(s),r=r(s),t.flags|=1,at(e,t,r,n),t.child;case 14:return r=t.type,s=fn(r,t.pendingProps),s=fn(r.type,s),sy(e,t,r,s,n);case 15:return Nw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),Ml(e,t),t.tag=1,vt(r)?(e=!0,dc(t)):e=!1,gi(t,n),Ew(t,r,s),Hf(t,r,s,n),Qf(null,t,r,!0,e,n);case 19:return Dw(e,t,n);case 22:return Iw(e,t,n)}throw Error(U(156,t.tag))};function Jw(e,t){return C1(e,t)}function Ij(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,t,n,r){return new Ij(e,t,n,r)}function Wp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mj(e){if(typeof e=="function")return Wp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===cp)return 11;if(e===up)return 14}return 2}function zr(e,t){var n=e.alternate;return n===null?(n=qt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Dl(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Wp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Xs:return xs(n.children,s,i,t);case lp:o=8,s|=8;break;case mf:return e=qt(12,n,t,s|2),e.elementType=mf,e.lanes=i,e;case gf:return e=qt(13,n,t,s),e.elementType=gf,e.lanes=i,e;case yf:return e=qt(19,n,t,s),e.elementType=yf,e.lanes=i,e;case l1:return au(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case o1:o=10;break e;case a1:o=9;break e;case cp:o=11;break e;case up:o=14;break e;case wr:o=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=qt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function xs(e,t,n,r){return e=qt(7,e,r,t),e.lanes=n,e}function au(e,t,n,r){return e=qt(22,e,r,t),e.elementType=l1,e.lanes=n,e.stateNode={isHidden:!1},e}function ld(e,t,n){return e=qt(6,e,null,t),e.lanes=n,e}function cd(e,t,n){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Aj(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Uu(0),this.expirationTimes=Uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uu(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Hp(e,t,n,r,s,i,o,a,l){return e=new Aj(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=qt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ep(i),e}function Lj(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ys,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Zw(e){if(!e)return Ur;e=e._reactInternals;e:{if(Is(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var n=e.type;if(vt(n))return Z1(e,n,t)}return t}function eb(e,t,n,r,s,i,o,a,l){return e=Hp(n,r,!0,e,s,i,o,a,l),e.context=Zw(null),n=e.current,r=ut(),s=Or(n),i=Zn(r,s),i.callback=t??null,Dr(n,i,s),e.current.lanes=s,ma(e,s,r),wt(e,r),e}function lu(e,t,n,r){var s=t.current,i=ut(),o=Or(s);return n=Zw(n),t.context===null?t.context=n:t.pendingContext=n,t=Zn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Dr(s,t,o),e!==null&&(gn(e,s,o,i),Rl(e,s,o)),o}function Sc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function gy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gp(e,t){gy(e,t),(e=e.alternate)&&gy(e,t)}function Dj(){return null}var tb=typeof reportError=="function"?reportError:function(e){console.error(e)};function Kp(e){this._internalRoot=e}cu.prototype.render=Kp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));lu(e,t,null,null)};cu.prototype.unmount=Kp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ts(function(){lu(null,e,null,null)}),t[nr]=null}};function cu(e){this._internalRoot=e}cu.prototype.unstable_scheduleHydration=function(e){if(e){var t=I1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_r.length&&t!==0&&t<_r[n].priority;n++);_r.splice(n,0,e),n===0&&A1(e)}};function Qp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function uu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function yy(){}function Fj(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=Sc(o);i.call(c)}}var o=eb(t,r,e,0,null,!1,!1,"",yy);return e._reactRootContainer=o,e[nr]=o.current,Yo(e.nodeType===8?e.parentNode:e),Ts(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Sc(l);a.call(c)}}var l=Hp(e,0,!1,null,null,!1,!1,"",yy);return e._reactRootContainer=l,e[nr]=l.current,Yo(e.nodeType===8?e.parentNode:e),Ts(function(){lu(t,l,n,r)}),l}function du(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=Sc(o);a.call(l)}}lu(t,o,e,s)}else o=Fj(n,t,e,s,r);return Sc(o)}R1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=bo(t.pendingLanes);n!==0&&(hp(t,n|1),wt(t,Le()),!(oe&6)&&(Ei=Le()+500,qr()))}break;case 13:Ts(function(){var r=rr(e,1);if(r!==null){var s=ut();gn(r,e,1,s)}}),Gp(e,1)}};pp=function(e){if(e.tag===13){var t=rr(e,134217728);if(t!==null){var n=ut();gn(t,e,134217728,n)}Gp(e,134217728)}};N1=function(e){if(e.tag===13){var t=Or(e),n=rr(e,t);if(n!==null){var r=ut();gn(n,e,t,r)}Gp(e,t)}};I1=function(){return ce};M1=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};jf=function(e,t,n){switch(t){case"input":if(wf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=tu(r);if(!s)throw Error(U(90));u1(r),wf(r,s)}}}break;case"textarea":f1(e,n);break;case"select":t=n.value,t!=null&&fi(e,!!n.multiple,t,!1)}};v1=Bp;w1=Ts;var Oj={usingClientEntryPoint:!1,Events:[ya,ti,tu,y1,x1,Bp]},so={findFiberByHostInstance:ds,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zj={bundleType:so.bundleType,version:so.version,rendererPackageName:so.rendererPackageName,rendererConfig:so.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:or.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_1(e),e===null?null:e.stateNode},findFiberByHostInstance:so.findFiberByHostInstance||Dj,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 Ja=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ja.isDisabled&&Ja.supportsFiber)try{Xc=Ja.inject(zj),In=Ja}catch{}}Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Oj;Ot.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qp(t))throw Error(U(200));return Lj(e,t,null,n)};Ot.createRoot=function(e,t){if(!Qp(e))throw Error(U(299));var n=!1,r="",s=tb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Hp(e,1,!1,null,null,n,!1,r,s),e[nr]=t.current,Yo(e.nodeType===8?e.parentNode:e),new Kp(t)};Ot.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=_1(t),e=e===null?null:e.stateNode,e};Ot.flushSync=function(e){return Ts(e)};Ot.hydrate=function(e,t,n){if(!uu(t))throw Error(U(200));return du(null,e,t,!0,n)};Ot.hydrateRoot=function(e,t,n){if(!Qp(e))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=tb;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=eb(t,null,e,1,n??null,s,!1,i,o),e[nr]=t.current,Yo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new cu(t)};Ot.render=function(e,t,n){if(!uu(t))throw Error(U(200));return du(null,e,t,!1,n)};Ot.unmountComponentAtNode=function(e){if(!uu(e))throw Error(U(40));return e._reactRootContainer?(Ts(function(){du(null,null,e,!1,function(){e._reactRootContainer=null,e[nr]=null})}),!0):!1};Ot.unstable_batchedUpdates=Bp;Ot.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!uu(n))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return du(e,t,n,!1,r)};Ot.version="18.3.1-next-f1338f8080-20240426";function nb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nb)}catch(e){console.error(e)}}nb(),n1.exports=Ot;var Ms=n1.exports,rb,xy=Ms;rb=xy.createRoot,xy.hydrateRoot;var _o=typeof window<"u"?_.useLayoutEffect:_.useEffect;function ud(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function $j(e,t,n={},r={}){_.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([i])=>{t(i)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function Bj(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}const sb=!1;function ia(e){return e[e.length-1]}function Vj(e){return typeof e=="function"}function jr(e,t){return Vj(e)?e(t):e}const Uj=Object.prototype.hasOwnProperty,vy=Object.prototype.propertyIsEnumerable,Wj=()=>Object.create(null),ns=(e,t)=>Er(e,t,Wj);function Er(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=ky(e)&&ky(s);if(!i&&!(Ti(e)&&Ti(s)))return s;const o=i?e:wy(e);if(!o)return s;const a=i?s:wy(s);if(!a)return s;const l=o.length,c=a.length,u=i?new Array(c):n();let d=0;for(let h=0;h<c;h++){const p=i?h:a[h],m=e[p],y=s[p];if(m===y){u[p]=m,(i?h<l:Uj.call(e,p))&&d++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){u[p]=y;continue}const w=Er(m,y,n,r+1);u[p]=w,w===m&&d++}return l===c&&d===l?e:u}function wy(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!vy.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!vy.call(e,s))return!1;r.push(s)}return r}function Ti(e){if(!by(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!by(n)||!n.hasOwnProperty("isPrototypeOf"))}function by(e){return Object.prototype.toString.call(e)==="[object Object]"}function ky(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vs(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!vs(e[r],t[r],n))return!1;return!0}if(Ti(e)&&Ti(t)){const r=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const o in t)if((!r||t[o]!==void 0)&&!vs(e[o],t[o],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&s++;let i=0;for(const o in t)if((!r||t[o]!==void 0)&&(i++,i>s||!vs(e[o],t[o],n)))return!1;return s===i}return!1}function Ri(e){let t,n;const r=new Promise((s,i)=>{t=s,n=i});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e==null||e(s)},r.reject=s=>{r.status="rejected",n(s)},r}function oa(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Hj(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function _y(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return Hj(t)}const Gj=["http:","https:","mailto:","tel:"];function Cc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function io(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",s;for(;(s=t.exec(e))!==null;)r+=_y(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+_y(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function Kj(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Qj(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function er(){throw new Error("Invariant failed")}function aa(e){const t=new Map;let n,r;const s=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,n=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const o=t.get(i);if(o)return s(o),o.value},set(i,o){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const a=t.get(i);if(a)a.value=o,s(a);else{const l={key:i,value:o,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(i,l)}},clear(){t.clear(),n=void 0,r=void 0}}}const Tr=4,ib=5;function qj(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function qp(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,i=e.substring(t,s);if(!i||!i.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(i==="$"){const a=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(i.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const o=qj(i);if(o){const[a,l]=o,c=i.charCodeAt(a+1);if(c===45){if(a+2<i.length&&i.charCodeAt(a+2)===36){const u=a+3,d=l;if(u<d)return n[0]=3,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+l+1,n[5]=s,n}}else if(c===36){const u=a+1,d=a+2;return d===l?(n[0]=2,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+d,n[3]=t+l,n[4]=t+l+1,n[5]=s,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function fu(e,t,n,r,s,i,o){var l,c,u,d,h,p,m,y,w,g,x,v,b;o==null||o(n);let a=r;{const S=n.fullPath??n.from,k=S.length,T=((l=n.options)==null?void 0:l.caseSensitive)??e,P=!!((u=(c=n.options)==null?void 0:c.params)!=null&&u.parse&&((h=(d=n.options)==null?void 0:d.skipRouteOnParseError)!=null&&h.params));for(;a<k;){const j=qp(S,a,t);let I;const M=a,O=j[5];switch(a=O+1,i++,j[0]){case 0:{const z=S.substring(j[2],j[3]);if(T){const E=(p=s.static)==null?void 0:p.get(z);if(E)I=E;else{s.static??(s.static=new Map);const F=ps(n.fullPath??n.from);F.parent=s,F.depth=i,I=F,s.static.set(z,F)}}else{const E=z.toLowerCase(),F=(m=s.staticInsensitive)==null?void 0:m.get(E);if(F)I=F;else{s.staticInsensitive??(s.staticInsensitive=new Map);const V=ps(n.fullPath??n.from);V.parent=s,V.depth=i,I=V,s.staticInsensitive.set(E,V)}}break}case 1:{const z=S.substring(M,j[1]),E=S.substring(j[4],O),F=T&&!!(z||E),V=z?F?z:z.toLowerCase():void 0,A=E?F?E:E.toLowerCase():void 0,B=!P&&((y=s.dynamic)==null?void 0:y.find(C=>!C.skipOnParamError&&C.caseSensitive===F&&C.prefix===V&&C.suffix===A));if(B)I=B;else{const C=fd(1,n.fullPath??n.from,F,V,A);I=C,C.depth=i,C.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(C)}break}case 3:{const z=S.substring(M,j[1]),E=S.substring(j[4],O),F=T&&!!(z||E),V=z?F?z:z.toLowerCase():void 0,A=E?F?E:E.toLowerCase():void 0,B=!P&&((w=s.optional)==null?void 0:w.find(C=>!C.skipOnParamError&&C.caseSensitive===F&&C.prefix===V&&C.suffix===A));if(B)I=B;else{const C=fd(3,n.fullPath??n.from,F,V,A);I=C,C.parent=s,C.depth=i,s.optional??(s.optional=[]),s.optional.push(C)}break}case 2:{const z=S.substring(M,j[1]),E=S.substring(j[4],O),F=T&&!!(z||E),V=z?F?z:z.toLowerCase():void 0,A=E?F?E:E.toLowerCase():void 0,B=fd(2,n.fullPath??n.from,F,V,A);I=B,B.parent=s,B.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push(B)}}s=I}if(P&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const j=ps(n.fullPath??n.from);j.kind=ib,j.parent=s,i++,j.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(j),s=j}const R=(n.path||!n.children)&&!n.isRoot;if(R&&S.endsWith("/")){const j=ps(n.fullPath??n.from);j.kind=Tr,j.parent=s,i++,j.depth=i,s.index=j,s=j}s.parse=((x=(g=n.options)==null?void 0:g.params)==null?void 0:x.parse)??null,s.skipOnParamError=P,s.parsingPriority=((b=(v=n.options)==null?void 0:v.skipRouteOnParseError)==null?void 0:b.priority)??0,R&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const S of n.children)fu(e,t,S,a,s,i,o)}function dd(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function kr(e){var t,n,r;if(e.pathless)for(const s of e.pathless)kr(s);if(e.static)for(const s of e.static.values())kr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())kr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(dd);for(const s of e.dynamic)kr(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(dd);for(const s of e.optional)kr(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(dd);for(const s of e.wildcard)kr(s)}}function ps(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function fd(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function Yj(e,t){const n=ps("/"),r=new Uint16Array(6);for(const s of e)fu(!1,r,s,1,n,0);kr(n),t.masksTree=n,t.flatCache=aa(1e3)}function Xj(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=Yp(e,t.masksTree);return t.flatCache.set(e,r),r}function Jj(e,t,n,r,s){e||(e="/"),r||(r="/");const i=t?`case\0${e}`:e;let o=s.singleCache.get(i);return o||(o=ps("/"),fu(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),Yp(r,o,n)}function Zj(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=Yp(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=nE(i.route)),t.matchCache.set(r,i),i}function eE(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function tE(e,t=!1,n){const r=ps(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return fu(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&er(),i[l.id]=l,a!==0&&l.path){const c=eE(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),kr(r),{processedTree:{segmentTree:r,singleCache:aa(1e3),matchCache:aa(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function Yp(e,t,n=!1){const r=e.split("/"),s=sE(e,r,t,n);if(!s)return null;const[i]=ob(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function ob(e,t,n){var u,d,h,p,m,y,w,g,x,v;const r=rE(n.node);let s=null;const i=Object.create(null);let o=((u=n.extract)==null?void 0:u.part)??0,a=((d=n.extract)==null?void 0:d.node)??0,l=((h=n.extract)==null?void 0:h.path)??0,c=((p=n.extract)==null?void 0:p.segment)??0;for(;a<r.length;o++,a++,l++,c++){const b=r[a];if(b.kind===Tr)break;if(b.kind===ib){c--,o--,l--;continue}const S=t[o],k=l;if(S&&(l+=S.length),b.kind===1){s??(s=n.node.fullPath.split("/"));const T=s[c],P=((m=b.prefix)==null?void 0:m.length)??0;if(T.charCodeAt(P)===123){const R=((y=b.suffix)==null?void 0:y.length)??0,j=T.substring(P+2,T.length-R-1),I=S.substring(P,S.length-R);i[j]=decodeURIComponent(I)}else{const R=T.substring(1);i[R]=decodeURIComponent(S)}}else if(b.kind===3){if(n.skipped&1<<a){o--,l=k-1;continue}s??(s=n.node.fullPath.split("/"));const T=s[c],P=((w=b.prefix)==null?void 0:w.length)??0,R=((g=b.suffix)==null?void 0:g.length)??0,j=T.substring(P+3,T.length-R-1),I=b.suffix||b.prefix?S.substring(P,S.length-R):S;I&&(i[j]=decodeURIComponent(I))}else if(b.kind===2){const T=b,P=e.substring(k+(((x=T.prefix)==null?void 0:x.length)??0),e.length-(((v=T.suffix)==null?void 0:v.length)??0)),R=decodeURIComponent(P);i["*"]=R,i._splat=R;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function nE(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function rE(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function sE(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!ia(t),i=s&&e!=="/",o=t.length-(s?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let l=null,c=null;for(;a.length;){const u=a.pop(),{node:d,index:h,skipped:p,depth:m,statics:y,dynamics:w,optionals:g}=u;let{extract:x,rawParams:v,parsedParams:b}=u;if(d.kind===2&&d.route&&!el(c,u))continue;if(d.skipOnParamError){if(!Sy(e,t,u))continue;v=u.rawParams,x=u.extract,b=u.parsedParams}r&&d.route&&d.kind!==Tr&&el(l,u)&&(l=u);const S=h===o;if(S&&(d.route&&(!i||d.kind===Tr||d.kind===2)&&el(c,u)&&(c=u),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;const k=S?void 0:t[h];let T;if(S&&d.index){const P={node:d.index,index:h,skipped:p,depth:m+1,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b};let R=!0;if(d.index.skipOnParamError&&(Sy(e,t,P)||(R=!1)),R){if(!w&&!g&&!p&&iE(y,o))return P;el(c,P)&&(c=P)}}if(d.wildcard)for(let P=d.wildcard.length-1;P>=0;P--){const R=d.wildcard[P],{prefix:j,suffix:I}=R;if(!(j&&(S||!(R.caseSensitive?k:T??(T=k.toLowerCase())).startsWith(j)))){if(I){if(S)continue;const M=t.slice(h).join("/").slice(-I.length);if((R.caseSensitive?M:M.toLowerCase())!==I)continue}a.push({node:R,index:o,skipped:p,depth:m+1,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}}if(d.optional){const P=p|1<<m,R=m+1;for(let j=d.optional.length-1;j>=0;j--){const I=d.optional[j];a.push({node:I,index:h,skipped:P,depth:R,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}if(!S)for(let j=d.optional.length-1;j>=0;j--){const I=d.optional[j],{prefix:M,suffix:O}=I;if(M||O){const z=I.caseSensitive?k:T??(T=k.toLowerCase());if(M&&!z.startsWith(M)||O&&!z.endsWith(O))continue}a.push({node:I,index:h+1,skipped:p,depth:R,statics:y,dynamics:w,optionals:g+Za(o,h),extract:x,rawParams:v,parsedParams:b})}}if(!S&&d.dynamic&&k)for(let P=d.dynamic.length-1;P>=0;P--){const R=d.dynamic[P],{prefix:j,suffix:I}=R;if(j||I){const M=R.caseSensitive?k:T??(T=k.toLowerCase());if(j&&!M.startsWith(j)||I&&!M.endsWith(I))continue}a.push({node:R,index:h+1,skipped:p,depth:m+1,statics:y,dynamics:w+Za(o,h),optionals:g,extract:x,rawParams:v,parsedParams:b})}if(!S&&d.staticInsensitive){const P=d.staticInsensitive.get(T??(T=k.toLowerCase()));P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+Za(o,h),dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}if(!S&&d.static){const P=d.static.get(k);P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+Za(o,h),dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}if(d.pathless){const P=m+1;for(let R=d.pathless.length-1;R>=0;R--){const j=d.pathless[R];a.push({node:j,index:h,skipped:p,depth:P,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}}}if(c)return c;if(r&&l){let u=l.index;for(let h=0;h<l.index;h++)u+=t[h].length;const d=u===e.length?"/":e.slice(u);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(d),l}return null}function Za(e,t){return 2**(e-t-1)}function iE(e,t){return e===2**(t-1)-1}function Sy(e,t,n){try{const[r,s]=ob(e,t,n);n.rawParams=r,n.extract=s;const i=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,i),!0}catch{return null}}function el(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Tr)>(e.node.kind===Tr)||t.node.kind===Tr==(e.node.kind===Tr)&&t.depth>e.depth))):!0}function Fl(e){return Xp(e.filter(t=>t!==void 0).join("/"))}function Xp(e){return e.replace(/\/{2,}/g,"/")}function ab(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function $r(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function lb(e){return $r(ab(e))}function Pc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function oE(e,t,n){return Pc(e,n)===Pc(t,n)}function aE({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),i=!s&&t===".";let o;if(r){o=s?t:i?e:e+"\0"+t;const d=r.get(o);if(d)return d}let a;if(i)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&ia(a)==="";)a.pop();const d=t.split("/");for(let h=0,p=d.length;h<p;h++){const m=d[h];m===""?h?h===p-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(ia(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,c="";for(let d=0;d<a.length;d++){d>0&&(c+="/");const h=a[d];if(!h)continue;l=qp(h,0,l);const p=l[0];if(p===0){c+=h;continue}const m=l[5],y=h.substring(0,l[1]),w=h.substring(l[4],m),g=h.substring(l[2],l[3]);p===1?c+=y||w?`${y}{$${g}}${w}`:`$${g}`:p===2?c+=y||w?`${y}{$}${w}`:"$":c+=`${y}{-$${g}}${w}`}c=Xp(c);const u=c||"/";return o&&r&&r.set(o,u),u}function lE(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,i=>t.get(i)??i)}function hd(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>Py(s,n)).join("/"):Py(r,n)}function Cy({path:e,params:t,decoder:n,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const o=e.length;let a=0,l,c="";for(;a<o;){const u=a;l=qp(e,u,l);const d=l[5];if(a=d+1,u===d)continue;const h=l[0];if(h===0){c+="/"+e.substring(u,d);continue}if(h===2){const p=t._splat;i._splat=p,i["*"]=p;const m=e.substring(u,l[1]),y=e.substring(l[4],d);if(!p){s=!0,(m||y)&&(c+="/"+m+y);continue}const w=hd("_splat",t,n);c+="/"+m+w+y;continue}if(h===1){const p=e.substring(l[2],l[3]);!s&&!(p in t)&&(s=!0),i[p]=t[p];const m=e.substring(u,l[1]),y=e.substring(l[4],d),w=hd(p,t,n)??"undefined";c+="/"+m+w+y;continue}if(h===3){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;i[p]=m;const y=e.substring(u,l[1]),w=e.substring(l[4],d),g=hd(p,t,n)??"";c+="/"+y+g+w;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function Py(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function st(e){return(e==null?void 0:e.isNotFound)===!0}function cE(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const uE="tsr-scroll-restoration-v1_3";function dE(){const e=cE();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Ti(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=jr(r,t)||t},persist:()=>{try{e.setItem(uE,JSON.stringify(t))}catch{}}}}const jy=dE(),fE=e=>e.state.__TSR_key||e.href;function hE(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let tl=!1;const oo="window",Ey="data-scroll-restoration-id";function pE(e,t){if(!jy)return;const n=jy;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,tl=!1;const r=e.options.getScrollRestorationKey||fE,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(tl||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(oo,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;s.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},o=a=>{var c;if(!e.isScrollRestoring||!a||s.size===0||!n)return;const l=(c=n.state)[a]||(c[a]={});for(const[u,d]of s){let h;if(u===oo)h=oo;else if(u.isConnected){const p=u.getAttribute(Ey);h=p?`[${Ey}="${p}"]`:hE(u)}h&&(l[h]=d)}};document.addEventListener("scroll",i,!0),e.subscribe("onBeforeLoad",a=>{o(a.fromLocation?r(a.fromLocation):void 0),s.clear()}),window.addEventListener("pagehide",()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",a=>{var d;const l=r(a.toLocation),c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors;if(s.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){tl=!0;try{const h=e.isScrollRestoring?n.state[l]:void 0;let p=!1;if(h)for(const m in h){const y=h[m];if(!Ti(y))continue;const{scrollX:w,scrollY:g}=y;if(!(!Number.isFinite(w)||!Number.isFinite(g))){if(m===oo)window.scrollTo({top:g,left:w,behavior:c}),p=!0;else if(m){let x;try{x=document.querySelector(m)}catch{continue}x&&(x.scrollLeft=w,x.scrollTop=g,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const y=((d=window.history.state)==null?void 0:d.__hashScrollIntoViewOptions)??!0;if(y){const w=document.getElementById(m);w&&w.scrollIntoView(y)}}else{const y={top:0,left:0,behavior:c};if(window.scrollTo(y),u)for(const w of u){if(w===oo)continue;const g=typeof w=="function"?w():document.querySelector(w);g&&g.scrollTo(y)}}}}finally{tl=!1}e.isScrollRestoring&&n.set(h=>(h[l]||(h[l]={}),h))}})}function mE(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function pd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function gE(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const i=n[r];i==null?n[r]=pd(s):Array.isArray(i)?i.push(pd(s)):n[r]=[i,pd(s)]}return n}const yE=vE(JSON.parse),xE=wE(JSON.stringify,JSON.parse);function vE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=gE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function wE(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const i=mE(s,r);return i?`?${i}`:""}}const ws="__root__";function bE(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function yt(e){return e instanceof Response&&!!e.options}function kE(e){return{input:({url:t})=>{for(const n of e)t=oh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=cb(e[n],t);return t}}}function _E(e){const t=lb(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),i=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const a=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===s?o.pathname="/":a.startsWith(i)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Fl(["/",t,o.pathname]),o)}}function oh(e,t){var r;const n=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function cb(e,t){var r;const n=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function SE(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:i}=t,o=new Map,a=new Map,l=new Map,c=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),h=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),y=n(e.statusCode),w=n(e.redirect),g=n([]),x=n([]),v=n([]),b=r(()=>md(o,g.get())),S=r(()=>md(a,x.get())),k=r(()=>md(l,v.get())),T=r(()=>g.get()[0]),P=r(()=>g.get().some(V=>{var A;return((A=o.get(V))==null?void 0:A.get().status)==="pending"})),R=r(()=>{var V;return{locationHref:p.get().href,resolvedLocationHref:(V=m.get())==null?void 0:V.href,status:c.get()}}),j=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:h.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:w.get()})),I=aa(64);function M(V){let A=I.get(V);return A||(A=r(()=>{const B=g.get();for(const C of B){const $=o.get(C);if($&&$.routeId===V)return $.get()}}),I.set(V,A)),A}const O={status:c,loadedAt:u,isLoading:d,isTransitioning:h,location:p,resolvedLocation:m,statusCode:y,redirect:w,matchesId:g,pendingIds:x,cachedIds:v,matches:b,pendingMatches:S,cachedMatches:k,firstId:T,hasPending:P,matchRouteDeps:R,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:j,getRouteMatchStore:M,setMatches:z,setPending:E,setCached:F};z(e.matches),i==null||i(O);function z(V){gd(V,o,g,n,s)}function E(V){gd(V,a,x,n,s)}function F(V){gd(V,l,v,n,s)}return O}function md(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function gd(e,t,n,r,s){const i=e.map(a=>a.id),o=new Set(i);s(()=>{for(const a of t.keys())o.has(a)||t.delete(a);for(const a of e){const l=t.get(a.id);if(!l){const c=r(a);c.routeId=a.routeId,t.set(a.id,c);continue}l.routeId=a.routeId,l.get()!==a&&l.set(a)}Qj(n.get(),i)||n.set(i)})}const ah=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},CE=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),hu=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),bs=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let i=0;i<=s;i++){const o=e.matches[i];if(!o)continue;const a=e.router.getMatch(o.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},Ty=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),s=r>=0?r:0;let i=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;i<0&&(i=s);for(let o=i;o>=0;o--){const a=e.matches[o];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return o}return n?i:s},Rr=(e,t,n)=>{var r,s,i;if(!(!yt(n)&&!st(n)))throw yt(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((r=t._nonReactive.beforeLoadPromise)==null||r.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:yt(n)?"redirected":st(n)?"notFound":o.status==="pending"?"success":o.status,context:bs(e,t.index),isFetching:!1,error:n})),st(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),yt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},ub=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Ry=(e,t,n)=>{const r=bs(e,n);e.updateMatch(t,s=>({...s,context:r}))},ao=(e,t,n,r)=>{var a,l;const{id:s,routeId:i}=e.matches[t],o=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Rr(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(c){n=c,Rr(e,e.router.getMatch(s),n)}e.updateMatch(s,c=>{var u,d;return(u=c._nonReactive.beforeLoadPromise)==null||u.resolve(),c._nonReactive.beforeLoadPromise=void 0,(d=c._nonReactive.loadPromise)==null||d.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!yt(n)&&!st(n)&&(e.serialError??(e.serialError=n))},db=(e,t,n,r)=>{var i;if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!hu(e,t)&&(n.options.loader||n.options.beforeLoad||hb(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{ah(e)},s);r._nonReactive.pendingTimeout=o}},PE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;db(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Rr(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},jE=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Ri(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&ao(e,n,o,"PARSE_PARAMS"),a&&ao(e,n,a,"VALIDATE_SEARCH"),db(e,t,r,s);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,b=>({...b,isFetching:"beforeLoad",fetchCount:b.fetchCount+1,abortController:l})))},d=()=>{var b;(b=s._nonReactive.beforeLoadPromise)==null||b.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}s._nonReactive.beforeLoadPromise=Ri();const h={...bs(e,n,!1),...s.__routeContext},{search:p,params:m,cause:y}=s,w=hu(e,t),g={search:p,abortController:l,params:m,preload:w,context:h,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:w?"preload":y,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=b=>{if(b===void 0){e.router.batch(()=>{u(),d()});return}(yt(b)||st(b))&&(u(),ao(e,n,b,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,S=>({...S,__beforeLoadContext:b})),d()})};let v;try{if(v=r.options.beforeLoad(g),oa(v))return u(),v.catch(b=>{ao(e,n,b,"BEFORE_LOAD")}).then(x)}catch(b){u(),ao(e,n,b,"BEFORE_LOAD")}x(v)},EE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>jE(e,n,t,s),a=()=>{if(ub(e,n))return;const l=PE(e,n,s);return oa(l)?l.then(o):o()};return i()},TE=(e,t,n)=>{var i,o,a,l,c,u;const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(o=(i=n.options).head)==null?void 0:o.call(i,s),(l=(a=n.options).scripts)==null?void 0:l.call(a,s),(u=(c=n.options).headers)==null?void 0:u.call(c,s)]).then(([d,h,p])=>({meta:d==null?void 0:d.meta,links:d==null?void 0:d.links,headScripts:d==null?void 0:d.scripts,headers:p,scripts:h,styles:d==null?void 0:d.styles}))},fb=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=bs(e,r),d=hu(e,n);return{params:o,deps:a,preload:!!d,parentMatchPromise:i,abortController:l,context:u,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:d?"preload":c,route:s,...e.router.options.additionalContext}},Ny=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(sb??e.router.isServer)||u.ssr===!0)&&la(s);const d=s.options.loader,h=typeof d=="function"?d:d==null?void 0:d.handler,p=h==null?void 0:h(fb(e,t,n,r,s)),m=!!h&&oa(p);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,w=>({...w,isFetching:"loader"})),h){const w=m?await p:p;Rr(e,e.router.getMatch(n),w),w!==void 0&&e.updateMatch(n,g=>({...g,loaderData:w}))}s._lazyPromise&&await s._lazyPromise;const y=u._nonReactive.minPendingPromise;y&&await y,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,w=>({...w,error:void 0,context:bs(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let h=d;if((h==null?void 0:h.name)==="AbortError"){if(u.abortController.signal.aborted){(i=u._nonReactive.loaderPromise)==null||i.resolve(),u._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:bs(e,r)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,st(d)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),Rr(e,e.router.getMatch(n),d);try{(c=(l=s.options).onError)==null||c.call(l,d)}catch(m){h=m,Rr(e,e.router.getMatch(n),m)}!yt(h)&&!st(h)&&await la(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:h,context:bs(e,r),status:"error",isFetching:!1}))}}catch(u){const d=e.router.getMatch(n);d&&(d._nonReactive.loaderPromise=void 0),Rr(e,d,u)}},RE=async(e,t,n)=>{var p,m,y,w;async function r(g,x,v,b,S){const k=Date.now()-x.updatedAt,T=g?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,P=S.options.shouldReload,R=typeof P=="function"?P(fb(e,t,s,n,S)):P,{status:j,invalid:I}=b,M=k>=T&&(!!e.forceStaleReload||b.cause==="enter"||v!==void 0&&v!==b.id);o=j==="success"&&(I||(R??M)),g&&S.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var O,z;try{await Ny(e,t,s,n,S);const E=e.router.getMatch(s);(O=E._nonReactive.loaderPromise)==null||O.resolve(),(z=E._nonReactive.loadPromise)==null||z.resolve(),E._nonReactive.loaderPromise=void 0,E._nonReactive.loadPromise=void 0}catch(E){yt(E)&&await e.router.navigate(E.options)}})()):j!=="success"||o?await Ny(e,t,s,n,S):Ry(e,s,n))}const{id:s,routeId:i}=e.matches[n];let o=!1,a=!1;const l=e.router.looseRoutesById[i],c=l.options.loader,u=((typeof c=="function"||c==null?void 0:c.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(ub(e,s)){if(!e.router.getMatch(s))return e.matches[n];Ry(e,s,n)}else{const g=e.router.getMatch(s),x=e.router.stores.matchesId.get()[n],v=((p=x&&e.router.stores.matchStores.get(x)||null)==null?void 0:p.routeId)===i?x:(m=e.router.stores.matches.get().find(S=>S.routeId===i))==null?void 0:m.id,b=hu(e,s);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload&&u)return g;await g._nonReactive.loaderPromise;const S=e.router.getMatch(s),k=S._nonReactive.error||S.error;k&&Rr(e,S,k),S.status==="pending"&&await r(b,g,v,S,l)}else{const S=b&&!e.router.stores.matchStores.has(s),k=e.router.getMatch(s);k._nonReactive.loaderPromise=Ri(),S!==k.preload&&e.updateMatch(s,T=>({...T,preload:S})),await r(b,g,v,k,l)}}const d=e.router.getMatch(s);a||((y=d._nonReactive.loaderPromise)==null||y.resolve(),(w=d._nonReactive.loadPromise)==null||w.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,a||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=a?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:h,invalid:!1})),e.router.getMatch(s)):d};async function Iy(e){var h,p;const t=e,n=[];CE(t.router)&&ah(t);let r;for(let m=0;m<t.matches.length;m++){try{const y=EE(t,m);oa(y)&&await y}catch(y){if(yt(y))throw y;if(st(y))r=y;else if(!t.preload)throw y;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?Ty(t,r):void 0,o=r&&t.preload?0:i!==void 0?Math.min(i+1,s):s;let a,l;for(let m=0;m<o;m++)n.push(RE(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const y of m){if(y.status!=="rejected")continue;const w=y.reason;if(yt(w))throw w;st(w)?a??(a=w):l??(l=w)}if(l!==void 0)throw l}const c=a??(r&&!t.preload?r:void 0);let u=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!c&&r&&t.preload)return t.matches;if(c){const m=Ty(t,c);m===void 0&&er();const y=t.matches[m],w=t.router.looseRoutesById[y.routeId],g=(h=t.router.options)==null?void 0:h.defaultNotFoundComponent;!w.options.notFoundComponent&&g&&(w.options.notFoundComponent=g),c.routeId=y.routeId;const x=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,v=>({...v,...x?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await la(w,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||(p=t.router.getMatch(m.id))!=null&&p.globalNotFound&&t.updateMatch(m.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await la(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:y,routeId:w}=t.matches[m],g=t.router.looseRoutesById[w];try{const x=TE(t,y,g);if(x){const v=await x;t.updateMatch(y,b=>({...b,...v}))}}catch(x){console.error(`Error executing head for route ${w}:`,x)}}const d=ah(t);if(oa(d)&&await d,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function My(e,t){const n=t.map(r=>{var s,i;return(i=(s=e.options[r])==null?void 0:s.preload)==null?void 0:i.call(s)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function la(e,t=Ol){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:s,...i}=r.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Ol?(()=>{if(e._componentsPromise===void 0){const r=My(e,Ol);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():My(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function hb(e){var t;for(const n of Ol)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Ol=["component","errorComponent","pendingComponent","notFoundComponent"];var Br="__TSR_index",Ay="popstate",Ly="beforeunload";function NE(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:o}))},s=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},i=async({task:o,navigateOpts:a,...l})=>{var d,h;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const c=((d=e.getBlockers)==null?void 0:d.call(e))??[],u=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&u)for(const p of c){const m=jc(l.path,l.state);if(await p.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){(h=e.onBlocked)==null||h.call(e);return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,a,l)=>{const c=t.state[Br];a=Dy(c+1,a),i({task:()=>{e.pushState(o,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:o,state:a})},replace:(o,a,l)=>{const c=t.state[Br];a=Dy(c,a),i({task:()=>{e.replaceState(o,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:o,state:a})},go:(o,a)=>{i({task:()=>{e.go(o),s({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{i({task:()=>{e.back((o==null?void 0:o.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{i({task:()=>{e.forward((o==null?void 0:o.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[Br]!==0,createHref:o=>e.createHref(o),block:o=>{var l;if(!e.setBlockers)return()=>{};const a=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...a,o]),()=>{var u,d;const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];(d=e.setBlockers)==null||d.call(e,c.filter(h=>h!==o))}},flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:r}}function Dy(e,t){t||(t={});const n=Jp();return{...t,key:n,__TSR_key:n,[Br]:e}}function IE(e){var P,R;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=j=>s=j,a=j=>j,l=()=>jc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((P=t.history.state)!=null&&P.__TSR_key)&&!((R=t.history.state)!=null&&R.key)){const j=Jp();t.history.replaceState({[Br]:0,key:j,__TSR_key:j},"")}let c=l(),u,d=!1,h=!1,p=!1,m=!1;const y=()=>c;let w,g;const x=()=>{w&&(T._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),T._ignoreSubscribers=!1,w=void 0,g=void 0,u=void 0)},v=(j,I,M)=>{const O=a(I);g||(u=c),c=jc(I,M),w={href:O,state:M,isPush:(w==null?void 0:w.isPush)||j==="push"},g||(g=Promise.resolve().then(()=>x()))},b=j=>{c=l(),T.notify({type:j})},S=async()=>{if(h){h=!1;return}const j=l(),I=j.state[Br]-c.state[Br],M=I===1,O=I===-1,z=!M&&!O||d;d=!1;const E=z?"GO":O?"BACK":"FORWARD",F=z?{type:"GO",index:I}:{type:O?"BACK":"FORWARD"};if(p)p=!1;else{const V=i();if(typeof document<"u"&&V.length){for(const A of V)if(await A.blockerFn({currentLocation:c,nextLocation:j,action:E})){h=!0,t.history.go(1),T.notify(F);return}}}c=l(),T.notify(F)},k=j=>{if(m){m=!1;return}let I=!1;const M=i();if(typeof document<"u"&&M.length)for(const O of M){const z=O.enableBeforeUnload??!0;if(z===!0){I=!0;break}if(typeof z=="function"&&z()===!0){I=!0;break}}if(I)return j.preventDefault(),j.returnValue=""},T=NE({getLocation:y,getLength:()=>t.history.length,pushState:(j,I)=>v("push",j,I),replaceState:(j,I)=>v("replace",j,I),back:j=>(j&&(p=!0),m=!0,t.history.back()),forward:j=>{j&&(p=!0),m=!0,t.history.forward()},go:j=>{d=!0,t.history.go(j)},createHref:j=>a(j),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ly,k,{capture:!0}),t.removeEventListener(Ay,S)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ly,k,{capture:!0}),t.addEventListener(Ay,S),t.history.pushState=function(...j){const I=n.apply(t.history,j);return T._ignoreSubscribers||b("PUSH"),I},t.history.replaceState=function(...j){const I=r.apply(t.history,j);return T._ignoreSubscribers||b("REPLACE"),I},T}function ME(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function jc(e,t){const n=ME(e),r=n.indexOf("#"),s=n.indexOf("?"),i=Jp();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[Br]:0,key:i,__TSR_key:i}}}function Jp(){return(Math.random()+1).toString(36).substring(7)}function xi(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:(n==null?void 0:n.pathname)!==r.pathname,hrefChanged:(n==null?void 0:n.href)!==r.href,hashChanged:(n==null?void 0:n.hash)!==r.hash}}var AE=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{var u;const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,o=r==null?void 0:r.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=lE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=IE()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let d;this.resolvePathCache=aa(1e3),d=this.buildRouteTree(),this.setRoutes(d)}if(!this.stores&&this.latestLocation){const d=this.getStoreConfig(this);this.batch=d.batch,this.stores=SE(DE(this.latestLocation),d),pE(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==l||o!==c){this.basepath=l;const d=[],h=lb(l);h&&h!=="/"&&d.push(_E({basepath:l})),c&&d.push(c),this.rewrite=d.length===0?void 0:d.length===1?d[0]:kE(d),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((u=window.CSS)==null?void 0:u.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=tE(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&Yj(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:l,search:c,hash:u,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const g=this.options.parseSearch(c),x=this.options.stringifySearch(g);return{href:l+x+u,publicHref:l+x+u,pathname:io(l).path,external:!1,searchStr:x,search:ns(r==null?void 0:r.search,g),hash:io(u.slice(1)).path,state:Er(r==null?void 0:r.state,h)}}const p=new URL(d,this.origin),m=oh(this.rewrite,p),y=this.options.parseSearch(m.search),w=this.options.stringifySearch(y);return m.search=w,{href:m.href.replace(m.origin,""),publicHref:d,pathname:io(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:w,search:ns(r==null?void 0:r.search,y),hash:io(m.hash.slice(1)).path,state:Er(r==null?void 0:r.state,h)}},i=s(n),{__tempLocation:o,__tempKey:a}=i.state;if(o&&(!a||a===this.tempLocationKey)){const l=s(o);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>aE({base:n,to:Xp(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>FE({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var s;if(this.stores.pendingMatchStores.has(n))return;const r=(s=this.stores.matchStores.get(n))==null?void 0:s.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(i={})=>{var j,I;const o=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(o);i.from;const l=i.unsafeRelative==="path"?o.pathname:i.from??a.fullPath,c=this.resolvePathWithBase(l,"."),u=a.search,d=Object.assign(Object.create(null),a.params),h=i.to?this.resolvePathWithBase(c,`${i.to}`):this.resolvePathWithBase(c,"."),p=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?d:Object.assign(d,jr(i.params,d)),m=this.getMatchedRoutes(h);let y=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]),Object.keys(p).length>0)for(const M of y){const O=((j=M.options.params)==null?void 0:j.stringify)??M.options.stringifyParams;if(O)try{Object.assign(p,O(p))}catch{}}const w=n.leaveParams?h:io(Cy({path:h,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let g=u;if(n._includeValidateSearch&&((I=this.options.search)!=null&&I.strict)){const M={};y.forEach(O=>{if(O.options.validateSearch)try{Object.assign(M,zl(O.options.validateSearch,{...M,...g}))}catch{}}),g=M}g=OE({search:g,dest:i,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),g=ns(u,g);const x=this.options.stringifySearch(g),v=i.hash===!0?o.hash:i.hash?jr(i.hash,o.hash):void 0,b=v?`#${v}`:"";let S=i.state===!0?o.state:i.state?jr(i.state,o.state):{};S=Er(o.state,S);const k=`${w}${x}${b}`;let T,P,R=!1;if(this.rewrite){const M=new URL(k,this.origin),O=cb(this.rewrite,M);T=M.href.replace(M.origin,""),O.origin!==this.origin?(P=O.href,R=!0):P=O.pathname+O.search+O.hash}else T=Kj(k),P=T;return{publicHref:P,href:T,pathname:w,search:g,searchStr:x,state:S,hash:v??"",external:R,unmaskOnReload:i.unmaskOnReload}},s=(i={},o)=>{const a=r(i);let l=o?r(o):void 0;if(!l){const c=Object.create(null);if(this.options.routeMasks){const u=Xj(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:d,params:h,...p}=u.route,m=h===!1||h===null?Object.create(null):(h??!0)===!0?c:Object.assign(c,jr(h,c));o={from:n.from,...p,params:m},l=r(o)}}}return l&&(a.maskedLocation=l),a};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const i=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{s.state[u]=this.latestLocation.state[u]});const c=vs(s.state,this.latestLocation.state);return l.forEach(u=>{delete s.state[u]}),c},o=$r(this.latestLocation.href)===$r(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Ri(()=>{a==null||a.resolve(),a=void 0}),o&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=s;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:o,href:a,...l}={})=>{if(a){const d=this.history.location.state.__TSR_index,h=jc(a,{__TSR_index:n?d:d+1}),p=new URL(h.pathname,this.origin);l.to=oh(this.rewrite,p).pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:i,...o})=>{var l,c;let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const d=this.buildLocation({to:n,...o});s=s??d.publicHref,i=i??d.publicHref}const u=!a&&i?i:s;if(Cc(u,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const d=((c=(l=this.history).getBlockers)==null?void 0:c.call(l))??[];for(const h of d)if(h!=null&&h.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return o.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...o,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(i=>i.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{let r,s,i;const o=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(l=>{this.startTransition(async()=>{var c;try{this.beforeLoad();const u=this.latestLocation,d=xi(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...d}),this.emit({type:"onBeforeLoad",...d}),await Iy({router:this,sync:n==null?void 0:n.sync,forceStaleReload:o.href===u.href,matches:this.stores.pendingMatches.get(),location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var w,g;let h=null,p=null,m=null,y=null;this.batch(()=>{const x=this.stores.pendingMatches.get(),v=x.length,b=this.stores.matches.get();h=v?b.filter(T=>!this.stores.pendingMatchStores.has(T.id)):null;const S=new Set;for(const T of this.stores.pendingMatchStores.values())T.routeId&&S.add(T.routeId);const k=new Set;for(const T of this.stores.matchStores.values())T.routeId&&k.add(T.routeId);p=v?b.filter(T=>!S.has(T.routeId)):null,m=v?x.filter(T=>!k.has(T.routeId)):null,y=v?x.filter(T=>k.has(T.routeId)):b,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(this.stores.setMatches(x),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(T=>T.status!=="error"&&T.status!=="notFound"&&T.status!=="redirected")]),this.clearExpiredCache())});for(const[x,v]of[[p,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(x)for(const b of x)(g=(w=this.looseRoutesById[b.routeId].options)[v])==null||g.call(w,b)})})}})}catch(u){yt(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):st(u)&&(s=u);const d=r?r.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(d),this.stores.redirect.set(r)})}this.latestLoadPromise===i&&((c=this.commitLocationPromise)==null||c.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(l=>l.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,o=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(xi(i,o)):r.types;if(a===!1){n();return}s={update:n,types:a}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const i=this.stores.matchStores.get(n);if(i){i.set(r);return}const o=this.stores.cachedMatchStores.get(n);if(o){const a=r(o.get());a.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(l=>l.filter(c=>c!==n)):o.set(a)}})},this.getMatch=n=>{var r,s,i;return((r=this.stores.cachedMatchStores.get(n))==null?void 0:r.get())??((s=this.stores.pendingMatchStores.get(n))==null?void 0:s.get())??((i=this.stores.matchStores.get(n))==null?void 0:i.get())},this.invalidate=n=>{const r=s=>{var i;return((i=n==null?void 0:n.filter)==null?void 0:i.call(n,s))??!0?{...s,invalid:!0,...n!=null&&n.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),i=this.getParsedLocationHref(s);n.options.href=i,n.headers.set("Location",i)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;n.options.href=i,n.headers.set("Location",i)}}catch{}if(n.options.href&&!n.options._builtLocation&&Cc(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const o=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=la,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const i=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),o=new Set([...i,...this.stores.cachedIds.get()]),a=s.filter(l=>!o.has(l.id));if(a.length){const l=this.stores.cachedMatches.get();this.stores.setCached([...l,...a])}try{return s=await Iy({router:this,matches:s,location:r,preload:!0,updateMatch:(l,c)=>{i.has(l)?s=s.map(u=>u.id===l?c(u):u):this.updateMatch(l,c)}}),s}catch(l){if(yt(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});st(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(s);if(r!=null&&r.pending&&this.stores.status.get()!=="pending")return!1;const o=((r==null?void 0:r.pending)===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Jj(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!vs(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?vs(o.search,i.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??xE,parseSearch:e.parseSearch??yE,protocolAllowlist:e.protocolAllowlist??Gj}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var d,h;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s,parsedParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:$r(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?$E(this.options.notFoundMode,o):void 0,c=new Array(o.length),u=new Map;for(const p of this.stores.matchStores.values())p.routeId&&u.set(p.routeId,p.get());for(let p=0;p<o.length;p++){const m=o[p],y=c[p-1];let w,g,x;{const E=(y==null?void 0:y.search)??e.search,F=(y==null?void 0:y._strictSearch)??void 0;try{const V=zl(m.options.validateSearch,{...E})??void 0;w={...E,...V},g={...F,...V},x=void 0}catch(V){let A=V;if(V instanceof Ec||(A=new Ec(V.message,{cause:V})),t!=null&&t.throwOnError)throw A;w=E,g={},x=A}}const v=((h=(d=m.options).loaderDeps)==null?void 0:h.call(d,{search:w}))??"",b=v?JSON.stringify(v):"",{interpolatedPath:S,usedParams:k}=Cy({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),T=m.id+S+b,P=this.getMatch(T),R=u.get(m.id),j=(P==null?void 0:P._strictParams)??k;let I;if(!P)try{Fy(m,k,i,j)}catch(E){if(st(E)||yt(E)?I=E:I=new LE(E.message,{cause:E}),t!=null&&t.throwOnError)throw I}Object.assign(s,j);const M=R?"stay":"enter";let O;if(P)O={...P,cause:M,params:(R==null?void 0:R.params)??s,_strictParams:j,search:ns(R?R.search:P.search,w),_strictSearch:g};else{const E=m.options.loader||m.options.beforeLoad||m.lazyFn||hb(m)?"pending":"success";O={id:T,ssr:m.options.ssr,index:p,routeId:m.id,params:(R==null?void 0:R.params)??s,_strictParams:j,pathname:S,updatedAt:Date.now(),search:R?ns(R.search,w):w,_strictSearch:g,searchError:void 0,status:E,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Ri()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:M,loaderDeps:R?Er(R.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t!=null&&t.preload||(O.globalNotFound=l===m.id),O.searchError=x;const z=this.getParentContext(y);O.context={...z,...O.__routeContext,...O.__beforeLoadContext},c[p]=O}for(let p=0;p<c.length;p++){const m=c[p],y=this.looseRoutesById[m.routeId],w=this.getMatch(m.id),g=u.get(m.routeId);if(m.params=g?ns(g.params,s):s,!w){const x=c[p-1],v=this.getParentContext(x);if(y.options.context){const b={deps:m.loaderDeps,params:m.params,context:v??{},location:e,navigate:S=>this.navigate({...S,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:c,routeId:y.id};m.__routeContext=y.options.context(b)??void 0}m.context={...v,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=ia(t),i={...e.search};for(const d of t)try{Object.assign(i,zl(d.options.validateSearch,i))}catch{}const o=ia(this.stores.matchesId.get()),a=o&&((u=this.stores.matchStores.get(o))==null?void 0:u.get()),l=a&&a.routeId===s.id&&a.pathname===e.pathname;let c;if(l)c=a.params;else{const d=Object.assign(Object.create(null),n);for(const h of t)try{Fy(h,n,r??{},d)}catch{}c=d}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},Ec=class extends Error{},LE=class extends Error{};function DE(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function zl(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ec("Async validation not supported");if(n.issues)throw new Ec(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function FE({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=$r(e);let i,o;const a=Zj(s,n,!0);return a&&(i=a.route,Object.assign(r,a.rawParams),o=Object.assign(Object.create(null),a.parsedParams)),{matchedRoutes:(a==null?void 0:a.branch)||[t.__root__],routeParams:r,foundRoute:i,parsedParams:o}}function OE({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return zE(n)(e,t,r??!1)}function zE(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)(s=i.options.search)!=null&&s.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const o=({search:a,next:l})=>{let c=a;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(c=i.options.preSearchFilters.reduce((d,h)=>h(d),a));const u=l(c);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((d,h)=>h(d),u):u};t.middlewares.push(o)}if(i.options.validateSearch){const o=({search:a,next:l})=>{const c=l(a);if(!t._includeValidateSearch)return c;try{return{...c,...zl(i.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(o)}}const n=({search:i})=>{const o=t.dest;return o.search?o.search===!0?i:jr(o.search,i):{}};t.middlewares.push(n);const r=(i,o,a)=>{if(i>=a.length)return o;const l=a[i];return l({search:o,next:u=>r(i+1,u,a)})};return function(o,a,l){return t.dest=a,t._includeValidateSearch=l,r(0,o,t.middlewares)}}function $E(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return ws}function Fy(e,t,n,r){var i;const s=((i=e.options.params)==null?void 0:i.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=s(r);Object.assign(r,o)}}const BE="Error preloading route! ☝️";var pb=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var l,c;this.originalIndex=t.originalIndex;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(c=(l=this.options).getParentRoute)==null?void 0:c.call(l),r?this._path=ws:this.parentRoute||er();let s=r?ws:n==null?void 0:n.path;s&&s!=="/"&&(s=ab(s));const i=(n==null?void 0:n.id)||s;let o=r?ws:Fl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Fl(["/",o]));const a=o==="__root__"?"/":Fl([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=$r(a)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>bE({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},VE=class extends pb{constructor(e){super(e)}};function UE(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==""){const r=document.getElementById(t.hash);r&&r.scrollIntoView(n)}}}function Zp(e){const t=e.errorComponent??em;return f.jsx(WE,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}var WE=class extends _.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function em({error:e}){const[t,n]=_.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function HE({children:e,fallback:t=null}){return mb()?f.jsx(bi.Fragment,{children:e}):f.jsx(bi.Fragment,{children:t})}function mb(){return bi.useSyncExternalStore(GE,()=>!0,()=>!1)}function GE(){return()=>{}}var gb=_.createContext(null);function $t(e){return _.useContext(gb)}var pu=_.createContext(void 0),KE=_.createContext(void 0),_e=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(_e||{});function QE({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(c,u,d){const h=u.depsTail;if(h!==void 0&&h.dep===c)return;const p=h!==void 0?h.nextDep:u.deps;if(p!==void 0&&p.dep===c){p.version=d,u.depsTail=p;return}const m=c.subsTail;if(m!==void 0&&m.version===d&&m.sub===u)return;const y=u.depsTail=c.subsTail={version:d,dep:c,sub:u,prevDep:h,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=y),h!==void 0?h.nextDep=y:u.deps=y,m!==void 0?m.nextSub=y:c.subs=y}function s(c,u=c.sub){const d=c.dep,h=c.prevDep,p=c.nextDep,m=c.nextSub,y=c.prevSub;return p!==void 0?p.prevDep=h:u.depsTail=h,h!==void 0?h.nextDep=p:u.deps=p,m!==void 0?m.prevSub=y:d.subsTail=y,y!==void 0?y.nextSub=m:(d.subs=m)===void 0&&n(d),p}function i(c){let u=c.nextSub,d;e:do{const h=c.sub;let p=h.flags;if(p&60?p&12?p&4?!(p&48)&&l(c,h)?(h.flags=p|40,p&=1):p=0:h.flags=p&-9|32:p=0:h.flags=p|32,p&2&&t(h),p&1){const m=h.subs;if(m!==void 0){const y=(c=m).nextSub;y!==void 0&&(d={value:u,prev:d},u=y);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;d!==void 0;)if(c=d.value,d=d.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function o(c,u){let d,h=0,p=!1;e:do{const m=c.dep,y=m.flags;if(u.flags&16)p=!0;else if((y&17)===17){if(e(m)){const w=m.subs;w.nextSub!==void 0&&a(w),p=!0}}else if((y&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(d={value:c,prev:d}),c=m.deps,u=m,++h;continue}if(!p){const w=c.nextDep;if(w!==void 0){c=w;continue}}for(;h--;){const w=u.subs,g=w.nextSub!==void 0;if(g?(c=d.value,d=d.prev):c=w,p){if(e(u)){g&&a(w),u=c.sub;continue}p=!1}else u.flags&=-33;u=c.sub;const x=c.nextDep;if(x!==void 0){c=x;continue e}}return p}while(!0)}function a(c){do{const u=c.sub,d=u.flags;(d&48)===32&&(u.flags=d|16,(d&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let d=u.depsTail;for(;d!==void 0;){if(d===c)return!0;d=d.prevDep}return!1}}function qE(e,t,n){var i,o,a;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(o=r?e.error:t)==null?void 0:o.bind(s),complete:(a=r?e.complete:n)==null?void 0:a.bind(s)}}const lh=[];let $l=0;const{link:Oy,unlink:YE,propagate:XE,checkDirty:yb,shallowPropagate:zy}=QE({update(e){return e._update()},notify(e){lh[ch++]=e,e.flags&=~_e.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=_e.Mutable|_e.Dirty,Tc(e))}});let nl=0,ch=0,En,uh=0;function xb(e){try{++uh,e()}finally{--uh||vb()}}function Tc(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=YE(n,e)}function vb(){if(!(uh>0)){for(;nl<ch;){const e=lh[nl];lh[nl++]=void 0,e.notify()}nl=0,ch=0}}function $y(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?_e.None:_e.Mutable,get(){return En!==void 0&&Oy(s,En,$l),s._snapshot},subscribe(i){const o=qE(i),a={current:!1},l=JE(()=>{var c;s.get(),a.current?(c=o.next)==null||c.call(o,s._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const o=En,a=(t==null?void 0:t.compare)??Object.is;if(n)En=s,++$l,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=_e.Mutable|_e.RecursedCheck);try{const l=s._snapshot,c=typeof i=="function"?i(l):i===void 0&&n?r(l):i;return l===void 0||!a(l,c)?(s._snapshot=c,!0):!1}finally{En=o,n&&(s.flags&=~_e.RecursedCheck),Tc(s)}}};return n?(s.flags=_e.Mutable|_e.Dirty,s.get=function(){const i=s.flags;if(i&_e.Dirty||i&_e.Pending&&yb(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&zy(o)}}else i&_e.Pending&&(s.flags=i&~_e.Pending);return En!==void 0&&Oy(s,En,$l),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(XE(o),zy(o),vb())}},s}function JE(e){const t=()=>{const r=En;En=n,++$l,n.depsTail=void 0,n.flags=_e.Watching|_e.RecursedCheck;try{return e()}finally{En=r,n.flags&=~_e.RecursedCheck,Tc(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:_e.Watching|_e.RecursedCheck,notify(){const r=this.flags;r&_e.Dirty||r&_e.Pending&&yb(this.deps,this)?t():this.flags=_e.Watching},stop(){this.flags=_e.None,this.depsTail=void 0,Tc(this)}};return t(),n}var wb={exports:{}},bb={},kb={exports:{}},_b={};/**
41
+ `+i.stack}return{value:e,source:t,stack:s,digest:null}}function od(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var mj=typeof WeakMap=="function"?WeakMap:Map;function Tw(e,t,n){n=Zn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){bc||(bc=!0,nh=r),Gf(e,t)},n}function Rw(e,t,n){n=Zn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Gf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Gf(e,t),typeof r!="function"&&(Fr===null?Fr=new Set([this]):Fr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function ey(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new mj;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Tj.bind(null,e,t,n),t.then(e,e))}function ty(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ny(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Zn(-1,1),t.tag=2,Dr(n,t,1))),n.lanes|=1),e)}var gj=or.ReactCurrentOwner,gt=!1;function at(e,t,n,r){t.child=e===null?iw(t,null,n,r):Ci(t,e.child,n,r)}function ry(e,t,n,r,s){n=n.render;var i=t.ref;return gi(t,s),r=Mp(e,t,n,r,i,s),n=Ap(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sr(e,t,s)):(Pe&&n&&bp(t),t.flags|=1,at(e,t,r,s),t.child)}function sy(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Wp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Nw(e,t,i,r,s)):(e=Dl(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:qo,n(o,r)&&e.ref===t.ref)return sr(e,t,s)}return t.flags|=1,e=zr(i,r),e.ref=t.ref,e.return=t,t.child=e}function Nw(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(qo(i,r)&&e.ref===t.ref)if(gt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(gt=!0);else return t.lanes=e.lanes,sr(e,t,s)}return Kf(e,t,n,r,s)}function Iw(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(ai,It),It|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(ai,It),It|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ve(ai,It),It|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ve(ai,It),It|=r;return at(e,t,s,n),t.child}function Mw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Kf(e,t,n,r,s){var i=vt(n)?Cs:it.current;return i=_i(t,i),gi(t,s),n=Mp(e,t,n,r,i,s),r=Ap(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sr(e,t,s)):(Pe&&r&&bp(t),t.flags|=1,at(e,t,n,s),t.child)}function iy(e,t,n,r,s){if(vt(n)){var i=!0;dc(t)}else i=!1;if(gi(t,s),t.stateNode===null)Ml(e,t),Ew(t,n,r),Hf(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=en(c):(c=vt(n)?Cs:it.current,c=_i(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Zg(t,o,r,c),br=!1;var h=t.memoizedState;o.state=h,gc(t,r,o,s),l=t.memoizedState,a!==r||h!==l||xt.current||br?(typeof u=="function"&&(Wf(t,n,u,r),l=t.memoizedState),(a=br||Jg(t,n,a,r,h,l,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,aw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:fn(t.type,a),o.props=c,d=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=en(l):(l=vt(n)?Cs:it.current,l=_i(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&Zg(t,o,r,l),br=!1,h=t.memoizedState,o.state=h,gc(t,r,o,s);var m=t.memoizedState;a!==d||h!==m||xt.current||br?(typeof p=="function"&&(Wf(t,n,p,r),m=t.memoizedState),(c=br||Jg(t,n,c,r,h,m,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Qf(e,t,n,r,i,s)}function Qf(e,t,n,r,s,i){Mw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&Wg(t,n,!1),sr(e,t,i);r=t.stateNode,gj.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ci(t,e.child,null,i),t.child=Ci(t,null,a,i)):at(e,t,a,i),t.memoizedState=r.state,s&&Wg(t,n,!0),t.child}function Aw(e){var t=e.stateNode;t.pendingContext?Ug(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ug(e,t.context,!1),Tp(e,t.containerInfo)}function oy(e,t,n,r,s){return Si(),_p(s),t.flags|=256,at(e,t,n,r),t.child}var qf={dehydrated:null,treeContext:null,retryLane:0};function Yf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Lw(e,t,n){var r=t.pendingProps,s=je.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ve(je,s&1),e===null)return Vf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=au(o,r,0,null),e=xs(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Yf(n),t.memoizedState=qf,e):Fp(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return yj(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=zr(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=zr(a,i):(i=xs(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Yf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=qf,r}return i=e.child,e=i.sibling,r=zr(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Fp(e,t){return t=au({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function qa(e,t,n,r){return r!==null&&_p(r),Ci(t,e.child,null,n),e=Fp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yj(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=od(Error(U(422))),qa(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=au({mode:"visible",children:r.children},s,0,null),i=xs(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ci(t,e.child,null,o),t.child.memoizedState=Yf(o),t.memoizedState=qf,i);if(!(t.mode&1))return qa(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(U(419)),r=od(i,r,void 0),qa(e,t,o,r)}if(a=(o&e.childLanes)!==0,gt||a){if(r=Qe,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,rr(e,s),gn(r,e,s,-1))}return Up(),r=od(Error(U(421))),qa(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Rj.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Mt=Lr(s.nextSibling),Lt=t,Pe=!0,pn=null,e!==null&&(Gt[Kt++]=Xn,Gt[Kt++]=Jn,Gt[Kt++]=Ps,Xn=e.id,Jn=e.overflow,Ps=t),t=Fp(t,r.children),t.flags|=4096,t)}function ay(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Uf(e.return,t,n)}function ad(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function Dw(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(at(e,t,r.children,n),r=je.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ay(e,n,t);else if(e.tag===19)ay(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ve(je,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&yc(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),ad(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&yc(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}ad(t,!0,n,null,i);break;case"together":ad(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ml(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,n=zr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xj(e,t,n){switch(t.tag){case 3:Aw(t),Si();break;case 5:lw(t);break;case 1:vt(t.type)&&dc(t);break;case 4:Tp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;ve(pc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ve(je,je.current&1),t.flags|=128,null):n&t.child.childLanes?Lw(e,t,n):(ve(je,je.current&1),e=sr(e,t,n),e!==null?e.sibling:null);ve(je,je.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Dw(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ve(je,je.current),r)break;return null;case 22:case 23:return t.lanes=0,Iw(e,t,n)}return sr(e,t,n)}var Fw,Xf,Ow,zw;Fw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Xf=function(){};Ow=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,hs(Mn.current);var i=null;switch(n){case"input":s=vf(e,s),r=vf(e,r),i=[];break;case"select":s=Ne({},s,{value:void 0}),r=Ne({},r,{value:void 0}),i=[];break;case"textarea":s=kf(e,s),r=kf(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=cc)}Sf(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Vo.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Vo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ke("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};zw=function(e,t,n,r){n!==r&&(t.flags|=4)};function ro(e,t){if(!Pe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vj(e,t,n){var r=t.pendingProps;switch(kp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return vt(t.type)&&uc(),tt(t),null;case 3:return r=t.stateNode,Pi(),_e(xt),_e(it),Np(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ka(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pn!==null&&(ih(pn),pn=null))),Xf(e,t),tt(t),null;case 5:Rp(t);var s=hs(ea.current);if(n=t.type,e!==null&&t.stateNode!=null)Ow(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return tt(t),null}if(e=hs(Mn.current),Ka(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rn]=t,r[Jo]=i,e=(t.mode&1)!==0,n){case"dialog":ke("cancel",r),ke("close",r);break;case"iframe":case"object":case"embed":ke("load",r);break;case"video":case"audio":for(s=0;s<ko.length;s++)ke(ko[s],r);break;case"source":ke("error",r);break;case"img":case"image":case"link":ke("error",r),ke("load",r);break;case"details":ke("toggle",r);break;case"input":gg(r,i),ke("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ke("invalid",r);break;case"textarea":xg(r,i),ke("invalid",r)}Sf(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ga(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ga(r.textContent,a,e),s=["children",""+a]):Vo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ke("scroll",r)}switch(n){case"input":Oa(r),yg(r,i,!0);break;case"textarea":Oa(r),vg(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=cc)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=h1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Rn]=t,e[Jo]=r,Fw(e,t,!1,!1),t.stateNode=e;e:{switch(o=Cf(n,r),n){case"dialog":ke("cancel",e),ke("close",e),s=r;break;case"iframe":case"object":case"embed":ke("load",e),s=r;break;case"video":case"audio":for(s=0;s<ko.length;s++)ke(ko[s],e);s=r;break;case"source":ke("error",e),s=r;break;case"img":case"image":case"link":ke("error",e),ke("load",e),s=r;break;case"details":ke("toggle",e),s=r;break;case"input":gg(e,r),s=vf(e,r),ke("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Ne({},r,{value:void 0}),ke("invalid",e);break;case"textarea":xg(e,r),s=kf(e,r),ke("invalid",e);break;default:s=r}Sf(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?g1(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&p1(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Uo(e,l):typeof l=="number"&&Uo(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Vo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ke("scroll",e):l!=null&&ap(e,i,l,o))}switch(n){case"input":Oa(e),yg(e,r,!1);break;case"textarea":Oa(e),vg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?fi(e,!!r.multiple,i,!1):r.defaultValue!=null&&fi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=cc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tt(t),null;case 6:if(e&&t.stateNode!=null)zw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(n=hs(ea.current),hs(Mn.current),Ka(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rn]=t,(i=r.nodeValue!==n)&&(e=Lt,e!==null))switch(e.tag){case 3:Ga(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ga(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rn]=t,t.stateNode=r}return tt(t),null;case 13:if(_e(je),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pe&&Mt!==null&&t.mode&1&&!(t.flags&128))rw(),Si(),t.flags|=98560,i=!1;else if(i=Ka(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(U(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(U(317));i[Rn]=t}else Si(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else pn!==null&&(ih(pn),pn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||je.current&1?Ue===0&&(Ue=3):Up())),t.updateQueue!==null&&(t.flags|=4),tt(t),null);case 4:return Pi(),Xf(e,t),e===null&&Yo(t.stateNode.containerInfo),tt(t),null;case 10:return Pp(t.type._context),tt(t),null;case 17:return vt(t.type)&&uc(),tt(t),null;case 19:if(_e(je),i=t.memoizedState,i===null)return tt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)ro(i,!1);else{if(Ue!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=yc(e),o!==null){for(t.flags|=128,ro(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ve(je,je.current&1|2),t.child}e=e.sibling}i.tail!==null&&De()>Ei&&(t.flags|=128,r=!0,ro(i,!1),t.lanes=4194304)}else{if(!r)if(e=yc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ro(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Pe)return tt(t),null}else 2*De()-i.renderingStartTime>Ei&&n!==1073741824&&(t.flags|=128,r=!0,ro(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=De(),t.sibling=null,n=je.current,ve(je,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return Vp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?It&1073741824&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function wj(e,t){switch(kp(t),t.tag){case 1:return vt(t.type)&&uc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pi(),_e(xt),_e(it),Np(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Rp(t),null;case 13:if(_e(je),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));Si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _e(je),null;case 4:return Pi(),null;case 10:return Pp(t.type._context),null;case 22:case 23:return Vp(),null;case 24:return null;default:return null}}var Ya=!1,rt=!1,bj=typeof WeakSet=="function"?WeakSet:Set,G=null;function oi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ae(e,t,r)}else n.current=null}function Jf(e,t,n){try{n()}catch(r){Ae(e,t,r)}}var ly=!1;function kj(e,t){if(Lf=oc,e=W1(),wp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,d=e,h=null;t:for(;;){for(var p;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++c===s&&(a=o),h===i&&++u===r&&(l=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Df={focusedElem:e,selectionRange:n},oc=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,w=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:fn(t.type,y),w);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(b){Ae(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return m=ly,ly=!1,m}function No(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Jf(t,n,i)}s=s.next}while(s!==r)}}function iu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Zf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function $w(e){var t=e.alternate;t!==null&&(e.alternate=null,$w(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rn],delete t[Jo],delete t[zf],delete t[sj],delete t[ij])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Bw(e){return e.tag===5||e.tag===3||e.tag===4}function cy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function eh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=cc));else if(r!==4&&(e=e.child,e!==null))for(eh(e,t,n),e=e.sibling;e!==null;)eh(e,t,n),e=e.sibling}function th(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(th(e,t,n),e=e.sibling;e!==null;)th(e,t,n),e=e.sibling}var qe=null,hn=!1;function lr(e,t,n){for(n=n.child;n!==null;)Vw(e,t,n),n=n.sibling}function Vw(e,t,n){if(In&&typeof In.onCommitFiberUnmount=="function")try{In.onCommitFiberUnmount(Xc,n)}catch{}switch(n.tag){case 5:rt||oi(n,t);case 6:var r=qe,s=hn;qe=null,lr(e,t,n),qe=r,hn=s,qe!==null&&(hn?(e=qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):qe.removeChild(n.stateNode));break;case 18:qe!==null&&(hn?(e=qe,n=n.stateNode,e.nodeType===8?ed(e.parentNode,n):e.nodeType===1&&ed(e,n),Ko(e)):ed(qe,n.stateNode));break;case 4:r=qe,s=hn,qe=n.stateNode.containerInfo,hn=!0,lr(e,t,n),qe=r,hn=s;break;case 0:case 11:case 14:case 15:if(!rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Jf(n,t,o),s=s.next}while(s!==r)}lr(e,t,n);break;case 1:if(!rt&&(oi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ae(n,t,a)}lr(e,t,n);break;case 21:lr(e,t,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,lr(e,t,n),rt=r):lr(e,t,n);break;default:lr(e,t,n)}}function uy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new bj),t.forEach(function(r){var s=Nj.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function on(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:qe=a.stateNode,hn=!1;break e;case 3:qe=a.stateNode.containerInfo,hn=!0;break e;case 4:qe=a.stateNode.containerInfo,hn=!0;break e}a=a.return}if(qe===null)throw Error(U(160));Vw(i,o,s),qe=null,hn=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Ae(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Uw(t,e),t=t.sibling}function Uw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(on(t,e),bn(e),r&4){try{No(3,e,e.return),iu(3,e)}catch(y){Ae(e,e.return,y)}try{No(5,e,e.return)}catch(y){Ae(e,e.return,y)}}break;case 1:on(t,e),bn(e),r&512&&n!==null&&oi(n,n.return);break;case 5:if(on(t,e),bn(e),r&512&&n!==null&&oi(n,n.return),e.flags&32){var s=e.stateNode;try{Uo(s,"")}catch(y){Ae(e,e.return,y)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&d1(s,i),Cf(a,o);var c=Cf(a,i);for(o=0;o<l.length;o+=2){var u=l[o],d=l[o+1];u==="style"?g1(s,d):u==="dangerouslySetInnerHTML"?p1(s,d):u==="children"?Uo(s,d):ap(s,u,d,c)}switch(a){case"input":wf(s,i);break;case"textarea":f1(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?fi(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?fi(s,!!i.multiple,i.defaultValue,!0):fi(s,!!i.multiple,i.multiple?[]:"",!1))}s[Jo]=i}catch(y){Ae(e,e.return,y)}}break;case 6:if(on(t,e),bn(e),r&4){if(e.stateNode===null)throw Error(U(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){Ae(e,e.return,y)}}break;case 3:if(on(t,e),bn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ko(t.containerInfo)}catch(y){Ae(e,e.return,y)}break;case 4:on(t,e),bn(e);break;case 13:on(t,e),bn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||($p=De())),r&4&&uy(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(rt=(c=rt)||u,on(t,e),rt=c):on(t,e),bn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(G=e,u=e.child;u!==null;){for(d=G=u;G!==null;){switch(h=G,p=h.child,h.tag){case 0:case 11:case 14:case 15:No(4,h,h.return);break;case 1:oi(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(y){Ae(r,n,y)}}break;case 5:oi(h,h.return);break;case 22:if(h.memoizedState!==null){fy(d);continue}}p!==null?(p.return=h,G=p):fy(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=m1("display",o))}catch(y){Ae(e,e.return,y)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(y){Ae(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:on(t,e),bn(e),r&4&&uy(e);break;case 21:break;default:on(t,e),bn(e)}}function bn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Bw(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Uo(s,""),r.flags&=-33);var i=cy(e);th(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=cy(e);eh(e,a,o);break;default:throw Error(U(161))}}catch(l){Ae(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _j(e,t,n){G=e,Ww(e)}function Ww(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var s=G,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Ya;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||rt;a=Ya;var c=rt;if(Ya=o,(rt=l)&&!c)for(G=s;G!==null;)o=G,l=o.child,o.tag===22&&o.memoizedState!==null?hy(s):l!==null?(l.return=o,G=l):hy(s);for(;i!==null;)G=i,Ww(i),i=i.sibling;G=s,Ya=a,rt=c}dy(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,G=i):dy(e)}}function dy(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rt||iu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!rt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:fn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&qg(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qg(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Ko(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}rt||t.flags&512&&Zf(t)}catch(h){Ae(t,t.return,h)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function fy(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function hy(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{iu(4,t)}catch(l){Ae(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Ae(t,s,l)}}var i=t.return;try{Zf(t)}catch(l){Ae(t,i,l)}break;case 5:var o=t.return;try{Zf(t)}catch(l){Ae(t,o,l)}}}catch(l){Ae(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var Sj=Math.ceil,wc=or.ReactCurrentDispatcher,Op=or.ReactCurrentOwner,Xt=or.ReactCurrentBatchConfig,ae=0,Qe=null,$e=null,Je=0,It=0,ai=Qr(0),Ue=0,sa=null,Es=0,ou=0,zp=0,Io=null,mt=null,$p=0,Ei=1/0,Gn=null,bc=!1,nh=null,Fr=null,Xa=!1,Pr=null,kc=0,Mo=0,rh=null,Al=-1,Ll=0;function ut(){return ae&6?De():Al!==-1?Al:Al=De()}function Or(e){return e.mode&1?ae&2&&Je!==0?Je&-Je:aj.transition!==null?(Ll===0&&(Ll=E1()),Ll):(e=ue,e!==0||(e=window.event,e=e===void 0?16:L1(e.type)),e):1}function gn(e,t,n,r){if(50<Mo)throw Mo=0,rh=null,Error(U(185));ma(e,n,r),(!(ae&2)||e!==Qe)&&(e===Qe&&(!(ae&2)&&(ou|=n),Ue===4&&Sr(e,Je)),wt(e,r),n===1&&ae===0&&!(t.mode&1)&&(Ei=De()+500,nu&&qr()))}function wt(e,t){var n=e.callbackNode;aP(e,t);var r=ic(e,e===Qe?Je:0);if(r===0)n!==null&&kg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&kg(n),t===1)e.tag===0?oj(py.bind(null,e)):ew(py.bind(null,e)),nj(function(){!(ae&6)&&qr()}),n=null;else{switch(T1(r)){case 1:n=fp;break;case 4:n=P1;break;case 16:n=sc;break;case 536870912:n=j1;break;default:n=sc}n=Jw(n,Hw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Hw(e,t){if(Al=-1,Ll=0,ae&6)throw Error(U(327));var n=e.callbackNode;if(yi()&&e.callbackNode!==n)return null;var r=ic(e,e===Qe?Je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=_c(e,r);else{t=r;var s=ae;ae|=2;var i=Kw();(Qe!==e||Je!==t)&&(Gn=null,Ei=De()+500,ys(e,t));do try{jj();break}catch(a){Gw(e,a)}while(!0);Cp(),wc.current=i,ae=s,$e!==null?t=0:(Qe=null,Je=0,t=Ue)}if(t!==0){if(t===2&&(s=Rf(e),s!==0&&(r=s,t=sh(e,s))),t===1)throw n=sa,ys(e,0),Sr(e,r),wt(e,De()),n;if(t===6)Sr(e,r);else{if(s=e.current.alternate,!(r&30)&&!Cj(s)&&(t=_c(e,r),t===2&&(i=Rf(e),i!==0&&(r=i,t=sh(e,i))),t===1))throw n=sa,ys(e,0),Sr(e,r),wt(e,De()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:as(e,mt,Gn);break;case 3:if(Sr(e,r),(r&130023424)===r&&(t=$p+500-De(),10<t)){if(ic(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ut(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Of(as.bind(null,e,mt,Gn),t);break}as(e,mt,Gn);break;case 4:if(Sr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-mn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=De()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sj(r/1960))-r,10<r){e.timeoutHandle=Of(as.bind(null,e,mt,Gn),r);break}as(e,mt,Gn);break;case 5:as(e,mt,Gn);break;default:throw Error(U(329))}}}return wt(e,De()),e.callbackNode===n?Hw.bind(null,e):null}function sh(e,t){var n=Io;return e.current.memoizedState.isDehydrated&&(ys(e,t).flags|=256),e=_c(e,t),e!==2&&(t=mt,mt=n,t!==null&&ih(t)),e}function ih(e){mt===null?mt=e:mt.push.apply(mt,e)}function Cj(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!xn(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Sr(e,t){for(t&=~zp,t&=~ou,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-mn(t),r=1<<n;e[n]=-1,t&=~r}}function py(e){if(ae&6)throw Error(U(327));yi();var t=ic(e,0);if(!(t&1))return wt(e,De()),null;var n=_c(e,t);if(e.tag!==0&&n===2){var r=Rf(e);r!==0&&(t=r,n=sh(e,r))}if(n===1)throw n=sa,ys(e,0),Sr(e,t),wt(e,De()),n;if(n===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,as(e,mt,Gn),wt(e,De()),null}function Bp(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(Ei=De()+500,nu&&qr())}}function Ts(e){Pr!==null&&Pr.tag===0&&!(ae&6)&&yi();var t=ae;ae|=1;var n=Xt.transition,r=ue;try{if(Xt.transition=null,ue=1,e)return e()}finally{ue=r,Xt.transition=n,ae=t,!(ae&6)&&qr()}}function Vp(){It=ai.current,_e(ai)}function ys(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,tj(n)),$e!==null)for(n=$e.return;n!==null;){var r=n;switch(kp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&uc();break;case 3:Pi(),_e(xt),_e(it),Np();break;case 5:Rp(r);break;case 4:Pi();break;case 13:_e(je);break;case 19:_e(je);break;case 10:Pp(r.type._context);break;case 22:case 23:Vp()}n=n.return}if(Qe=e,$e=e=zr(e.current,null),Je=It=t,Ue=0,sa=null,zp=ou=Es=0,mt=Io=null,fs!==null){for(t=0;t<fs.length;t++)if(n=fs[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}fs=null}return e}function Gw(e,t){do{var n=$e;try{if(Cp(),Nl.current=vc,xc){for(var r=Ee.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}xc=!1}if(js=0,Ke=Ve=Ee=null,Ro=!1,ta=0,Op.current=null,n===null||n.return===null){Ue=1,sa=t,$e=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=ty(o);if(p!==null){p.flags&=-257,ny(p,o,a,i,t),p.mode&1&&ey(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var y=new Set;y.add(l),t.updateQueue=y}else m.add(l);break e}else{if(!(t&1)){ey(i,c,t),Up();break e}l=Error(U(426))}}else if(Pe&&a.mode&1){var w=ty(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),ny(w,o,a,i,t),_p(ji(l,a));break e}}i=l=ji(l,a),Ue!==4&&(Ue=2),Io===null?Io=[i]:Io.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=Tw(i,l,t);Qg(i,g);break e;case 1:a=l;var x=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Fr===null||!Fr.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=Rw(i,a,t);Qg(i,b);break e}}i=i.return}while(i!==null)}qw(n)}catch(S){t=S,$e===n&&n!==null&&($e=n=n.return);continue}break}while(!0)}function Kw(){var e=wc.current;return wc.current=vc,e===null?vc:e}function Up(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Qe===null||!(Es&268435455)&&!(ou&268435455)||Sr(Qe,Je)}function _c(e,t){var n=ae;ae|=2;var r=Kw();(Qe!==e||Je!==t)&&(Gn=null,ys(e,t));do try{Pj();break}catch(s){Gw(e,s)}while(!0);if(Cp(),ae=n,wc.current=r,$e!==null)throw Error(U(261));return Qe=null,Je=0,Ue}function Pj(){for(;$e!==null;)Qw($e)}function jj(){for(;$e!==null&&!JC();)Qw($e)}function Qw(e){var t=Xw(e.alternate,e,It);e.memoizedProps=e.pendingProps,t===null?qw(e):$e=t,Op.current=null}function qw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=wj(n,t),n!==null){n.flags&=32767,$e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,$e=null;return}}else if(n=vj(n,t,It),n!==null){$e=n;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);Ue===0&&(Ue=5)}function as(e,t,n){var r=ue,s=Xt.transition;try{Xt.transition=null,ue=1,Ej(e,t,n,r)}finally{Xt.transition=s,ue=r}return null}function Ej(e,t,n,r){do yi();while(Pr!==null);if(ae&6)throw Error(U(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(lP(e,i),e===Qe&&($e=Qe=null,Je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xa||(Xa=!0,Jw(sc,function(){return yi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Xt.transition,Xt.transition=null;var o=ue;ue=1;var a=ae;ae|=4,Op.current=null,kj(e,n),Uw(n,e),QP(Df),oc=!!Lf,Df=Lf=null,e.current=n,_j(n),ZC(),ae=a,ue=o,Xt.transition=i}else e.current=n;if(Xa&&(Xa=!1,Pr=e,kc=s),i=e.pendingLanes,i===0&&(Fr=null),nP(n.stateNode),wt(e,De()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(bc)throw bc=!1,e=nh,nh=null,e;return kc&1&&e.tag!==0&&yi(),i=e.pendingLanes,i&1?e===rh?Mo++:(Mo=0,rh=e):Mo=0,qr(),null}function yi(){if(Pr!==null){var e=T1(kc),t=Xt.transition,n=ue;try{if(Xt.transition=null,ue=16>e?16:e,Pr===null)var r=!1;else{if(e=Pr,Pr=null,kc=0,ae&6)throw Error(U(331));var s=ae;for(ae|=4,G=e.current;G!==null;){var i=G,o=i.child;if(G.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(G=c;G!==null;){var u=G;switch(u.tag){case 0:case 11:case 15:No(8,u,i)}var d=u.child;if(d!==null)d.return=u,G=d;else for(;G!==null;){u=G;var h=u.sibling,p=u.return;if($w(u),u===c){G=null;break}if(h!==null){h.return=p,G=h;break}G=p}}}var m=i.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var w=y.sibling;y.sibling=null,y=w}while(y!==null)}}G=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,G=o;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:No(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,G=g;break e}G=i.return}}var x=e.current;for(G=x;G!==null;){o=G;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,G=v;else e:for(o=x;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:iu(9,a)}}catch(S){Ae(a,a.return,S)}if(a===o){G=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,G=b;break e}G=a.return}}if(ae=s,qr(),In&&typeof In.onPostCommitFiberRoot=="function")try{In.onPostCommitFiberRoot(Xc,e)}catch{}r=!0}return r}finally{ue=n,Xt.transition=t}}return!1}function my(e,t,n){t=ji(n,t),t=Tw(e,t,1),e=Dr(e,t,1),t=ut(),e!==null&&(ma(e,1,t),wt(e,t))}function Ae(e,t,n){if(e.tag===3)my(e,e,n);else for(;t!==null;){if(t.tag===3){my(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fr===null||!Fr.has(r))){e=ji(n,e),e=Rw(t,e,1),t=Dr(t,e,1),e=ut(),t!==null&&(ma(t,1,e),wt(t,e));break}}t=t.return}}function Tj(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ut(),e.pingedLanes|=e.suspendedLanes&n,Qe===e&&(Je&n)===n&&(Ue===4||Ue===3&&(Je&130023424)===Je&&500>De()-$p?ys(e,0):zp|=n),wt(e,t)}function Yw(e,t){t===0&&(e.mode&1?(t=Ba,Ba<<=1,!(Ba&130023424)&&(Ba=4194304)):t=1);var n=ut();e=rr(e,t),e!==null&&(ma(e,t,n),wt(e,n))}function Rj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yw(e,n)}function Nj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),Yw(e,n)}var Xw;Xw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||xt.current)gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return gt=!1,xj(e,t,n);gt=!!(e.flags&131072)}else gt=!1,Pe&&t.flags&1048576&&tw(t,hc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ml(e,t),e=t.pendingProps;var s=_i(t,it.current);gi(t,n),s=Mp(null,t,r,e,s,n);var i=Ap();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vt(r)?(i=!0,dc(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ep(t),s.updater=su,t.stateNode=s,s._reactInternals=t,Hf(t,r,e,n),t=Qf(null,t,r,!0,i,n)):(t.tag=0,Pe&&i&&bp(t),at(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ml(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Mj(r),e=fn(r,e),s){case 0:t=Kf(null,t,r,e,n);break e;case 1:t=iy(null,t,r,e,n);break e;case 11:t=ry(null,t,r,e,n);break e;case 14:t=sy(null,t,r,fn(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),Kf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),iy(e,t,r,s,n);case 3:e:{if(Aw(t),e===null)throw Error(U(387));r=t.pendingProps,i=t.memoizedState,s=i.element,aw(e,t),gc(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=ji(Error(U(423)),t),t=oy(e,t,r,n,s);break e}else if(r!==s){s=ji(Error(U(424)),t),t=oy(e,t,r,n,s);break e}else for(Mt=Lr(t.stateNode.containerInfo.firstChild),Lt=t,Pe=!0,pn=null,n=iw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Si(),r===s){t=sr(e,t,n);break e}at(e,t,r,n)}t=t.child}return t;case 5:return lw(t),e===null&&Vf(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Ff(r,s)?o=null:i!==null&&Ff(r,i)&&(t.flags|=32),Mw(e,t),at(e,t,o,n),t.child;case 6:return e===null&&Vf(t),null;case 13:return Lw(e,t,n);case 4:return Tp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ci(t,null,r,n):at(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),ry(e,t,r,s,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,ve(pc,r._currentValue),r._currentValue=o,i!==null)if(xn(i.value,o)){if(i.children===s.children&&!xt.current){t=sr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Zn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Uf(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(U(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Uf(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}at(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,gi(t,n),s=en(s),r=r(s),t.flags|=1,at(e,t,r,n),t.child;case 14:return r=t.type,s=fn(r,t.pendingProps),s=fn(r.type,s),sy(e,t,r,s,n);case 15:return Nw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),Ml(e,t),t.tag=1,vt(r)?(e=!0,dc(t)):e=!1,gi(t,n),Ew(t,r,s),Hf(t,r,s,n),Qf(null,t,r,!0,e,n);case 19:return Dw(e,t,n);case 22:return Iw(e,t,n)}throw Error(U(156,t.tag))};function Jw(e,t){return C1(e,t)}function Ij(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,t,n,r){return new Ij(e,t,n,r)}function Wp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mj(e){if(typeof e=="function")return Wp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===cp)return 11;if(e===up)return 14}return 2}function zr(e,t){var n=e.alternate;return n===null?(n=qt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Dl(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Wp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Xs:return xs(n.children,s,i,t);case lp:o=8,s|=8;break;case mf:return e=qt(12,n,t,s|2),e.elementType=mf,e.lanes=i,e;case gf:return e=qt(13,n,t,s),e.elementType=gf,e.lanes=i,e;case yf:return e=qt(19,n,t,s),e.elementType=yf,e.lanes=i,e;case l1:return au(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case o1:o=10;break e;case a1:o=9;break e;case cp:o=11;break e;case up:o=14;break e;case wr:o=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=qt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function xs(e,t,n,r){return e=qt(7,e,r,t),e.lanes=n,e}function au(e,t,n,r){return e=qt(22,e,r,t),e.elementType=l1,e.lanes=n,e.stateNode={isHidden:!1},e}function ld(e,t,n){return e=qt(6,e,null,t),e.lanes=n,e}function cd(e,t,n){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Aj(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Uu(0),this.expirationTimes=Uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uu(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Hp(e,t,n,r,s,i,o,a,l){return e=new Aj(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=qt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ep(i),e}function Lj(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ys,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Zw(e){if(!e)return Ur;e=e._reactInternals;e:{if(Is(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var n=e.type;if(vt(n))return Z1(e,n,t)}return t}function eb(e,t,n,r,s,i,o,a,l){return e=Hp(n,r,!0,e,s,i,o,a,l),e.context=Zw(null),n=e.current,r=ut(),s=Or(n),i=Zn(r,s),i.callback=t??null,Dr(n,i,s),e.current.lanes=s,ma(e,s,r),wt(e,r),e}function lu(e,t,n,r){var s=t.current,i=ut(),o=Or(s);return n=Zw(n),t.context===null?t.context=n:t.pendingContext=n,t=Zn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Dr(s,t,o),e!==null&&(gn(e,s,o,i),Rl(e,s,o)),o}function Sc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function gy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gp(e,t){gy(e,t),(e=e.alternate)&&gy(e,t)}function Dj(){return null}var tb=typeof reportError=="function"?reportError:function(e){console.error(e)};function Kp(e){this._internalRoot=e}cu.prototype.render=Kp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));lu(e,t,null,null)};cu.prototype.unmount=Kp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ts(function(){lu(null,e,null,null)}),t[nr]=null}};function cu(e){this._internalRoot=e}cu.prototype.unstable_scheduleHydration=function(e){if(e){var t=I1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_r.length&&t!==0&&t<_r[n].priority;n++);_r.splice(n,0,e),n===0&&A1(e)}};function Qp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function uu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function yy(){}function Fj(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=Sc(o);i.call(c)}}var o=eb(t,r,e,0,null,!1,!1,"",yy);return e._reactRootContainer=o,e[nr]=o.current,Yo(e.nodeType===8?e.parentNode:e),Ts(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Sc(l);a.call(c)}}var l=Hp(e,0,!1,null,null,!1,!1,"",yy);return e._reactRootContainer=l,e[nr]=l.current,Yo(e.nodeType===8?e.parentNode:e),Ts(function(){lu(t,l,n,r)}),l}function du(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=Sc(o);a.call(l)}}lu(t,o,e,s)}else o=Fj(n,t,e,s,r);return Sc(o)}R1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=bo(t.pendingLanes);n!==0&&(hp(t,n|1),wt(t,De()),!(ae&6)&&(Ei=De()+500,qr()))}break;case 13:Ts(function(){var r=rr(e,1);if(r!==null){var s=ut();gn(r,e,1,s)}}),Gp(e,1)}};pp=function(e){if(e.tag===13){var t=rr(e,134217728);if(t!==null){var n=ut();gn(t,e,134217728,n)}Gp(e,134217728)}};N1=function(e){if(e.tag===13){var t=Or(e),n=rr(e,t);if(n!==null){var r=ut();gn(n,e,t,r)}Gp(e,t)}};I1=function(){return ue};M1=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}};jf=function(e,t,n){switch(t){case"input":if(wf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=tu(r);if(!s)throw Error(U(90));u1(r),wf(r,s)}}}break;case"textarea":f1(e,n);break;case"select":t=n.value,t!=null&&fi(e,!!n.multiple,t,!1)}};v1=Bp;w1=Ts;var Oj={usingClientEntryPoint:!1,Events:[ya,ti,tu,y1,x1,Bp]},so={findFiberByHostInstance:ds,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zj={bundleType:so.bundleType,version:so.version,rendererPackageName:so.rendererPackageName,rendererConfig:so.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:or.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_1(e),e===null?null:e.stateNode},findFiberByHostInstance:so.findFiberByHostInstance||Dj,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 Ja=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ja.isDisabled&&Ja.supportsFiber)try{Xc=Ja.inject(zj),In=Ja}catch{}}Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Oj;Ot.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qp(t))throw Error(U(200));return Lj(e,t,null,n)};Ot.createRoot=function(e,t){if(!Qp(e))throw Error(U(299));var n=!1,r="",s=tb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Hp(e,1,!1,null,null,n,!1,r,s),e[nr]=t.current,Yo(e.nodeType===8?e.parentNode:e),new Kp(t)};Ot.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=_1(t),e=e===null?null:e.stateNode,e};Ot.flushSync=function(e){return Ts(e)};Ot.hydrate=function(e,t,n){if(!uu(t))throw Error(U(200));return du(null,e,t,!0,n)};Ot.hydrateRoot=function(e,t,n){if(!Qp(e))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=tb;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=eb(t,null,e,1,n??null,s,!1,i,o),e[nr]=t.current,Yo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new cu(t)};Ot.render=function(e,t,n){if(!uu(t))throw Error(U(200));return du(null,e,t,!1,n)};Ot.unmountComponentAtNode=function(e){if(!uu(e))throw Error(U(40));return e._reactRootContainer?(Ts(function(){du(null,null,e,!1,function(){e._reactRootContainer=null,e[nr]=null})}),!0):!1};Ot.unstable_batchedUpdates=Bp;Ot.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!uu(n))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return du(e,t,n,!1,r)};Ot.version="18.3.1-next-f1338f8080-20240426";function nb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nb)}catch(e){console.error(e)}}nb(),n1.exports=Ot;var Ms=n1.exports,rb,xy=Ms;rb=xy.createRoot,xy.hydrateRoot;var _o=typeof window<"u"?_.useLayoutEffect:_.useEffect;function ud(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function $j(e,t,n={},r={}){_.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([i])=>{t(i)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function Bj(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}const sb=!1;function ia(e){return e[e.length-1]}function Vj(e){return typeof e=="function"}function jr(e,t){return Vj(e)?e(t):e}const Uj=Object.prototype.hasOwnProperty,vy=Object.prototype.propertyIsEnumerable,Wj=()=>Object.create(null),ns=(e,t)=>Er(e,t,Wj);function Er(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=ky(e)&&ky(s);if(!i&&!(Ti(e)&&Ti(s)))return s;const o=i?e:wy(e);if(!o)return s;const a=i?s:wy(s);if(!a)return s;const l=o.length,c=a.length,u=i?new Array(c):n();let d=0;for(let h=0;h<c;h++){const p=i?h:a[h],m=e[p],y=s[p];if(m===y){u[p]=m,(i?h<l:Uj.call(e,p))&&d++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){u[p]=y;continue}const w=Er(m,y,n,r+1);u[p]=w,w===m&&d++}return l===c&&d===l?e:u}function wy(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!vy.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!vy.call(e,s))return!1;r.push(s)}return r}function Ti(e){if(!by(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!by(n)||!n.hasOwnProperty("isPrototypeOf"))}function by(e){return Object.prototype.toString.call(e)==="[object Object]"}function ky(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vs(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!vs(e[r],t[r],n))return!1;return!0}if(Ti(e)&&Ti(t)){const r=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const o in t)if((!r||t[o]!==void 0)&&!vs(e[o],t[o],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&s++;let i=0;for(const o in t)if((!r||t[o]!==void 0)&&(i++,i>s||!vs(e[o],t[o],n)))return!1;return s===i}return!1}function Ri(e){let t,n;const r=new Promise((s,i)=>{t=s,n=i});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e==null||e(s)},r.reject=s=>{r.status="rejected",n(s)},r}function oa(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Hj(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function _y(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return Hj(t)}const Gj=["http:","https:","mailto:","tel:"];function Cc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function io(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",s;for(;(s=t.exec(e))!==null;)r+=_y(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+_y(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function Kj(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Qj(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function er(){throw new Error("Invariant failed")}function aa(e){const t=new Map;let n,r;const s=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,n=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const o=t.get(i);if(o)return s(o),o.value},set(i,o){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const a=t.get(i);if(a)a.value=o,s(a);else{const l={key:i,value:o,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(i,l)}},clear(){t.clear(),n=void 0,r=void 0}}}const Tr=4,ib=5;function qj(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function qp(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,i=e.substring(t,s);if(!i||!i.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(i==="$"){const a=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(i.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const o=qj(i);if(o){const[a,l]=o,c=i.charCodeAt(a+1);if(c===45){if(a+2<i.length&&i.charCodeAt(a+2)===36){const u=a+3,d=l;if(u<d)return n[0]=3,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+l+1,n[5]=s,n}}else if(c===36){const u=a+1,d=a+2;return d===l?(n[0]=2,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+d,n[3]=t+l,n[4]=t+l+1,n[5]=s,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function fu(e,t,n,r,s,i,o){var l,c,u,d,h,p,m,y,w,g,x,v,b;o==null||o(n);let a=r;{const S=n.fullPath??n.from,k=S.length,T=((l=n.options)==null?void 0:l.caseSensitive)??e,P=!!((u=(c=n.options)==null?void 0:c.params)!=null&&u.parse&&((h=(d=n.options)==null?void 0:d.skipRouteOnParseError)!=null&&h.params));for(;a<k;){const j=qp(S,a,t);let I;const M=a,O=j[5];switch(a=O+1,i++,j[0]){case 0:{const z=S.substring(j[2],j[3]);if(T){const E=(p=s.static)==null?void 0:p.get(z);if(E)I=E;else{s.static??(s.static=new Map);const F=ps(n.fullPath??n.from);F.parent=s,F.depth=i,I=F,s.static.set(z,F)}}else{const E=z.toLowerCase(),F=(m=s.staticInsensitive)==null?void 0:m.get(E);if(F)I=F;else{s.staticInsensitive??(s.staticInsensitive=new Map);const V=ps(n.fullPath??n.from);V.parent=s,V.depth=i,I=V,s.staticInsensitive.set(E,V)}}break}case 1:{const z=S.substring(M,j[1]),E=S.substring(j[4],O),F=T&&!!(z||E),V=z?F?z:z.toLowerCase():void 0,A=E?F?E:E.toLowerCase():void 0,B=!P&&((y=s.dynamic)==null?void 0:y.find(C=>!C.skipOnParamError&&C.caseSensitive===F&&C.prefix===V&&C.suffix===A));if(B)I=B;else{const C=fd(1,n.fullPath??n.from,F,V,A);I=C,C.depth=i,C.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(C)}break}case 3:{const z=S.substring(M,j[1]),E=S.substring(j[4],O),F=T&&!!(z||E),V=z?F?z:z.toLowerCase():void 0,A=E?F?E:E.toLowerCase():void 0,B=!P&&((w=s.optional)==null?void 0:w.find(C=>!C.skipOnParamError&&C.caseSensitive===F&&C.prefix===V&&C.suffix===A));if(B)I=B;else{const C=fd(3,n.fullPath??n.from,F,V,A);I=C,C.parent=s,C.depth=i,s.optional??(s.optional=[]),s.optional.push(C)}break}case 2:{const z=S.substring(M,j[1]),E=S.substring(j[4],O),F=T&&!!(z||E),V=z?F?z:z.toLowerCase():void 0,A=E?F?E:E.toLowerCase():void 0,B=fd(2,n.fullPath??n.from,F,V,A);I=B,B.parent=s,B.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push(B)}}s=I}if(P&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const j=ps(n.fullPath??n.from);j.kind=ib,j.parent=s,i++,j.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(j),s=j}const R=(n.path||!n.children)&&!n.isRoot;if(R&&S.endsWith("/")){const j=ps(n.fullPath??n.from);j.kind=Tr,j.parent=s,i++,j.depth=i,s.index=j,s=j}s.parse=((x=(g=n.options)==null?void 0:g.params)==null?void 0:x.parse)??null,s.skipOnParamError=P,s.parsingPriority=((b=(v=n.options)==null?void 0:v.skipRouteOnParseError)==null?void 0:b.priority)??0,R&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const S of n.children)fu(e,t,S,a,s,i,o)}function dd(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function kr(e){var t,n,r;if(e.pathless)for(const s of e.pathless)kr(s);if(e.static)for(const s of e.static.values())kr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())kr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(dd);for(const s of e.dynamic)kr(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(dd);for(const s of e.optional)kr(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(dd);for(const s of e.wildcard)kr(s)}}function ps(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function fd(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function Yj(e,t){const n=ps("/"),r=new Uint16Array(6);for(const s of e)fu(!1,r,s,1,n,0);kr(n),t.masksTree=n,t.flatCache=aa(1e3)}function Xj(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=Yp(e,t.masksTree);return t.flatCache.set(e,r),r}function Jj(e,t,n,r,s){e||(e="/"),r||(r="/");const i=t?`case\0${e}`:e;let o=s.singleCache.get(i);return o||(o=ps("/"),fu(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),Yp(r,o,n)}function Zj(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=Yp(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=nE(i.route)),t.matchCache.set(r,i),i}function eE(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function tE(e,t=!1,n){const r=ps(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return fu(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&er(),i[l.id]=l,a!==0&&l.path){const c=eE(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),kr(r),{processedTree:{segmentTree:r,singleCache:aa(1e3),matchCache:aa(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function Yp(e,t,n=!1){const r=e.split("/"),s=sE(e,r,t,n);if(!s)return null;const[i]=ob(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function ob(e,t,n){var u,d,h,p,m,y,w,g,x,v;const r=rE(n.node);let s=null;const i=Object.create(null);let o=((u=n.extract)==null?void 0:u.part)??0,a=((d=n.extract)==null?void 0:d.node)??0,l=((h=n.extract)==null?void 0:h.path)??0,c=((p=n.extract)==null?void 0:p.segment)??0;for(;a<r.length;o++,a++,l++,c++){const b=r[a];if(b.kind===Tr)break;if(b.kind===ib){c--,o--,l--;continue}const S=t[o],k=l;if(S&&(l+=S.length),b.kind===1){s??(s=n.node.fullPath.split("/"));const T=s[c],P=((m=b.prefix)==null?void 0:m.length)??0;if(T.charCodeAt(P)===123){const R=((y=b.suffix)==null?void 0:y.length)??0,j=T.substring(P+2,T.length-R-1),I=S.substring(P,S.length-R);i[j]=decodeURIComponent(I)}else{const R=T.substring(1);i[R]=decodeURIComponent(S)}}else if(b.kind===3){if(n.skipped&1<<a){o--,l=k-1;continue}s??(s=n.node.fullPath.split("/"));const T=s[c],P=((w=b.prefix)==null?void 0:w.length)??0,R=((g=b.suffix)==null?void 0:g.length)??0,j=T.substring(P+3,T.length-R-1),I=b.suffix||b.prefix?S.substring(P,S.length-R):S;I&&(i[j]=decodeURIComponent(I))}else if(b.kind===2){const T=b,P=e.substring(k+(((x=T.prefix)==null?void 0:x.length)??0),e.length-(((v=T.suffix)==null?void 0:v.length)??0)),R=decodeURIComponent(P);i["*"]=R,i._splat=R;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function nE(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function rE(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function sE(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!ia(t),i=s&&e!=="/",o=t.length-(s?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let l=null,c=null;for(;a.length;){const u=a.pop(),{node:d,index:h,skipped:p,depth:m,statics:y,dynamics:w,optionals:g}=u;let{extract:x,rawParams:v,parsedParams:b}=u;if(d.kind===2&&d.route&&!el(c,u))continue;if(d.skipOnParamError){if(!Sy(e,t,u))continue;v=u.rawParams,x=u.extract,b=u.parsedParams}r&&d.route&&d.kind!==Tr&&el(l,u)&&(l=u);const S=h===o;if(S&&(d.route&&(!i||d.kind===Tr||d.kind===2)&&el(c,u)&&(c=u),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;const k=S?void 0:t[h];let T;if(S&&d.index){const P={node:d.index,index:h,skipped:p,depth:m+1,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b};let R=!0;if(d.index.skipOnParamError&&(Sy(e,t,P)||(R=!1)),R){if(!w&&!g&&!p&&iE(y,o))return P;el(c,P)&&(c=P)}}if(d.wildcard)for(let P=d.wildcard.length-1;P>=0;P--){const R=d.wildcard[P],{prefix:j,suffix:I}=R;if(!(j&&(S||!(R.caseSensitive?k:T??(T=k.toLowerCase())).startsWith(j)))){if(I){if(S)continue;const M=t.slice(h).join("/").slice(-I.length);if((R.caseSensitive?M:M.toLowerCase())!==I)continue}a.push({node:R,index:o,skipped:p,depth:m+1,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}}if(d.optional){const P=p|1<<m,R=m+1;for(let j=d.optional.length-1;j>=0;j--){const I=d.optional[j];a.push({node:I,index:h,skipped:P,depth:R,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}if(!S)for(let j=d.optional.length-1;j>=0;j--){const I=d.optional[j],{prefix:M,suffix:O}=I;if(M||O){const z=I.caseSensitive?k:T??(T=k.toLowerCase());if(M&&!z.startsWith(M)||O&&!z.endsWith(O))continue}a.push({node:I,index:h+1,skipped:p,depth:R,statics:y,dynamics:w,optionals:g+Za(o,h),extract:x,rawParams:v,parsedParams:b})}}if(!S&&d.dynamic&&k)for(let P=d.dynamic.length-1;P>=0;P--){const R=d.dynamic[P],{prefix:j,suffix:I}=R;if(j||I){const M=R.caseSensitive?k:T??(T=k.toLowerCase());if(j&&!M.startsWith(j)||I&&!M.endsWith(I))continue}a.push({node:R,index:h+1,skipped:p,depth:m+1,statics:y,dynamics:w+Za(o,h),optionals:g,extract:x,rawParams:v,parsedParams:b})}if(!S&&d.staticInsensitive){const P=d.staticInsensitive.get(T??(T=k.toLowerCase()));P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+Za(o,h),dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}if(!S&&d.static){const P=d.static.get(k);P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+Za(o,h),dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}if(d.pathless){const P=m+1;for(let R=d.pathless.length-1;R>=0;R--){const j=d.pathless[R];a.push({node:j,index:h,skipped:p,depth:P,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}}}if(c)return c;if(r&&l){let u=l.index;for(let h=0;h<l.index;h++)u+=t[h].length;const d=u===e.length?"/":e.slice(u);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(d),l}return null}function Za(e,t){return 2**(e-t-1)}function iE(e,t){return e===2**(t-1)-1}function Sy(e,t,n){try{const[r,s]=ob(e,t,n);n.rawParams=r,n.extract=s;const i=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,i),!0}catch{return null}}function el(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Tr)>(e.node.kind===Tr)||t.node.kind===Tr==(e.node.kind===Tr)&&t.depth>e.depth))):!0}function Fl(e){return Xp(e.filter(t=>t!==void 0).join("/"))}function Xp(e){return e.replace(/\/{2,}/g,"/")}function ab(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function $r(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function lb(e){return $r(ab(e))}function Pc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function oE(e,t,n){return Pc(e,n)===Pc(t,n)}function aE({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),i=!s&&t===".";let o;if(r){o=s?t:i?e:e+"\0"+t;const d=r.get(o);if(d)return d}let a;if(i)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&ia(a)==="";)a.pop();const d=t.split("/");for(let h=0,p=d.length;h<p;h++){const m=d[h];m===""?h?h===p-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(ia(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,c="";for(let d=0;d<a.length;d++){d>0&&(c+="/");const h=a[d];if(!h)continue;l=qp(h,0,l);const p=l[0];if(p===0){c+=h;continue}const m=l[5],y=h.substring(0,l[1]),w=h.substring(l[4],m),g=h.substring(l[2],l[3]);p===1?c+=y||w?`${y}{$${g}}${w}`:`$${g}`:p===2?c+=y||w?`${y}{$}${w}`:"$":c+=`${y}{-$${g}}${w}`}c=Xp(c);const u=c||"/";return o&&r&&r.set(o,u),u}function lE(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,i=>t.get(i)??i)}function hd(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>Py(s,n)).join("/"):Py(r,n)}function Cy({path:e,params:t,decoder:n,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const o=e.length;let a=0,l,c="";for(;a<o;){const u=a;l=qp(e,u,l);const d=l[5];if(a=d+1,u===d)continue;const h=l[0];if(h===0){c+="/"+e.substring(u,d);continue}if(h===2){const p=t._splat;i._splat=p,i["*"]=p;const m=e.substring(u,l[1]),y=e.substring(l[4],d);if(!p){s=!0,(m||y)&&(c+="/"+m+y);continue}const w=hd("_splat",t,n);c+="/"+m+w+y;continue}if(h===1){const p=e.substring(l[2],l[3]);!s&&!(p in t)&&(s=!0),i[p]=t[p];const m=e.substring(u,l[1]),y=e.substring(l[4],d),w=hd(p,t,n)??"undefined";c+="/"+m+w+y;continue}if(h===3){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;i[p]=m;const y=e.substring(u,l[1]),w=e.substring(l[4],d),g=hd(p,t,n)??"";c+="/"+y+g+w;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function Py(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function st(e){return(e==null?void 0:e.isNotFound)===!0}function cE(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const uE="tsr-scroll-restoration-v1_3";function dE(){const e=cE();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Ti(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=jr(r,t)||t},persist:()=>{try{e.setItem(uE,JSON.stringify(t))}catch{}}}}const jy=dE(),fE=e=>e.state.__TSR_key||e.href;function hE(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let tl=!1;const oo="window",Ey="data-scroll-restoration-id";function pE(e,t){if(!jy)return;const n=jy;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,tl=!1;const r=e.options.getScrollRestorationKey||fE,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(tl||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(oo,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;s.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},o=a=>{var c;if(!e.isScrollRestoring||!a||s.size===0||!n)return;const l=(c=n.state)[a]||(c[a]={});for(const[u,d]of s){let h;if(u===oo)h=oo;else if(u.isConnected){const p=u.getAttribute(Ey);h=p?`[${Ey}="${p}"]`:hE(u)}h&&(l[h]=d)}};document.addEventListener("scroll",i,!0),e.subscribe("onBeforeLoad",a=>{o(a.fromLocation?r(a.fromLocation):void 0),s.clear()}),window.addEventListener("pagehide",()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",a=>{var d;const l=r(a.toLocation),c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors;if(s.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){tl=!0;try{const h=e.isScrollRestoring?n.state[l]:void 0;let p=!1;if(h)for(const m in h){const y=h[m];if(!Ti(y))continue;const{scrollX:w,scrollY:g}=y;if(!(!Number.isFinite(w)||!Number.isFinite(g))){if(m===oo)window.scrollTo({top:g,left:w,behavior:c}),p=!0;else if(m){let x;try{x=document.querySelector(m)}catch{continue}x&&(x.scrollLeft=w,x.scrollTop=g,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const y=((d=window.history.state)==null?void 0:d.__hashScrollIntoViewOptions)??!0;if(y){const w=document.getElementById(m);w&&w.scrollIntoView(y)}}else{const y={top:0,left:0,behavior:c};if(window.scrollTo(y),u)for(const w of u){if(w===oo)continue;const g=typeof w=="function"?w():document.querySelector(w);g&&g.scrollTo(y)}}}}finally{tl=!1}e.isScrollRestoring&&n.set(h=>(h[l]||(h[l]={}),h))}})}function mE(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function pd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function gE(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const i=n[r];i==null?n[r]=pd(s):Array.isArray(i)?i.push(pd(s)):n[r]=[i,pd(s)]}return n}const yE=vE(JSON.parse),xE=wE(JSON.stringify,JSON.parse);function vE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=gE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function wE(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const i=mE(s,r);return i?`?${i}`:""}}const ws="__root__";function bE(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function yt(e){return e instanceof Response&&!!e.options}function kE(e){return{input:({url:t})=>{for(const n of e)t=oh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=cb(e[n],t);return t}}}function _E(e){const t=lb(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),i=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const a=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===s?o.pathname="/":a.startsWith(i)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Fl(["/",t,o.pathname]),o)}}function oh(e,t){var r;const n=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function cb(e,t){var r;const n=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function SE(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:i}=t,o=new Map,a=new Map,l=new Map,c=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),h=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),y=n(e.statusCode),w=n(e.redirect),g=n([]),x=n([]),v=n([]),b=r(()=>md(o,g.get())),S=r(()=>md(a,x.get())),k=r(()=>md(l,v.get())),T=r(()=>g.get()[0]),P=r(()=>g.get().some(V=>{var A;return((A=o.get(V))==null?void 0:A.get().status)==="pending"})),R=r(()=>{var V;return{locationHref:p.get().href,resolvedLocationHref:(V=m.get())==null?void 0:V.href,status:c.get()}}),j=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:h.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:w.get()})),I=aa(64);function M(V){let A=I.get(V);return A||(A=r(()=>{const B=g.get();for(const C of B){const $=o.get(C);if($&&$.routeId===V)return $.get()}}),I.set(V,A)),A}const O={status:c,loadedAt:u,isLoading:d,isTransitioning:h,location:p,resolvedLocation:m,statusCode:y,redirect:w,matchesId:g,pendingIds:x,cachedIds:v,matches:b,pendingMatches:S,cachedMatches:k,firstId:T,hasPending:P,matchRouteDeps:R,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:j,getRouteMatchStore:M,setMatches:z,setPending:E,setCached:F};z(e.matches),i==null||i(O);function z(V){gd(V,o,g,n,s)}function E(V){gd(V,a,x,n,s)}function F(V){gd(V,l,v,n,s)}return O}function md(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function gd(e,t,n,r,s){const i=e.map(a=>a.id),o=new Set(i);s(()=>{for(const a of t.keys())o.has(a)||t.delete(a);for(const a of e){const l=t.get(a.id);if(!l){const c=r(a);c.routeId=a.routeId,t.set(a.id,c);continue}l.routeId=a.routeId,l.get()!==a&&l.set(a)}Qj(n.get(),i)||n.set(i)})}const ah=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},CE=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),hu=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),bs=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let i=0;i<=s;i++){const o=e.matches[i];if(!o)continue;const a=e.router.getMatch(o.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},Ty=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),s=r>=0?r:0;let i=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;i<0&&(i=s);for(let o=i;o>=0;o--){const a=e.matches[o];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return o}return n?i:s},Rr=(e,t,n)=>{var r,s,i;if(!(!yt(n)&&!st(n)))throw yt(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((r=t._nonReactive.beforeLoadPromise)==null||r.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:yt(n)?"redirected":st(n)?"notFound":o.status==="pending"?"success":o.status,context:bs(e,t.index),isFetching:!1,error:n})),st(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),yt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},ub=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Ry=(e,t,n)=>{const r=bs(e,n);e.updateMatch(t,s=>({...s,context:r}))},ao=(e,t,n,r)=>{var a,l;const{id:s,routeId:i}=e.matches[t],o=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Rr(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(c){n=c,Rr(e,e.router.getMatch(s),n)}e.updateMatch(s,c=>{var u,d;return(u=c._nonReactive.beforeLoadPromise)==null||u.resolve(),c._nonReactive.beforeLoadPromise=void 0,(d=c._nonReactive.loadPromise)==null||d.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!yt(n)&&!st(n)&&(e.serialError??(e.serialError=n))},db=(e,t,n,r)=>{var i;if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!hu(e,t)&&(n.options.loader||n.options.beforeLoad||hb(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{ah(e)},s);r._nonReactive.pendingTimeout=o}},PE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;db(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Rr(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},jE=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Ri(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&ao(e,n,o,"PARSE_PARAMS"),a&&ao(e,n,a,"VALIDATE_SEARCH"),db(e,t,r,s);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,b=>({...b,isFetching:"beforeLoad",fetchCount:b.fetchCount+1,abortController:l})))},d=()=>{var b;(b=s._nonReactive.beforeLoadPromise)==null||b.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}s._nonReactive.beforeLoadPromise=Ri();const h={...bs(e,n,!1),...s.__routeContext},{search:p,params:m,cause:y}=s,w=hu(e,t),g={search:p,abortController:l,params:m,preload:w,context:h,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:w?"preload":y,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=b=>{if(b===void 0){e.router.batch(()=>{u(),d()});return}(yt(b)||st(b))&&(u(),ao(e,n,b,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,S=>({...S,__beforeLoadContext:b})),d()})};let v;try{if(v=r.options.beforeLoad(g),oa(v))return u(),v.catch(b=>{ao(e,n,b,"BEFORE_LOAD")}).then(x)}catch(b){u(),ao(e,n,b,"BEFORE_LOAD")}x(v)},EE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>jE(e,n,t,s),a=()=>{if(ub(e,n))return;const l=PE(e,n,s);return oa(l)?l.then(o):o()};return i()},TE=(e,t,n)=>{var i,o,a,l,c,u;const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(o=(i=n.options).head)==null?void 0:o.call(i,s),(l=(a=n.options).scripts)==null?void 0:l.call(a,s),(u=(c=n.options).headers)==null?void 0:u.call(c,s)]).then(([d,h,p])=>({meta:d==null?void 0:d.meta,links:d==null?void 0:d.links,headScripts:d==null?void 0:d.scripts,headers:p,scripts:h,styles:d==null?void 0:d.styles}))},fb=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=bs(e,r),d=hu(e,n);return{params:o,deps:a,preload:!!d,parentMatchPromise:i,abortController:l,context:u,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:d?"preload":c,route:s,...e.router.options.additionalContext}},Ny=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(sb??e.router.isServer)||u.ssr===!0)&&la(s);const d=s.options.loader,h=typeof d=="function"?d:d==null?void 0:d.handler,p=h==null?void 0:h(fb(e,t,n,r,s)),m=!!h&&oa(p);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,w=>({...w,isFetching:"loader"})),h){const w=m?await p:p;Rr(e,e.router.getMatch(n),w),w!==void 0&&e.updateMatch(n,g=>({...g,loaderData:w}))}s._lazyPromise&&await s._lazyPromise;const y=u._nonReactive.minPendingPromise;y&&await y,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,w=>({...w,error:void 0,context:bs(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let h=d;if((h==null?void 0:h.name)==="AbortError"){if(u.abortController.signal.aborted){(i=u._nonReactive.loaderPromise)==null||i.resolve(),u._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:bs(e,r)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,st(d)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),Rr(e,e.router.getMatch(n),d);try{(c=(l=s.options).onError)==null||c.call(l,d)}catch(m){h=m,Rr(e,e.router.getMatch(n),m)}!yt(h)&&!st(h)&&await la(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:h,context:bs(e,r),status:"error",isFetching:!1}))}}catch(u){const d=e.router.getMatch(n);d&&(d._nonReactive.loaderPromise=void 0),Rr(e,d,u)}},RE=async(e,t,n)=>{var p,m,y,w;async function r(g,x,v,b,S){const k=Date.now()-x.updatedAt,T=g?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,P=S.options.shouldReload,R=typeof P=="function"?P(fb(e,t,s,n,S)):P,{status:j,invalid:I}=b,M=k>=T&&(!!e.forceStaleReload||b.cause==="enter"||v!==void 0&&v!==b.id);o=j==="success"&&(I||(R??M)),g&&S.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var O,z;try{await Ny(e,t,s,n,S);const E=e.router.getMatch(s);(O=E._nonReactive.loaderPromise)==null||O.resolve(),(z=E._nonReactive.loadPromise)==null||z.resolve(),E._nonReactive.loaderPromise=void 0,E._nonReactive.loadPromise=void 0}catch(E){yt(E)&&await e.router.navigate(E.options)}})()):j!=="success"||o?await Ny(e,t,s,n,S):Ry(e,s,n))}const{id:s,routeId:i}=e.matches[n];let o=!1,a=!1;const l=e.router.looseRoutesById[i],c=l.options.loader,u=((typeof c=="function"||c==null?void 0:c.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(ub(e,s)){if(!e.router.getMatch(s))return e.matches[n];Ry(e,s,n)}else{const g=e.router.getMatch(s),x=e.router.stores.matchesId.get()[n],v=((p=x&&e.router.stores.matchStores.get(x)||null)==null?void 0:p.routeId)===i?x:(m=e.router.stores.matches.get().find(S=>S.routeId===i))==null?void 0:m.id,b=hu(e,s);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload&&u)return g;await g._nonReactive.loaderPromise;const S=e.router.getMatch(s),k=S._nonReactive.error||S.error;k&&Rr(e,S,k),S.status==="pending"&&await r(b,g,v,S,l)}else{const S=b&&!e.router.stores.matchStores.has(s),k=e.router.getMatch(s);k._nonReactive.loaderPromise=Ri(),S!==k.preload&&e.updateMatch(s,T=>({...T,preload:S})),await r(b,g,v,k,l)}}const d=e.router.getMatch(s);a||((y=d._nonReactive.loaderPromise)==null||y.resolve(),(w=d._nonReactive.loadPromise)==null||w.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,a||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=a?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:h,invalid:!1})),e.router.getMatch(s)):d};async function Iy(e){var h,p;const t=e,n=[];CE(t.router)&&ah(t);let r;for(let m=0;m<t.matches.length;m++){try{const y=EE(t,m);oa(y)&&await y}catch(y){if(yt(y))throw y;if(st(y))r=y;else if(!t.preload)throw y;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?Ty(t,r):void 0,o=r&&t.preload?0:i!==void 0?Math.min(i+1,s):s;let a,l;for(let m=0;m<o;m++)n.push(RE(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const y of m){if(y.status!=="rejected")continue;const w=y.reason;if(yt(w))throw w;st(w)?a??(a=w):l??(l=w)}if(l!==void 0)throw l}const c=a??(r&&!t.preload?r:void 0);let u=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!c&&r&&t.preload)return t.matches;if(c){const m=Ty(t,c);m===void 0&&er();const y=t.matches[m],w=t.router.looseRoutesById[y.routeId],g=(h=t.router.options)==null?void 0:h.defaultNotFoundComponent;!w.options.notFoundComponent&&g&&(w.options.notFoundComponent=g),c.routeId=y.routeId;const x=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,v=>({...v,...x?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await la(w,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||(p=t.router.getMatch(m.id))!=null&&p.globalNotFound&&t.updateMatch(m.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await la(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:y,routeId:w}=t.matches[m],g=t.router.looseRoutesById[w];try{const x=TE(t,y,g);if(x){const v=await x;t.updateMatch(y,b=>({...b,...v}))}}catch(x){console.error(`Error executing head for route ${w}:`,x)}}const d=ah(t);if(oa(d)&&await d,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function My(e,t){const n=t.map(r=>{var s,i;return(i=(s=e.options[r])==null?void 0:s.preload)==null?void 0:i.call(s)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function la(e,t=Ol){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:s,...i}=r.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Ol?(()=>{if(e._componentsPromise===void 0){const r=My(e,Ol);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():My(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function hb(e){var t;for(const n of Ol)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Ol=["component","errorComponent","pendingComponent","notFoundComponent"];var Br="__TSR_index",Ay="popstate",Ly="beforeunload";function NE(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:o}))},s=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},i=async({task:o,navigateOpts:a,...l})=>{var d,h;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const c=((d=e.getBlockers)==null?void 0:d.call(e))??[],u=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&u)for(const p of c){const m=jc(l.path,l.state);if(await p.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){(h=e.onBlocked)==null||h.call(e);return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,a,l)=>{const c=t.state[Br];a=Dy(c+1,a),i({task:()=>{e.pushState(o,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:o,state:a})},replace:(o,a,l)=>{const c=t.state[Br];a=Dy(c,a),i({task:()=>{e.replaceState(o,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:o,state:a})},go:(o,a)=>{i({task:()=>{e.go(o),s({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{i({task:()=>{e.back((o==null?void 0:o.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{i({task:()=>{e.forward((o==null?void 0:o.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[Br]!==0,createHref:o=>e.createHref(o),block:o=>{var l;if(!e.setBlockers)return()=>{};const a=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...a,o]),()=>{var u,d;const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];(d=e.setBlockers)==null||d.call(e,c.filter(h=>h!==o))}},flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:r}}function Dy(e,t){t||(t={});const n=Jp();return{...t,key:n,__TSR_key:n,[Br]:e}}function IE(e){var P,R;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=j=>s=j,a=j=>j,l=()=>jc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((P=t.history.state)!=null&&P.__TSR_key)&&!((R=t.history.state)!=null&&R.key)){const j=Jp();t.history.replaceState({[Br]:0,key:j,__TSR_key:j},"")}let c=l(),u,d=!1,h=!1,p=!1,m=!1;const y=()=>c;let w,g;const x=()=>{w&&(T._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),T._ignoreSubscribers=!1,w=void 0,g=void 0,u=void 0)},v=(j,I,M)=>{const O=a(I);g||(u=c),c=jc(I,M),w={href:O,state:M,isPush:(w==null?void 0:w.isPush)||j==="push"},g||(g=Promise.resolve().then(()=>x()))},b=j=>{c=l(),T.notify({type:j})},S=async()=>{if(h){h=!1;return}const j=l(),I=j.state[Br]-c.state[Br],M=I===1,O=I===-1,z=!M&&!O||d;d=!1;const E=z?"GO":O?"BACK":"FORWARD",F=z?{type:"GO",index:I}:{type:O?"BACK":"FORWARD"};if(p)p=!1;else{const V=i();if(typeof document<"u"&&V.length){for(const A of V)if(await A.blockerFn({currentLocation:c,nextLocation:j,action:E})){h=!0,t.history.go(1),T.notify(F);return}}}c=l(),T.notify(F)},k=j=>{if(m){m=!1;return}let I=!1;const M=i();if(typeof document<"u"&&M.length)for(const O of M){const z=O.enableBeforeUnload??!0;if(z===!0){I=!0;break}if(typeof z=="function"&&z()===!0){I=!0;break}}if(I)return j.preventDefault(),j.returnValue=""},T=NE({getLocation:y,getLength:()=>t.history.length,pushState:(j,I)=>v("push",j,I),replaceState:(j,I)=>v("replace",j,I),back:j=>(j&&(p=!0),m=!0,t.history.back()),forward:j=>{j&&(p=!0),m=!0,t.history.forward()},go:j=>{d=!0,t.history.go(j)},createHref:j=>a(j),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ly,k,{capture:!0}),t.removeEventListener(Ay,S)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ly,k,{capture:!0}),t.addEventListener(Ay,S),t.history.pushState=function(...j){const I=n.apply(t.history,j);return T._ignoreSubscribers||b("PUSH"),I},t.history.replaceState=function(...j){const I=r.apply(t.history,j);return T._ignoreSubscribers||b("REPLACE"),I},T}function ME(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function jc(e,t){const n=ME(e),r=n.indexOf("#"),s=n.indexOf("?"),i=Jp();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[Br]:0,key:i,__TSR_key:i}}}function Jp(){return(Math.random()+1).toString(36).substring(7)}function xi(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:(n==null?void 0:n.pathname)!==r.pathname,hrefChanged:(n==null?void 0:n.href)!==r.href,hashChanged:(n==null?void 0:n.hash)!==r.hash}}var AE=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{var u;const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,o=r==null?void 0:r.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=lE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=IE()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let d;this.resolvePathCache=aa(1e3),d=this.buildRouteTree(),this.setRoutes(d)}if(!this.stores&&this.latestLocation){const d=this.getStoreConfig(this);this.batch=d.batch,this.stores=SE(DE(this.latestLocation),d),pE(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==l||o!==c){this.basepath=l;const d=[],h=lb(l);h&&h!=="/"&&d.push(_E({basepath:l})),c&&d.push(c),this.rewrite=d.length===0?void 0:d.length===1?d[0]:kE(d),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((u=window.CSS)==null?void 0:u.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=tE(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&Yj(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:l,search:c,hash:u,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const g=this.options.parseSearch(c),x=this.options.stringifySearch(g);return{href:l+x+u,publicHref:l+x+u,pathname:io(l).path,external:!1,searchStr:x,search:ns(r==null?void 0:r.search,g),hash:io(u.slice(1)).path,state:Er(r==null?void 0:r.state,h)}}const p=new URL(d,this.origin),m=oh(this.rewrite,p),y=this.options.parseSearch(m.search),w=this.options.stringifySearch(y);return m.search=w,{href:m.href.replace(m.origin,""),publicHref:d,pathname:io(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:w,search:ns(r==null?void 0:r.search,y),hash:io(m.hash.slice(1)).path,state:Er(r==null?void 0:r.state,h)}},i=s(n),{__tempLocation:o,__tempKey:a}=i.state;if(o&&(!a||a===this.tempLocationKey)){const l=s(o);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>aE({base:n,to:Xp(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>FE({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var s;if(this.stores.pendingMatchStores.has(n))return;const r=(s=this.stores.matchStores.get(n))==null?void 0:s.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(i={})=>{var j,I;const o=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(o);i.from;const l=i.unsafeRelative==="path"?o.pathname:i.from??a.fullPath,c=this.resolvePathWithBase(l,"."),u=a.search,d=Object.assign(Object.create(null),a.params),h=i.to?this.resolvePathWithBase(c,`${i.to}`):this.resolvePathWithBase(c,"."),p=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?d:Object.assign(d,jr(i.params,d)),m=this.getMatchedRoutes(h);let y=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]),Object.keys(p).length>0)for(const M of y){const O=((j=M.options.params)==null?void 0:j.stringify)??M.options.stringifyParams;if(O)try{Object.assign(p,O(p))}catch{}}const w=n.leaveParams?h:io(Cy({path:h,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let g=u;if(n._includeValidateSearch&&((I=this.options.search)!=null&&I.strict)){const M={};y.forEach(O=>{if(O.options.validateSearch)try{Object.assign(M,zl(O.options.validateSearch,{...M,...g}))}catch{}}),g=M}g=OE({search:g,dest:i,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),g=ns(u,g);const x=this.options.stringifySearch(g),v=i.hash===!0?o.hash:i.hash?jr(i.hash,o.hash):void 0,b=v?`#${v}`:"";let S=i.state===!0?o.state:i.state?jr(i.state,o.state):{};S=Er(o.state,S);const k=`${w}${x}${b}`;let T,P,R=!1;if(this.rewrite){const M=new URL(k,this.origin),O=cb(this.rewrite,M);T=M.href.replace(M.origin,""),O.origin!==this.origin?(P=O.href,R=!0):P=O.pathname+O.search+O.hash}else T=Kj(k),P=T;return{publicHref:P,href:T,pathname:w,search:g,searchStr:x,state:S,hash:v??"",external:R,unmaskOnReload:i.unmaskOnReload}},s=(i={},o)=>{const a=r(i);let l=o?r(o):void 0;if(!l){const c=Object.create(null);if(this.options.routeMasks){const u=Xj(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:d,params:h,...p}=u.route,m=h===!1||h===null?Object.create(null):(h??!0)===!0?c:Object.assign(c,jr(h,c));o={from:n.from,...p,params:m},l=r(o)}}}return l&&(a.maskedLocation=l),a};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const i=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{s.state[u]=this.latestLocation.state[u]});const c=vs(s.state,this.latestLocation.state);return l.forEach(u=>{delete s.state[u]}),c},o=$r(this.latestLocation.href)===$r(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Ri(()=>{a==null||a.resolve(),a=void 0}),o&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=s;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:o,href:a,...l}={})=>{if(a){const d=this.history.location.state.__TSR_index,h=jc(a,{__TSR_index:n?d:d+1}),p=new URL(h.pathname,this.origin);l.to=oh(this.rewrite,p).pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:i,...o})=>{var l,c;let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const d=this.buildLocation({to:n,...o});s=s??d.publicHref,i=i??d.publicHref}const u=!a&&i?i:s;if(Cc(u,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const d=((c=(l=this.history).getBlockers)==null?void 0:c.call(l))??[];for(const h of d)if(h!=null&&h.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return o.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...o,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(i=>i.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{let r,s,i;const o=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(l=>{this.startTransition(async()=>{var c;try{this.beforeLoad();const u=this.latestLocation,d=xi(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...d}),this.emit({type:"onBeforeLoad",...d}),await Iy({router:this,sync:n==null?void 0:n.sync,forceStaleReload:o.href===u.href,matches:this.stores.pendingMatches.get(),location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var w,g;let h=null,p=null,m=null,y=null;this.batch(()=>{const x=this.stores.pendingMatches.get(),v=x.length,b=this.stores.matches.get();h=v?b.filter(T=>!this.stores.pendingMatchStores.has(T.id)):null;const S=new Set;for(const T of this.stores.pendingMatchStores.values())T.routeId&&S.add(T.routeId);const k=new Set;for(const T of this.stores.matchStores.values())T.routeId&&k.add(T.routeId);p=v?b.filter(T=>!S.has(T.routeId)):null,m=v?x.filter(T=>!k.has(T.routeId)):null,y=v?x.filter(T=>k.has(T.routeId)):b,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(this.stores.setMatches(x),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(T=>T.status!=="error"&&T.status!=="notFound"&&T.status!=="redirected")]),this.clearExpiredCache())});for(const[x,v]of[[p,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(x)for(const b of x)(g=(w=this.looseRoutesById[b.routeId].options)[v])==null||g.call(w,b)})})}})}catch(u){yt(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):st(u)&&(s=u);const d=r?r.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(d),this.stores.redirect.set(r)})}this.latestLoadPromise===i&&((c=this.commitLocationPromise)==null||c.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(l=>l.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,o=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(xi(i,o)):r.types;if(a===!1){n();return}s={update:n,types:a}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const i=this.stores.matchStores.get(n);if(i){i.set(r);return}const o=this.stores.cachedMatchStores.get(n);if(o){const a=r(o.get());a.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(l=>l.filter(c=>c!==n)):o.set(a)}})},this.getMatch=n=>{var r,s,i;return((r=this.stores.cachedMatchStores.get(n))==null?void 0:r.get())??((s=this.stores.pendingMatchStores.get(n))==null?void 0:s.get())??((i=this.stores.matchStores.get(n))==null?void 0:i.get())},this.invalidate=n=>{const r=s=>{var i;return((i=n==null?void 0:n.filter)==null?void 0:i.call(n,s))??!0?{...s,invalid:!0,...n!=null&&n.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),i=this.getParsedLocationHref(s);n.options.href=i,n.headers.set("Location",i)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;n.options.href=i,n.headers.set("Location",i)}}catch{}if(n.options.href&&!n.options._builtLocation&&Cc(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const o=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=la,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const i=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),o=new Set([...i,...this.stores.cachedIds.get()]),a=s.filter(l=>!o.has(l.id));if(a.length){const l=this.stores.cachedMatches.get();this.stores.setCached([...l,...a])}try{return s=await Iy({router:this,matches:s,location:r,preload:!0,updateMatch:(l,c)=>{i.has(l)?s=s.map(u=>u.id===l?c(u):u):this.updateMatch(l,c)}}),s}catch(l){if(yt(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});st(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(s);if(r!=null&&r.pending&&this.stores.status.get()!=="pending")return!1;const o=((r==null?void 0:r.pending)===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Jj(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!vs(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?vs(o.search,i.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??xE,parseSearch:e.parseSearch??yE,protocolAllowlist:e.protocolAllowlist??Gj}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var d,h;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s,parsedParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:$r(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?$E(this.options.notFoundMode,o):void 0,c=new Array(o.length),u=new Map;for(const p of this.stores.matchStores.values())p.routeId&&u.set(p.routeId,p.get());for(let p=0;p<o.length;p++){const m=o[p],y=c[p-1];let w,g,x;{const E=(y==null?void 0:y.search)??e.search,F=(y==null?void 0:y._strictSearch)??void 0;try{const V=zl(m.options.validateSearch,{...E})??void 0;w={...E,...V},g={...F,...V},x=void 0}catch(V){let A=V;if(V instanceof Ec||(A=new Ec(V.message,{cause:V})),t!=null&&t.throwOnError)throw A;w=E,g={},x=A}}const v=((h=(d=m.options).loaderDeps)==null?void 0:h.call(d,{search:w}))??"",b=v?JSON.stringify(v):"",{interpolatedPath:S,usedParams:k}=Cy({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),T=m.id+S+b,P=this.getMatch(T),R=u.get(m.id),j=(P==null?void 0:P._strictParams)??k;let I;if(!P)try{Fy(m,k,i,j)}catch(E){if(st(E)||yt(E)?I=E:I=new LE(E.message,{cause:E}),t!=null&&t.throwOnError)throw I}Object.assign(s,j);const M=R?"stay":"enter";let O;if(P)O={...P,cause:M,params:(R==null?void 0:R.params)??s,_strictParams:j,search:ns(R?R.search:P.search,w),_strictSearch:g};else{const E=m.options.loader||m.options.beforeLoad||m.lazyFn||hb(m)?"pending":"success";O={id:T,ssr:m.options.ssr,index:p,routeId:m.id,params:(R==null?void 0:R.params)??s,_strictParams:j,pathname:S,updatedAt:Date.now(),search:R?ns(R.search,w):w,_strictSearch:g,searchError:void 0,status:E,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Ri()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:M,loaderDeps:R?Er(R.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t!=null&&t.preload||(O.globalNotFound=l===m.id),O.searchError=x;const z=this.getParentContext(y);O.context={...z,...O.__routeContext,...O.__beforeLoadContext},c[p]=O}for(let p=0;p<c.length;p++){const m=c[p],y=this.looseRoutesById[m.routeId],w=this.getMatch(m.id),g=u.get(m.routeId);if(m.params=g?ns(g.params,s):s,!w){const x=c[p-1],v=this.getParentContext(x);if(y.options.context){const b={deps:m.loaderDeps,params:m.params,context:v??{},location:e,navigate:S=>this.navigate({...S,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:c,routeId:y.id};m.__routeContext=y.options.context(b)??void 0}m.context={...v,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=ia(t),i={...e.search};for(const d of t)try{Object.assign(i,zl(d.options.validateSearch,i))}catch{}const o=ia(this.stores.matchesId.get()),a=o&&((u=this.stores.matchStores.get(o))==null?void 0:u.get()),l=a&&a.routeId===s.id&&a.pathname===e.pathname;let c;if(l)c=a.params;else{const d=Object.assign(Object.create(null),n);for(const h of t)try{Fy(h,n,r??{},d)}catch{}c=d}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},Ec=class extends Error{},LE=class extends Error{};function DE(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function zl(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ec("Async validation not supported");if(n.issues)throw new Ec(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function FE({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=$r(e);let i,o;const a=Zj(s,n,!0);return a&&(i=a.route,Object.assign(r,a.rawParams),o=Object.assign(Object.create(null),a.parsedParams)),{matchedRoutes:(a==null?void 0:a.branch)||[t.__root__],routeParams:r,foundRoute:i,parsedParams:o}}function OE({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return zE(n)(e,t,r??!1)}function zE(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)(s=i.options.search)!=null&&s.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const o=({search:a,next:l})=>{let c=a;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(c=i.options.preSearchFilters.reduce((d,h)=>h(d),a));const u=l(c);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((d,h)=>h(d),u):u};t.middlewares.push(o)}if(i.options.validateSearch){const o=({search:a,next:l})=>{const c=l(a);if(!t._includeValidateSearch)return c;try{return{...c,...zl(i.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(o)}}const n=({search:i})=>{const o=t.dest;return o.search?o.search===!0?i:jr(o.search,i):{}};t.middlewares.push(n);const r=(i,o,a)=>{if(i>=a.length)return o;const l=a[i];return l({search:o,next:u=>r(i+1,u,a)})};return function(o,a,l){return t.dest=a,t._includeValidateSearch=l,r(0,o,t.middlewares)}}function $E(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return ws}function Fy(e,t,n,r){var i;const s=((i=e.options.params)==null?void 0:i.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=s(r);Object.assign(r,o)}}const BE="Error preloading route! ☝️";var pb=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var l,c;this.originalIndex=t.originalIndex;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(c=(l=this.options).getParentRoute)==null?void 0:c.call(l),r?this._path=ws:this.parentRoute||er();let s=r?ws:n==null?void 0:n.path;s&&s!=="/"&&(s=ab(s));const i=(n==null?void 0:n.id)||s;let o=r?ws:Fl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Fl(["/",o]));const a=o==="__root__"?"/":Fl([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=$r(a)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>bE({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},VE=class extends pb{constructor(e){super(e)}};function UE(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==""){const r=document.getElementById(t.hash);r&&r.scrollIntoView(n)}}}function Zp(e){const t=e.errorComponent??em;return f.jsx(WE,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}var WE=class extends _.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function em({error:e}){const[t,n]=_.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function HE({children:e,fallback:t=null}){return mb()?f.jsx(bi.Fragment,{children:e}):f.jsx(bi.Fragment,{children:t})}function mb(){return bi.useSyncExternalStore(GE,()=>!0,()=>!1)}function GE(){return()=>{}}var gb=_.createContext(null);function $t(e){return _.useContext(gb)}var pu=_.createContext(void 0),KE=_.createContext(void 0),Se=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Se||{});function QE({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(c,u,d){const h=u.depsTail;if(h!==void 0&&h.dep===c)return;const p=h!==void 0?h.nextDep:u.deps;if(p!==void 0&&p.dep===c){p.version=d,u.depsTail=p;return}const m=c.subsTail;if(m!==void 0&&m.version===d&&m.sub===u)return;const y=u.depsTail=c.subsTail={version:d,dep:c,sub:u,prevDep:h,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=y),h!==void 0?h.nextDep=y:u.deps=y,m!==void 0?m.nextSub=y:c.subs=y}function s(c,u=c.sub){const d=c.dep,h=c.prevDep,p=c.nextDep,m=c.nextSub,y=c.prevSub;return p!==void 0?p.prevDep=h:u.depsTail=h,h!==void 0?h.nextDep=p:u.deps=p,m!==void 0?m.prevSub=y:d.subsTail=y,y!==void 0?y.nextSub=m:(d.subs=m)===void 0&&n(d),p}function i(c){let u=c.nextSub,d;e:do{const h=c.sub;let p=h.flags;if(p&60?p&12?p&4?!(p&48)&&l(c,h)?(h.flags=p|40,p&=1):p=0:h.flags=p&-9|32:p=0:h.flags=p|32,p&2&&t(h),p&1){const m=h.subs;if(m!==void 0){const y=(c=m).nextSub;y!==void 0&&(d={value:u,prev:d},u=y);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;d!==void 0;)if(c=d.value,d=d.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function o(c,u){let d,h=0,p=!1;e:do{const m=c.dep,y=m.flags;if(u.flags&16)p=!0;else if((y&17)===17){if(e(m)){const w=m.subs;w.nextSub!==void 0&&a(w),p=!0}}else if((y&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(d={value:c,prev:d}),c=m.deps,u=m,++h;continue}if(!p){const w=c.nextDep;if(w!==void 0){c=w;continue}}for(;h--;){const w=u.subs,g=w.nextSub!==void 0;if(g?(c=d.value,d=d.prev):c=w,p){if(e(u)){g&&a(w),u=c.sub;continue}p=!1}else u.flags&=-33;u=c.sub;const x=c.nextDep;if(x!==void 0){c=x;continue e}}return p}while(!0)}function a(c){do{const u=c.sub,d=u.flags;(d&48)===32&&(u.flags=d|16,(d&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let d=u.depsTail;for(;d!==void 0;){if(d===c)return!0;d=d.prevDep}return!1}}function qE(e,t,n){var i,o,a;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(o=r?e.error:t)==null?void 0:o.bind(s),complete:(a=r?e.complete:n)==null?void 0:a.bind(s)}}const lh=[];let $l=0;const{link:Oy,unlink:YE,propagate:XE,checkDirty:yb,shallowPropagate:zy}=QE({update(e){return e._update()},notify(e){lh[ch++]=e,e.flags&=~Se.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Se.Mutable|Se.Dirty,Tc(e))}});let nl=0,ch=0,En,uh=0;function xb(e){try{++uh,e()}finally{--uh||vb()}}function Tc(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=YE(n,e)}function vb(){if(!(uh>0)){for(;nl<ch;){const e=lh[nl];lh[nl++]=void 0,e.notify()}nl=0,ch=0}}function $y(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Se.None:Se.Mutable,get(){return En!==void 0&&Oy(s,En,$l),s._snapshot},subscribe(i){const o=qE(i),a={current:!1},l=JE(()=>{var c;s.get(),a.current?(c=o.next)==null||c.call(o,s._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const o=En,a=(t==null?void 0:t.compare)??Object.is;if(n)En=s,++$l,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=Se.Mutable|Se.RecursedCheck);try{const l=s._snapshot,c=typeof i=="function"?i(l):i===void 0&&n?r(l):i;return l===void 0||!a(l,c)?(s._snapshot=c,!0):!1}finally{En=o,n&&(s.flags&=~Se.RecursedCheck),Tc(s)}}};return n?(s.flags=Se.Mutable|Se.Dirty,s.get=function(){const i=s.flags;if(i&Se.Dirty||i&Se.Pending&&yb(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&zy(o)}}else i&Se.Pending&&(s.flags=i&~Se.Pending);return En!==void 0&&Oy(s,En,$l),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(XE(o),zy(o),vb())}},s}function JE(e){const t=()=>{const r=En;En=n,++$l,n.depsTail=void 0,n.flags=Se.Watching|Se.RecursedCheck;try{return e()}finally{En=r,n.flags&=~Se.RecursedCheck,Tc(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Se.Watching|Se.RecursedCheck,notify(){const r=this.flags;r&Se.Dirty||r&Se.Pending&&yb(this.deps,this)?t():this.flags=Se.Watching},stop(){this.flags=Se.None,this.depsTail=void 0,Tc(this)}};return t(),n}var wb={exports:{}},bb={},kb={exports:{}},_b={};/**
42
42
  * @license React
43
43
  * use-sync-external-store-shim.production.js
44
44
  *
@@ -54,10 +54,10 @@ Error generating stack: `+i.message+`
54
54
  *
55
55
  * This source code is licensed under the MIT license found in the
56
56
  * LICENSE file in the root directory of this source tree.
57
- */var mu=_,cT=lT;function uT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dT=typeof Object.is=="function"?Object.is:uT,fT=cT.useSyncExternalStore,hT=mu.useRef,pT=mu.useEffect,mT=mu.useMemo,gT=mu.useDebugValue;bb.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=hT(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=mT(function(){function l(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return d=m}return d=p}if(m=d,dT(u,p))return m;var y=r(p);return s!==void 0&&s(m,y)?(u=p,m):(u=p,d=y)}var c=!1,u,d,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,s]);var a=fT(e,i[0],i[1]);return pT(function(){o.hasValue=!0,o.value=a},[a]),gT(a),a};wb.exports=bb;var Sb=wb.exports;const yT=qc(Sb);function xT(e,t){return e===t}function kt(e,t,n=xT){const r=_.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),s=_.useCallback(()=>e==null?void 0:e.get(),[e]);return Sb.useSyncExternalStoreWithSelector(r,s,s,t,n)}var vT={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function As(e){const t=$t(),n=_.useContext(e.from?KE:pu),r=e.from??n,s=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,i=_.useRef(void 0);return kt(s??vT,o=>{if((e.shouldThrow??!0)&&!o&&er(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=Er(i.current,a);return i.current=l,l}return a})}function Cb(e){return As({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Pb(e){const{select:t,...n}=e;return As({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Oi(e){return As({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function tm(e){return As({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function nn(e){const t=$t();return _.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function jb(e){return As({...e,select:t=>e.select?e.select(t.context):t.context})}function wT(e,t){const n=$t(),r=Bj(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:d,replace:h,startTransition:p,resetScroll:m,viewTransition:y,children:w,target:g,disabled:x,style:v,className:b,onClick:S,onBlur:k,onFocus:T,onMouseEnter:P,onMouseLeave:R,onTouchStart:j,ignoreBlocker:I,params:M,search:O,hash:z,state:E,mask:F,reloadDocument:V,unsafeRelative:A,from:B,_fromLocation:C,...$}=e,Q=mb(),N=_.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),le=kt(n.stores.location,de=>de,(de,D)=>de.href===D.href),fe=_.useMemo(()=>{const de={_fromLocation:le,...N};return n.buildLocation(de)},[n,le,N]),ue=fe.maskedLocation?fe.maskedLocation.publicHref:fe.publicHref,jt=fe.maskedLocation?fe.maskedLocation.external:fe.external,He=_.useMemo(()=>PT(ue,jt,n.history,x),[x,jt,ue,n.history]),Vt=_.useMemo(()=>{if(He!=null&&He.external)return Cc(He.href,n.protocolAllowlist)?void 0:He.href;if(!jT(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Cc(a,n.protocolAllowlist)?void 0:a}catch{}},[a,He,n.protocolAllowlist]),vn=_.useMemo(()=>{if(Vt)return!1;if(o!=null&&o.exact){if(!oE(le.pathname,fe.pathname,n.basepath))return!1}else{const de=Pc(le.pathname,n.basepath),D=Pc(fe.pathname,n.basepath);if(!(de.startsWith(D)&&(de.length===D.length||de[D.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!vs(le.search,fe.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?Q&&le.hash===fe.hash:!0},[o==null?void 0:o.exact,o==null?void 0:o.explicitUndefined,o==null?void 0:o.includeHash,o==null?void 0:o.includeSearch,le,Vt,Q,fe.hash,fe.pathname,fe.search,n.basepath]),zn=vn?jr(s,{})??bT:xd,Ds=vn?xd:jr(i,{})??xd,Na=[b,zn.className,Ds.className].filter(Boolean).join(" "),Ia=(v||zn.style||Ds.style)&&{...v,...zn.style,...Ds.style},[Ma,Ki]=_.useState(!1),Qi=_.useRef(!1),ar=e.reloadDocument||Vt?!1:l??n.options.defaultPreload,Fs=c??n.options.defaultPreloadDelay??0,wn=_.useCallback(()=>{n.preloadRoute({...N,_builtLocation:fe}).catch(de=>{console.warn(de),console.warn(BE)})},[n,N,fe]);$j(r,_.useCallback(de=>{de!=null&&de.isIntersecting&&wn()},[wn]),CT,{disabled:!!x||ar!=="viewport"}),_.useEffect(()=>{Qi.current||!x&&ar==="render"&&(wn(),Qi.current=!0)},[x,wn,ar]);const Du=de=>{const D=de.currentTarget.getAttribute("target"),H=g!==void 0?g:D;if(!x&&!ET(de)&&!de.defaultPrevented&&(!H||H==="_self")&&de.button===0){de.preventDefault(),Ms.flushSync(()=>{Ki(!0)});const Z=n.subscribe("onResolved",()=>{Z(),Ki(!1)});n.navigate({...N,replace:h,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:y,ignoreBlocker:I})}};if(Vt)return{...$,ref:r,href:Vt,...w&&{children:w},...g&&{target:g},...x&&{disabled:x},...v&&{style:v},...b&&{className:b},...S&&{onClick:S},...k&&{onBlur:k},...T&&{onFocus:T},...P&&{onMouseEnter:P},...R&&{onMouseLeave:R},...j&&{onTouchStart:j}};const Aa=de=>{if(x||ar!=="intent")return;if(!Fs){wn();return}const D=de.currentTarget;if(lo.has(D))return;const H=setTimeout(()=>{lo.delete(D),wn()},Fs);lo.set(D,H)},Fu=de=>{x||ar!=="intent"||wn()},La=de=>{if(x||!ar||!Fs)return;const D=de.currentTarget,H=lo.get(D);H&&(clearTimeout(H),lo.delete(D))};return{...$,...zn,...Ds,href:He==null?void 0:He.href,ref:r,onClick:$s([S,Du]),onBlur:$s([k,La]),onFocus:$s([T,Aa]),onMouseEnter:$s([P,Aa]),onMouseLeave:$s([R,La]),onTouchStart:$s([j,Fu]),disabled:!!x,target:g,...Ia&&{style:Ia},...Na&&{className:Na},...x&&kT,...vn&&_T,...Q&&Ma&&ST}}var xd={},bT={className:"active"},kT={role:"link","aria-disabled":!0},_T={"data-status":"active","aria-current":"page"},ST={"data-transitioning":"transitioning"},lo=new WeakMap,CT={rootMargin:"100px"},$s=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function PT(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function jT(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Eb=_.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=wT(r,t),o=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=i;return _.createElement("a",l,o)}return _.createElement(n,i,o)});function ET(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var TT=class extends pb{constructor(e){super(e),this.useMatch=t=>As({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>jb({...t,from:this.id}),this.useSearch=t=>tm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Oi({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Pb({...t,from:this.id}),this.useLoaderData=t=>Cb({...t,from:this.id}),this.useNavigate=()=>nn({from:this.fullPath}),this.Link=bi.forwardRef((t,n)=>f.jsx(Eb,{ref:n,from:this.fullPath,...t}))}};function rn(e){return new TT(e)}var RT=class extends VE{constructor(e){super(e),this.useMatch=t=>As({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>jb({...t,from:this.id}),this.useSearch=t=>tm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Oi({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Pb({...t,from:this.id}),this.useLoaderData=t=>Cb({...t,from:this.id}),this.useNavigate=()=>nn({from:this.fullPath}),this.Link=bi.forwardRef((t,n)=>f.jsx(Eb,{ref:n,from:this.fullPath,...t}))}};function NT(e){return new RT(e)}function IT(e){const t=$t(),n=`not-found-${kt(t.stores.location,r=>r.pathname)}-${kt(t.stores.status,r=>r)}`;return f.jsx(Zp,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(st(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(st(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function MT(){return f.jsx("p",{children:"Not Found"})}function Ks(e){return f.jsx(f.Fragment,{children:e.children})}function Tb(e,t,n){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...n}):f.jsx(MT,{})}function AT(e){return null}function LT(){return AT($t()),null}var Rb=_.memo(function({matchId:t}){const n=$t(),r=n.stores.matchStores.get(t);r||er();const s=kt(n.stores.loadedAt,o=>o),i=kt(r,o=>o);return f.jsx(DT,{router:n,matchId:t,resetKey:s,matchState:_.useMemo(()=>{var l;const o=i.routeId,a=(l=n.routesById[o].parentRoute)==null?void 0:l.id;return{routeId:o,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:a}},[i._displayPending,i.routeId,i.ssr,n.routesById])})});function DT({router:e,matchId:t,resetKey:n,matchState:r}){var m,y;const s=e.routesById[r.routeId],i=s.options.pendingComponent??e.options.defaultPendingComponent,o=i?f.jsx(i,{}):null,a=s.options.errorComponent??e.options.defaultErrorComponent,l=s.options.onCatch??e.options.defaultOnCatch,c=s.isRoot?s.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",d=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??i??(((y=s.options.errorComponent)==null?void 0:y.preload)||u))?_.Suspense:Ks,h=a?Zp:Ks,p=c?IT:Ks;return f.jsxs(s.isRoot?s.options.shellComponent??Ks:Ks,{children:[f.jsx(pu.Provider,{value:t,children:f.jsx(d,{fallback:o,children:f.jsx(h,{getResetKey:()=>n,errorComponent:a||em,onCatch:(w,g)=>{if(st(w))throw w.routeId??(w.routeId=r.routeId),w;l==null||l(w,g)},children:f.jsx(p,{fallback:w=>{if(w.routeId??(w.routeId=r.routeId),!c||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!s.isRoot)throw w;return _.createElement(c,w)},children:u||r._displayPending?f.jsx(HE,{fallback:o,children:f.jsx(By,{matchId:t})}):f.jsx(By,{matchId:t})})})})}),r.parentRouteId===ws?f.jsxs(f.Fragment,{children:[f.jsx(FT,{resetKey:n}),e.options.scrollRestoration&&sb?f.jsx(LT,{}):null]}):null]})}function FT({resetKey:e}){const t=$t(),n=_.useRef(void 0);return _o(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...xi(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var By=_.memo(function({matchId:t}){const n=$t(),r=(u,d)=>{var h;return((h=n.getMatch(u.id))==null?void 0:h._nonReactive[d])??u._nonReactive[d]},s=n.stores.matchStores.get(t);s||er();const i=kt(s,u=>u),o=i.routeId,a=n.routesById[o],l=_.useMemo(()=>{var d;const u=(d=n.routesById[o].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:d({routeId:o,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return u?JSON.stringify(u):void 0},[o,i.loaderDeps,i._strictParams,i._strictSearch,n.options.defaultRemountDeps,n.routesById]),c=_.useMemo(()=>{const u=a.options.component??n.options.defaultComponent;return u?f.jsx(u,{},l):f.jsx(Nb,{})},[l,a.options.component,n.options.defaultComponent]);if(i._displayPending)throw r(i,"displayPendingPromise");if(i._forcePending)throw r(i,"minPendingPromise");if(i.status==="pending"){const u=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(u){const d=n.getMatch(i.id);if(d&&!d._nonReactive.minPendingPromise){const h=Ri();d._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),d._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return st(i.error)||er(),Tb(n,a,i.error);if(i.status==="redirected")throw yt(i.error)||er(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),Nb=_.memo(function(){const t=$t(),n=_.useContext(pu);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=kt(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=kt(t.stores.matchesId,u=>u[u.findIndex(d=>d===n)+1])}const o=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(s)return o||er(),Tb(t,o,void 0);if(!i)return null;const l=f.jsx(Rb,{matchId:i});return r===ws?f.jsx(_.Suspense,{fallback:a,children:l}):l});function OT(){const e=$t(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),s=kt(e.stores.isLoading,d=>d),i=kt(e.stores.hasPending,d=>d),o=ud(s),a=s||n||i,l=ud(a),c=s||i,u=ud(c);return e.startTransition=d=>{r(!0),_.startTransition(()=>{d(),r(!1)})},_.useEffect(()=>{const d=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $r(e.latestLocation.publicHref)!==$r(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{d()}},[e,e.history]),_o(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),_o(()=>{o&&!s&&e.emit({type:"onLoad",...xi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),_o(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...xi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),_o(()=>{if(l&&!a){const d=xi(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...d}),xb(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),d.hrefChanged&&UE(e)}},[a,l,e]),null}function zT(){const e=$t(),t=e.routesById[ws].options.pendingComponent??e.options.defaultPendingComponent,n=t?f.jsx(t,{}):null,r=f.jsxs(typeof document<"u"&&e.ssr?Ks:_.Suspense,{fallback:n,children:[f.jsx(OT,{}),f.jsx($T,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:r}):r}function $T(){const e=$t(),t=kt(e.stores.firstId,s=>s),n=kt(e.stores.loadedAt,s=>s),r=t?f.jsx(Rb,{matchId:t}):null;return f.jsx(pu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:f.jsx(Zp,{getResetKey:()=>n,errorComponent:em,onCatch:void 0,children:r})})}var BT=e=>({createMutableStore:$y,createReadonlyStore:$y,batch:xb}),VT=e=>new UT(e),UT=class extends AE{constructor(e){super(e,BT)}};function WT({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=f.jsx(gb.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function HT({router:e,...t}){return f.jsx(WT,{router:e,...t,children:f.jsx(zT,{})})}function GT(e){const t=$t({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=_.useRef(void 0);return kt(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Er(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const KT="modulepreload",QT=function(e,t){return new URL(e,t).href},Vy={},Fn=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=QT(c,r),c in Vy)return;Vy[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(!!r)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===c&&(!u||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":KT,u||(p.as="script"),p.crossOrigin="",p.href=c,l&&p.setAttribute("nonce",l),document.head.appendChild(p),u)return new Promise((m,y)=>{p.addEventListener("load",m),p.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};function qT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const YT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JT={};function Uy(e,t){return(JT.jsx?XT:YT).test(e)}const ZT=/[ \t\n\f\r]/g;function e2(e){return typeof e=="object"?e.type==="text"?Wy(e.value):!1:Wy(e)}function Wy(e){return e.replace(ZT,"")===""}class va{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}va.prototype.normal={};va.prototype.property={};va.prototype.space=void 0;function Ib(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new va(n,r,t)}function dh(e){return e.toLowerCase()}class Pt{constructor(t,n){this.attribute=n,this.property=t}}Pt.prototype.attribute="";Pt.prototype.booleanish=!1;Pt.prototype.boolean=!1;Pt.prototype.commaOrSpaceSeparated=!1;Pt.prototype.commaSeparated=!1;Pt.prototype.defined=!1;Pt.prototype.mustUseProperty=!1;Pt.prototype.number=!1;Pt.prototype.overloadedBoolean=!1;Pt.prototype.property="";Pt.prototype.spaceSeparated=!1;Pt.prototype.space=void 0;let t2=0;const ee=Ls(),De=Ls(),fh=Ls(),W=Ls(),pe=Ls(),ks=Ls(),Nt=Ls();function Ls(){return 2**++t2}const hh=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:De,commaOrSpaceSeparated:Nt,commaSeparated:ks,number:W,overloadedBoolean:fh,spaceSeparated:pe},Symbol.toStringTag,{value:"Module"})),vd=Object.keys(hh);class nm extends Pt{constructor(t,n,r,s){let i=-1;if(super(t,n),Hy(this,"space",s),typeof r=="number")for(;++i<vd.length;){const o=vd[i];Hy(this,vd[i],(r&hh[o])===hh[o])}}}nm.prototype.defined=!0;function Hy(e,t,n){n&&(e[t]=n)}function zi(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new nm(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[dh(r)]=r,n[dh(i.attribute)]=r}return new va(t,n,e.space)}const Mb=zi({properties:{ariaActiveDescendant:null,ariaAtomic:De,ariaAutoComplete:null,ariaBusy:De,ariaChecked:De,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:pe,ariaCurrent:null,ariaDescribedBy:pe,ariaDetails:null,ariaDisabled:De,ariaDropEffect:pe,ariaErrorMessage:null,ariaExpanded:De,ariaFlowTo:pe,ariaGrabbed:De,ariaHasPopup:null,ariaHidden:De,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pe,ariaLevel:W,ariaLive:null,ariaModal:De,ariaMultiLine:De,ariaMultiSelectable:De,ariaOrientation:null,ariaOwns:pe,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:De,ariaReadOnly:De,ariaRelevant:null,ariaRequired:De,ariaRoleDescription:pe,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:De,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ab(e,t){return t in e?e[t]:t}function Lb(e,t){return Ab(e,t.toLowerCase())}const n2=zi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ks,acceptCharset:pe,accessKey:pe,action:null,allow:null,allowFullScreen:ee,allowPaymentRequest:ee,allowUserMedia:ee,alpha:ee,alt:null,as:null,async:ee,autoCapitalize:null,autoComplete:pe,autoFocus:ee,autoPlay:ee,blocking:pe,capture:null,charSet:null,checked:ee,cite:null,className:pe,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:De,controls:ee,controlsList:pe,coords:W|ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ee,defer:ee,dir:null,dirName:null,disabled:ee,download:fh,draggable:De,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ee,formTarget:null,headers:pe,height:W,hidden:fh,high:W,href:null,hrefLang:null,htmlFor:pe,httpEquiv:pe,id:null,imageSizes:null,imageSrcSet:null,inert:ee,inputMode:null,integrity:null,is:null,isMap:ee,itemId:null,itemProp:pe,itemRef:pe,itemScope:ee,itemType:pe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ee,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:ee,muted:ee,name:null,nonce:null,noModule:ee,noValidate:ee,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:ee,optimum:W,pattern:null,ping:pe,placeholder:null,playsInline:ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ee,referrerPolicy:null,rel:pe,required:ee,reversed:ee,rows:W,rowSpan:W,sandbox:pe,scope:null,scoped:ee,seamless:ee,selected:ee,shadowRootClonable:ee,shadowRootCustomElementRegistry:ee,shadowRootDelegatesFocus:ee,shadowRootMode:null,shadowRootSerializable:ee,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:De,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:ee,useMap:null,value:De,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pe,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ee,declare:ee,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:ee,noHref:ee,noShade:ee,noWrap:ee,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:De,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ee,disablePictureInPicture:ee,disableRemotePlayback:ee,exportParts:ks,part:pe,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:Lb}),r2=zi({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",maskType:"mask-type",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:Nt,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:pe,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:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,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:ks,g2:ks,glyphName:ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:Nt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,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:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Nt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Nt,rev:Nt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Nt,requiredFeatures:Nt,requiredFonts:Nt,requiredFormats:Nt,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:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:Nt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Nt,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Nt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ab}),Db=zi({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()}}),Fb=zi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Lb}),Ob=zi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),s2={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"},i2=/[A-Z]/g,Gy=/-[a-z]/g,o2=/^data[-\w.:]+$/i;function a2(e,t){const n=dh(t);let r=t,s=Pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&o2.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Gy,c2);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Gy.test(i)){let o=i.replace(i2,l2);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=nm}return new s(r,t)}function l2(e){return"-"+e.toLowerCase()}function c2(e){return e.charAt(1).toUpperCase()}const u2=Ib([Mb,n2,Db,Fb,Ob],"html"),rm=Ib([Mb,r2,Db,Fb,Ob],"svg");function d2(e){return e.join(" ").trim()}var sm={},Ky=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,f2=/\n/g,h2=/^\s*/,p2=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,m2=/^:\s*/,g2=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,y2=/^[;\s]*/,x2=/^\s+|\s+$/g,v2=`
58
- `,Qy="/",qy="*",us="",w2="comment",b2="declaration";function k2(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(m){var y=m.match(f2);y&&(n+=y.length);var w=m.lastIndexOf(v2);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new o(m),c(),y}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var w=y[0];return s(w),e=e.slice(w.length),y}}function c(){l(h2)}function u(m){var y;for(m=m||[];y=d();)y!==!1&&m.push(y);return m}function d(){var m=i();if(!(Qy!=e.charAt(0)||qy!=e.charAt(1))){for(var y=2;us!=e.charAt(y)&&(qy!=e.charAt(y)||Qy!=e.charAt(y+1));)++y;if(y+=2,us===e.charAt(y-1))return a("End of comment missing");var w=e.slice(2,y-2);return r+=2,s(w),e=e.slice(y),r+=2,m({type:w2,comment:w})}}function h(){var m=i(),y=l(p2);if(y){if(d(),!l(m2))return a("property missing ':'");var w=l(g2),g=m({type:b2,property:Yy(y[0].replace(Ky,us)),value:w?Yy(w[0].replace(Ky,us)):us});return l(y2),g}}function p(){var m=[];u(m);for(var y;y=h();)y!==!1&&(m.push(y),u(m));return m}return c(),p()}function Yy(e){return e?e.replace(x2,us):us}var _2=k2,S2=ec&&ec.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sm,"__esModule",{value:!0});sm.default=P2;const C2=S2(_2);function P2(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,C2.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:a}=i;s?t(o,a,i):a&&(n=n||{},n[o]=a)}),n}var gu={};Object.defineProperty(gu,"__esModule",{value:!0});gu.camelCase=void 0;var j2=/^--[a-zA-Z0-9_-]+$/,E2=/-([a-z])/g,T2=/^[^-]+$/,R2=/^-(webkit|moz|ms|o|khtml)-/,N2=/^-(ms)-/,I2=function(e){return!e||T2.test(e)||j2.test(e)},M2=function(e,t){return t.toUpperCase()},Xy=function(e,t){return"".concat(t,"-")},A2=function(e,t){return t===void 0&&(t={}),I2(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(N2,Xy):e=e.replace(R2,Xy),e.replace(E2,M2))};gu.camelCase=A2;var L2=ec&&ec.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},D2=L2(sm),F2=gu;function ph(e,t){var n={};return!e||typeof e!="string"||(0,D2.default)(e,function(r,s){r&&s&&(n[(0,F2.camelCase)(r,t)]=s)}),n}ph.default=ph;var O2=ph;const z2=qc(O2),zb=$b("end"),im=$b("start");function $b(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 $2(e){const t=im(e),n=zb(e);if(t&&n)return{start:t,end:n}}function Ao(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jy(e.position):"start"in e||"end"in e?Jy(e):"line"in e||"column"in e?mh(e):""}function mh(e){return Zy(e&&e.line)+":"+Zy(e&&e.column)}function Jy(e){return mh(e&&e.start)+"-"+mh(e&&e.end)}function Zy(e){return e&&typeof e=="number"?e:1}class ot extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(o=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=Ao(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ot.prototype.file="";ot.prototype.name="";ot.prototype.reason="";ot.prototype.message="";ot.prototype.stack="";ot.prototype.column=void 0;ot.prototype.line=void 0;ot.prototype.ancestors=void 0;ot.prototype.cause=void 0;ot.prototype.fatal=void 0;ot.prototype.place=void 0;ot.prototype.ruleId=void 0;ot.prototype.source=void 0;const om={}.hasOwnProperty,B2=new Map,V2=/[A-Z]/g,U2=new Set(["table","tbody","thead","tfoot","tr"]),W2=new Set(["td","th"]),Bb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function H2(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=Z2(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=J2(n,t.jsx,t.jsxs)}const s={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"?rm:u2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Vb(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Vb(e,t,n){if(t.type==="element")return G2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return K2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return q2(e,t,n);if(t.type==="mdxjsEsm")return Q2(e,t);if(t.type==="root")return Y2(e,t,n);if(t.type==="text")return X2(e,t)}function G2(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=rm,e.schema=s),e.ancestors.push(t);const i=Wb(e,t.tagName,!1),o=eR(e,t);let a=lm(e,t);return U2.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!e2(l):!0})),Ub(e,o,i,t),am(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function K2(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)}ca(e,t.position)}function Q2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ca(e,t.position)}function q2(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=rm,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Wb(e,t.name,!0),o=tR(e,t),a=lm(e,t);return Ub(e,o,i,t),am(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function Y2(e,t,n){const r={};return am(r,lm(e,t)),e.create(t,e.Fragment,r,n)}function X2(e,t){return t.value}function Ub(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function am(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function J2(e,t,n){return r;function r(s,i,o,a){const c=Array.isArray(o.children)?n:t;return a?c(i,o,a):c(i,o)}}function Z2(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=im(r);return t(s,i,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function eR(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&om.call(t.properties,s)){const i=nR(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&W2.has(t.tagName)?r=a:n[o]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function tR(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const o=i.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ca(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else ca(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function lm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:B2;for(;++r<t.children.length;){const i=t.children[r];let o;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=s.get(l)||0;o=l+"-"+c,s.set(l,c+1)}}const a=Vb(e,i,o);a!==void 0&&n.push(a)}return n}function nR(e,t,n){const r=a2(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qT(n):d2(n)),r.property==="style"){let s=typeof n=="object"?n:rR(e,String(n));return e.stylePropertyNameCase==="css"&&(s=sR(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?s2[r.property]||r.property:r.attribute,n]}}function rR(e,t){try{return z2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new ot("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Bb+"#cannot-parse-style-attribute",s}}function Wb(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,o;for(;++i<s.length;){const a=Uy(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=o}else r=Uy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return om.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);ca(e)}function ca(e,t){const n=new ot("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=Bb+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sR(e){const t={};let n;for(n in e)om.call(e,n)&&(t[iR(n)]=e[n]);return t}function iR(e){let t=e.replace(V2,oR);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function oR(e){return"-"+e.toLowerCase()}const wd={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"]},aR={};function lR(e,t){const n=aR,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Hb(e,r,s)}function Hb(e,t,n){if(cR(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 ex(e.children,t,n)}return Array.isArray(e)?ex(e,t,n):""}function ex(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Hb(e[s],t,n);return r.join("")}function cR(e){return!!(e&&typeof e=="object")}const tx=document.createElement("i");function cm(e){const t="&"+e+";";tx.innerHTML=t;const n=tx.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ln(e,t,n,r){const s=e.length;let i=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function Qt(e,t){return e.length>0?(Ln(e,e.length,0,t),e):t}const nx={}.hasOwnProperty;function uR(e){const t={};let n=-1;for(;++n<e.length;)dR(t,e[n]);return t}function dR(e,t){let n;for(n in t){const s=(nx.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){nx.call(s,o)||(s[o]=[]);const a=i[o];fR(s[o],Array.isArray(a)?a:a?[a]:[])}}}function fR(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ln(e,0,0,r)}function Gb(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 vi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nn=Yr(/[A-Za-z]/),At=Yr(/[\dA-Za-z]/),hR=Yr(/[#-'*+\--9=?A-Z^-~]/);function gh(e){return e!==null&&(e<32||e===127)}const yh=Yr(/\d/),pR=Yr(/[\dA-Fa-f]/),mR=Yr(/[!-/:-@[-`{-~]/);function J(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const gR=Yr(new RegExp("\\p{P}|\\p{S}","u")),yR=Yr(/\s/);function Yr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $i(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&At(e.charCodeAt(n+1))&&At(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(o=String.fromCharCode(i,a),s=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function ve(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return ae(l)?(e.enter(n),a(l)):t(l)}function a(l){return ae(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const xR={tokenize:vR};function vR(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ve(e,t,"linePrefix")}function s(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return J(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const wR={tokenize:bR},rx={tokenize:kR};function bR(e){const t=this,n=[];let r=0,s,i,o;return a;function a(v){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,l,c)(v)}return c(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const b=t.events.length;let S=b,k;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){k=t.events[S][1].end;break}g(r);let T=b;for(;T<t.events.length;)t.events[T][1].end={...k},T++;return Ln(t.events,S+1,0,t.events.slice(b)),t.events.length=T,c(v)}return a(v)}function c(v){if(r===n.length){if(!s)return h(v);if(s.currentConstruct&&s.currentConstruct.concrete)return m(v);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(rx,u,d)(v)}function u(v){return s&&x(),g(r),h(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(v)}function h(v){return t.containerState={},e.attempt(rx,p,m)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),h(v)}function m(v){if(v===null){s&&x(),g(0),e.consume(v);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),y(v)}function y(v){if(v===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(v);return}return J(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),y)}function w(v,b){const S=t.sliceStream(v);if(b&&S.push(null),v.previous=i,i&&(i.next=v),i=v,s.defineSkip(v.start),s.write(S),t.parser.lazy[v.start.line]){let k=s.events.length;for(;k--;)if(s.events[k][1].start.offset<o&&(!s.events[k][1].end||s.events[k][1].end.offset>o))return;const T=t.events.length;let P=T,R,j;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(R){j=t.events[P][1].end;break}R=!0}for(g(r),k=T;k<t.events.length;)t.events[k][1].end={...j},k++;Ln(t.events,P+1,0,t.events.slice(T)),t.events.length=k}}function g(v){let b=n.length;for(;b-- >v;){const S=n[b];t.containerState=S[1],S[0].exit.call(t,e)}n.length=v}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function kR(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sx(e){if(e===null||bt(e)||yR(e))return 1;if(gR(e))return 2}function um(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const xh={name:"attention",resolveAll:_R,tokenize:SR};function _R(e,t){let n=-1,r,s,i,o,a,l,c,u;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;l=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 d={...e[r][1].end},h={...e[n][1].start};ix(d,-l),ix(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Qt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Qt(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),c=Qt(c,um(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Qt(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Qt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Ln(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function SR(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=sx(r);let i;return o;function o(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=sx(l),d=!u||u===2&&s||n.includes(l),h=!s||s===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(s||!h)),c._close=!!(i===42?h:h&&(u||!d)),t(l)}}function ix(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const CR={name:"autolink",tokenize:PR};function PR(e,t,n){let r=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return Nn(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||At(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||At(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||gh(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):hR(p)?(e.consume(p),c):n(p)}function u(p){return At(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||At(p))&&r++<63){const m=p===45?h:d;return e.consume(p),m}return n(p)}}const yu={partial:!0,tokenize:jR};function jR(e,t,n){return r;function r(i){return ae(i)?ve(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||J(i)?t(i):n(i)}}const Kb={continuation:{tokenize:TR},exit:RR,name:"blockQuote",tokenize:ER};function ER(e,t,n){const r=this;return s;function s(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return ae(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function TR(e,t,n){const r=this;return s;function s(o){return ae(o)?ve(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(Kb,t,n)(o)}}function RR(e){e.exit("blockQuote")}const Qb={name:"characterEscape",tokenize:NR};function NR(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return mR(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const qb={name:"characterReference",tokenize:IR};function IR(e,t,n){const r=this;let s=0,i,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,o=At,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=pR,u):(e.enter("characterReferenceValue"),i=7,o=yh,u(d))}function u(d){if(d===59&&s){const h=e.exit("characterReferenceValue");return o===At&&!cm(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&s++<i?(e.consume(d),u):n(d)}}const ox={partial:!0,tokenize:AR},ax={concrete:!0,name:"codeFenced",tokenize:MR};function MR(e,t,n){const r=this,s={partial:!0,tokenize:S};let i=0,o=0,a;return l;function l(k){return c(k)}function c(k){const T=r.events[r.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(o++,e.consume(k),u):o<3?n(k):(e.exit("codeFencedFenceSequence"),ae(k)?ve(e,d,"whitespace")(k):d(k))}function d(k){return k===null||J(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(ox,y,b)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||J(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):ae(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ve(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),h)}function p(k){return k===null||J(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||J(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===a?n(k):(e.consume(k),m)}function y(k){return e.attempt(s,b,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g}function g(k){return i>0&&ae(k)?ve(e,x,"linePrefix",i+1)(k):x(k)}function x(k){return k===null||J(k)?e.check(ox,y,b)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||J(k)?(e.exit("codeFlowValue"),x(k)):(e.consume(k),v)}function b(k){return e.exit("codeFenced"),t(k)}function S(k,T,P){let R=0;return j;function j(E){return k.enter("lineEnding"),k.consume(E),k.exit("lineEnding"),I}function I(E){return k.enter("codeFencedFence"),ae(E)?ve(k,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):M(E)}function M(E){return E===a?(k.enter("codeFencedFenceSequence"),O(E)):P(E)}function O(E){return E===a?(R++,k.consume(E),O):R>=o?(k.exit("codeFencedFenceSequence"),ae(E)?ve(k,z,"whitespace")(E):z(E)):P(E)}function z(E){return E===null||J(E)?(k.exit("codeFencedFence"),T(E)):P(E)}}}function AR(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const bd={name:"codeIndented",tokenize:DR},LR={partial:!0,tokenize:FR};function DR(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),ve(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):J(c)?e.attempt(LR,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||J(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function FR(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):J(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):ve(e,i,"linePrefix",5)(o)}function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):J(o)?s(o):n(o)}}const OR={name:"codeText",previous:$R,resolve:zR,tokenize:BR};function zR(e){let t=e.length-4,n=3,r,s;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;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function $R(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BR(e,t,n){let r=0,s,i;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),s=0,u(d)):J(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||J(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),s++,u):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}class VR{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 s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&co(this.left,r),i.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),co(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),co(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);co(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);co(this.left,n.reverse())}}}function co(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 Yb(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new VR(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,UR(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(o=u.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(u.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...u.get(s)[1].start},a=u.slice(s,n),a.unshift(r),u.splice(s,n-s+1,a))}}return Ln(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function UR(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,d,h=-1,p=n,m=0,y=0;const w=[y];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(y=h+1,w.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):w.pop(),h=w.length;h--;){const g=a.slice(w[h],w[h+1]),x=i.pop();l.push([x,x+g.length-1]),e.splice(x,2,g)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const WR={resolve:GR,tokenize:KR},HR={partial:!0,tokenize:QR};function GR(e){return Yb(e),e}function KR(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(a)}function s(a){return a===null?i(a):J(a)?e.check(HR,o,i)(a):(e.consume(a),s)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function QR(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ve(e,i,"linePrefix")}function i(o){if(o===null||J(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Xb(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||gh(g)?n(g):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(a),h(g)):g===null||g===60||J(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!u&&(g===null||g===41||bt(g))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,y):g===41?(e.consume(g),u--,y):g===null||g===32||g===40||gh(g)?n(g):(e.consume(g),g===92?w:y)}function w(g){return g===40||g===41||g===92?(e.consume(g),y):y(g)}}function Jb(e,t,n,r,s,i){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(i),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):J(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||J(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!ae(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function Zb(e,t,n,r,s,i){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===o?(e.exit(i),l(o)):h===null?n(h):J(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ve(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||J(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===o||h===92?(e.consume(h),u):u(h)}}function Lo(e,t){let n;return r;function r(s){return J(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ae(s)?ve(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const qR={name:"definition",tokenize:XR},YR={partial:!0,tokenize:JR};function XR(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return Jb.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=vi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return bt(p)?Lo(e,c)(p):c(p)}function c(p){return Xb(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(YR,d,d)(p)}function d(p){return ae(p)?ve(e,h,"whitespace")(p):h(p)}function h(p){return p===null||J(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function JR(e,t,n){return r;function r(a){return bt(a)?Lo(e,s)(a):n(a)}function s(a){return Zb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return ae(a)?ve(e,o,"whitespace")(a):o(a)}function o(a){return a===null||J(a)?t(a):n(a)}}const ZR={name:"hardBreakEscape",tokenize:eN};function eN(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return J(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const tN={name:"headingAtx",resolve:nN,tokenize:rN};function nN(e,t){let n=e.length-2,r=3,s,i;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&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ln(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function rN(e,t,n){let r=0;return s;function s(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||bt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||J(u)?(e.exit("atxHeading"),t(u)):ae(u)?ve(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||bt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const sN=["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"],lx=["pre","script","style","textarea"],iN={concrete:!0,name:"htmlFlow",resolveTo:lN,tokenize:cN},oN={partial:!0,tokenize:dN},aN={partial:!0,tokenize:uN};function lN(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 cN(e,t,n){const r=this;let s,i,o,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),i=!0,y):N===63?(e.consume(N),s=3,r.interrupt?t:C):Nn(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function h(N){return N===45?(e.consume(N),s=2,p):N===91?(e.consume(N),s=5,a=0,m):Nn(N)?(e.consume(N),s=4,r.interrupt?t:C):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:C):n(N)}function m(N){const le="CDATA[";return N===le.charCodeAt(a++)?(e.consume(N),a===le.length?r.interrupt?t:M:m):n(N)}function y(N){return Nn(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||bt(N)){const le=N===47,fe=o.toLowerCase();return!le&&!i&&lx.includes(fe)?(s=1,r.interrupt?t(N):M(N)):sN.includes(o.toLowerCase())?(s=6,le?(e.consume(N),g):r.interrupt?t(N):M(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?x(N):v(N))}return N===45||At(N)?(e.consume(N),o+=String.fromCharCode(N),w):n(N)}function g(N){return N===62?(e.consume(N),r.interrupt?t:M):n(N)}function x(N){return ae(N)?(e.consume(N),x):j(N)}function v(N){return N===47?(e.consume(N),j):N===58||N===95||Nn(N)?(e.consume(N),b):ae(N)?(e.consume(N),v):j(N)}function b(N){return N===45||N===46||N===58||N===95||At(N)?(e.consume(N),b):S(N)}function S(N){return N===61?(e.consume(N),k):ae(N)?(e.consume(N),S):v(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,T):ae(N)?(e.consume(N),k):P(N)}function T(N){return N===l?(e.consume(N),l=null,R):N===null||J(N)?n(N):(e.consume(N),T)}function P(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||bt(N)?S(N):(e.consume(N),P)}function R(N){return N===47||N===62||ae(N)?v(N):n(N)}function j(N){return N===62?(e.consume(N),I):n(N)}function I(N){return N===null||J(N)?M(N):ae(N)?(e.consume(N),I):n(N)}function M(N){return N===45&&s===2?(e.consume(N),F):N===60&&s===1?(e.consume(N),V):N===62&&s===4?(e.consume(N),$):N===63&&s===3?(e.consume(N),C):N===93&&s===5?(e.consume(N),B):J(N)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(oN,Q,O)(N)):N===null||J(N)?(e.exit("htmlFlowData"),O(N)):(e.consume(N),M)}function O(N){return e.check(aN,z,Q)(N)}function z(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),E}function E(N){return N===null||J(N)?O(N):(e.enter("htmlFlowData"),M(N))}function F(N){return N===45?(e.consume(N),C):M(N)}function V(N){return N===47?(e.consume(N),o="",A):M(N)}function A(N){if(N===62){const le=o.toLowerCase();return lx.includes(le)?(e.consume(N),$):M(N)}return Nn(N)&&o.length<8?(e.consume(N),o+=String.fromCharCode(N),A):M(N)}function B(N){return N===93?(e.consume(N),C):M(N)}function C(N){return N===62?(e.consume(N),$):N===45&&s===2?(e.consume(N),C):M(N)}function $(N){return N===null||J(N)?(e.exit("htmlFlowData"),Q(N)):(e.consume(N),$)}function Q(N){return e.exit("htmlFlow"),t(N)}}function uN(e,t,n){const r=this;return s;function s(o){return J(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function dN(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(yu,t,n)}}const fN={name:"htmlText",tokenize:hN};function hN(e,t,n){const r=this;let s,i,o;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),c):C===47?(e.consume(C),S):C===63?(e.consume(C),v):Nn(C)?(e.consume(C),P):n(C)}function c(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),i=0,m):Nn(C)?(e.consume(C),x):n(C)}function u(C){return C===45?(e.consume(C),p):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),h):J(C)?(o=d,V(C)):(e.consume(C),d)}function h(C){return C===45?(e.consume(C),p):d(C)}function p(C){return C===62?F(C):C===45?h(C):d(C)}function m(C){const $="CDATA[";return C===$.charCodeAt(i++)?(e.consume(C),i===$.length?y:m):n(C)}function y(C){return C===null?n(C):C===93?(e.consume(C),w):J(C)?(o=y,V(C)):(e.consume(C),y)}function w(C){return C===93?(e.consume(C),g):y(C)}function g(C){return C===62?F(C):C===93?(e.consume(C),g):y(C)}function x(C){return C===null||C===62?F(C):J(C)?(o=x,V(C)):(e.consume(C),x)}function v(C){return C===null?n(C):C===63?(e.consume(C),b):J(C)?(o=v,V(C)):(e.consume(C),v)}function b(C){return C===62?F(C):v(C)}function S(C){return Nn(C)?(e.consume(C),k):n(C)}function k(C){return C===45||At(C)?(e.consume(C),k):T(C)}function T(C){return J(C)?(o=T,V(C)):ae(C)?(e.consume(C),T):F(C)}function P(C){return C===45||At(C)?(e.consume(C),P):C===47||C===62||bt(C)?R(C):n(C)}function R(C){return C===47?(e.consume(C),F):C===58||C===95||Nn(C)?(e.consume(C),j):J(C)?(o=R,V(C)):ae(C)?(e.consume(C),R):F(C)}function j(C){return C===45||C===46||C===58||C===95||At(C)?(e.consume(C),j):I(C)}function I(C){return C===61?(e.consume(C),M):J(C)?(o=I,V(C)):ae(C)?(e.consume(C),I):R(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,O):J(C)?(o=M,V(C)):ae(C)?(e.consume(C),M):(e.consume(C),z)}function O(C){return C===s?(e.consume(C),s=void 0,E):C===null?n(C):J(C)?(o=O,V(C)):(e.consume(C),O)}function z(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||bt(C)?R(C):(e.consume(C),z)}function E(C){return C===47||C===62||bt(C)?R(C):n(C)}function F(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function V(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),A}function A(C){return ae(C)?ve(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):B(C)}function B(C){return e.enter("htmlTextData"),o(C)}}const dm={name:"labelEnd",resolveAll:yN,resolveTo:xN,tokenize:vN},pN={tokenize:wN},mN={tokenize:bN},gN={tokenize:kN};function yN(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 s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Ln(e,0,e.length,n),e}function xN(e,t){let n=e.length,r=0,s,i,o,a;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Qt(a,e.slice(i+1,i+r+3)),a=Qt(a,[["enter",u,t]]),a=Qt(a,um(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=Qt(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Qt(a,e.slice(o+1)),a=Qt(a,[["exit",l,t]]),Ln(e,i,e.length,a),e}function vN(e,t,n){const r=this;let s=r.events.length,i,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return a;function a(h){return i?i._inactive?d(h):(o=r.parser.defined.includes(vi(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(pN,u,o?u:d)(h):h===91?e.attempt(mN,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(gN,u,d)(h)}function u(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function wN(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),s}function s(d){return bt(d)?Lo(e,i)(d):i(d)}function i(d){return d===41?u(d):Xb(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return bt(d)?Lo(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Zb(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return bt(d)?Lo(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function bN(e,t,n){const r=this;return s;function s(a){return Jb.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(vi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function kN(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const _N={name:"labelStartImage",resolveAll:dm.resolveAll,tokenize:SN};function SN(e,t,n){const r=this;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const CN={name:"labelStartLink",resolveAll:dm.resolveAll,tokenize:PN};function PN(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const kd={name:"lineEnding",tokenize:jN};function jN(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ve(e,t,"linePrefix")}}const Bl={name:"thematicBreak",tokenize:EN};function EN(e,t,n){let r=0,s;return i;function i(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,a(c)}function a(c){return c===s?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||J(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ae(c)?ve(e,a,"whitespace")(c):a(c))}}const pt={continuation:{tokenize:IN},exit:AN,name:"list",tokenize:NN},TN={partial:!0,tokenize:LN},RN={partial:!0,tokenize:MN};function NN(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:yh(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Bl,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return yh(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yu,r.interrupt?n:u,e.attempt(TN,h,d))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function d(p){return ae(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function IN(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(RN,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(pt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function MN(e,t,n){const r=this;return ve(e,s,"listItemIndent",r.containerState.size+1);function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(i):n(i)}}function AN(e){e.exit(this.containerState.type)}function LN(e,t,n){const r=this;return ve(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const o=r.events[r.events.length-1];return!ae(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const cx={name:"setextUnderline",resolveTo:DN,tokenize:FN};function DN(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",o,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function FN(e,t,n){const r=this;let s;return i;function i(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===s?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ae(c)?ve(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||J(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const ON={tokenize:zN};function zN(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,s,ve(e,e.attempt(this.parser.constructs.flow,s,e.attempt(WR,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const $N={resolveAll:tk()},BN=ek("string"),VN=ek("text");function ek(e){return{resolveAll:tk(e==="text"?UN:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,o,a);return o;function o(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=s[u];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function tk(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function UN(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],s=t.sliceStream(r);let i=s.length,o=-1,a=0,l;for(;i--;){const c=s[i];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:r.start._bufferIndex+o,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const WN={42:pt,43:pt,45:pt,48:pt,49:pt,50:pt,51:pt,52:pt,53:pt,54:pt,55:pt,56:pt,57:pt,62:Kb},HN={91:qR},GN={[-2]:bd,[-1]:bd,32:bd},KN={35:tN,42:Bl,45:[cx,Bl],60:iN,61:cx,95:Bl,96:ax,126:ax},QN={38:qb,92:Qb},qN={[-5]:kd,[-4]:kd,[-3]:kd,33:_N,38:qb,42:xh,60:[CR,fN],91:CN,92:[ZR,Qb],93:dm,95:xh,96:OR},YN={null:[xh,$N]},XN={null:[42,95]},JN={null:[]},ZN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:XN,contentInitial:HN,disable:JN,document:WN,flow:KN,flowInitial:GN,insideSpan:YN,string:QN,text:qN},Symbol.toStringTag,{value:"Module"}));function eI(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 s={},i=[];let o=[],a=[];const l={attempt:T(S),check:T(k),consume:x,enter:v,exit:b,interrupt:T(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(I){return o=Qt(o,I),w(),o[o.length-1]!==null?[]:(P(t,0),c.events=um(i,c.events,c),c.events)}function h(I,M){return nI(p(I),M)}function p(I){return tI(o,I)}function m(){const{_bufferIndex:I,_index:M,line:O,column:z,offset:E}=r;return{_bufferIndex:I,_index:M,line:O,column:z,offset:E}}function y(I){s[I.line]=I.column,j()}function w(){let I;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<M.length;)g(M.charCodeAt(r._bufferIndex));else g(M)}}function g(I){u=u(I)}function x(I){J(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,j()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=I}function v(I,M){const O=M||{};return O.type=I,O.start=m(),c.events.push(["enter",O,c]),a.push(O),O}function b(I){const M=a.pop();return M.end=m(),c.events.push(["exit",M,c]),M}function S(I,M){P(I,M.from)}function k(I,M){M.restore()}function T(I,M){return O;function O(z,E,F){let V,A,B,C;return Array.isArray(z)?Q(z):"tokenize"in z?Q([z]):$(z);function $(ue){return jt;function jt(He){const Vt=He!==null&&ue[He],vn=He!==null&&ue.null,zn=[...Array.isArray(Vt)?Vt:Vt?[Vt]:[],...Array.isArray(vn)?vn:vn?[vn]:[]];return Q(zn)(He)}}function Q(ue){return V=ue,A=0,ue.length===0?F:N(ue[A])}function N(ue){return jt;function jt(He){return C=R(),B=ue,ue.partial||(c.currentConstruct=ue),ue.name&&c.parser.constructs.disable.null.includes(ue.name)?fe():ue.tokenize.call(M?Object.assign(Object.create(c),M):c,l,le,fe)(He)}}function le(ue){return I(B,C),E}function fe(ue){return C.restore(),++A<V.length?N(V[A]):F}}}function P(I,M){I.resolveAll&&!i.includes(I)&&i.push(I),I.resolve&&Ln(c.events,M,c.events.length-M,I.resolve(c.events.slice(M),c)),I.resolveTo&&(c.events=I.resolveTo(c.events,c))}function R(){const I=m(),M=c.previous,O=c.currentConstruct,z=c.events.length,E=Array.from(a);return{from:z,restore:F};function F(){r=I,c.previous=M,c.currentConstruct=O,c.events.length=z,a=E,j()}}function j(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function tI(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,i)];else{if(o=e.slice(n,s),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}i>0&&o.push(e[s].slice(0,i))}return o}function nI(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
57
+ */var mu=_,cT=lT;function uT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dT=typeof Object.is=="function"?Object.is:uT,fT=cT.useSyncExternalStore,hT=mu.useRef,pT=mu.useEffect,mT=mu.useMemo,gT=mu.useDebugValue;bb.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=hT(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=mT(function(){function l(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return d=m}return d=p}if(m=d,dT(u,p))return m;var y=r(p);return s!==void 0&&s(m,y)?(u=p,m):(u=p,d=y)}var c=!1,u,d,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,s]);var a=fT(e,i[0],i[1]);return pT(function(){o.hasValue=!0,o.value=a},[a]),gT(a),a};wb.exports=bb;var Sb=wb.exports;const yT=qc(Sb);function xT(e,t){return e===t}function kt(e,t,n=xT){const r=_.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),s=_.useCallback(()=>e==null?void 0:e.get(),[e]);return Sb.useSyncExternalStoreWithSelector(r,s,s,t,n)}var vT={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function As(e){const t=$t(),n=_.useContext(e.from?KE:pu),r=e.from??n,s=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,i=_.useRef(void 0);return kt(s??vT,o=>{if((e.shouldThrow??!0)&&!o&&er(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=Er(i.current,a);return i.current=l,l}return a})}function Cb(e){return As({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Pb(e){const{select:t,...n}=e;return As({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Oi(e){return As({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function tm(e){return As({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function nn(e){const t=$t();return _.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function jb(e){return As({...e,select:t=>e.select?e.select(t.context):t.context})}function wT(e,t){const n=$t(),r=Bj(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:d,replace:h,startTransition:p,resetScroll:m,viewTransition:y,children:w,target:g,disabled:x,style:v,className:b,onClick:S,onBlur:k,onFocus:T,onMouseEnter:P,onMouseLeave:R,onTouchStart:j,ignoreBlocker:I,params:M,search:O,hash:z,state:E,mask:F,reloadDocument:V,unsafeRelative:A,from:B,_fromLocation:C,...$}=e,q=mb(),N=_.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=kt(n.stores.location,fe=>fe,(fe,D)=>fe.href===D.href),he=_.useMemo(()=>{const fe={_fromLocation:ce,...N};return n.buildLocation(fe)},[n,ce,N]),de=he.maskedLocation?he.maskedLocation.publicHref:he.publicHref,jt=he.maskedLocation?he.maskedLocation.external:he.external,Ge=_.useMemo(()=>PT(de,jt,n.history,x),[x,jt,de,n.history]),Vt=_.useMemo(()=>{if(Ge!=null&&Ge.external)return Cc(Ge.href,n.protocolAllowlist)?void 0:Ge.href;if(!jT(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Cc(a,n.protocolAllowlist)?void 0:a}catch{}},[a,Ge,n.protocolAllowlist]),vn=_.useMemo(()=>{if(Vt)return!1;if(o!=null&&o.exact){if(!oE(ce.pathname,he.pathname,n.basepath))return!1}else{const fe=Pc(ce.pathname,n.basepath),D=Pc(he.pathname,n.basepath);if(!(fe.startsWith(D)&&(fe.length===D.length||fe[D.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!vs(ce.search,he.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?q&&ce.hash===he.hash:!0},[o==null?void 0:o.exact,o==null?void 0:o.explicitUndefined,o==null?void 0:o.includeHash,o==null?void 0:o.includeSearch,ce,Vt,q,he.hash,he.pathname,he.search,n.basepath]),zn=vn?jr(s,{})??bT:xd,Ds=vn?xd:jr(i,{})??xd,Na=[b,zn.className,Ds.className].filter(Boolean).join(" "),Ia=(v||zn.style||Ds.style)&&{...v,...zn.style,...Ds.style},[Ma,Ki]=_.useState(!1),Qi=_.useRef(!1),ar=e.reloadDocument||Vt?!1:l??n.options.defaultPreload,Fs=c??n.options.defaultPreloadDelay??0,wn=_.useCallback(()=>{n.preloadRoute({...N,_builtLocation:he}).catch(fe=>{console.warn(fe),console.warn(BE)})},[n,N,he]);$j(r,_.useCallback(fe=>{fe!=null&&fe.isIntersecting&&wn()},[wn]),CT,{disabled:!!x||ar!=="viewport"}),_.useEffect(()=>{Qi.current||!x&&ar==="render"&&(wn(),Qi.current=!0)},[x,wn,ar]);const Du=fe=>{const D=fe.currentTarget.getAttribute("target"),H=g!==void 0?g:D;if(!x&&!ET(fe)&&!fe.defaultPrevented&&(!H||H==="_self")&&fe.button===0){fe.preventDefault(),Ms.flushSync(()=>{Ki(!0)});const ee=n.subscribe("onResolved",()=>{ee(),Ki(!1)});n.navigate({...N,replace:h,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:y,ignoreBlocker:I})}};if(Vt)return{...$,ref:r,href:Vt,...w&&{children:w},...g&&{target:g},...x&&{disabled:x},...v&&{style:v},...b&&{className:b},...S&&{onClick:S},...k&&{onBlur:k},...T&&{onFocus:T},...P&&{onMouseEnter:P},...R&&{onMouseLeave:R},...j&&{onTouchStart:j}};const Aa=fe=>{if(x||ar!=="intent")return;if(!Fs){wn();return}const D=fe.currentTarget;if(lo.has(D))return;const H=setTimeout(()=>{lo.delete(D),wn()},Fs);lo.set(D,H)},Fu=fe=>{x||ar!=="intent"||wn()},La=fe=>{if(x||!ar||!Fs)return;const D=fe.currentTarget,H=lo.get(D);H&&(clearTimeout(H),lo.delete(D))};return{...$,...zn,...Ds,href:Ge==null?void 0:Ge.href,ref:r,onClick:$s([S,Du]),onBlur:$s([k,La]),onFocus:$s([T,Aa]),onMouseEnter:$s([P,Aa]),onMouseLeave:$s([R,La]),onTouchStart:$s([j,Fu]),disabled:!!x,target:g,...Ia&&{style:Ia},...Na&&{className:Na},...x&&kT,...vn&&_T,...q&&Ma&&ST}}var xd={},bT={className:"active"},kT={role:"link","aria-disabled":!0},_T={"data-status":"active","aria-current":"page"},ST={"data-transitioning":"transitioning"},lo=new WeakMap,CT={rootMargin:"100px"},$s=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function PT(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function jT(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Eb=_.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=wT(r,t),o=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=i;return _.createElement("a",l,o)}return _.createElement(n,i,o)});function ET(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var TT=class extends pb{constructor(e){super(e),this.useMatch=t=>As({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>jb({...t,from:this.id}),this.useSearch=t=>tm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Oi({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Pb({...t,from:this.id}),this.useLoaderData=t=>Cb({...t,from:this.id}),this.useNavigate=()=>nn({from:this.fullPath}),this.Link=bi.forwardRef((t,n)=>f.jsx(Eb,{ref:n,from:this.fullPath,...t}))}};function rn(e){return new TT(e)}var RT=class extends VE{constructor(e){super(e),this.useMatch=t=>As({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>jb({...t,from:this.id}),this.useSearch=t=>tm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Oi({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Pb({...t,from:this.id}),this.useLoaderData=t=>Cb({...t,from:this.id}),this.useNavigate=()=>nn({from:this.fullPath}),this.Link=bi.forwardRef((t,n)=>f.jsx(Eb,{ref:n,from:this.fullPath,...t}))}};function NT(e){return new RT(e)}function IT(e){const t=$t(),n=`not-found-${kt(t.stores.location,r=>r.pathname)}-${kt(t.stores.status,r=>r)}`;return f.jsx(Zp,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(st(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(st(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function MT(){return f.jsx("p",{children:"Not Found"})}function Ks(e){return f.jsx(f.Fragment,{children:e.children})}function Tb(e,t,n){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...n}):f.jsx(MT,{})}function AT(e){return null}function LT(){return AT($t()),null}var Rb=_.memo(function({matchId:t}){const n=$t(),r=n.stores.matchStores.get(t);r||er();const s=kt(n.stores.loadedAt,o=>o),i=kt(r,o=>o);return f.jsx(DT,{router:n,matchId:t,resetKey:s,matchState:_.useMemo(()=>{var l;const o=i.routeId,a=(l=n.routesById[o].parentRoute)==null?void 0:l.id;return{routeId:o,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:a}},[i._displayPending,i.routeId,i.ssr,n.routesById])})});function DT({router:e,matchId:t,resetKey:n,matchState:r}){var m,y;const s=e.routesById[r.routeId],i=s.options.pendingComponent??e.options.defaultPendingComponent,o=i?f.jsx(i,{}):null,a=s.options.errorComponent??e.options.defaultErrorComponent,l=s.options.onCatch??e.options.defaultOnCatch,c=s.isRoot?s.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",d=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??i??(((y=s.options.errorComponent)==null?void 0:y.preload)||u))?_.Suspense:Ks,h=a?Zp:Ks,p=c?IT:Ks;return f.jsxs(s.isRoot?s.options.shellComponent??Ks:Ks,{children:[f.jsx(pu.Provider,{value:t,children:f.jsx(d,{fallback:o,children:f.jsx(h,{getResetKey:()=>n,errorComponent:a||em,onCatch:(w,g)=>{if(st(w))throw w.routeId??(w.routeId=r.routeId),w;l==null||l(w,g)},children:f.jsx(p,{fallback:w=>{if(w.routeId??(w.routeId=r.routeId),!c||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!s.isRoot)throw w;return _.createElement(c,w)},children:u||r._displayPending?f.jsx(HE,{fallback:o,children:f.jsx(By,{matchId:t})}):f.jsx(By,{matchId:t})})})})}),r.parentRouteId===ws?f.jsxs(f.Fragment,{children:[f.jsx(FT,{resetKey:n}),e.options.scrollRestoration&&sb?f.jsx(LT,{}):null]}):null]})}function FT({resetKey:e}){const t=$t(),n=_.useRef(void 0);return _o(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...xi(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var By=_.memo(function({matchId:t}){const n=$t(),r=(u,d)=>{var h;return((h=n.getMatch(u.id))==null?void 0:h._nonReactive[d])??u._nonReactive[d]},s=n.stores.matchStores.get(t);s||er();const i=kt(s,u=>u),o=i.routeId,a=n.routesById[o],l=_.useMemo(()=>{var d;const u=(d=n.routesById[o].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:d({routeId:o,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return u?JSON.stringify(u):void 0},[o,i.loaderDeps,i._strictParams,i._strictSearch,n.options.defaultRemountDeps,n.routesById]),c=_.useMemo(()=>{const u=a.options.component??n.options.defaultComponent;return u?f.jsx(u,{},l):f.jsx(Nb,{})},[l,a.options.component,n.options.defaultComponent]);if(i._displayPending)throw r(i,"displayPendingPromise");if(i._forcePending)throw r(i,"minPendingPromise");if(i.status==="pending"){const u=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(u){const d=n.getMatch(i.id);if(d&&!d._nonReactive.minPendingPromise){const h=Ri();d._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),d._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return st(i.error)||er(),Tb(n,a,i.error);if(i.status==="redirected")throw yt(i.error)||er(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),Nb=_.memo(function(){const t=$t(),n=_.useContext(pu);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=kt(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=kt(t.stores.matchesId,u=>u[u.findIndex(d=>d===n)+1])}const o=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(s)return o||er(),Tb(t,o,void 0);if(!i)return null;const l=f.jsx(Rb,{matchId:i});return r===ws?f.jsx(_.Suspense,{fallback:a,children:l}):l});function OT(){const e=$t(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),s=kt(e.stores.isLoading,d=>d),i=kt(e.stores.hasPending,d=>d),o=ud(s),a=s||n||i,l=ud(a),c=s||i,u=ud(c);return e.startTransition=d=>{r(!0),_.startTransition(()=>{d(),r(!1)})},_.useEffect(()=>{const d=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $r(e.latestLocation.publicHref)!==$r(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{d()}},[e,e.history]),_o(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),_o(()=>{o&&!s&&e.emit({type:"onLoad",...xi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),_o(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...xi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),_o(()=>{if(l&&!a){const d=xi(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...d}),xb(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),d.hrefChanged&&UE(e)}},[a,l,e]),null}function zT(){const e=$t(),t=e.routesById[ws].options.pendingComponent??e.options.defaultPendingComponent,n=t?f.jsx(t,{}):null,r=f.jsxs(typeof document<"u"&&e.ssr?Ks:_.Suspense,{fallback:n,children:[f.jsx(OT,{}),f.jsx($T,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:r}):r}function $T(){const e=$t(),t=kt(e.stores.firstId,s=>s),n=kt(e.stores.loadedAt,s=>s),r=t?f.jsx(Rb,{matchId:t}):null;return f.jsx(pu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:f.jsx(Zp,{getResetKey:()=>n,errorComponent:em,onCatch:void 0,children:r})})}var BT=e=>({createMutableStore:$y,createReadonlyStore:$y,batch:xb}),VT=e=>new UT(e),UT=class extends AE{constructor(e){super(e,BT)}};function WT({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=f.jsx(gb.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function HT({router:e,...t}){return f.jsx(WT,{router:e,...t,children:f.jsx(zT,{})})}function GT(e){const t=$t({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=_.useRef(void 0);return kt(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Er(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const KT="modulepreload",QT=function(e,t){return new URL(e,t).href},Vy={},Fn=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=QT(c,r),c in Vy)return;Vy[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(!!r)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===c&&(!u||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":KT,u||(p.as="script"),p.crossOrigin="",p.href=c,l&&p.setAttribute("nonce",l),document.head.appendChild(p),u)return new Promise((m,y)=>{p.addEventListener("load",m),p.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};function qT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const YT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JT={};function Uy(e,t){return(JT.jsx?XT:YT).test(e)}const ZT=/[ \t\n\f\r]/g;function e2(e){return typeof e=="object"?e.type==="text"?Wy(e.value):!1:Wy(e)}function Wy(e){return e.replace(ZT,"")===""}class va{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}va.prototype.normal={};va.prototype.property={};va.prototype.space=void 0;function Ib(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new va(n,r,t)}function dh(e){return e.toLowerCase()}class Pt{constructor(t,n){this.attribute=n,this.property=t}}Pt.prototype.attribute="";Pt.prototype.booleanish=!1;Pt.prototype.boolean=!1;Pt.prototype.commaOrSpaceSeparated=!1;Pt.prototype.commaSeparated=!1;Pt.prototype.defined=!1;Pt.prototype.mustUseProperty=!1;Pt.prototype.number=!1;Pt.prototype.overloadedBoolean=!1;Pt.prototype.property="";Pt.prototype.spaceSeparated=!1;Pt.prototype.space=void 0;let t2=0;const te=Ls(),Fe=Ls(),fh=Ls(),W=Ls(),me=Ls(),ks=Ls(),Nt=Ls();function Ls(){return 2**++t2}const hh=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Fe,commaOrSpaceSeparated:Nt,commaSeparated:ks,number:W,overloadedBoolean:fh,spaceSeparated:me},Symbol.toStringTag,{value:"Module"})),vd=Object.keys(hh);class nm extends Pt{constructor(t,n,r,s){let i=-1;if(super(t,n),Hy(this,"space",s),typeof r=="number")for(;++i<vd.length;){const o=vd[i];Hy(this,vd[i],(r&hh[o])===hh[o])}}}nm.prototype.defined=!0;function Hy(e,t,n){n&&(e[t]=n)}function zi(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new nm(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[dh(r)]=r,n[dh(i.attribute)]=r}return new va(t,n,e.space)}const Mb=zi({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:me,ariaCurrent:null,ariaDescribedBy:me,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:me,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:me,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:me,ariaLevel:W,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:me,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:me,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:Fe,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ab(e,t){return t in e?e[t]:t}function Lb(e,t){return Ab(e,t.toLowerCase())}const n2=zi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ks,acceptCharset:me,accessKey:me,action:null,allow:null,allowFullScreen:te,allowPaymentRequest:te,allowUserMedia:te,alpha:te,alt:null,as:null,async:te,autoCapitalize:null,autoComplete:me,autoFocus:te,autoPlay:te,blocking:me,capture:null,charSet:null,checked:te,cite:null,className:me,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:Fe,controls:te,controlsList:me,coords:W|ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:fh,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:te,formTarget:null,headers:me,height:W,hidden:fh,high:W,href:null,hrefLang:null,htmlFor:me,httpEquiv:me,id:null,imageSizes:null,imageSrcSet:null,inert:te,inputMode:null,integrity:null,is:null,isMap:te,itemId:null,itemProp:me,itemRef:me,itemScope:te,itemType:me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:te,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:te,muted:te,name:null,nonce:null,noModule:te,noValidate:te,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:te,optimum:W,pattern:null,ping:me,placeholder:null,playsInline:te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:te,referrerPolicy:null,rel:me,required:te,reversed:te,rows:W,rowSpan:W,sandbox:me,scope:null,scoped:te,seamless:te,selected:te,shadowRootClonable:te,shadowRootCustomElementRegistry:te,shadowRootDelegatesFocus:te,shadowRootMode:null,shadowRootSerializable:te,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:te,useMap:null,value:Fe,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:me,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:te,declare:te,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:te,noHref:te,noShade:te,noWrap:te,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:te,disablePictureInPicture:te,disableRemotePlayback:te,exportParts:ks,part:me,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:Lb}),r2=zi({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",maskType:"mask-type",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:Nt,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:me,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:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:te,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,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:ks,g2:ks,glyphName:ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:Nt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,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:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Nt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Nt,rev:Nt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Nt,requiredFeatures:Nt,requiredFonts:Nt,requiredFormats:Nt,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:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:Nt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Nt,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Nt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ab}),Db=zi({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()}}),Fb=zi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Lb}),Ob=zi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),s2={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"},i2=/[A-Z]/g,Gy=/-[a-z]/g,o2=/^data[-\w.:]+$/i;function a2(e,t){const n=dh(t);let r=t,s=Pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&o2.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Gy,c2);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Gy.test(i)){let o=i.replace(i2,l2);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=nm}return new s(r,t)}function l2(e){return"-"+e.toLowerCase()}function c2(e){return e.charAt(1).toUpperCase()}const u2=Ib([Mb,n2,Db,Fb,Ob],"html"),rm=Ib([Mb,r2,Db,Fb,Ob],"svg");function d2(e){return e.join(" ").trim()}var sm={},Ky=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,f2=/\n/g,h2=/^\s*/,p2=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,m2=/^:\s*/,g2=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,y2=/^[;\s]*/,x2=/^\s+|\s+$/g,v2=`
58
+ `,Qy="/",qy="*",us="",w2="comment",b2="declaration";function k2(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(m){var y=m.match(f2);y&&(n+=y.length);var w=m.lastIndexOf(v2);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new o(m),c(),y}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var w=y[0];return s(w),e=e.slice(w.length),y}}function c(){l(h2)}function u(m){var y;for(m=m||[];y=d();)y!==!1&&m.push(y);return m}function d(){var m=i();if(!(Qy!=e.charAt(0)||qy!=e.charAt(1))){for(var y=2;us!=e.charAt(y)&&(qy!=e.charAt(y)||Qy!=e.charAt(y+1));)++y;if(y+=2,us===e.charAt(y-1))return a("End of comment missing");var w=e.slice(2,y-2);return r+=2,s(w),e=e.slice(y),r+=2,m({type:w2,comment:w})}}function h(){var m=i(),y=l(p2);if(y){if(d(),!l(m2))return a("property missing ':'");var w=l(g2),g=m({type:b2,property:Yy(y[0].replace(Ky,us)),value:w?Yy(w[0].replace(Ky,us)):us});return l(y2),g}}function p(){var m=[];u(m);for(var y;y=h();)y!==!1&&(m.push(y),u(m));return m}return c(),p()}function Yy(e){return e?e.replace(x2,us):us}var _2=k2,S2=ec&&ec.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sm,"__esModule",{value:!0});sm.default=P2;const C2=S2(_2);function P2(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,C2.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:a}=i;s?t(o,a,i):a&&(n=n||{},n[o]=a)}),n}var gu={};Object.defineProperty(gu,"__esModule",{value:!0});gu.camelCase=void 0;var j2=/^--[a-zA-Z0-9_-]+$/,E2=/-([a-z])/g,T2=/^[^-]+$/,R2=/^-(webkit|moz|ms|o|khtml)-/,N2=/^-(ms)-/,I2=function(e){return!e||T2.test(e)||j2.test(e)},M2=function(e,t){return t.toUpperCase()},Xy=function(e,t){return"".concat(t,"-")},A2=function(e,t){return t===void 0&&(t={}),I2(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(N2,Xy):e=e.replace(R2,Xy),e.replace(E2,M2))};gu.camelCase=A2;var L2=ec&&ec.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},D2=L2(sm),F2=gu;function ph(e,t){var n={};return!e||typeof e!="string"||(0,D2.default)(e,function(r,s){r&&s&&(n[(0,F2.camelCase)(r,t)]=s)}),n}ph.default=ph;var O2=ph;const z2=qc(O2),zb=$b("end"),im=$b("start");function $b(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 $2(e){const t=im(e),n=zb(e);if(t&&n)return{start:t,end:n}}function Ao(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jy(e.position):"start"in e||"end"in e?Jy(e):"line"in e||"column"in e?mh(e):""}function mh(e){return Zy(e&&e.line)+":"+Zy(e&&e.column)}function Jy(e){return mh(e&&e.start)+"-"+mh(e&&e.end)}function Zy(e){return e&&typeof e=="number"?e:1}class ot extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(o=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=Ao(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ot.prototype.file="";ot.prototype.name="";ot.prototype.reason="";ot.prototype.message="";ot.prototype.stack="";ot.prototype.column=void 0;ot.prototype.line=void 0;ot.prototype.ancestors=void 0;ot.prototype.cause=void 0;ot.prototype.fatal=void 0;ot.prototype.place=void 0;ot.prototype.ruleId=void 0;ot.prototype.source=void 0;const om={}.hasOwnProperty,B2=new Map,V2=/[A-Z]/g,U2=new Set(["table","tbody","thead","tfoot","tr"]),W2=new Set(["td","th"]),Bb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function H2(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=Z2(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=J2(n,t.jsx,t.jsxs)}const s={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"?rm:u2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Vb(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Vb(e,t,n){if(t.type==="element")return G2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return K2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return q2(e,t,n);if(t.type==="mdxjsEsm")return Q2(e,t);if(t.type==="root")return Y2(e,t,n);if(t.type==="text")return X2(e,t)}function G2(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=rm,e.schema=s),e.ancestors.push(t);const i=Wb(e,t.tagName,!1),o=eR(e,t);let a=lm(e,t);return U2.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!e2(l):!0})),Ub(e,o,i,t),am(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function K2(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)}ca(e,t.position)}function Q2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ca(e,t.position)}function q2(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=rm,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Wb(e,t.name,!0),o=tR(e,t),a=lm(e,t);return Ub(e,o,i,t),am(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function Y2(e,t,n){const r={};return am(r,lm(e,t)),e.create(t,e.Fragment,r,n)}function X2(e,t){return t.value}function Ub(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function am(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function J2(e,t,n){return r;function r(s,i,o,a){const c=Array.isArray(o.children)?n:t;return a?c(i,o,a):c(i,o)}}function Z2(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=im(r);return t(s,i,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function eR(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&om.call(t.properties,s)){const i=nR(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&W2.has(t.tagName)?r=a:n[o]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function tR(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const o=i.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ca(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else ca(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function lm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:B2;for(;++r<t.children.length;){const i=t.children[r];let o;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=s.get(l)||0;o=l+"-"+c,s.set(l,c+1)}}const a=Vb(e,i,o);a!==void 0&&n.push(a)}return n}function nR(e,t,n){const r=a2(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qT(n):d2(n)),r.property==="style"){let s=typeof n=="object"?n:rR(e,String(n));return e.stylePropertyNameCase==="css"&&(s=sR(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?s2[r.property]||r.property:r.attribute,n]}}function rR(e,t){try{return z2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new ot("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Bb+"#cannot-parse-style-attribute",s}}function Wb(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,o;for(;++i<s.length;){const a=Uy(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=o}else r=Uy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return om.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);ca(e)}function ca(e,t){const n=new ot("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=Bb+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sR(e){const t={};let n;for(n in e)om.call(e,n)&&(t[iR(n)]=e[n]);return t}function iR(e){let t=e.replace(V2,oR);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function oR(e){return"-"+e.toLowerCase()}const wd={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"]},aR={};function lR(e,t){const n=aR,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Hb(e,r,s)}function Hb(e,t,n){if(cR(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 ex(e.children,t,n)}return Array.isArray(e)?ex(e,t,n):""}function ex(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Hb(e[s],t,n);return r.join("")}function cR(e){return!!(e&&typeof e=="object")}const tx=document.createElement("i");function cm(e){const t="&"+e+";";tx.innerHTML=t;const n=tx.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ln(e,t,n,r){const s=e.length;let i=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function Qt(e,t){return e.length>0?(Ln(e,e.length,0,t),e):t}const nx={}.hasOwnProperty;function uR(e){const t={};let n=-1;for(;++n<e.length;)dR(t,e[n]);return t}function dR(e,t){let n;for(n in t){const s=(nx.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){nx.call(s,o)||(s[o]=[]);const a=i[o];fR(s[o],Array.isArray(a)?a:a?[a]:[])}}}function fR(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ln(e,0,0,r)}function Gb(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 vi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nn=Yr(/[A-Za-z]/),At=Yr(/[\dA-Za-z]/),hR=Yr(/[#-'*+\--9=?A-Z^-~]/);function gh(e){return e!==null&&(e<32||e===127)}const yh=Yr(/\d/),pR=Yr(/[\dA-Fa-f]/),mR=Yr(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}const gR=Yr(new RegExp("\\p{P}|\\p{S}","u")),yR=Yr(/\s/);function Yr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $i(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&At(e.charCodeAt(n+1))&&At(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(o=String.fromCharCode(i,a),s=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function we(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return le(l)?(e.enter(n),a(l)):t(l)}function a(l){return le(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const xR={tokenize:vR};function vR(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),we(e,t,"linePrefix")}function s(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Z(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const wR={tokenize:bR},rx={tokenize:kR};function bR(e){const t=this,n=[];let r=0,s,i,o;return a;function a(v){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,l,c)(v)}return c(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const b=t.events.length;let S=b,k;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){k=t.events[S][1].end;break}g(r);let T=b;for(;T<t.events.length;)t.events[T][1].end={...k},T++;return Ln(t.events,S+1,0,t.events.slice(b)),t.events.length=T,c(v)}return a(v)}function c(v){if(r===n.length){if(!s)return h(v);if(s.currentConstruct&&s.currentConstruct.concrete)return m(v);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(rx,u,d)(v)}function u(v){return s&&x(),g(r),h(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(v)}function h(v){return t.containerState={},e.attempt(rx,p,m)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),h(v)}function m(v){if(v===null){s&&x(),g(0),e.consume(v);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),y(v)}function y(v){if(v===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(v);return}return Z(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),y)}function w(v,b){const S=t.sliceStream(v);if(b&&S.push(null),v.previous=i,i&&(i.next=v),i=v,s.defineSkip(v.start),s.write(S),t.parser.lazy[v.start.line]){let k=s.events.length;for(;k--;)if(s.events[k][1].start.offset<o&&(!s.events[k][1].end||s.events[k][1].end.offset>o))return;const T=t.events.length;let P=T,R,j;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(R){j=t.events[P][1].end;break}R=!0}for(g(r),k=T;k<t.events.length;)t.events[k][1].end={...j},k++;Ln(t.events,P+1,0,t.events.slice(T)),t.events.length=k}}function g(v){let b=n.length;for(;b-- >v;){const S=n[b];t.containerState=S[1],S[0].exit.call(t,e)}n.length=v}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function kR(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 sx(e){if(e===null||bt(e)||yR(e))return 1;if(gR(e))return 2}function um(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const xh={name:"attention",resolveAll:_R,tokenize:SR};function _R(e,t){let n=-1,r,s,i,o,a,l,c,u;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;l=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 d={...e[r][1].end},h={...e[n][1].start};ix(d,-l),ix(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Qt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Qt(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),c=Qt(c,um(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Qt(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Qt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Ln(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function SR(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=sx(r);let i;return o;function o(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=sx(l),d=!u||u===2&&s||n.includes(l),h=!s||s===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(s||!h)),c._close=!!(i===42?h:h&&(u||!d)),t(l)}}function ix(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const CR={name:"autolink",tokenize:PR};function PR(e,t,n){let r=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return Nn(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||At(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||At(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||gh(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):hR(p)?(e.consume(p),c):n(p)}function u(p){return At(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||At(p))&&r++<63){const m=p===45?h:d;return e.consume(p),m}return n(p)}}const yu={partial:!0,tokenize:jR};function jR(e,t,n){return r;function r(i){return le(i)?we(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||Z(i)?t(i):n(i)}}const Kb={continuation:{tokenize:TR},exit:RR,name:"blockQuote",tokenize:ER};function ER(e,t,n){const r=this;return s;function s(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return le(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function TR(e,t,n){const r=this;return s;function s(o){return le(o)?we(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(Kb,t,n)(o)}}function RR(e){e.exit("blockQuote")}const Qb={name:"characterEscape",tokenize:NR};function NR(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return mR(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const qb={name:"characterReference",tokenize:IR};function IR(e,t,n){const r=this;let s=0,i,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,o=At,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=pR,u):(e.enter("characterReferenceValue"),i=7,o=yh,u(d))}function u(d){if(d===59&&s){const h=e.exit("characterReferenceValue");return o===At&&!cm(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&s++<i?(e.consume(d),u):n(d)}}const ox={partial:!0,tokenize:AR},ax={concrete:!0,name:"codeFenced",tokenize:MR};function MR(e,t,n){const r=this,s={partial:!0,tokenize:S};let i=0,o=0,a;return l;function l(k){return c(k)}function c(k){const T=r.events[r.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(o++,e.consume(k),u):o<3?n(k):(e.exit("codeFencedFenceSequence"),le(k)?we(e,d,"whitespace")(k):d(k))}function d(k){return k===null||Z(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(ox,y,b)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||Z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):le(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),we(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),h)}function p(k){return k===null||Z(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||Z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===a?n(k):(e.consume(k),m)}function y(k){return e.attempt(s,b,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g}function g(k){return i>0&&le(k)?we(e,x,"linePrefix",i+1)(k):x(k)}function x(k){return k===null||Z(k)?e.check(ox,y,b)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||Z(k)?(e.exit("codeFlowValue"),x(k)):(e.consume(k),v)}function b(k){return e.exit("codeFenced"),t(k)}function S(k,T,P){let R=0;return j;function j(E){return k.enter("lineEnding"),k.consume(E),k.exit("lineEnding"),I}function I(E){return k.enter("codeFencedFence"),le(E)?we(k,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):M(E)}function M(E){return E===a?(k.enter("codeFencedFenceSequence"),O(E)):P(E)}function O(E){return E===a?(R++,k.consume(E),O):R>=o?(k.exit("codeFencedFenceSequence"),le(E)?we(k,z,"whitespace")(E):z(E)):P(E)}function z(E){return E===null||Z(E)?(k.exit("codeFencedFence"),T(E)):P(E)}}}function AR(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const bd={name:"codeIndented",tokenize:DR},LR={partial:!0,tokenize:FR};function DR(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),we(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Z(c)?e.attempt(LR,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Z(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function FR(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):we(e,i,"linePrefix",5)(o)}function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):Z(o)?s(o):n(o)}}const OR={name:"codeText",previous:$R,resolve:zR,tokenize:BR};function zR(e){let t=e.length-4,n=3,r,s;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;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function $R(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BR(e,t,n){let r=0,s,i;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),s=0,u(d)):Z(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||Z(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),s++,u):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}class VR{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 s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&co(this.left,r),i.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),co(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),co(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);co(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);co(this.left,n.reverse())}}}function co(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 Yb(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new VR(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,UR(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(o=u.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(u.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...u.get(s)[1].start},a=u.slice(s,n),a.unshift(r),u.splice(s,n-s+1,a))}}return Ln(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function UR(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,d,h=-1,p=n,m=0,y=0;const w=[y];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(y=h+1,w.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):w.pop(),h=w.length;h--;){const g=a.slice(w[h],w[h+1]),x=i.pop();l.push([x,x+g.length-1]),e.splice(x,2,g)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const WR={resolve:GR,tokenize:KR},HR={partial:!0,tokenize:QR};function GR(e){return Yb(e),e}function KR(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(a)}function s(a){return a===null?i(a):Z(a)?e.check(HR,o,i)(a):(e.consume(a),s)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function QR(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),we(e,i,"linePrefix")}function i(o){if(o===null||Z(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Xb(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||gh(g)?n(g):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(a),h(g)):g===null||g===60||Z(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!u&&(g===null||g===41||bt(g))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,y):g===41?(e.consume(g),u--,y):g===null||g===32||g===40||gh(g)?n(g):(e.consume(g),g===92?w:y)}function w(g){return g===40||g===41||g===92?(e.consume(g),y):y(g)}}function Jb(e,t,n,r,s,i){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(i),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Z(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!le(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function Zb(e,t,n,r,s,i){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===o?(e.exit(i),l(o)):h===null?n(h):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),we(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||Z(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===o||h===92?(e.consume(h),u):u(h)}}function Lo(e,t){let n;return r;function r(s){return Z(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):le(s)?we(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const qR={name:"definition",tokenize:XR},YR={partial:!0,tokenize:JR};function XR(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return Jb.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=vi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return bt(p)?Lo(e,c)(p):c(p)}function c(p){return Xb(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(YR,d,d)(p)}function d(p){return le(p)?we(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Z(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function JR(e,t,n){return r;function r(a){return bt(a)?Lo(e,s)(a):n(a)}function s(a){return Zb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return le(a)?we(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Z(a)?t(a):n(a)}}const ZR={name:"hardBreakEscape",tokenize:eN};function eN(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Z(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const tN={name:"headingAtx",resolve:nN,tokenize:rN};function nN(e,t){let n=e.length-2,r=3,s,i;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&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ln(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function rN(e,t,n){let r=0;return s;function s(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||bt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Z(u)?(e.exit("atxHeading"),t(u)):le(u)?we(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||bt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const sN=["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"],lx=["pre","script","style","textarea"],iN={concrete:!0,name:"htmlFlow",resolveTo:lN,tokenize:cN},oN={partial:!0,tokenize:dN},aN={partial:!0,tokenize:uN};function lN(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 cN(e,t,n){const r=this;let s,i,o,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),i=!0,y):N===63?(e.consume(N),s=3,r.interrupt?t:C):Nn(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function h(N){return N===45?(e.consume(N),s=2,p):N===91?(e.consume(N),s=5,a=0,m):Nn(N)?(e.consume(N),s=4,r.interrupt?t:C):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:C):n(N)}function m(N){const ce="CDATA[";return N===ce.charCodeAt(a++)?(e.consume(N),a===ce.length?r.interrupt?t:M:m):n(N)}function y(N){return Nn(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||bt(N)){const ce=N===47,he=o.toLowerCase();return!ce&&!i&&lx.includes(he)?(s=1,r.interrupt?t(N):M(N)):sN.includes(o.toLowerCase())?(s=6,ce?(e.consume(N),g):r.interrupt?t(N):M(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?x(N):v(N))}return N===45||At(N)?(e.consume(N),o+=String.fromCharCode(N),w):n(N)}function g(N){return N===62?(e.consume(N),r.interrupt?t:M):n(N)}function x(N){return le(N)?(e.consume(N),x):j(N)}function v(N){return N===47?(e.consume(N),j):N===58||N===95||Nn(N)?(e.consume(N),b):le(N)?(e.consume(N),v):j(N)}function b(N){return N===45||N===46||N===58||N===95||At(N)?(e.consume(N),b):S(N)}function S(N){return N===61?(e.consume(N),k):le(N)?(e.consume(N),S):v(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,T):le(N)?(e.consume(N),k):P(N)}function T(N){return N===l?(e.consume(N),l=null,R):N===null||Z(N)?n(N):(e.consume(N),T)}function P(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||bt(N)?S(N):(e.consume(N),P)}function R(N){return N===47||N===62||le(N)?v(N):n(N)}function j(N){return N===62?(e.consume(N),I):n(N)}function I(N){return N===null||Z(N)?M(N):le(N)?(e.consume(N),I):n(N)}function M(N){return N===45&&s===2?(e.consume(N),F):N===60&&s===1?(e.consume(N),V):N===62&&s===4?(e.consume(N),$):N===63&&s===3?(e.consume(N),C):N===93&&s===5?(e.consume(N),B):Z(N)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(oN,q,O)(N)):N===null||Z(N)?(e.exit("htmlFlowData"),O(N)):(e.consume(N),M)}function O(N){return e.check(aN,z,q)(N)}function z(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),E}function E(N){return N===null||Z(N)?O(N):(e.enter("htmlFlowData"),M(N))}function F(N){return N===45?(e.consume(N),C):M(N)}function V(N){return N===47?(e.consume(N),o="",A):M(N)}function A(N){if(N===62){const ce=o.toLowerCase();return lx.includes(ce)?(e.consume(N),$):M(N)}return Nn(N)&&o.length<8?(e.consume(N),o+=String.fromCharCode(N),A):M(N)}function B(N){return N===93?(e.consume(N),C):M(N)}function C(N){return N===62?(e.consume(N),$):N===45&&s===2?(e.consume(N),C):M(N)}function $(N){return N===null||Z(N)?(e.exit("htmlFlowData"),q(N)):(e.consume(N),$)}function q(N){return e.exit("htmlFlow"),t(N)}}function uN(e,t,n){const r=this;return s;function s(o){return Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function dN(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(yu,t,n)}}const fN={name:"htmlText",tokenize:hN};function hN(e,t,n){const r=this;let s,i,o;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),c):C===47?(e.consume(C),S):C===63?(e.consume(C),v):Nn(C)?(e.consume(C),P):n(C)}function c(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),i=0,m):Nn(C)?(e.consume(C),x):n(C)}function u(C){return C===45?(e.consume(C),p):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),h):Z(C)?(o=d,V(C)):(e.consume(C),d)}function h(C){return C===45?(e.consume(C),p):d(C)}function p(C){return C===62?F(C):C===45?h(C):d(C)}function m(C){const $="CDATA[";return C===$.charCodeAt(i++)?(e.consume(C),i===$.length?y:m):n(C)}function y(C){return C===null?n(C):C===93?(e.consume(C),w):Z(C)?(o=y,V(C)):(e.consume(C),y)}function w(C){return C===93?(e.consume(C),g):y(C)}function g(C){return C===62?F(C):C===93?(e.consume(C),g):y(C)}function x(C){return C===null||C===62?F(C):Z(C)?(o=x,V(C)):(e.consume(C),x)}function v(C){return C===null?n(C):C===63?(e.consume(C),b):Z(C)?(o=v,V(C)):(e.consume(C),v)}function b(C){return C===62?F(C):v(C)}function S(C){return Nn(C)?(e.consume(C),k):n(C)}function k(C){return C===45||At(C)?(e.consume(C),k):T(C)}function T(C){return Z(C)?(o=T,V(C)):le(C)?(e.consume(C),T):F(C)}function P(C){return C===45||At(C)?(e.consume(C),P):C===47||C===62||bt(C)?R(C):n(C)}function R(C){return C===47?(e.consume(C),F):C===58||C===95||Nn(C)?(e.consume(C),j):Z(C)?(o=R,V(C)):le(C)?(e.consume(C),R):F(C)}function j(C){return C===45||C===46||C===58||C===95||At(C)?(e.consume(C),j):I(C)}function I(C){return C===61?(e.consume(C),M):Z(C)?(o=I,V(C)):le(C)?(e.consume(C),I):R(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,O):Z(C)?(o=M,V(C)):le(C)?(e.consume(C),M):(e.consume(C),z)}function O(C){return C===s?(e.consume(C),s=void 0,E):C===null?n(C):Z(C)?(o=O,V(C)):(e.consume(C),O)}function z(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||bt(C)?R(C):(e.consume(C),z)}function E(C){return C===47||C===62||bt(C)?R(C):n(C)}function F(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function V(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),A}function A(C){return le(C)?we(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):B(C)}function B(C){return e.enter("htmlTextData"),o(C)}}const dm={name:"labelEnd",resolveAll:yN,resolveTo:xN,tokenize:vN},pN={tokenize:wN},mN={tokenize:bN},gN={tokenize:kN};function yN(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 s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Ln(e,0,e.length,n),e}function xN(e,t){let n=e.length,r=0,s,i,o,a;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Qt(a,e.slice(i+1,i+r+3)),a=Qt(a,[["enter",u,t]]),a=Qt(a,um(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=Qt(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Qt(a,e.slice(o+1)),a=Qt(a,[["exit",l,t]]),Ln(e,i,e.length,a),e}function vN(e,t,n){const r=this;let s=r.events.length,i,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return a;function a(h){return i?i._inactive?d(h):(o=r.parser.defined.includes(vi(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(pN,u,o?u:d)(h):h===91?e.attempt(mN,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(gN,u,d)(h)}function u(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function wN(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),s}function s(d){return bt(d)?Lo(e,i)(d):i(d)}function i(d){return d===41?u(d):Xb(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return bt(d)?Lo(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Zb(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return bt(d)?Lo(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function bN(e,t,n){const r=this;return s;function s(a){return Jb.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(vi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function kN(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const _N={name:"labelStartImage",resolveAll:dm.resolveAll,tokenize:SN};function SN(e,t,n){const r=this;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const CN={name:"labelStartLink",resolveAll:dm.resolveAll,tokenize:PN};function PN(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const kd={name:"lineEnding",tokenize:jN};function jN(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),we(e,t,"linePrefix")}}const Bl={name:"thematicBreak",tokenize:EN};function EN(e,t,n){let r=0,s;return i;function i(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,a(c)}function a(c){return c===s?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Z(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),le(c)?we(e,a,"whitespace")(c):a(c))}}const pt={continuation:{tokenize:IN},exit:AN,name:"list",tokenize:NN},TN={partial:!0,tokenize:LN},RN={partial:!0,tokenize:MN};function NN(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:yh(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Bl,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return yh(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yu,r.interrupt?n:u,e.attempt(TN,h,d))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function d(p){return le(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function IN(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,we(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!le(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(RN,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,we(e,e.attempt(pt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function MN(e,t,n){const r=this;return we(e,s,"listItemIndent",r.containerState.size+1);function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(i):n(i)}}function AN(e){e.exit(this.containerState.type)}function LN(e,t,n){const r=this;return we(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const o=r.events[r.events.length-1];return!le(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const cx={name:"setextUnderline",resolveTo:DN,tokenize:FN};function DN(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",o,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function FN(e,t,n){const r=this;let s;return i;function i(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===s?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),le(c)?we(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Z(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const ON={tokenize:zN};function zN(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,s,we(e,e.attempt(this.parser.constructs.flow,s,e.attempt(WR,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const $N={resolveAll:tk()},BN=ek("string"),VN=ek("text");function ek(e){return{resolveAll:tk(e==="text"?UN:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,o,a);return o;function o(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=s[u];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function tk(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function UN(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],s=t.sliceStream(r);let i=s.length,o=-1,a=0,l;for(;i--;){const c=s[i];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:r.start._bufferIndex+o,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const WN={42:pt,43:pt,45:pt,48:pt,49:pt,50:pt,51:pt,52:pt,53:pt,54:pt,55:pt,56:pt,57:pt,62:Kb},HN={91:qR},GN={[-2]:bd,[-1]:bd,32:bd},KN={35:tN,42:Bl,45:[cx,Bl],60:iN,61:cx,95:Bl,96:ax,126:ax},QN={38:qb,92:Qb},qN={[-5]:kd,[-4]:kd,[-3]:kd,33:_N,38:qb,42:xh,60:[CR,fN],91:CN,92:[ZR,Qb],93:dm,95:xh,96:OR},YN={null:[xh,$N]},XN={null:[42,95]},JN={null:[]},ZN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:XN,contentInitial:HN,disable:JN,document:WN,flow:KN,flowInitial:GN,insideSpan:YN,string:QN,text:qN},Symbol.toStringTag,{value:"Module"}));function eI(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 s={},i=[];let o=[],a=[];const l={attempt:T(S),check:T(k),consume:x,enter:v,exit:b,interrupt:T(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(I){return o=Qt(o,I),w(),o[o.length-1]!==null?[]:(P(t,0),c.events=um(i,c.events,c),c.events)}function h(I,M){return nI(p(I),M)}function p(I){return tI(o,I)}function m(){const{_bufferIndex:I,_index:M,line:O,column:z,offset:E}=r;return{_bufferIndex:I,_index:M,line:O,column:z,offset:E}}function y(I){s[I.line]=I.column,j()}function w(){let I;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<M.length;)g(M.charCodeAt(r._bufferIndex));else g(M)}}function g(I){u=u(I)}function x(I){Z(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,j()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=I}function v(I,M){const O=M||{};return O.type=I,O.start=m(),c.events.push(["enter",O,c]),a.push(O),O}function b(I){const M=a.pop();return M.end=m(),c.events.push(["exit",M,c]),M}function S(I,M){P(I,M.from)}function k(I,M){M.restore()}function T(I,M){return O;function O(z,E,F){let V,A,B,C;return Array.isArray(z)?q(z):"tokenize"in z?q([z]):$(z);function $(de){return jt;function jt(Ge){const Vt=Ge!==null&&de[Ge],vn=Ge!==null&&de.null,zn=[...Array.isArray(Vt)?Vt:Vt?[Vt]:[],...Array.isArray(vn)?vn:vn?[vn]:[]];return q(zn)(Ge)}}function q(de){return V=de,A=0,de.length===0?F:N(de[A])}function N(de){return jt;function jt(Ge){return C=R(),B=de,de.partial||(c.currentConstruct=de),de.name&&c.parser.constructs.disable.null.includes(de.name)?he():de.tokenize.call(M?Object.assign(Object.create(c),M):c,l,ce,he)(Ge)}}function ce(de){return I(B,C),E}function he(de){return C.restore(),++A<V.length?N(V[A]):F}}}function P(I,M){I.resolveAll&&!i.includes(I)&&i.push(I),I.resolve&&Ln(c.events,M,c.events.length-M,I.resolve(c.events.slice(M),c)),I.resolveTo&&(c.events=I.resolveTo(c.events,c))}function R(){const I=m(),M=c.previous,O=c.currentConstruct,z=c.events.length,E=Array.from(a);return{from:z,restore:F};function F(){r=I,c.previous=M,c.currentConstruct=O,c.events.length=z,a=E,j()}}function j(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function tI(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,i)];else{if(o=e.slice(n,s),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}i>0&&o.push(e[s].slice(0,i))}return o}function nI(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
59
59
  `;break}case-3:{o=`\r
60
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(i)}s=i===-2,r.push(o)}return r.join("")}function rI(e){const r={constructs:uR([ZN,...(e||{}).extensions||[]]),content:s(xR),defined:[],document:s(wR),flow:s(ON),lazy:{},string:s(BN),text:s(VN)};return r;function s(i){return o;function o(a){return eI(r,i,a)}}}function sI(e){for(;!Yb(e););return e}const ux=/[\0\t\n\r]/g;function iI(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let c,u,d,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(ux.lastIndex=d,c=ux.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(d);break}if(p===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(i.slice(d,h)),e+=h-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const oI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function aI(e){return e.replace(oI,lI)}function lI(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Gb(n.slice(i?2:1),i?16:10)}return cm(n)||e}const nk={}.hasOwnProperty;function cI(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),uI(n)(sI(rI(n).document().write(iI()(e,t,!0))))}function uI(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Fs),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(Ma),blockQuote:i(vn),characterEscape:R,characterReference:R,codeFenced:i(zn),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(zn,o),codeText:i(Ds,o),codeTextData:R,data:R,codeFlowValue:R,definition:i(Na),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Ia),hardBreakEscape:i(Ki),hardBreakTrailing:i(Ki),htmlFlow:i(Qi,o),htmlFlowData:R,htmlText:i(Qi,o),htmlTextData:R,image:i(ar),label:o,link:i(Fs),listItem:i(Du),listItemValue:h,listOrdered:i(wn,d),listUnordered:i(wn),paragraph:i(Aa),reference:N,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Ma),strong:i(Fu),thematicBreak:i(de)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:Vt,autolinkProtocol:He,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ue,characterReference:jt,codeFenced:l(w),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:l(g),codeText:l(E),codeTextData:j,data:j,definition:l(),definitionDestinationString:b,definitionLabelString:x,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(M),hardBreakTrailing:l(M),htmlFlow:l(O),htmlFlowData:j,htmlText:l(z),htmlTextData:j,image:l(V),label:B,labelText:A,lineEnding:I,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:le,resourceDestinationString:C,resourceTitleString:$,resource:Q,setextHeading:l(P),setextHeadingLineSequence:T,setextHeadingText:k,strong:l(),thematicBreak:l()}};rk(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let H={type:"root",children:[]};const Z={stack:[H],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},se=[];let he=-1;for(;++he<D.length;)if(D[he][1].type==="listOrdered"||D[he][1].type==="listUnordered")if(D[he][0]==="enter")se.push(he);else{const sn=se.pop();he=s(D,sn,he)}for(he=-1;++he<D.length;){const sn=t[D[he][0]];nk.call(sn,D[he][1].type)&&sn[D[he][1].type].call(Object.assign({sliceSerialize:D[he][2].sliceSerialize},Z),D[he][1])}if(Z.tokenStack.length>0){const sn=Z.tokenStack[Z.tokenStack.length-1];(sn[1]||dx).call(Z,void 0,sn[0])}for(H.position={start:cr(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:cr(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)H=t.transforms[he](H)||H;return H}function s(D,H,Z){let se=H-1,he=-1,sn=!1,ts,$n,qi,Yi;for(;++se<=Z;){const Et=D[se];switch(Et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Et[0]==="enter"?he++:he--,Yi=void 0;break}case"lineEndingBlank":{Et[0]==="enter"&&(ts&&!Yi&&!he&&!qi&&(qi=se),Yi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yi=void 0}if(!he&&Et[0]==="enter"&&Et[1].type==="listItemPrefix"||he===-1&&Et[0]==="exit"&&(Et[1].type==="listUnordered"||Et[1].type==="listOrdered")){if(ts){let Os=se;for($n=void 0;Os--;){const Bn=D[Os];if(Bn[1].type==="lineEnding"||Bn[1].type==="lineEndingBlank"){if(Bn[0]==="exit")continue;$n&&(D[$n][1].type="lineEndingBlank",sn=!0),Bn[1].type="lineEnding",$n=Os}else if(!(Bn[1].type==="linePrefix"||Bn[1].type==="blockQuotePrefix"||Bn[1].type==="blockQuotePrefixWhitespace"||Bn[1].type==="blockQuoteMarker"||Bn[1].type==="listItemIndent"))break}qi&&(!$n||qi<$n)&&(ts._spread=!0),ts.end=Object.assign({},$n?D[$n][1].start:Et[1].end),D.splice($n||se,0,["exit",ts,Et[2]]),se++,Z++}if(Et[1].type==="listItemPrefix"){const Os={type:"listItem",_spread:!1,start:Object.assign({},Et[1].start),end:void 0};ts=Os,D.splice(se,0,["enter",Os,Et[2]]),se++,Z++,qi=void 0,Yi=!0}}}return D[H][1]._spread=sn,Z}function i(D,H){return Z;function Z(se){a.call(this,D(se),se),H&&H.call(this,se)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(D,H,Z){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([H,Z||void 0]),D.position={start:cr(H.start),end:void 0}}function l(D){return H;function H(Z){D&&D.call(this,Z),c.call(this,Z)}}function c(D,H){const Z=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==D.type&&(H?H.call(this,D,se[0]):(se[1]||dx).call(this,D,se[0]));else throw new Error("Cannot close `"+D.type+"` ("+Ao({start:D.start,end:D.end})+"): it’s not open");Z.position.end=cr(D.end)}function u(){return lR(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(D){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function p(){const D=this.resume(),H=this.stack[this.stack.length-1];H.lang=D}function m(){const D=this.resume(),H=this.stack[this.stack.length-1];H.meta=D}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/(\r?\n|\r)$/g,"")}function x(D){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.label=H,Z.identifier=vi(this.sliceSerialize(D)).toLowerCase()}function v(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function b(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function S(D){const H=this.stack[this.stack.length-1];if(!H.depth){const Z=this.sliceSerialize(D).length;H.depth=Z}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function T(D){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function R(D){const Z=this.stack[this.stack.length-1].children;let se=Z[Z.length-1];(!se||se.type!=="text")&&(se=La(),se.position={start:cr(D.start),end:void 0},Z.push(se)),this.stack.push(se)}function j(D){const H=this.stack.pop();H.value+=this.sliceSerialize(D),H.position.end=cr(D.end)}function I(D){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Z=H.children[H.children.length-1];Z.position.end=cr(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(R.call(this,D),j.call(this,D))}function M(){this.data.atHardBreak=!0}function O(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function z(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function E(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function F(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function A(D){const H=this.sliceSerialize(D),Z=this.stack[this.stack.length-2];Z.label=aI(H),Z.identifier=vi(H).toLowerCase()}function B(){const D=this.stack[this.stack.length-1],H=this.resume(),Z=this.stack[this.stack.length-1];if(this.data.inReference=!0,Z.type==="link"){const se=D.children;Z.children=se}else Z.alt=H}function C(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function $(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function Q(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function le(D){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.label=H,Z.identifier=vi(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function fe(D){this.data.characterReferenceType=D.type}function ue(D){const H=this.sliceSerialize(D),Z=this.data.characterReferenceType;let se;Z?(se=Gb(H,Z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=cm(H);const he=this.stack[this.stack.length-1];he.value+=se}function jt(D){const H=this.stack.pop();H.position.end=cr(D.end)}function He(D){j.call(this,D);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(D)}function Vt(D){j.call(this,D);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(D)}function vn(){return{type:"blockquote",children:[]}}function zn(){return{type:"code",lang:null,meta:null,value:""}}function Ds(){return{type:"inlineCode",value:""}}function Na(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ia(){return{type:"emphasis",children:[]}}function Ma(){return{type:"heading",depth:0,children:[]}}function Ki(){return{type:"break"}}function Qi(){return{type:"html",value:""}}function ar(){return{type:"image",title:null,url:"",alt:null}}function Fs(){return{type:"link",title:null,url:"",children:[]}}function wn(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Du(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function Aa(){return{type:"paragraph",children:[]}}function Fu(){return{type:"strong",children:[]}}function La(){return{type:"text",value:""}}function de(){return{type:"thematicBreak"}}}function cr(e){return{line:e.line,column:e.column,offset:e.offset}}function rk(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?rk(e,r):dI(e,r)}}function dI(e,t){let n;for(n in t)if(nk.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 dx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ao({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ao({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ao({start:t.start,end:t.end})+") is still open")}function fI(e){const t=this;t.parser=n;function n(r){return cI(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hI(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 pI(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
60
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(i)}s=i===-2,r.push(o)}return r.join("")}function rI(e){const r={constructs:uR([ZN,...(e||{}).extensions||[]]),content:s(xR),defined:[],document:s(wR),flow:s(ON),lazy:{},string:s(BN),text:s(VN)};return r;function s(i){return o;function o(a){return eI(r,i,a)}}}function sI(e){for(;!Yb(e););return e}const ux=/[\0\t\n\r]/g;function iI(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let c,u,d,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(ux.lastIndex=d,c=ux.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(d);break}if(p===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(i.slice(d,h)),e+=h-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const oI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function aI(e){return e.replace(oI,lI)}function lI(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Gb(n.slice(i?2:1),i?16:10)}return cm(n)||e}const nk={}.hasOwnProperty;function cI(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),uI(n)(sI(rI(n).document().write(iI()(e,t,!0))))}function uI(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Fs),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(Ma),blockQuote:i(vn),characterEscape:R,characterReference:R,codeFenced:i(zn),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(zn,o),codeText:i(Ds,o),codeTextData:R,data:R,codeFlowValue:R,definition:i(Na),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Ia),hardBreakEscape:i(Ki),hardBreakTrailing:i(Ki),htmlFlow:i(Qi,o),htmlFlowData:R,htmlText:i(Qi,o),htmlTextData:R,image:i(ar),label:o,link:i(Fs),listItem:i(Du),listItemValue:h,listOrdered:i(wn,d),listUnordered:i(wn),paragraph:i(Aa),reference:N,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Ma),strong:i(Fu),thematicBreak:i(fe)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:Vt,autolinkProtocol:Ge,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:de,characterReference:jt,codeFenced:l(w),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:l(g),codeText:l(E),codeTextData:j,data:j,definition:l(),definitionDestinationString:b,definitionLabelString:x,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(M),hardBreakTrailing:l(M),htmlFlow:l(O),htmlFlowData:j,htmlText:l(z),htmlTextData:j,image:l(V),label:B,labelText:A,lineEnding:I,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:C,resourceTitleString:$,resource:q,setextHeading:l(P),setextHeadingLineSequence:T,setextHeadingText:k,strong:l(),thematicBreak:l()}};rk(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let H={type:"root",children:[]};const ee={stack:[H],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},ie=[];let pe=-1;for(;++pe<D.length;)if(D[pe][1].type==="listOrdered"||D[pe][1].type==="listUnordered")if(D[pe][0]==="enter")ie.push(pe);else{const sn=ie.pop();pe=s(D,sn,pe)}for(pe=-1;++pe<D.length;){const sn=t[D[pe][0]];nk.call(sn,D[pe][1].type)&&sn[D[pe][1].type].call(Object.assign({sliceSerialize:D[pe][2].sliceSerialize},ee),D[pe][1])}if(ee.tokenStack.length>0){const sn=ee.tokenStack[ee.tokenStack.length-1];(sn[1]||dx).call(ee,void 0,sn[0])}for(H.position={start:cr(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:cr(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)H=t.transforms[pe](H)||H;return H}function s(D,H,ee){let ie=H-1,pe=-1,sn=!1,ts,$n,qi,Yi;for(;++ie<=ee;){const Et=D[ie];switch(Et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Et[0]==="enter"?pe++:pe--,Yi=void 0;break}case"lineEndingBlank":{Et[0]==="enter"&&(ts&&!Yi&&!pe&&!qi&&(qi=ie),Yi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yi=void 0}if(!pe&&Et[0]==="enter"&&Et[1].type==="listItemPrefix"||pe===-1&&Et[0]==="exit"&&(Et[1].type==="listUnordered"||Et[1].type==="listOrdered")){if(ts){let Os=ie;for($n=void 0;Os--;){const Bn=D[Os];if(Bn[1].type==="lineEnding"||Bn[1].type==="lineEndingBlank"){if(Bn[0]==="exit")continue;$n&&(D[$n][1].type="lineEndingBlank",sn=!0),Bn[1].type="lineEnding",$n=Os}else if(!(Bn[1].type==="linePrefix"||Bn[1].type==="blockQuotePrefix"||Bn[1].type==="blockQuotePrefixWhitespace"||Bn[1].type==="blockQuoteMarker"||Bn[1].type==="listItemIndent"))break}qi&&(!$n||qi<$n)&&(ts._spread=!0),ts.end=Object.assign({},$n?D[$n][1].start:Et[1].end),D.splice($n||ie,0,["exit",ts,Et[2]]),ie++,ee++}if(Et[1].type==="listItemPrefix"){const Os={type:"listItem",_spread:!1,start:Object.assign({},Et[1].start),end:void 0};ts=Os,D.splice(ie,0,["enter",Os,Et[2]]),ie++,ee++,qi=void 0,Yi=!0}}}return D[H][1]._spread=sn,ee}function i(D,H){return ee;function ee(ie){a.call(this,D(ie),ie),H&&H.call(this,ie)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(D,H,ee){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([H,ee||void 0]),D.position={start:cr(H.start),end:void 0}}function l(D){return H;function H(ee){D&&D.call(this,ee),c.call(this,ee)}}function c(D,H){const ee=this.stack.pop(),ie=this.tokenStack.pop();if(ie)ie[0].type!==D.type&&(H?H.call(this,D,ie[0]):(ie[1]||dx).call(this,D,ie[0]));else throw new Error("Cannot close `"+D.type+"` ("+Ao({start:D.start,end:D.end})+"): it’s not open");ee.position.end=cr(D.end)}function u(){return lR(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(D){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function p(){const D=this.resume(),H=this.stack[this.stack.length-1];H.lang=D}function m(){const D=this.resume(),H=this.stack[this.stack.length-1];H.meta=D}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/(\r?\n|\r)$/g,"")}function x(D){const H=this.resume(),ee=this.stack[this.stack.length-1];ee.label=H,ee.identifier=vi(this.sliceSerialize(D)).toLowerCase()}function v(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function b(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function S(D){const H=this.stack[this.stack.length-1];if(!H.depth){const ee=this.sliceSerialize(D).length;H.depth=ee}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function T(D){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function R(D){const ee=this.stack[this.stack.length-1].children;let ie=ee[ee.length-1];(!ie||ie.type!=="text")&&(ie=La(),ie.position={start:cr(D.start),end:void 0},ee.push(ie)),this.stack.push(ie)}function j(D){const H=this.stack.pop();H.value+=this.sliceSerialize(D),H.position.end=cr(D.end)}function I(D){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=H.children[H.children.length-1];ee.position.end=cr(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(R.call(this,D),j.call(this,D))}function M(){this.data.atHardBreak=!0}function O(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function z(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function E(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function F(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function A(D){const H=this.sliceSerialize(D),ee=this.stack[this.stack.length-2];ee.label=aI(H),ee.identifier=vi(H).toLowerCase()}function B(){const D=this.stack[this.stack.length-1],H=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const ie=D.children;ee.children=ie}else ee.alt=H}function C(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function $(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function q(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ce(D){const H=this.resume(),ee=this.stack[this.stack.length-1];ee.label=H,ee.identifier=vi(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function he(D){this.data.characterReferenceType=D.type}function de(D){const H=this.sliceSerialize(D),ee=this.data.characterReferenceType;let ie;ee?(ie=Gb(H,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ie=cm(H);const pe=this.stack[this.stack.length-1];pe.value+=ie}function jt(D){const H=this.stack.pop();H.position.end=cr(D.end)}function Ge(D){j.call(this,D);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(D)}function Vt(D){j.call(this,D);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(D)}function vn(){return{type:"blockquote",children:[]}}function zn(){return{type:"code",lang:null,meta:null,value:""}}function Ds(){return{type:"inlineCode",value:""}}function Na(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ia(){return{type:"emphasis",children:[]}}function Ma(){return{type:"heading",depth:0,children:[]}}function Ki(){return{type:"break"}}function Qi(){return{type:"html",value:""}}function ar(){return{type:"image",title:null,url:"",alt:null}}function Fs(){return{type:"link",title:null,url:"",children:[]}}function wn(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Du(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function Aa(){return{type:"paragraph",children:[]}}function Fu(){return{type:"strong",children:[]}}function La(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function cr(e){return{line:e.line,column:e.column,offset:e.offset}}function rk(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?rk(e,r):dI(e,r)}}function dI(e,t){let n;for(n in t)if(nk.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 dx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ao({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ao({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ao({start:t.start,end:t.end})+") is still open")}function fI(e){const t=this;t.parser=n;function n(r){return cI(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hI(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 pI(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
61
61
  `}]}function mI(e,t){const n=t.value?t.value+`
62
62
  `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function gI(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yI(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xI(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=$i(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function vI(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 wI(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function sk(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 s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function bI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sk(e,t);const s={src:$i(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function kI(e,t){const n={src:$i(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 _I(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 SI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sk(e,t);const s={href:$i(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function CI(e,t){const n={href:$i(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 PI(e,t,n){const r=e.all(t),s=n?jI(n):ik(t),i={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(s||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
63
63
  `}),u.type==="element"&&u.tagName==="p"&&!s?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
@@ -67,7 +67,7 @@ Error generating stack: `+i.message+`
67
67
  `});++r<e.length;)r&&n.push({type:"text",value:`
68
68
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
69
69
  `}),n}function vx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function wx(e,t){const n=rM(e,t),r=n.one(e,void 0),s=GI(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
70
- `},s),i}function lM(e,t){return e&&"run"in e?async function(n,r){const s=wx(n,{file:r,...t});await e.run(s,r)}:function(n,r){return wx(n,{file:r,...e||t})}}function bx(e){if(e)throw e}var Vl=Object.prototype.hasOwnProperty,fk=Object.prototype.toString,kx=Object.defineProperty,_x=Object.getOwnPropertyDescriptor,Sx=function(t){return typeof Array.isArray=="function"?Array.isArray(t):fk.call(t)==="[object Array]"},Cx=function(t){if(!t||fk.call(t)!=="[object Object]")return!1;var n=Vl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Vl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||Vl.call(t,s)},Px=function(t,n){kx&&n.name==="__proto__"?kx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},jx=function(t,n){if(n==="__proto__")if(Vl.call(t,n)){if(_x)return _x(t,n).value}else return;return t[n]},cM=function e(){var t,n,r,s,i,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=jx(a,n),s=jx(t,n),a!==s&&(u&&s&&(Cx(s)||(i=Sx(s)))?(i?(i=!1,o=r&&Sx(r)?r:[]):o=r&&Cx(r)?r:{},Px(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&Px(a,{name:n,newValue:s}));return a};const _d=qc(cM);function wh(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 uM(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(l,...c){const u=e[++i];let d=-1;if(l){o(l);return}for(;++d<s.length;)(c[d]===null||c[d]===void 0)&&(c[d]=s[d]);s=c,u?dM(u,a)(...c):o(null,...c)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function dM(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(s);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return s(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(o,...a){n||(n=!0,t(o,...a))}function i(o){s(null,o)}}const Pn={basename:fM,dirname:hM,extname:pM,join:mM,sep:"/"};function fM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');wa(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else o<0&&(i=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(r=s):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function hM(e){if(wa(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 pM(e){wa(e);let t=e.length,n=-1,r=0,s=-1,i=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function mM(...e){let t=-1,n;for(;++t<e.length;)wa(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":gM(n)}function gM(e){wa(e);const t=e.codePointAt(0)===47;let n=yM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yM(e,t){let n="",r=0,s=-1,i=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||i===1))if(s!==o-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=o,i=0;continue}}else if(n.length>0){n="",r=0,s=o,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,i=0}else a===46&&i>-1?i++:i=-1}return n}function wa(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xM={cwd:vM};function vM(){return"/"}function bh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function wM(e){if(typeof e=="string")e=new URL(e);else if(!bh(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 bM(e)}function bM(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Sd=["history","path","basename","stem","extname","dirname"];class hk{constructor(t){let n;t?bh(t)?n={path:t}:typeof t=="string"||kM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Sd.length;){const i=Sd[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)Sd.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Pn.basename(this.path):void 0}set basename(t){Pd(t,"basename"),Cd(t,"basename"),this.path=Pn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Pn.dirname(this.path):void 0}set dirname(t){Ex(this.basename,"dirname"),this.path=Pn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Pn.extname(this.path):void 0}set extname(t){if(Cd(t,"extname"),Ex(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=Pn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){bh(t)&&(t=wM(t)),Pd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Pn.basename(this.path,this.extname):void 0}set stem(t){Pd(t,"stem"),Cd(t,"stem"),this.path=Pn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new ot(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Cd(e,t){if(e&&e.includes(Pn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Pn.sep+"`")}function Pd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ex(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function kM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _M=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},SM={}.hasOwnProperty;class gm extends _M{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=uM()}copy(){const t=new gm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(_d(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Td("data",this.frozen),this.namespace[t]=n,this):SM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Td("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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=il(t),r=this.parser||this.Parser;return jd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),jd("process",this.parser||this.Parser),Ed("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=il(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const p=d,m=r.stringify(p,h);jM(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?o(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),jd("processSync",this.parser||this.Parser),Ed("processSync",this.compiler||this.Compiler),this.process(t,s),Rx("processSync","process",n),r;function s(i,o){n=!0,bx(i),r=o}}run(t,n,r){Tx(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(o,a){const l=il(n);s.run(t,l,c);function c(u,d,h){const p=d||t;u?a(u):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),Rx("runSync","run",r),s;function i(o,a){bx(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=il(n),s=this.compiler||this.Compiler;return Ed("stringify",s),Tx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Td("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))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");a(c.plugins),c.settings&&(s.settings=_d(!0,s.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const y=r[h][1];wh(y)&&wh(p)&&(p=_d(!0,y,p)),r[h]=[c,p,...m]}}}}const CM=new gm().freeze();function jd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ed(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Td(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 Tx(e){if(!wh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Rx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function il(e){return PM(e)?e:new hk(e)}function PM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jM(e){return typeof e=="string"||EM(e)}function EM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nx=[],Ix={allowDangerousHtml:!0},RM=/^(https?|ircs?|mailto|xmpp)$/i,NM=[{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 IM(e){const t=MM(e),n=AM(e);return LM(t.runSync(t.parse(n),n),e)}function MM(e){const t=e.rehypePlugins||Nx,n=e.remarkPlugins||Nx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ix}:Ix;return CM().use(fI).use(n).use(lM,r).use(t)}function AM(e){const t=e.children||"",n=new hk;return typeof t=="string"&&(n.value=t),n}function LM(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||DM;for(const u of NM)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+TM+u.id,void 0);return dk(e,c),H2(e,{Fragment:f.Fragment,components:s,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return o?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in wd)if(Object.hasOwn(wd,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],y=wd[p];(y===null||y.includes(u.tagName))&&(u.properties[p]=l(String(m||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(u,d,h)),p&&h&&typeof d=="number")return a&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function DM(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||RM.test(e.slice(0,t))?e:""}const Rd=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,FM={p:({children:e})=>f.jsx("p",{className:"mb-4",children:e}),strong:({children:e})=>f.jsx("strong",{className:"font-bold",children:e}),h1:({children:e})=>f.jsx("h1",{className:Rd("text-lg"),children:e}),h2:({children:e})=>f.jsx("h2",{className:Rd("text-[1.3rem]"),children:e}),h3:({children:e})=>f.jsx("h3",{className:Rd("text-[1.1rem]"),children:e}),a:({children:e,href:t})=>f.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-watercolor-amber-dark",children:e}),code:({children:e})=>f.jsx("code",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-[3px] py-[0.1em] px-[0.35em]",children:e}),pre:({children:e})=>f.jsx("pre",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-md py-3 px-4 overflow-x-auto mb-4",children:e}),ul:({children:e})=>f.jsx("ul",{className:"list-disc mb-4 pl-[1.4rem]",children:e}),ol:({children:e})=>f.jsx("ol",{className:"list-decimal mb-4 pl-[1.4rem]",children:e}),li:({children:e})=>f.jsx("li",{className:"mb-[0.4rem]",children:e}),blockquote:({children:e})=>f.jsx("blockquote",{className:"mb-4 pl-4 border-l-[3px] border-solid border-black/[15%] opacity-[0.85]",children:e})},pk=({children:e})=>f.jsx(IM,{components:FM,children:e}),OM={},Mx=e=>{let t;const n=new Set,r=(u,d)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const p=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(OM?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,s,l);return l},zM=e=>e?Mx(e):Mx,mk={},{useDebugValue:$M}=bi,{useSyncExternalStoreWithSelector:BM}=yT;let Ax=!1;const VM=e=>e;function UM(e,t=VM,n){(mk?"production":void 0)!=="production"&&n&&!Ax&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ax=!0);const r=BM(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return $M(r),r}const WM=e=>{(mk?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?zM(e):e,n=(r,s)=>UM(t,r,s);return Object.assign(n,t),n},HM=e=>WM;let gk="";function GM(e){gk=e}function Ze(e){return`${gk}${e}`}const yk=async()=>{const e=await fetch(Ze("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},KM=async()=>{const e=await fetch(Ze("/api/agent/auth-status"));return e.ok?await e.json():null},W9=async()=>{try{const e=await fetch(Ze("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},H9=async e=>{try{const t=await fetch(`/api/connections/connect?id=${encodeURIComponent(e)}`,{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},xk=async()=>{try{const e=await fetch(Ze("/api/config"));return e.ok?e.json():null}catch{return null}},G9=async e=>{try{const t=await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)return{ok:!0};const n=await t.json().catch(()=>null);return{ok:!1,error:n==null?void 0:n.error}}catch(t){return{ok:!1,error:t.message}}},QM=async()=>{try{const e=await fetch("/api/icon");if(!e.ok)return null;const t=await e.blob();return new Promise(n=>{const r=new FileReader;r.onloadend=()=>n(r.result),r.readAsDataURL(t)})}catch{return null}},K9=async e=>{try{return(await fetch("/api/icon",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},qM=async()=>{try{const e=await fetch("/api/package-name");return e.ok?e.json():null}catch{return null}},On=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},YM=async()=>(await fetch(Ze("/api/agent/status"))).json(),XM=async()=>(await fetch("/api/agent/reconcile-queue")).json(),JM=async(e,t)=>{const n=await fetch(Ze("/api/agent/launch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await On(n)},ZM=async(e,t)=>{const n=await fetch("/api/agent/launch-audit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await On(n)},eA=async(e,t)=>{const n=await fetch("/api/agent/launch-reconcile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await On(n)},tA=async(e,t)=>{const n=await fetch("/api/agent/launch-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await On(n)},nA=async(e,t)=>{const n=await fetch("/api/agent/launch-extend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await On(n)},rA=async e=>{const t=await fetch("/api/agent/launch-suggest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await On(t)},sA=async()=>{const e=await fetch("/api/agent/launch-reconcile-all",{method:"POST"});await On(e)},iA=async e=>{const t=await fetch("/api/agent/launch-run-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await On(t)},oA=async e=>{const t=await fetch("/api/agent/launch-fix-review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await On(t)},aA=async(e,t,n)=>{const r=await fetch("/api/agent/feedback-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,text:t,context:n})}),s=await r.json();if(!r.ok)throw new Error(s.error??"Failed to send message");return s},Lx=async(e,t,n,r)=>{const s=await fetch("/api/agent/feedback-promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,index:t,target:n,note:r})});if(!s.ok){const i=await s.json().catch(()=>null);throw new Error((i==null?void 0:i.error)??`Failed to promote message (${s.status})`)}},lA=async e=>{const t=await fetch("/api/agent/feedback-summarize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)??`Failed to summarize feedback (${t.status})`);return n},cA=async(e,t)=>{const n=await fetch("/api/agent/feedback-undo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,commitSha:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to undo edit");return r},uA=async e=>{const t=await fetch(Ze("/api/agent/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await On(t,"Stop failed")},dA=async()=>(await fetch("/api/agent/login-relay/start",{method:"POST"})).json(),fA=async()=>(await fetch("/api/agent/login-relay/status")).json(),hA=async()=>{await fetch("/api/agent/login-relay/cancel",{method:"POST"})};function Jt(e,t,n,r=()=>({}),s){return async()=>{s&&e({[s]:!0});try{const i=await t();e({...n(i),...s&&{[s]:!1}})}catch(i){e({...r(i),...s&&{[s]:!1}})}}}function ur(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let pA=0;const Dx=()=>`preview-${++pA}`;function mA(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:Jt(e,KM,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await YM();e({agentStatus:n});const r=t().pendingReconcile,s=r?n.find(o=>o.taskKind==="reconcile"&&o.planId===r.planId):void 0;r&&s&&(s.status==="done"?(await t().loadPlans(),e(o=>({reconcileQueue:[...o.reconcileQueue,{...r,previewId:Dx()}],pendingReconcile:null}))):s.status==="error"&&e({pendingReconcile:null}));const i=n.find(o=>o.taskKind==="batch-reconcile");if((i==null?void 0:i.status)==="done"&&!t().batchReconcileConsumed){const o=await XM();o&&o.length>0&&(await t().loadPlans(),e(a=>({reconcileQueue:[...a.reconcileQueue,...o.map(l=>({planId:l.planId,before:l.before,previewId:Dx()}))]}))),e({batchReconcileConsumed:!0})}}catch{}},launchAgent:ur(t,JM),launchPlanAudit:ur(t,ZM),launchPlanReconcile:async(n,r,s)=>{const i=t().pendingReconcile;if(i)throw new Error(i.planId===n?"A reconcile is already in progress for this plan":"A reconcile is already in progress for another plan");if(t().reconcileQueue.some(o=>o.planId===n))throw new Error("Review the pending reconcile for this plan first");e({pendingReconcile:{planId:n,before:s}});try{await eA(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:ur(t,tA),launchIdeaExtend:ur(t,nA),launchBatchReconcile:ur(t,async()=>{e({batchReconcileConsumed:!1}),await sA()}),launchSuggestIdeas:ur(t,rA),launchRunAll:ur(t,iA),launchFixReview:ur(t,oA),stopAgent:async n=>{try{await uA(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await dA();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:Jt(e,fA,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await hA()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}const gA=async()=>(await fetch("/api/tasks")).json(),Q9=async e=>{const t=await fetch(`/api/tasks/output?id=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},yA=async()=>(await fetch("/api/suggestions")).json(),xA=async e=>{const t=await fetch("/api/suggestions/promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to promote suggestion"}));throw new Error(n.error)}return t.json()},vA=async e=>{const t=await fetch("/api/suggestions/dismiss",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to dismiss suggestion"}));throw new Error(n.error)}},wA=async()=>(await fetch("/api/docs")).json(),vk=async()=>{const e=await fetch("/api/roadmap");if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},bA=async(e,t,n,r)=>{const s=await fetch("/api/roadmap/promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,item:t,subject:n,candidateName:r})});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to promote roadmap item"}));throw new Error(i.error)}return s.json()},q9=async(e,t,n)=>{const r=await fetch("/api/roadmap/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,name:t,description:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap item"}));throw new Error(s.error)}},Y9=async(e,t,n)=>{const r=await fetch("/api/roadmap/candidates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,itemName:t,name:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap candidate"}));throw new Error(s.error)}},kA=async()=>(await fetch("/api/consistency")).json(),wk=async()=>(await fetch("/api/ideas")).json(),_A=async()=>(await fetch("/api/archivable-ideas")).json(),SA=async e=>{const t=await fetch("/api/ideas/archive",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to archive ideas");return n},bk=async e=>{const t=await fetch(Ze("/api/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create idea");return n.id},kk=async(e,t)=>{const n=await fetch("/api/ideas/check-overlap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e,candidates:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to check overlap");return r},CA=async()=>{const e=await fetch("/api/ideas/prioritise",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},PA=async()=>{const e=await fetch("/api/parked-questions");if(!e.ok)throw new Error(`Failed to fetch parked questions: ${e.status}`);return e.json()},_k=async()=>(await fetch(Ze("/api/plans"))).json(),jA=async e=>{await fetch("/api/plans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},EA=async(e,t)=>{const n=await fetch(`/api/plans?title=${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>null);throw new Error((r==null?void 0:r.error)??`Failed to update plan (${n.status})`)}},TA=async()=>{const e=await fetch("/api/releases");if(!e.ok)throw new Error("Failed to load releases");const{versions:t}=await e.json();return t},X9=async e=>{const t=await fetch(`/api/release-notes?version=${encodeURIComponent(e)}`);if(!t.ok)throw new Error("Failed to load release notes");return t.json()};function RA(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await wA();e({repoDocs:n.files,repoDocsLoading:!1});const{activeDocTitle:r}=t();if(!r){const s=["MAIN.md","README.md"].find(i=>n.files.some(o=>o.name===i));s&&e({activeDocTitle:s})}}catch{e({repoDocs:[],repoDocsLoading:!1})}},activeDocTitle:null,setActiveDocTitle:n=>e({activeDocTitle:n}),docSearchQuery:"",setDocSearchQuery:n=>e({docSearchQuery:n}),releaseVersions:[],releaseVersionsLoading:!0,loadReleaseVersions:async()=>{e({releaseVersionsLoading:!0});try{const n=await TA();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}function NA(e,t){return{ideaEntries:[],loadIdeas:Jt(e,wk,n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:Jt(e,_A,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await SA(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function IA(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:Jt(e,PA,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const Ic=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=Math.floor((Date.now()-t.getTime())/864e5);return n<=0?"today":n===1?"yesterday":n<7?`${n}d ago`:n<30?`${Math.floor(n/7)}w ago`:n<365?`${Math.floor(n/30)}mo ago`:`${Math.floor(n/365)}y ago`},Sk=e=>{if(e.length===0)return null;const t=e.filter(n=>n.done).length;return{done:t,total:e.length,pct:Math.round(t/e.length*100)}},Ck=e=>Sk(e.phases),Fx=e=>{var t;return((t=Ck(e))==null?void 0:t.pct)??null},MA=e=>Sk([...e.phases,...e.fixes??[]]),AA=(e,t)=>{const n=MA(e);if(!n)return null;const r=Math.min(n.total,n.done+t);return{done:n.done,total:n.total,pct:r/n.total*100}},ym=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,xm=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:ym(e.id,t)?"in-progress":e.status,LA=e=>!e.pr&&e.status!=="done"&&e.status!=="dropped"&&e.status!=="review"&&e.phases.length>0&&e.phases.every(t=>t.done)&&(e.fixes??[]).every(t=>t.done),DA=(e,t)=>{if(e)return e.find(n=>n.status==="in-progress"||n.status==="review")};function Nd(e,t){const n=e.split(/(\s+)/).filter(u=>u!==""),r=t.split(/(\s+)/).filter(u=>u!==""),s=n.length,i=r.length,o=Array.from({length:s+1},()=>new Array(i+1).fill(0));for(let u=s-1;u>=0;u--)for(let d=i-1;d>=0;d--)o[u][d]=n[u]===r[d]?o[u+1][d+1]+1:Math.max(o[u+1][d],o[u][d+1]);const a=[];let l=0,c=0;for(;l<s&&c<i;)n[l]===r[c]?(a.push({type:"same",text:n[l]}),l++,c++):o[l+1][c]>=o[l][c+1]?(a.push({type:"removed",text:n[l]}),l++):(a.push({type:"added",text:r[c]}),c++);for(;l<s;)a.push({type:"removed",text:n[l]}),l++;for(;c<i;)a.push({type:"added",text:r[c]}),c++;return FA(a)}function FA(e){const t=[];for(const n of e){const r=t[t.length-1];r&&r.type===n.type?r.text+=n.text:t.push({...n})}return t}const OA=["idea","planned","in-progress","review","done","dropped"],zA=["feat","fix","chore","docs","refactor"],J9=["claude-code","opencode"],$A={"claude-code":"Claude Code",opencode:"OpenCode"},Z9={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},eH={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"}},BA=["in-progress","review","planned","idea"],VA=["open"],vm={statuses:BA,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:VA,subject:null},Ox={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},ol=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},zx=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},$x=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},Id=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},Bx=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),Fo=(e,t)=>t===null||e===t,wm=(e,t,n,r="asc")=>{if(n==="order")return e.order!==void 0&&t.order!==void 0?(r==="desc"?-1:1)*(e.order-t.order):e.order!==void 0?-1:t.order!==void 0?1:zx(e)-zx(t);const s=(()=>{switch(n){case"status":{const i=Ox[e.status]-Ox[t.status];return i!==0?i:ol(t)-ol(e)}case"updated":return ol(t)-ol(e);case"title":return e.title.localeCompare(t.title);case"id":return $x(e)-$x(t);case"progress":return(Fx(t)??-1)-(Fx(e)??-1);default:return 0}})();return r==="desc"?-s:s},kh=(e,t)=>{const n={};for(const r of e)for(const s of t(r))n[String(s)]=(n[String(s)]??0)+1;return n},Ul=(e,t=vm)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=kh(e.filter(a=>Bx(a,n)&&Id(a,t.search)&&Fo(a.subject,t.subject)),a=>[a.status]);for(const a of OA)s[a]??(s[a]=0);const i=kh(e.filter(a=>r.has(a.status)&&Id(a,t.search)&&Fo(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&Bx(a,n)&&Id(a,t.search)&&Fo(a.subject,t.subject)).sort((a,l)=>wm(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},UA=["open","done","dropped"],WA={open:"idea",done:"done",dropped:"dropped"},Md=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},HA=e=>e.type==="plan"?e.plan.subject:e.idea.subject,GA=e=>e.type==="plan"?e.plan.order:e.idea.order,KA=e=>{const t=e.type==="plan"?e.plan.updated??e.plan.created:e.idea.created,n=new Date(t??"").getTime();return Number.isNaN(n)?0:n},Vx=(e,t)=>e.reduce((n,r)=>{const s=GA(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),Ux=e=>e.reduce((t,n)=>Math.max(t,KA(n)),0),QA=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=HA(l);if(!c||n&&!n.includes(c)){s.push(l);continue}r.has(c)||r.set(c,[]),(a=r.get(c))==null||a.push(l)}const i=t==="desc"?-1:1,o=[...r.entries()].map(([l,c])=>({subject:l,rows:c})).sort((l,c)=>{const u=Vx(l.rows,t),d=Vx(c.rows,t);return u!==void 0&&d!==void 0?i*(u-d):u!==void 0?-1:d!==void 0?1:Ux(c.rows)-Ux(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},Wx=e=>e.type==="plan"?e.plan:e.type==="note"?{title:e.idea.title,id:e.idea.id??void 0,status:WA[e.idea.status??"open"],created:e.idea.created??"",tags:[],body:e.idea.body,phases:[],order:e.idea.order}:{...(e.children.length>0?[...e.children].sort((n,r)=>wm(n,r,"status"))[0]:void 0)??{status:"idea",created:e.idea.created??"",tags:[],body:e.idea.body,phases:[]},title:e.idea.title,id:e.idea.id??void 0,order:e.idea.order},qA=(e,t,n=vm)=>{const{statusCounts:r,tagCounts:s}=Ul(e,n),i=t.filter(p=>p.kind==="note"),o=t.filter(p=>p.kind!=="note"),a=new Set(o.map(p=>p.id).filter(p=>!!p)),l=new Map,c=[];for(const p of e)if(p.idea&&a.has(p.idea)){const m=l.get(p.idea)??[];m.push(p),l.set(p.idea,m)}else c.push(p);const u=new Set(n.noteStatuses),d=kh(i.filter(p=>Md(p,n.search)),p=>[p.status??"open"]);for(const p of UA)d[p]??(d[p]=0);const h=Ul(c,n).rows.map(p=>({type:"plan",plan:p}));for(const p of o){const m=p.id?l.get(p.id)??[]:[],y=Ul(m,n).rows;!Fo(p.subject,n.subject)&&y.length===0||y.length===0&&(m.length>0||!Md(p,n.search))||h.push({type:"idea-group",idea:p,children:y})}for(const p of i)u.has(p.status??"open")&&Md(p,n.search)&&Fo(p.subject,n.subject)&&h.push({type:"note",idea:p});return h.sort((p,m)=>wm(Wx(p),Wx(m),n.sortKey,n.sortDirection)),{rows:h,statusCounts:r,tagCounts:s,noteStatusCounts:d}},YA=.2,XA=5,Pk=3,jk=2,Ek=1,JA=Pk+jk+Ek,ZA=new Set(["a","an","the","and","or","of","to","in","on","for","is","at","with","this","that","it","as","be","by","are","was","were","from","into","so","but","not","its"]),al=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!ZA.has(n));return new Set(t)},Ad=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function eL(e,t,n={}){const{threshold:r=YA,limit:s=XA}=n,i=al(e);if(i.size===0)return[];const o=[];for(const a of t){const l=al(a.title),c=al(a.body),u=al((a.tags??[]).join(" ")),h=(Ad(i,l)*Pk+Ad(i,u)*jk+Ad(i,c)*Ek)/(i.size*JA);h>=r&&o.push({candidate:a,score:h})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const tL=e=>{if(!e.file)return;const t=e.line_start??e.line;if(!t)return e.file;const n=e.line_end&&e.line_end!==t?`-${e.line_end}`:"";return`${e.file}:${t}${n}`},nL=(e,t)=>{const n=e.description??e.title??e.summary;if(!(n!=null&&n.trim()))throw new Error(`Finding ${t+1} has no description/title/summary`);const r=[tL(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},rL=e=>{let t;try{t=JSON.parse(e)}catch{throw new Error("Not valid JSON")}const n=Array.isArray(t)?t:Array.isArray(t==null?void 0:t.findings)?t.findings:null;if(!n)throw new Error('Expected a JSON array of findings, or an object with a "findings" array');if(n.length===0)throw new Error("No findings to add");return n.map((r,s)=>nL(r,s))};function sL(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:Jt(e,_k,n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:vm,togglePlanStatus:n=>e(r=>({planFilters:{...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]}})),togglePlanTag:n=>e(r=>({planFilters:{...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]}})),toggleNoteStatus:n=>e(r=>({planFilters:{...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]}})),setPlanSearch:n=>e(r=>({planFilters:{...r.planFilters,search:n}})),setSubjectFilter:n=>e(r=>({planFilters:{...r.planFilters,subject:n}})),setPlanSortKey:n=>e(r=>({planFilters:{...r.planFilters,sortKey:n}})),togglePlanSortDirection:()=>e(n=>({planFilters:{...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc"}})),detailView:"details",setDetailView:n=>e({detailView:n})}}const iL={horizons:[],statuses:[]},oL=e=>[...new Set(e.links.map(t=>t.status))],Tk=(e,t)=>t.length===0||e.links.some(n=>t.includes(n.status)),Rk=(e,t)=>t.length===0||t.includes(e),tH=(e,t)=>e.horizons.filter(n=>Rk(n.title,t.horizons)).map(n=>({...n,items:n.items.filter(r=>Tk(r,t.statuses))})),nH=(e,t)=>Object.fromEntries(e.horizons.map(n=>[n.title,n.items.filter(r=>Tk(r,t.statuses)).length])),rH=(e,t)=>{const n={};for(const r of e.horizons)if(Rk(r.title,t.horizons))for(const s of r.items)for(const i of oL(s))n[i]=(n[i]??0)+1;return n};function aL(e,t){return{roadmap:null,roadmapLoading:!1,roadmapError:null,loadRoadmap:Jt(e,vk,n=>({roadmap:n,roadmapError:null}),n=>({roadmapError:String(n)}),"roadmapLoading"),roadmapFilters:iL,toggleRoadmapHorizon:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,horizons:r.roadmapFilters.horizons.includes(n)?r.roadmapFilters.horizons.filter(s=>s!==n):[...r.roadmapFilters.horizons,n]}})),toggleRoadmapStatus:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,statuses:r.roadmapFilters.statuses.includes(n)?r.roadmapFilters.statuses.filter(s=>s!==n):[...r.roadmapFilters.statuses,n]}}))}}async function Xr(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const lL=async()=>{const e=await fetch(Ze("/api/git/status"));return await Xr(e,"Failed to load git status"),e.json()},sH=async()=>{const e=await fetch(Ze("/api/git/diff"));return await Xr(e,"Failed to load diff"),(await e.json()).files},Nk=async(e,t,n)=>{const r=await fetch(Ze("/api/git/commit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n})});await Xr(r,"Commit failed")},cL=async()=>{const e=await fetch(Ze("/api/git/push"),{method:"POST"});await Xr(e,"Push failed")},Ik=async e=>{const t=await fetch(Ze("/api/git/suggest-commit-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await Xr(t,"Failed to suggest a commit message"),t.json()},uL=async()=>{const e=await fetch(Ze("/api/git/sync"),{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Xr(e,"Sync failed"),{ok:!0}},dL=async()=>{const e=await fetch(Ze("/api/git/pull"),{method:"POST"});await Xr(e,"Pull failed")},fL=async()=>{const e=await fetch("/api/git/fix-divergence",{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Xr(e,"Fix failed"),{ok:!0}},hL=async e=>{const t=await fetch("/api/git/resolve-conflict",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});try{return await t.json()}catch{return{ok:!1,error:`Unexpected response (status ${t.status})`}}},pL=async e=>{const t=await fetch("/api/git/branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return n.branch},mL=async()=>(await fetch(Ze("/api/status"))).json(),gL=async e=>{await fetch(`/api/status/check?name=${e}`,{method:"POST"})},yL=async()=>{await fetch("/api/status/fix",{method:"POST"})},xL=async()=>{const e=await fetch("/api/refresh",{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function vL(e,t){return{status:null,refreshing:!1,loadStatus:Jt(e,mL,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await xL().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadGitStatus(),t().loadAgentStatus(),t().loadAgentAuthStatus()]);const n=t().plansError;return n?{ok:!1,error:n}:{ok:!0}}finally{e({refreshing:!1})}},runCheck:async n=>{try{await gL(n)}catch{}},fixQuality:async()=>{try{await yL()}catch{}},commitInFlight:!1,setCommitInFlight:n=>e({commitInFlight:n}),activeGitAction:null,setActiveGitAction:n=>e({activeGitAction:n}),quickCommit:async()=>{const{gitStatus:n,loadGitStatus:r,commitInFlight:s}=t();if(s)return{ok:!1,error:"A commit is already in progress"};if(!n||n.length===0)return{ok:!1,error:"Nothing to commit"};const i=n.map(o=>o.path);e({commitInFlight:!0});try{const{title:o,message:a}=await Ik(i);return await Nk(i,o,a||void 0),await r()?{ok:!0,title:o}:{ok:!0,title:o,warning:"Committed, but the git status refresh failed — reload to confirm"}}catch(o){return{ok:!1,error:o.message}}finally{e({commitInFlight:!1})}},consistency:[],loadConsistency:Jt(e,kA,n=>({consistency:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a}=await lL();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a}),!0}catch{return!1}},capabilities:[],loadCapabilities:Jt(e,yk,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function wL(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:Jt(e,yA,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await xA(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await vA(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await bA(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await CA();return await t().refreshAll(),n}}}function bL(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:Jt(e,gA,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const L=HM()((e,t)=>({...sL(e),...aL(e),...NA(e,t),...wL(e,t),...bL(e),...RA(e,t),...vL(e,t),...mA(e,t),...IA(e)})),bm=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),Jr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),kL=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},_L=e=>e.capabilities.filter(t=>t.status!=="ok").length,SL=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1},CL=e=>{var t;return((t=e.agentStatus.find(n=>n.rateLimit))==null?void 0:t.rateLimit)??null};function PL(e){return e.includes("running")?"running":e.includes("fail")?"fail":e.every(t=>t==="stale")?"stale":"pass"}function Mk(e){var t,n,r,s;return{qualityStatus:PL([((t=e==null?void 0:e.lint)==null?void 0:t.status)??"stale",((n=e==null?void 0:e.format)==null?void 0:n.status)??"stale"]),testStatus:((r=e==null?void 0:e.test)==null?void 0:r.status)??"stale",consistencyStatus:((s=e==null?void 0:e.consistency)==null?void 0:s.status)??"stale"}}function Ak(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Ak(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jL(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Ak(e))&&(r&&(r+=" "),r+=t);return r}const km="-",EL=e=>{const t=RL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(km);return a[0]===""&&a.length!==1&&a.shift(),Lk(a,t)||TL(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Lk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Lk(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(km);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Hx=/^\[(.+)\]$/,TL=e=>{if(Hx.test(e)){const t=Hx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},RL=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return IL(Object.entries(e.classGroups),n).forEach(([i,o])=>{_h(o,r,i,t)}),r},_h=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Gx(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(NL(s)){_h(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{_h(o,Gx(t,i),n,r)})})},Gx=(e,t)=>{let n=e;return t.split(km).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},NL=e=>e.isThemeGetter,IL=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,ML=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},Dk="!",AL=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,u=0,d;for(let w=0;w<a.length;w++){let g=a[w];if(c===0){if(g===s&&(r||a.slice(w,w+i)===t)){l.push(a.slice(u,w)),u=w+i;continue}if(g==="/"){d=w;continue}}g==="["?c++:g==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(Dk),m=p?h.substring(1):h,y=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:o}):o},LL=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},DL=e=>({cache:ML(e.cacheSize),parseClassName:AL(e),...EL(e)}),FL=/\s+/,OL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(FL);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let m=!!p,y=r(m?h.substring(0,p):h);if(!y){if(!m){a=c+(a.length>0?" "+a:a);continue}if(y=r(h),!y){a=c+(a.length>0?" "+a:a);continue}m=!1}const w=LL(u).join(":"),g=d?w+Dk:w,x=g+y;if(i.includes(x))continue;i.push(x);const v=s(y,m);for(let b=0;b<v.length;++b){const S=v[b];i.push(g+S)}a=c+(a.length>0?" "+a:a)}return a};function zL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Fk(t))&&(r&&(r+=" "),r+=n);return r}const Fk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Fk(e[r]))&&(n&&(n+=" "),n+=t);return n};function $L(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,d)=>d(u),e());return n=DL(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=OL(l,n);return s(l,u),u}return function(){return i(zL.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ok=/^\[(?:([a-z-]+):)?(.+)\]$/i,BL=/^\d+\/\d+$/,VL=new Set(["px","full","screen"]),UL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WL=/\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$/,HL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,GL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vn=e=>wi(e)||VL.has(e)||BL.test(e),dr=e=>Bi(e,"length",tD),wi=e=>!!e&&!Number.isNaN(Number(e)),Ld=e=>Bi(e,"number",wi),fo=e=>!!e&&Number.isInteger(Number(e)),QL=e=>e.endsWith("%")&&wi(e.slice(0,-1)),ne=e=>Ok.test(e),fr=e=>UL.test(e),qL=new Set(["length","size","percentage"]),YL=e=>Bi(e,qL,zk),XL=e=>Bi(e,"position",zk),JL=new Set(["image","url"]),ZL=e=>Bi(e,JL,rD),eD=e=>Bi(e,"",nD),ho=()=>!0,Bi=(e,t,n)=>{const r=Ok.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},tD=e=>WL.test(e)&&!HL.test(e),zk=()=>!1,nD=e=>GL.test(e),rD=e=>KL.test(e),sD=()=>{const e=we("colors"),t=we("spacing"),n=we("blur"),r=we("brightness"),s=we("borderColor"),i=we("borderRadius"),o=we("borderSpacing"),a=we("borderWidth"),l=we("contrast"),c=we("grayscale"),u=we("hueRotate"),d=we("invert"),h=we("gap"),p=we("gradientColorStops"),m=we("gradientColorStopPositions"),y=we("inset"),w=we("margin"),g=we("opacity"),x=we("padding"),v=we("saturate"),b=we("scale"),S=we("sepia"),k=we("skew"),T=we("space"),P=we("translate"),R=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",ne,t],M=()=>[ne,t],O=()=>["",Vn,dr],z=()=>["auto",wi,ne],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",ne],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[wi,ne];return{cacheSize:500,separator:":",theme:{colors:[ho],spacing:[Vn,dr],blur:["none","",fr,ne],brightness:$(),borderColor:[e],borderRadius:["none","","full",fr,ne],borderSpacing:M(),borderWidth:O(),contrast:$(),grayscale:B(),hueRotate:$(),invert:B(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[QL,dr],inset:I(),margin:I(),opacity:$(),padding:M(),saturate:$(),scale:$(),sepia:B(),skew:$(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[fr]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:[...E(),ne]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fo,ne]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",fo,ne]}],"grid-cols":[{"grid-cols":[ho]}],"col-start-end":[{col:["auto",{span:["full",fo,ne]},ne]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[ho]}],"row-start-end":[{row:["auto",{span:[fo,ne]},ne]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[fr]},fr]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fr,dr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ld]}],"font-family":[{font:[ho]}],"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",ne]}],"line-clamp":[{"line-clamp":["none",wi,Ld]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vn,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vn,dr]}],"underline-offset":[{"underline-offset":["auto",Vn,ne]}],"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:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],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",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),XL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",YL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ZL]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:F()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[Vn,ne]}],"outline-w":[{outline:[Vn,dr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Vn,dr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fr,eD]}],"shadow-color":[{shadow:[ho]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fr,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[fo,ne]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],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",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Vn,dr,Ld]}],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"]}}},iD=$L(sD);function Dd(e,t,n){if(e&&e.length){const[r,s]=t,i=Math.PI/180*n,o=Math.cos(i),a=Math.sin(i);for(const l of e){const[c,u]=l;l[0]=(c-r)*o-(u-s)*a+r,l[1]=(c-r)*a+(u-s)*o+s}}}function oD(e,t){return e[0]===t[0]&&e[1]===t[1]}function aD(e,t,n,r=1){const s=n,i=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,a=[0,0];if(s)for(const c of o)Dd(c,a,s);const l=function(c,u,d){const h=[];for(const x of c){const v=[...x];oD(v[0],v[v.length-1])||v.push([v[0][0],v[0][1]]),v.length>2&&h.push(v)}const p=[];u=Math.max(u,.1);const m=[];for(const x of h)for(let v=0;v<x.length-1;v++){const b=x[v],S=x[v+1];if(b[1]!==S[1]){const k=Math.min(b[1],S[1]);m.push({ymin:k,ymax:Math.max(b[1],S[1]),x:k===b[1]?b[0]:S[0],islope:(S[0]-b[0])/(S[1]-b[1])})}}if(m.sort((x,v)=>x.ymin<v.ymin?-1:x.ymin>v.ymin?1:x.x<v.x?-1:x.x>v.x?1:x.ymax===v.ymax?0:(x.ymax-v.ymax)/Math.abs(x.ymax-v.ymax)),!m.length)return p;let y=[],w=m[0].ymin,g=0;for(;y.length||m.length;){if(m.length){let x=-1;for(let v=0;v<m.length&&!(m[v].ymin>w);v++)x=v;m.splice(0,x+1).forEach(v=>{y.push({s:w,edge:v})})}if(y=y.filter(x=>!(x.edge.ymax<=w)),y.sort((x,v)=>x.edge.x===v.edge.x?0:(x.edge.x-v.edge.x)/Math.abs(x.edge.x-v.edge.x)),(d!==1||g%u==0)&&y.length>1)for(let x=0;x<y.length;x+=2){const v=x+1;if(v>=y.length)break;const b=y[x].edge,S=y[v].edge;p.push([[Math.round(b.x),w],[Math.round(S.x),w]])}w+=d,y.forEach(x=>{x.edge.x=x.edge.x+d*x.edge.islope}),g++}return p}(o,i,r);if(s){for(const c of o)Dd(c,a,-s);(function(c,u,d){const h=[];c.forEach(p=>h.push(...p)),Dd(h,u,d)})(l,a,-s)}return l}function ba(e,t){var n;const r=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let i=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(i=s),aD(e,s,r,i||1)}class _m{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=ba(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(t,n){const r=[];for(const s of t)r.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],n));return r}}function wu(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class lD extends _m{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=ba(t,Object.assign({},n,{hachureGap:r})),i=Math.PI/180*n.hachureAngle,o=[],a=.5*r*Math.cos(i),l=.5*r*Math.sin(i);for(const[c,u]of s)wu([c,u])&&o.push([[c[0]-a,c[1]+l],[...u]],[[c[0]+a,c[1]-l],[...u]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class cD extends _m{fillPolygons(t,n){const r=this._fillPolygons(t,n),s=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),i=this._fillPolygons(t,s);return r.ops=r.ops.concat(i.ops),r}}class uD{constructor(t){this.helper=t}fillPolygons(t,n){const r=ba(t,n=Object.assign({},n,{hachureAngle:0}));return this.dotsOnLines(r,n)}dotsOnLines(t,n){const r=[];let s=n.hachureGap;s<0&&(s=4*n.strokeWidth),s=Math.max(s,.1);let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const o=s/4;for(const a of t){const l=wu(a),c=l/s,u=Math.ceil(c)-1,d=l-u*s,h=(a[0][0]+a[1][0])/2-s/4,p=Math.min(a[0][1],a[1][1]);for(let m=0;m<u;m++){const y=p+d+m*s,w=h-o+2*Math.random()*o,g=y-o+2*Math.random()*o,x=this.helper.ellipse(w,g,i,i,n);r.push(...x.ops)}}return{type:"fillSketch",ops:r}}}class dD{constructor(t){this.helper=t}fillPolygons(t,n){const r=ba(t,n);return{type:"fillSketch",ops:this.dashedLine(r,n)}}dashedLine(t,n){const r=n.dashOffset<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashOffset,s=n.dashGap<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashGap,i=[];return t.forEach(o=>{const a=wu(o),l=Math.floor(a/(r+s)),c=(a+s-l*(r+s))/2;let u=o[0],d=o[1];u[0]>d[0]&&(u=o[1],d=o[0]);const h=Math.atan((d[1]-u[1])/(d[0]-u[0]));for(let p=0;p<l;p++){const m=p*(r+s),y=m+r,w=[u[0]+m*Math.cos(h)+c*Math.cos(h),u[1]+m*Math.sin(h)+c*Math.sin(h)],g=[u[0]+y*Math.cos(h)+c*Math.cos(h),u[1]+y*Math.sin(h)+c*Math.sin(h)];i.push(...this.helper.doubleLineOps(w[0],w[1],g[0],g[1],n))}}),i}}class fD{constructor(t){this.helper=t}fillPolygons(t,n){const r=n.hachureGap<0?4*n.strokeWidth:n.hachureGap,s=n.zigzagOffset<0?r:n.zigzagOffset,i=ba(t,n=Object.assign({},n,{hachureGap:r+s}));return{type:"fillSketch",ops:this.zigzagLines(i,s,n)}}zigzagLines(t,n,r){const s=[];return t.forEach(i=>{const o=wu(i),a=Math.round(o/(2*n));let l=i[0],c=i[1];l[0]>c[0]&&(l=i[1],c=i[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<a;d++){const h=2*d*n,p=2*(d+1)*n,m=Math.sqrt(2*Math.pow(n,2)),y=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],w=[l[0]+p*Math.cos(u),l[1]+p*Math.sin(u)],g=[y[0]+m*Math.cos(u+Math.PI/4),y[1]+m*Math.sin(u+Math.PI/4)];s.push(...this.helper.doubleLineOps(y[0],y[1],g[0],g[1],r),...this.helper.doubleLineOps(g[0],g[1],w[0],w[1],r))}}),s}}const ht={};class hD{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const pD=0,Fd=1,Kx=2,ll={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Od(e,t){return e.type===t}function Sm(e){const t=[],n=function(o){const a=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))a[a.length]={type:pD,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];a[a.length]={type:Fd,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:Kx,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!Od(i,Kx);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return Sm("M0,0"+e);s++,o=ll[i.text],r=i.text}else Od(i,Fd)?o=ll[r]:(s++,o=ll[i.text],r=i.text);if(!(s+o<n.length))throw new Error("Path data ended short");for(let l=s;l<s+o;l++){const c=n[l];if(!Od(c,Fd))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof ll[r]!="number")throw new Error("Bad segment: "+r);{const l={key:r,data:a};t.push(l),s+=o,i=n[s],r==="M"&&(r="L"),r==="m"&&(r="l")}}return t}function $k(e){let t=0,n=0,r=0,s=0;const i=[];for(const{key:o,data:a}of e)switch(o){case"M":i.push({key:"M",data:[...a]}),[t,n]=a,[r,s]=a;break;case"m":t+=a[0],n+=a[1],i.push({key:"M",data:[t,n]}),r=t,s=n;break;case"L":i.push({key:"L",data:[...a]}),[t,n]=a;break;case"l":t+=a[0],n+=a[1],i.push({key:"L",data:[t,n]});break;case"C":i.push({key:"C",data:[...a]}),t=a[4],n=a[5];break;case"c":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"C",data:l}),t=l[4],n=l[5];break}case"Q":i.push({key:"Q",data:[...a]}),t=a[2],n=a[3];break;case"q":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"Q",data:l}),t=l[2],n=l[3];break}case"A":i.push({key:"A",data:[...a]}),t=a[5],n=a[6];break;case"a":t+=a[5],n+=a[6],i.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],t,n]});break;case"H":i.push({key:"H",data:[...a]}),t=a[0];break;case"h":t+=a[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...a]}),n=a[0];break;case"v":n+=a[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...a]}),t=a[2],n=a[3];break;case"s":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"S",data:l}),t=l[2],n=l[3];break}case"T":i.push({key:"T",data:[...a]}),t=a[0],n=a[1];break;case"t":t+=a[0],n+=a[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=s}return i}function Bk(e){const t=[];let n="",r=0,s=0,i=0,o=0,a=0,l=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,s]=u,[i,o]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],s=u[5],a=u[2],l=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,s]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,s]});break;case"V":s=u[0],t.push({key:"L",data:[r,s]});break;case"S":{let d=0,h=0;n==="C"||n==="S"?(d=r+(r-a),h=s+(s-l)):(d=r,h=s),t.push({key:"C",data:[d,h,...u]}),a=u[0],l=u[1],r=u[2],s=u[3];break}case"T":{const[d,h]=u;let p=0,m=0;n==="Q"||n==="T"?(p=r+(r-a),m=s+(s-l)):(p=r,m=s);const y=r+2*(p-r)/3,w=s+2*(m-s)/3,g=d+2*(p-d)/3,x=h+2*(m-h)/3;t.push({key:"C",data:[y,w,g,x,d,h]}),a=p,l=m,r=d,s=h;break}case"Q":{const[d,h,p,m]=u,y=r+2*(d-r)/3,w=s+2*(h-s)/3,g=p+2*(d-p)/3,x=m+2*(h-m)/3;t.push({key:"C",data:[y,w,g,x,p,m]}),a=d,l=h,r=p,s=m;break}case"A":{const d=Math.abs(u[0]),h=Math.abs(u[1]),p=u[2],m=u[3],y=u[4],w=u[5],g=u[6];d===0||h===0?(t.push({key:"C",data:[r,s,w,g,w,g]}),r=w,s=g):(r!==w||s!==g)&&(Vk(r,s,w,g,d,h,p,m,y).forEach(function(x){t.push({key:"C",data:x})}),r=w,s=g);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function po(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Vk(e,t,n,r,s,i,o,a,l,c){const u=(d=o,Math.PI*d/180);var d;let h=[],p=0,m=0,y=0,w=0;if(c)[p,m,y,w]=c;else{[e,t]=po(e,t,-u),[n,r]=po(n,r,-u);const O=(e-n)/2,z=(t-r)/2;let E=O*O/(s*s)+z*z/(i*i);E>1&&(E=Math.sqrt(E),s*=E,i*=E);const F=s*s,V=i*i,A=F*V-F*z*z-V*O*O,B=F*z*z+V*O*O,C=(a===l?-1:1)*Math.sqrt(Math.abs(A/B));y=C*s*z/i+(e+n)/2,w=C*-i*O/s+(t+r)/2,p=Math.asin(parseFloat(((t-w)/i).toFixed(9))),m=Math.asin(parseFloat(((r-w)/i).toFixed(9))),e<y&&(p=Math.PI-p),n<y&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),l&&p>m&&(p-=2*Math.PI),!l&&m>p&&(m-=2*Math.PI)}let g=m-p;if(Math.abs(g)>120*Math.PI/180){const O=m,z=n,E=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=Vk(n=y+s*Math.cos(m),r=w+i*Math.sin(m),z,E,s,i,o,0,l,[m,O,y,w])}g=m-p;const x=Math.cos(p),v=Math.sin(p),b=Math.cos(m),S=Math.sin(m),k=Math.tan(g/4),T=4/3*s*k,P=4/3*i*k,R=[e,t],j=[e+T*v,t-P*x],I=[n+T*S,r-P*b],M=[n,r];if(j[0]=2*R[0]-j[0],j[1]=2*R[1]-j[1],c)return[j,I,M].concat(h);{h=[j,I,M].concat(h);const O=[];for(let z=0;z<h.length;z+=3){const E=po(h[z][0],h[z][1],u),F=po(h[z+1][0],h[z+1][1],u),V=po(h[z+2][0],h[z+2][1],u);O.push([E[0],E[1],F[0],F[1],V[0],V[1]])}return O}}const mD={randOffset:function(e,t){return Y(e,t)},randOffsetWithRange:function(e,t,n){return Mc(e,t,n)},ellipse:function(e,t,n,r,s){const i=Wk(n,r,s);return Sh(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return Wr(e,t,n,r,s,!0)}};function Uk(e,t,n,r,s){return{type:"path",ops:Wr(e,t,n,r,s)}}function Wl(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...Wr(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...Wr(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?Uk(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function gD(e,t,n,r,s){return function(i,o){return Wl(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function Qx(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=cl(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:cl(n[0],1.5*(1+.22*t.roughness),Xx(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=cl(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:cl(o,1.5*(1+.22*t.roughness),Xx(t));for(const c of a)c.op!=="move"&&r.push(c);for(const c of l)c.op!=="move"&&s.push(c)}}return{type:"path",ops:r.concat(s)}}return{type:"path",ops:[]}}function Wk(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/s;let o=Math.abs(e/2),a=Math.abs(t/2);const l=1-n.curveFitting;return o+=Y(o*l,n),a+=Y(a*l,n),{increment:i,rx:o,ry:a}}function Sh(e,t,n,r){const[s,i]=Jx(r.increment,e,t,r.rx,r.ry,1,r.increment*Mc(.1,Mc(.4,1,n),n),n);let o=Ac(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=Jx(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Ac(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function qx(e,t,n,r,s,i,o,a,l){const c=e,u=t;let d=Math.abs(n/2),h=Math.abs(r/2);d+=Y(.01*d,l),h+=Y(.01*h,l);let p=s,m=i;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);const y=2*Math.PI/l.curveStepCount,w=Math.min(y/2,(m-p)/2),g=Zx(w,c,u,d,h,p,m,1,l);if(!l.disableMultiStroke){const x=Zx(w,c,u,d,h,p,m,1.5,l);g.push(...x)}return o&&(a?g.push(...Wr(c,u,c+d*Math.cos(p),u+h*Math.sin(p),l),...Wr(c,u,c+d*Math.cos(m),u+h*Math.sin(m),l)):g.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+d*Math.cos(p),u+h*Math.sin(p)]})),{type:"path",ops:g}}function Yx(e,t){const n=Bk($k(Sm(e))),r=[];let s=[0,0],i=[0,0];for(const{key:o,data:a}of n)switch(o){case"M":i=[a[0],a[1]],s=[a[0],a[1]];break;case"L":r.push(...Wr(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[l,c,u,d,h,p]=a;r.push(...yD(l,c,u,d,h,p,i,t)),i=[h,p];break}case"Z":r.push(...Wr(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function zd(e,t){const n=[];for(const r of e)if(r.length){const s=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+Y(s,t),r[0][1]+Y(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+Y(s,t),r[o][1]+Y(s,t)]})}}return{type:"fillPath",ops:n}}function Vs(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!ht[s])switch(s){case"zigzag":ht[s]||(ht[s]=new lD(r));break;case"cross-hatch":ht[s]||(ht[s]=new cD(r));break;case"dots":ht[s]||(ht[s]=new uD(r));break;case"dashed":ht[s]||(ht[s]=new dD(r));break;case"zigzag-line":ht[s]||(ht[s]=new fD(r));break;default:s="hachure",ht[s]||(ht[s]=new _m(r))}return ht[s]}(t,mD).fillPolygons(e,t)}function Xx(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Hk(e){return e.randomizer||(e.randomizer=new hD(e.seed||0)),e.randomizer.next()}function Mc(e,t,n,r=1){return n.roughness*r*(Hk(n)*(t-e)+e)}function Y(e,t,n=1){return Mc(-e,e,t,n)}function Wr(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=Ch(e,t,n,r,s,!0,!1);if(o)return a;const l=Ch(e,t,n,r,s,!0,!0);return a.concat(l)}function Ch(e,t,n,r,s,i,o){const a=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(a);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let u=s.maxRandomnessOffset||0;u*u*100>a&&(u=l/10);const d=u/2,h=.2+.2*Hk(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;p=Y(p,s,c),m=Y(m,s,c);const y=[],w=()=>Y(d,s,c),g=()=>Y(u,s,c),x=s.preserveVertices;return o?y.push({op:"move",data:[e+(x?0:w()),t+(x?0:w())]}):y.push({op:"move",data:[e+(x?0:Y(u,s,c)),t+(x?0:Y(u,s,c))]}),o?y.push({op:"bcurveTo",data:[p+e+(n-e)*h+w(),m+t+(r-t)*h+w(),p+e+2*(n-e)*h+w(),m+t+2*(r-t)*h+w(),n+(x?0:w()),r+(x?0:w())]}):y.push({op:"bcurveTo",data:[p+e+(n-e)*h+g(),m+t+(r-t)*h+g(),p+e+2*(n-e)*h+g(),m+t+2*(r-t)*h+g(),n+(x?0:g()),r+(x?0:g())]}),y}function cl(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+Y(t,n),e[0][1]+Y(t,n)]),r.push([e[0][0]+Y(t,n),e[0][1]+Y(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+Y(t,n),e[s][1]+Y(t,n)]),s===e.length-1&&r.push([e[s][0]+Y(t,n),e[s][1]+Y(t,n)]);return Ac(r,null,n)}function Ac(e,t,n){const r=e.length,s=[];if(r>3){const i=[],o=1-n.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let a=1;a+2<r;a++){const l=e[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*e[a+1][0]-o*e[a-1][0])/6,l[1]+(o*e[a+1][1]-o*e[a-1][1])/6],i[2]=[e[a+1][0]+(o*e[a][0]-o*e[a+2][0])/6,e[a+1][1]+(o*e[a][1]-o*e[a+2][1])/6],i[3]=[e[a+1][0],e[a+1][1]],s.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}}else r===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&s.push(...Ch(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function Jx(e,t,n,r,s,i,o,a){const l=[],c=[];if(a.roughness===0){e/=4,c.push([t+r*Math.cos(-e),n+s*Math.sin(-e)]);for(let u=0;u<=2*Math.PI;u+=e){const d=[t+r*Math.cos(u),n+s*Math.sin(u)];l.push(d),c.push(d)}c.push([t+r*Math.cos(0),n+s*Math.sin(0)]),c.push([t+r*Math.cos(e),n+s*Math.sin(e)])}else{const u=Y(.5,a)-Math.PI/2;c.push([Y(i,a)+t+.9*r*Math.cos(u-e),Y(i,a)+n+.9*s*Math.sin(u-e)]);const d=2*Math.PI+u-.01;for(let h=u;h<d;h+=e){const p=[Y(i,a)+t+r*Math.cos(h),Y(i,a)+n+s*Math.sin(h)];l.push(p),c.push(p)}c.push([Y(i,a)+t+r*Math.cos(u+2*Math.PI+.5*o),Y(i,a)+n+s*Math.sin(u+2*Math.PI+.5*o)]),c.push([Y(i,a)+t+.98*r*Math.cos(u+o),Y(i,a)+n+.98*s*Math.sin(u+o)]),c.push([Y(i,a)+t+.9*r*Math.cos(u+.5*o),Y(i,a)+n+.9*s*Math.sin(u+.5*o)])}return[c,l]}function Zx(e,t,n,r,s,i,o,a,l){const c=i+Y(.1,l),u=[];u.push([Y(a,l)+t+.9*r*Math.cos(c-e),Y(a,l)+n+.9*s*Math.sin(c-e)]);for(let d=c;d<=o;d+=e)u.push([Y(a,l)+t+r*Math.cos(d),Y(a,l)+n+s*Math.sin(d)]);return u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),Ac(u,null,l)}function yD(e,t,n,r,s,i,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const d=a.disableMultiStroke?1:2,h=a.preserveVertices;for(let p=0;p<d;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(h?0:Y(c[0],a)),o[1]+(h?0:Y(c[0],a))]}),u=h?[s,i]:[s+Y(c[p],a),i+Y(c[p],a)],l.push({op:"bcurveTo",data:[e+Y(c[p],a),t+Y(c[p],a),n+Y(c[p],a),r+Y(c[p],a),u[0],u[1]]});return l}function mo(e){return[...e]}function e0(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(n===3)r.push(mo(e[0]),mo(e[1]),mo(e[2]),mo(e[2]));else{const s=[];s.push(e[0],e[0]);for(let a=1;a<e.length;a++)s.push(e[a]),a===e.length-1&&s.push(e[a]);const i=[],o=1-t;r.push(mo(s[0]));for(let a=1;a+2<s.length;a++){const l=s[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*s[a+1][0]-o*s[a-1][0])/6,l[1]+(o*s[a+1][1]-o*s[a-1][1])/6],i[2]=[s[a+1][0]+(o*s[a][0]-o*s[a+2][0])/6,s[a+1][1]+(o*s[a][1]-o*s[a+2][1])/6],i[3]=[s[a+1][0],s[a+1][1]],r.push(i[1],i[2],i[3])}}return r}function Hl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function xD(e,t,n){const r=Hl(t,n);if(r===0)return Hl(e,t);let s=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return s=Math.max(0,Math.min(1,s)),Hl(e,ls(t,n,s))}function ls(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Ph(e,t,n,r){const s=r||[];if(function(a,l){const c=a[l+0],u=a[l+1],d=a[l+2],h=a[l+3];let p=3*u[0]-2*c[0]-h[0];p*=p;let m=3*u[1]-2*c[1]-h[1];m*=m;let y=3*d[0]-2*h[0]-c[0];y*=y;let w=3*d[1]-2*h[1]-c[1];return w*=w,p<y&&(p=y),m<w&&(m=w),p+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Hl(i,o))>1&&s.push(a)):s.push(a),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],u=e[t+2],d=e[t+3],h=ls(l,c,.5),p=ls(c,u,.5),m=ls(u,d,.5),y=ls(h,p,.5),w=ls(p,m,.5),g=ls(y,w,.5);Ph([l,h,y,g],0,n,s),Ph([g,w,m,d],0,n,s)}var i,o;return s}function vD(e,t){return Lc(e,0,e.length,t)}function Lc(e,t,n,r,s){const i=s||[],o=e[t],a=e[n-1];let l=0,c=1;for(let u=t+1;u<n-1;++u){const d=xD(e[u],o,a);d>l&&(l=d,c=u)}return Math.sqrt(l)>r?(Lc(e,t,c+1,r,i),Lc(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function $d(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)Ph(e,3*i,t,r);return n&&n>0?Lc(r,0,r.length,n):r}const Tt="none";let Dc=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}}line(t,n,r,s,i){const o=this._o(i);return this._d("line",[Uk(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=gD(t,n,r,s,o);if(o.fill){const c=[[t,n],[t+r,n],[t+r,n+s],[t,n+s]];o.fillStyle==="solid"?a.push(zd([c],o)):a.push(Vs([c],o))}return o.stroke!==Tt&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=Wk(r,s,o),c=Sh(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=Sh(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(Vs([c.estimatedPoints],o));return o.stroke!==Tt&&a.push(c.opset),this._d("ellipse",a,o)}circle(t,n,r,s){const i=this.ellipse(t,n,r,r,s);return i.shape="circle",i}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[Wl(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],d=qx(t,n,r,s,i,o,a,!0,c);if(a&&c.fill)if(c.fillStyle==="solid"){const h=Object.assign({},c);h.disableMultiStroke=!0;const p=qx(t,n,r,s,i,o,!0,!1,h);p.type="fillPath",u.push(p)}else u.push(function(h,p,m,y,w,g,x){const v=h,b=p;let S=Math.abs(m/2),k=Math.abs(y/2);S+=Y(.01*S,x),k+=Y(.01*k,x);let T=w,P=g;for(;T<0;)T+=2*Math.PI,P+=2*Math.PI;P-T>2*Math.PI&&(T=0,P=2*Math.PI);const R=(P-T)/x.curveStepCount,j=[];for(let I=T;I<=P;I+=R)j.push([v+S*Math.cos(I),b+k*Math.sin(I)]);return j.push([v+S*Math.cos(P),b+k*Math.sin(P)]),j.push([v,b]),Vs([j],x)}(t,n,r,s,i,o,c));return c.stroke!==Tt&&u.push(d),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=Qx(t,r);if(r.fill&&r.fill!==Tt)if(r.fillStyle==="solid"){const o=Qx(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],a=t;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const c of l)c.length<3?o.push(...c):c.length===3?o.push(...$d(e0([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...$d(e0(c),10,(1+r.roughness)/2))}o.length&&s.push(Vs([o],r))}return r.stroke!==Tt&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=Wl(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(zd([t],r)):s.push(Vs([t],r))),r.stroke!==Tt&&s.push(i),this._d("polygon",s,r)}path(t,n){const r=this._o(n),s=[];if(!t)return this._d("path",s,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=r.fill&&r.fill!=="transparent"&&r.fill!==Tt,o=r.stroke!==Tt,a=!!(r.simplification&&r.simplification<1),l=function(u,d,h){const p=Bk($k(Sm(u))),m=[];let y=[],w=[0,0],g=[];const x=()=>{g.length>=4&&y.push(...$d(g,d)),g=[]},v=()=>{x(),y.length&&(m.push(y),y=[])};for(const{key:S,data:k}of p)switch(S){case"M":v(),w=[k[0],k[1]],y.push(w);break;case"L":x(),y.push([k[0],k[1]]);break;case"C":if(!g.length){const T=y.length?y[y.length-1]:w;g.push([T[0],T[1]])}g.push([k[0],k[1]]),g.push([k[2],k[3]]),g.push([k[4],k[5]]);break;case"Z":x(),y.push([w[0],w[1]])}if(v(),!h)return m;const b=[];for(const S of m){const k=vD(S,h);k.length&&b.push(k)}return b}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=Yx(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=Yx(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else s.push(zd(l,r));else s.push(Vs(l,r));return o&&(a?l.forEach(u=>{s.push(Wl(u,!1,r))}):s.push(c)),this._d("path",s,r)}opsToPath(t,n){let r="";for(const s of t.ops){const i=typeof n=="number"&&n>=0?s.data.map(o=>+o.toFixed(n)):s.data;switch(s.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,s=[];for(const i of n){let o=null;switch(i.type){case"path":o={d:this.opsToPath(i),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Tt};break;case"fillPath":o={d:this.opsToPath(i),stroke:Tt,strokeWidth:0,fill:r.fill||Tt};break;case"fillSketch":o=this.fillSketch(i,r)}o&&s.push(o)}return s}fillSketch(t,n){let r=n.fillWeight;return r<0&&(r=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||Tt,strokeWidth:r,fill:Tt}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},wD=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Dc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const o of n)switch(o.type){case"path":s.save(),s.strokeStyle=r.stroke==="none"?"transparent":r.stroke,s.lineWidth=r.strokeWidth,r.strokeLineDash&&s.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(s.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(s,o,i),s.restore();break;case"fillPath":{s.save(),s.fillStyle=r.fill||"";const a=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,o,i,a),s.restore();break}case"fillSketch":this.fillSketch(s,o,r)}}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=s,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,s="nonzero"){t.beginPath();for(const i of n.ops){const o=typeof r=="number"&&r>=0?i.data.map(a=>+a.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}n.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o),o}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o),o}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o),o}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i),i}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r),r}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r),r}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c),c}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r),r}path(t,n){const r=this.gen.path(t,n);return this.draw(r),r}};const ul="http://www.w3.org/2000/svg";class bD{constructor(t,n){this.svg=t,this.gen=new Dc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(ul,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(ul,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke",r.stroke),l.setAttribute("stroke-width",r.strokeWidth+""),l.setAttribute("fill","none"),r.strokeLineDash&&l.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":l=s.createElementNS(ul,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",r.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(s,a,r)}l&&i.appendChild(l)}return i}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const i=t.createElementNS(ul,"path");return i.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",s+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o)}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o)}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o)}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i)}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r)}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r)}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c)}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r)}path(t,n){const r=this.gen.path(t,n);return this.draw(r)}}var kD={canvas:(e,t)=>new wD(e,t),svg:(e,t)=>new bD(e,t),generator:e=>new Dc(e),newSeed:()=>Dc.newSeed()};const Cm=_.createContext({});function Pm(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const _D=typeof window<"u",Gk=_D?_.useLayoutEffect:_.useEffect,bu=_.createContext(null);function jm(e,t){e.indexOf(t)===-1&&e.push(t)}function Fc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Dn=(e,t,n)=>n>t?t:n<e?e:n;let Em=()=>{};const Hr={},Kk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Qk=e=>typeof e=="object"&&e!==null,qk=e=>/^0[^.\s]+$/u.test(e);function Yk(e){let t;return()=>(t===void 0&&(t=e()),t)}const Zt=e=>e,ka=(...e)=>e.reduce((t,n)=>r=>n(t(r))),ua=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Tm{constructor(){this.subscriptions=[]}add(t){return jm(this.subscriptions,t),()=>Fc(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Dt=e=>e*1e3,Yt=e=>e/1e3,Xk=(e,t)=>t?e*(1e3/t):0,Jk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,SD=1e-7,CD=12;function PD(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Jk(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>SD&&++a<CD);return o}function _a(e,t,n,r){if(e===t&&n===r)return Zt;const s=i=>PD(i,0,1,e,n);return i=>i===0||i===1?i:Jk(s(i),t,r)}const Zk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,e_=e=>t=>1-e(1-t),t_=_a(.33,1.53,.69,.99),Rm=e_(t_),n_=Zk(Rm),r_=e=>e>=1?1:(e*=2)<1?.5*Rm(e):.5*(2-Math.pow(2,-10*(e-1))),Nm=e=>1-Math.sin(Math.acos(e)),s_=e_(Nm),i_=Zk(Nm),jD=_a(.42,0,1,1),ED=_a(0,0,.58,1),o_=_a(.42,0,.58,1),TD=e=>Array.isArray(e)&&typeof e[0]!="number",a_=e=>Array.isArray(e)&&typeof e[0]=="number",RD={linear:Zt,easeIn:jD,easeInOut:o_,easeOut:ED,circIn:Nm,circInOut:i_,circOut:s_,backIn:Rm,backInOut:n_,backOut:t_,anticipate:r_},ND=e=>typeof e=="string",t0=e=>{if(a_(e)){Em(e.length===4);const[t,n,r,s]=e;return _a(t,n,r,s)}else if(ND(e))return RD[e];return e},dl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ID(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,h=!1)=>{const m=h&&s?n:r;return d&&o.add(u),m.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,s){i=!0;return}s=!0;const d=n;n=r,r=d,n.forEach(l),n.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const MD=40;function l_(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=dl.reduce((v,b)=>(v[b]=ID(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:m}=o,y=()=>{const v=Hr.useManualTiming,b=v?s.timestamp:performance.now();n=!1,v||(s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,MD),1)),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),d.process(s),h.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(y))},w=()=>{n=!0,r=!0,s.isProcessing||e(y)};return{schedule:dl.reduce((v,b)=>{const S=o[b];return v[b]=(k,T=!1,P=!1)=>(n||w(),S.schedule(k,T,P)),v},{}),cancel:v=>{for(let b=0;b<dl.length;b++)o[dl[b]].cancel(v)},state:s,steps:o}}const{schedule:ge,cancel:Gr,state:qe,steps:Bd}=l_(typeof requestAnimationFrame<"u"?requestAnimationFrame:Zt,!0);let Gl;function AD(){Gl=void 0}const lt={now:()=>(Gl===void 0&&lt.set(qe.isProcessing||Hr.useManualTiming?qe.timestamp:performance.now()),Gl),set:e=>{Gl=e,queueMicrotask(AD)}},c_=e=>t=>typeof t=="string"&&t.startsWith(e),u_=c_("--"),LD=c_("var(--"),Im=e=>LD(e)?DD.test(e.split("/*")[0].trim()):!1,DD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function n0(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Vi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},da={...Vi,transform:e=>Dn(0,1,e)},fl={...Vi,default:1},Oo=e=>Math.round(e*1e5)/1e5,Mm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function FD(e){return e==null}const OD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Am=(e,t)=>n=>!!(typeof n=="string"&&OD.test(n)&&n.startsWith(e)||t&&!FD(n)&&Object.prototype.hasOwnProperty.call(n,t)),d_=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Mm);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},zD=e=>Dn(0,255,e),Vd={...Vi,transform:e=>Math.round(zD(e))},ms={test:Am("rgb","red"),parse:d_("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Vd.transform(e)+", "+Vd.transform(t)+", "+Vd.transform(n)+", "+Oo(da.transform(r))+")"};function $D(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const jh={test:Am("#"),parse:$D,transform:ms.transform},Sa=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Hn=Sa("deg"),An=Sa("%"),K=Sa("px"),BD=Sa("vh"),VD=Sa("vw"),r0={...An,parse:e=>An.parse(e)/100,transform:e=>An.transform(e*100)},li={test:Am("hsl","hue"),parse:d_("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+An.transform(Oo(t))+", "+An.transform(Oo(n))+", "+Oo(da.transform(r))+")"},Oe={test:e=>ms.test(e)||jh.test(e)||li.test(e),parse:e=>ms.test(e)?ms.parse(e):li.test(e)?li.parse(e):jh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ms.transform(e):li.transform(e),getAnimatableNone:e=>{const t=Oe.parse(e);return t.alpha=0,Oe.transform(t)}},UD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function WD(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Mm))==null?void 0:t.length)||0)+(((n=e.match(UD))==null?void 0:n.length)||0)>0}const f_="number",h_="color",HD="var",GD="var(",s0="${}",KD=/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 Ii(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(KD,l=>(Oe.test(l)?(r.color.push(i),s.push(h_),n.push(Oe.parse(l))):l.startsWith(GD)?(r.var.push(i),s.push(HD),n.push(l)):(r.number.push(i),s.push(f_),n.push(parseFloat(l))),++i,s0)).split(s0);return{values:n,split:a,indexes:r,types:s}}function QD(e){return Ii(e).values}function p_({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===f_?s+=Oo(r[i]):o===h_?s+=Oe.transform(r[i]):s+=r[i]}return s}}function qD(e){return p_(Ii(e))}const YD=e=>typeof e=="number"?0:Oe.test(e)?Oe.getAnimatableNone(e):e,XD=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:YD(e);function JD(e){const t=Ii(e);return p_(t)(t.values.map((r,s)=>XD(r,t.split[s])))}const yn={test:WD,parse:QD,createTransformer:qD,getAnimatableNone:JD};function Ud(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 ZD({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Ud(l,a,e+1/3),i=Ud(l,a,e),o=Ud(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Oc(e,t){return n=>n>0?t:e}const me=(e,t,n)=>e+(t-e)*n,Wd=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},e3=[jh,ms,li],t3=e=>e3.find(t=>t.test(e));function i0(e){const t=t3(e);if(!t)return!1;let n=t.parse(e);return t===li&&(n=ZD(n)),n}const o0=(e,t)=>{const n=i0(e),r=i0(t);if(!n||!r)return Oc(e,t);const s={...n};return i=>(s.red=Wd(n.red,r.red,i),s.green=Wd(n.green,r.green,i),s.blue=Wd(n.blue,r.blue,i),s.alpha=me(n.alpha,r.alpha,i),ms.transform(s))},Eh=new Set(["none","hidden"]);function n3(e,t){return Eh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function r3(e,t){return n=>me(e,t,n)}function Lm(e){return typeof e=="number"?r3:typeof e=="string"?Im(e)?Oc:Oe.test(e)?o0:o3:Array.isArray(e)?m_:typeof e=="object"?Oe.test(e)?o0:s3:Oc}function m_(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Lm(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function s3(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Lm(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function i3(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],a=e.values[o]??0;n[s]=a,r[i]++}return n}const o3=(e,t)=>{const n=yn.createTransformer(t),r=Ii(e),s=Ii(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Eh.has(e)&&!s.values.length||Eh.has(t)&&!r.values.length?n3(e,t):ka(m_(i3(r,s),s.values),n):Oc(e,t)};function g_(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?me(e,t,n):Lm(e)(e,t)}const a3=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ge.update(t,n),stop:()=>Gr(t),now:()=>qe.isProcessing?qe.timestamp:lt.now()}},y_=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},zc=2e4;function Dm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zc;)t+=n,r=e.next(t);return t>=zc?1/0:t}function l3(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Dm(r),zc);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Yt(s)}}const Ie={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};function Th(e,t){return e*Math.sqrt(1-t*t)}const c3=12;function u3(e,t,n){let r=n;for(let s=1;s<c3;s++)r=r-e(r)/t(r);return r}const Hd=.001;function d3({duration:e=Ie.duration,bounce:t=Ie.bounce,velocity:n=Ie.velocity,mass:r=Ie.mass}){let s,i,o=1-t;o=Dn(Ie.minDamping,Ie.maxDamping,o),e=Dn(Ie.minDuration,Ie.maxDuration,Yt(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,p=Th(c,o),m=Math.exp(-d);return Hd-h/p*m},i=c=>{const d=c*o*e,h=d*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-d),y=Th(Math.pow(c,2),o);return(-s(c)+Hd>0?-1:1)*((h-p)*m)/y}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Hd+u*d},i=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=u3(s,i,a);if(e=Dt(e),isNaN(l))return{stiffness:Ie.stiffness,damping:Ie.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const f3=["duration","bounce"],h3=["stiffness","damping","mass"];function a0(e,t){return t.some(n=>e[n]!==void 0)}function p3(e){let t={velocity:Ie.velocity,stiffness:Ie.stiffness,damping:Ie.damping,mass:Ie.mass,isResolvedFromDuration:!1,...e};if(!a0(e,h3)&&a0(e,f3))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Dn(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ie.mass,stiffness:s,damping:i}}else{const n=d3({...e,velocity:0});t={...t,...n,mass:Ie.mass},t.isResolvedFromDuration=!0}return t}function $c(e=Ie.visualDuration,t=Ie.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=p3({...n,velocity:-Yt(n.velocity||0)}),m=h||0,y=c/(2*Math.sqrt(l*u)),w=o-i,g=Yt(Math.sqrt(l/u)),x=Math.abs(w)<5;r||(r=x?Ie.restSpeed.granular:Ie.restSpeed.default),s||(s=x?Ie.restDelta.granular:Ie.restDelta.default);let v,b,S,k,T,P;if(y<1)S=Th(g,y),k=(m+y*g*w)/S,v=j=>{const I=Math.exp(-y*g*j);return o-I*(k*Math.sin(S*j)+w*Math.cos(S*j))},T=y*g*k+w*S,P=y*g*w-k*S,b=j=>Math.exp(-y*g*j)*(T*Math.sin(S*j)+P*Math.cos(S*j));else if(y===1){v=I=>o-Math.exp(-g*I)*(w+(m+g*w)*I);const j=m+g*w;b=I=>Math.exp(-g*I)*(g*j*I-m)}else{const j=g*Math.sqrt(y*y-1);v=z=>{const E=Math.exp(-y*g*z),F=Math.min(j*z,300);return o-E*((m+y*g*w)*Math.sinh(F)+j*w*Math.cosh(F))/j};const I=(m+y*g*w)/j,M=y*g*I-w*j,O=y*g*w-I*j;b=z=>{const E=Math.exp(-y*g*z),F=Math.min(j*z,300);return E*(M*Math.sinh(F)+O*Math.cosh(F))}}const R={calculatedDuration:p&&d||null,velocity:j=>Dt(b(j)),next:j=>{if(!p&&y<1){const M=Math.exp(-y*g*j),O=Math.sin(S*j),z=Math.cos(S*j),E=o-M*(k*O+w*z),F=Dt(M*(T*O+P*z));return a.done=Math.abs(F)<=r&&Math.abs(o-E)<=s,a.value=a.done?o:E,a}const I=v(j);if(p)a.done=j>=d;else{const M=Dt(b(j));a.done=Math.abs(M)<=r&&Math.abs(o-I)<=s}return a.value=a.done?o:I,a},toString:()=>{const j=Math.min(Dm(R),zc),I=y_(M=>R.next(j*M).value,j,30);return j+"ms "+I},toTransition:()=>{}};return R}$c.applyToOptions=e=>{const t=l3(e,100,$c);return e.ease=t.ease,e.duration=Dt(t.duration),e.type="keyframes",e};const m3=5;function x_(e,t,n){const r=Math.max(t-m3,0);return Xk(n-e(r),t-r)}function Rh({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let y=n*t;const w=d+y,g=o===void 0?w:o(w);g!==w&&(y=g-d);const x=P=>-y*Math.exp(-P/r),v=P=>g+x(P),b=P=>{const R=x(P),j=v(P);h.done=Math.abs(R)<=c,h.value=h.done?g:j};let S,k;const T=P=>{p(h.value)&&(S=P,k=$c({keyframes:[h.value,m(h.value)],velocity:x_(v,P,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:P=>{let R=!1;return!k&&S===void 0&&(R=!0,b(P),T(P)),S!==void 0&&P>=S?k.next(P-S):(!R&&b(P),h)}}}function g3(e,t,n){const r=[],s=n||Hr.mix||g_,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Zt:t;a=ka(l,a)}r.push(a)}return r}function y3(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Em(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=g3(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const h=ua(e[d],e[d+1],u);return a[d](h)};return n?u=>c(Dn(e[0],e[i-1],u)):c}function x3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ua(0,t,r);e.push(me(n,1,s))}}function v3(e){const t=[0];return x3(t,e.length-1),t}function w3(e,t){return e.map(n=>n*t)}function b3(e,t){return e.map(()=>t||o_).splice(0,e.length-1)}function zo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=TD(r)?r.map(t0):t0(r),i={done:!1,value:t[0]},o=w3(n&&n.length===t.length?n:v3(t),e),a=y3(o,t,{ease:Array.isArray(s)?s:b3(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const k3=e=>e!==null;function ku(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(k3),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const _3={decay:Rh,inertia:Rh,tween:zo,keyframes:zo,spring:$c};function v_(e){typeof e.type=="string"&&(e.type=_3[e.type])}class Fm{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 S3=e=>e/100;class Bc extends Fm{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==lt.now()&&this.tick(lt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;v_(t);const{type:n=zo,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||zo;l!==zo&&typeof a[0]!="number"&&(this.mixKeyframes=ka(S3,g_(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Dm(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}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:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:h,repeatDelay:p,type:m,onUpdate:y,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,b=r;if(d){const P=Math.min(this.currentTime,s)/a;let R=Math.floor(P),j=P%1;!j&&P>=1&&(j=1),j===1&&R--,R=Math.min(R,d+1),!!(R%2)&&(h==="reverse"?(j=1-j,p&&(j-=p/a)):h==="mirror"&&(b=o)),v=Dn(0,1,j)*a}let S;x?(this.delayState.value=u[0],S=this.delayState):S=b.next(v),i&&!x&&(S.value=i(S.value));let{done:k}=S;!x&&l!==null&&(k=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return T&&m!==Rh&&(S.value=ku(u,this.options,w,this.speed)),y&&y(S.value),T&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Yt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Yt(t)}get time(){return Yt(this.currentTime)}set time(t){t=Dt(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),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return x_(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(lt.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Yt(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=a3,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(lt.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 C3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const gs=e=>e*180/Math.PI,Nh=e=>{const t=gs(Math.atan2(e[1],e[0]));return Ih(t)},P3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Nh,rotateZ:Nh,skewX:e=>gs(Math.atan(e[1])),skewY:e=>gs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ih=e=>(e=e%360,e<0&&(e+=360),e),l0=Nh,c0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),u0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),j3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:c0,scaleY:u0,scale:e=>(c0(e)+u0(e))/2,rotateX:e=>Ih(gs(Math.atan2(e[6],e[5]))),rotateY:e=>Ih(gs(Math.atan2(-e[2],e[0]))),rotateZ:l0,rotate:l0,skewX:e=>gs(Math.atan(e[4])),skewY:e=>gs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Mh(e){return e.includes("scale")?1:0}function Ah(e,t){if(!e||e==="none")return Mh(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=j3,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=P3,s=a}if(!s)return Mh(t);const i=r[t],o=s[1].split(",").map(T3);return typeof i=="function"?i(o):o[i]}const E3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Ah(n,t)};function T3(e){return parseFloat(e.trim())}const Ui=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wi=new Set([...Ui,"pathRotation"]),d0=e=>e===Vi||e===K,R3=new Set(["x","y","z"]),N3=Ui.filter(e=>!R3.has(e));function I3(e){const t=[];return N3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Nr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-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})=>Ah(t,"x"),y:(e,{transform:t})=>Ah(t,"y")};Nr.translateX=Nr.x;Nr.translateY=Nr.y;const _s=new Set;let Lh=!1,Dh=!1,Fh=!1;function w_(){if(Dh){const e=Array.from(_s).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=I3(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Dh=!1,Lh=!1,_s.forEach(e=>e.complete(Fh)),_s.clear()}function b_(){_s.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Dh=!0)})}function M3(){Fh=!0,b_(),w_(),Fh=!1}class Om{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(_s.add(this),Lh||(Lh=!0,ge.read(b_),ge.resolveKeyframes(w_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}C3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_s.delete(this)}cancel(){this.state==="scheduled"&&(_s.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const A3=e=>e.startsWith("--");function k_(e,t,n){A3(t)?e.style.setProperty(t,n):e.style[t]=n}const L3={};function __(e,t){const n=Yk(e);return()=>L3[t]??n()}const D3=__(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),S_=__(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),So=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,f0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:So([0,.65,.55,1]),circOut:So([.55,0,1,.45]),backIn:So([.31,.01,.66,-.59]),backOut:So([.33,1.53,.69,.99])};function C_(e,t){if(e)return typeof e=="function"?S_()?y_(e,t):"ease-out":a_(e)?So(e):Array.isArray(e)?e.map(n=>C_(n,t)||f0.easeOut):f0[e]}function F3(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=C_(a,s);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function P_(e){return typeof e=="function"&&"applyToOptions"in e}function O3({type:e,...t}){return P_(e)&&S_()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class j_ extends Fm{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,Em(typeof t.type!="string");const c=O3(t);this.animation=F3(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=ku(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),k_(n,r,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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 n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Yt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Yt(t)}get time(){return Yt(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Dt(t),n&&this.animation.pause()}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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&D3()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Zt):s(this)}}const E_={anticipate:r_,backInOut:n_,circInOut:i_};function z3(e){return e in E_}function $3(e){typeof e.ease=="string"&&z3(e.ease)&&(e.ease=E_[e.ease])}const Gd=10;class B3 extends j_{constructor(t){$3(t),v_(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Bc({...o,autoplay:!1}),l=Math.max(Gd,lt.now()-this.startTime),c=Dn(0,Gd,l-Gd),u=a.sample(l).value,{name:d}=this.options;i&&d&&k_(i,d,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const h0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(yn.test(e)||e==="0")&&!e.startsWith("url("));function V3(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 U3(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=h0(s,t),a=h0(i,t);return!o||!a?!1:V3(e)||(n==="spring"||P_(n))&&r}function Oh(e){e.duration=0,e.type="keyframes"}const T_=new Set(["opacity","clipPath","filter","transform"]),W3=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function H3(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&W3.test(e[t]))return!0;return!1}const G3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),K3=Yk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Q3(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return K3()&&n&&(T_.has(n)||G3.has(n)&&H3(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const q3=40;class Y3 extends Fm{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...d}){var m;super(),this.stop=()=>{var y,w;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=lt.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:u,...d},p=(u==null?void 0:u.KeyframeResolver)||Om;this.keyframeResolver=new p(a,(y,w,g)=>this.onKeyframesResolved(y,w,h,!g),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var g,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=lt.now();let d=!0;U3(t,i,o,a)||(d=!1,(Hr.instantAnimations||!l)&&(u==null||u(ku(t,r,n))),t[0]=t[t.length-1],Oh(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>q3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=d&&!c&&Q3(p),y=(x=(g=p.motionValue)==null?void 0:g.owner)==null?void 0:x.current;let w;if(m)try{w=new B3({...p,element:y})}catch{w=new Bc(p)}else w=new Bc(p);w.finished.then(()=>{this.notifyFinished()}).catch(Zt),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}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(),M3()),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()}}function R_(e,t,n,r=0,s=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const p0=30,X3=e=>!isNaN(parseFloat(e));class J3{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=lt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=lt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=X3(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 Tm);const r=this.events[t].add(n);return t==="change"?()=>{r(),ge.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=lt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>p0)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,p0);return Xk(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 Mi(e,t){return new J3(e,t)}function N_(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function zm(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?N_(n,e):n}const Z3={type:"spring",stiffness:500,damping:25,restSpeed:10},eF=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),tF={type:"keyframes",duration:.8},nF={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},rF=(e,{keyframes:t})=>t.length>2?tF:Wi.has(e)?e.startsWith("scale")?eF(t[1]):Z3:nF,sF=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function iF(e){for(const t in e)if(!sF.has(t))return!0;return!1}const $m=(e,t,n,r={},s,i)=>o=>{const a=zm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Dt(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};iF(a)||Object.assign(u,rF(e,u)),u.duration&&(u.duration=Dt(u.duration)),u.repeatDelay&&(u.repeatDelay=Dt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Oh(u),u.delay===0&&(d=!0)),(Hr.instantAnimations||Hr.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(d=!0,Oh(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const h=ku(u.keyframes,a);if(h!==void 0){ge.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new Bc(u):new Y3(u)},oF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function aF(e){const t=oF.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function I_(e,t,n=1){const[r,s]=aF(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Kk(o)?parseFloat(o):o}return Im(s)?I_(s,t,n+1):s}function m0(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Bm(e,t,n,r){if(typeof t=="function"){const[s,i]=m0(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=m0(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Ss(e,t,n){const r=e.getProps();return Bm(r,t,n!==void 0?n:r.custom,e)}const M_=new Set(["width","height","top","left","right","bottom",...Ui]),zh=e=>Array.isArray(e);function lF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Mi(n))}function cF(e){return zh(e)?e[e.length-1]||0:e}function uF(e,t){const n=Ss(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=cF(i[o]);lF(e,o,a)}}const Ye=e=>!!(e&&e.getVelocity);function dF(e){return!!(Ye(e)&&e.add)}function $h(e,t){const n=e.getValue("willChange");if(dF(n))return n.add(t);if(!n&&Hr.WillChange){const r=new Hr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Vm(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const fF="framerAppearId",A_="data-"+Vm(fF);function L_(e){return e.props[A_]}function hF({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function D_(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?N_(i,l):l;const c=i==null?void 0:i.reduceMotion,u=i==null?void 0:i.skipAnimations;r&&(i=r);const d=[],h=s&&e.animationState&&e.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(e,a,i,n,d);for(const m in a){const y=e.getValue(m,e.latestValues[m]??null),w=a[m];if(w===void 0||h&&hF(h,m))continue;const g={delay:n,...zm(i||{},m)};u&&(g.skipAnimations=!0);const x=y.get();if(x!==void 0&&!y.isAnimating()&&!Array.isArray(w)&&w===x&&!g.velocity){ge.update(()=>y.set(w));continue}let v=!1;if(window.MotionHandoffAnimation){const k=L_(e);if(k){const T=window.MotionHandoffAnimation(k,m,ge);T!==null&&(g.startTime=T,v=!0)}}$h(e,m);const b=c??e.shouldReduceMotion;y.start($m(m,y,w,b&&M_.has(m)?{type:!1}:g,e,v));const S=y.animation;S&&d.push(S)}if(o){const m=()=>ge.update(()=>{o&&uF(e,o)});d.length?Promise.all(d).then(m):m()}return d}function Bh(e,t,n={}){var l;const r=Ss(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(D_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=s;return pF(e,t,c,u,d,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[i,o]:[o,i];return c().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function pF(e,t,n=0,r=0,s=0,i=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Bh(l,t,{...o,delay:n+(typeof r=="function"?0:r)+R_(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function mF(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Bh(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Bh(e,t,n);else{const s=typeof t=="function"?Ss(e,t,n.custom):t;r=Promise.all(D_(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const gF={test:e=>e==="auto",parse:e=>e},F_=e=>t=>t.test(e),O_=[Vi,K,An,Hn,VD,BD,gF],g0=e=>O_.find(F_(e));function yF(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||qk(e):!0}const xF=new Set(["brightness","contrast","saturate","opacity"]);function vF(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Mm)||[];if(!r)return e;const s=n.replace(r,"");let i=xF.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const wF=/\b([a-z-]*)\(.*?\)/gu,Vh={...yn,getAnimatableNone:e=>{const t=e.match(wF);return t?t.map(vF).join(" "):e}},Uh={...yn,getAnimatableNone:e=>{const t=yn.parse(e);return yn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},y0={...Vi,transform:Math.round},bF={rotate:Hn,pathRotation:Hn,rotateX:Hn,rotateY:Hn,rotateZ:Hn,scale:fl,scaleX:fl,scaleY:fl,scaleZ:fl,skew:Hn,skewX:Hn,skewY:Hn,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:da,originX:r0,originY:r0,originZ:K},Vc={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,...bF,zIndex:y0,fillOpacity:da,strokeOpacity:da,numOctaves:y0},kF={...Vc,color:Oe,backgroundColor:Oe,outlineColor:Oe,fill:Oe,stroke:Oe,borderColor:Oe,borderTopColor:Oe,borderRightColor:Oe,borderBottomColor:Oe,borderLeftColor:Oe,filter:Vh,WebkitFilter:Vh,mask:Uh,WebkitMask:Uh},z_=e=>kF[e],_F=new Set([Vh,Uh]);function $_(e,t){let n=z_(e);return _F.has(n)||(n=yn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const SF=new Set(["auto","none","0"]);function CF(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!SF.has(i)&&Ii(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=$_(n,s)}class PF extends Om{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let d=t[u];if(typeof d=="string"&&(d=d.trim(),Im(d))){const h=I_(d,n.current);h!==void 0&&(t[u]=h),u===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!M_.has(r)||t.length!==2)return;const[s,i]=t,o=g0(s),a=g0(i),l=n0(s),c=n0(i);if(l!==c&&Nr[r]){this.needsMeasurement=!0;return}if(o!==a)if(d0(o)&&d0(a))for(let u=0;u<t.length;u++){const d=t[u];typeof d=="string"&&(t[u]=parseFloat(d))}else Nr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||yF(t[s]))&&r.push(s);r.length&&CF(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=Nr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Nr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function B_(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const Wh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Kl(e){return Qk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Um}=l_(queueMicrotask,!1),dn={x:!1,y:!1};function V_(){return dn.x||dn.y}function jF(e){return e==="x"||e==="y"?dn[e]?null:(dn[e]=!0,()=>{dn[e]=!1}):dn.x||dn.y?null:(dn.x=dn.y=!0,()=>{dn.x=dn.y=!1})}function U_(e,t){const n=B_(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function EF(e){return!(e.pointerType==="touch"||V_())}function TF(e,t,n={}){const[r,s,i]=U_(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},d=w=>{c&&(c(w),c=void 0),u()},h=w=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,d(w))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=w=>{if(w.pointerType!=="touch"){if(a){l=!0;return}d(w)}},y=w=>{if(!EF(w))return;l=!1;const g=t(o,w);typeof g=="function"&&(c=g,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",y,s),o.addEventListener("pointerdown",p,s)}),i}const W_=(e,t)=>t?e===t?!0:W_(e,t.parentElement):!1,Wm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,RF=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function NF(e){return RF.has(e.tagName)||e.isContentEditable===!0}const IF=new Set(["INPUT","SELECT","TEXTAREA"]);function MF(e){return IF.has(e.tagName)||e.isContentEditable===!0}const Ql=new WeakSet;function x0(e){return t=>{t.key==="Enter"&&e(t)}}function Kd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const AF=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=x0(()=>{if(Ql.has(n))return;Kd(n,"down");const s=x0(()=>{Kd(n,"up")}),i=()=>Kd(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function v0(e){return Wm(e)&&!V_()}const w0=new WeakSet;function LF(e,t,n={}){const[r,s,i]=U_(e,n),o=a=>{const l=a.currentTarget;if(!v0(a)||w0.has(a))return;Ql.add(l),n.stopPropagation&&w0.add(a);const c=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),Ql.has(l)&&Ql.delete(l),v0(p)&&typeof c=="function"&&c(p,{success:m})},d=p=>{u(p,l===window||l===document||n.useGlobalTarget||W_(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",d,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Kl(a)&&(a.addEventListener("focus",c=>AF(c,s)),!NF(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Hm(e){return Qk(e)&&"ownerSVGElement"in e}const ql=new WeakMap;let xr;const H_=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Hm(r)&&"getBBox"in r?r.getBBox()[t]:r[n],DF=H_("inline","width","offsetWidth"),FF=H_("block","height","offsetHeight");function OF({target:e,borderBoxSize:t}){var n;(n=ql.get(e))==null||n.forEach(r=>{r(e,{get width(){return DF(e,t)},get height(){return FF(e,t)}})})}function zF(e){e.forEach(OF)}function $F(){typeof ResizeObserver>"u"||(xr=new ResizeObserver(zF))}function BF(e,t){xr||$F();const n=B_(e);return n.forEach(r=>{let s=ql.get(r);s||(s=new Set,ql.set(r,s)),s.add(t),xr==null||xr.observe(r)}),()=>{n.forEach(r=>{const s=ql.get(r);s==null||s.delete(t),s!=null&&s.size||xr==null||xr.unobserve(r)})}}const Yl=new Set;let ci;function VF(){ci=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yl.forEach(t=>t(e))},window.addEventListener("resize",ci)}function UF(e){return Yl.add(e),ci||VF(),()=>{Yl.delete(e),!Yl.size&&typeof ci=="function"&&(window.removeEventListener("resize",ci),ci=void 0)}}function b0(e,t){return typeof e=="function"?UF(e):BF(e,t)}function WF(e){return Hm(e)&&e.tagName==="svg"}const HF=[...O_,Oe,yn],GF=e=>HF.find(F_(e)),k0=()=>({translate:0,scale:1,origin:0,originPoint:0}),ui=()=>({x:k0(),y:k0()}),_0=()=>({min:0,max:0}),$e=()=>({x:_0(),y:_0()}),KF=new WeakMap;function _u(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function fa(e){return typeof e=="string"||Array.isArray(e)}const Gm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Km=["initial",...Gm];function Su(e){return _u(e.animate)||Km.some(t=>fa(e[t]))}function G_(e){return!!(Su(e)||e.variants)}function QF(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Ye(s))e.addValue(r,s);else if(Ye(i))e.addValue(r,Mi(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Mi(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Uc={current:null},Qm={current:!1},qF=typeof window<"u";function K_(){if(Qm.current=!0,!!qF)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Uc.current=e.matches;e.addEventListener("change",t),t()}else Uc.current=!1}const S0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wc={};function Q_(e){Wc=e}function YF(){return Wc}class XF{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Om,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 p=lt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ge.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Su(n),this.isVariantNode=G_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];c[p]!==void 0&&Ye(m)&&m.set(c[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,KF.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((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Qm.current||K_(),this.shouldReduceMotion=Uc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Gr(this.notifyUpdate),Gr(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){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&T_.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,d=new j_({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:Dt(u)}),h=o(d);this.valueSubscriptions.set(t,()=>{h(),d.cancel()});return}const r=Wi.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ge.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}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 Wc){const n=Wc[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$e()}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<S0.length;r++){const s=S0[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=QF(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=Mi(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"&&(Kk(r)||qk(r))?r=parseFloat(r):!GF(r)&&yn.test(n)&&(r=$_(t,n)),this.setBaseTarget(t,Ye(r)?r.get():r)),Ye(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Bm(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ye(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Tm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Um.render(this.render)}}class q_ extends XF{constructor(){super(...arguments),this.KeyframeResolver=PF}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[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;Ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Y_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function JF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ZF(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 Qd(e){return e===void 0||e===1}function Hh({scale:e,scaleX:t,scaleY:n}){return!Qd(e)||!Qd(t)||!Qd(n)}function cs(e){return Hh(e)||X_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function X_(e){return C0(e.x)||C0(e.y)}function C0(e){return e&&e!=="0%"}function Hc(e,t,n){const r=e-n,s=t*r;return n+s}function P0(e,t,n,r,s){return s!==void 0&&(e=Hc(e,s,r)),Hc(e,n,r)+t}function Gh(e,t=0,n=1,r,s){e.min=P0(e.min,t,n,r,s),e.max=P0(e.max,t,n,r,s)}function J_(e,{x:t,y:n}){Gh(e.x,t.translate,t.scale,t.originPoint),Gh(e.y,n.translate,n.scale,n.originPoint)}const j0=.999999999999,E0=1.0000000000001;function eO(e,t,n,r=!1){var a;const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Tn(e.x,-i.scroll.offset.x),Tn(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,J_(e,o)),r&&cs(i.latestValues)&&Xl(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<E0&&t.x>j0&&(t.x=1),t.y<E0&&t.y>j0&&(t.y=1)}function Tn(e,t){e.min+=t,e.max+=t}function T0(e,t,n,r,s=.5){const i=me(e.min,e.max,s);Gh(e,t,n,i,r)}function R0(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Xl(e,t,n){const r=n??e;T0(e.x,R0(t.x,r.x),t.scaleX,t.scale,t.originX),T0(e.y,R0(t.y,r.y),t.scaleY,t.scale,t.originY)}function Z_(e,t){return Y_(ZF(e.getBoundingClientRect(),t))}function tO(e,t,n){const r=Z_(e,n),{scroll:s}=t;return s&&(Tn(r.x,s.offset.x),Tn(r.y,s.offset.y)),r}const nO={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rO=Ui.length;function sO(e,t,n){let r="",s=!0;for(let o=0;o<rO;o++){const a=Ui[o],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const u=parseFloat(l);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=Wh(l,Vc[a]);if(!c){s=!1;const d=nO[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${Wh(i,Vc.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function qm(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Wi.has(l)){o=!0;continue}else if(u_(l)){s[l]=c;continue}else{const u=Wh(c,Vc[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=sO(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}function eS(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function N0(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const go={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(K.test(e))e=parseFloat(e);else return e;const n=N0(e,t.target.x),r=N0(e,t.target.y);return`${n}% ${r}%`}},iO={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=yn.parse(e);if(s.length>5)return r;const i=yn.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=me(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}},Kh={borderRadius:{...go,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:go,borderTopRightRadius:go,borderBottomLeftRadius:go,borderBottomRightRadius:go,boxShadow:iO};function tS(e,{layout:t,layoutId:n}){return Wi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Kh[e]||e==="opacity")}function Ym(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const a in r)(Ye(r[a])||s&&Ye(s[a])||tS(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function oO(e){return window.getComputedStyle(e)}class aO extends q_{constructor(){super(...arguments),this.type="html",this.renderInstance=eS}readValueFromInstance(t,n){var r;if(Wi.has(n))return(r=this.projection)!=null&&r.isProjecting?Mh(n):E3(t,n);{const s=oO(t),i=(u_(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Z_(t,n)}build(t,n,r){qm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ym(t,n,r)}}const lO={offset:"stroke-dashoffset",array:"stroke-dasharray"},cO={offset:"strokeDashoffset",array:"strokeDasharray"};function uO(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?lO:cO;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const dO=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function nS(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(qm(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox);for(const p of dO)d[p]!==void 0&&(h[p]=d[p],delete d[p]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),s!==void 0&&uO(d,s,i,o,!1)}const rS=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"]),sS=e=>typeof e=="string"&&e.toLowerCase()==="svg";function fO(e,t,n,r){eS(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(rS.has(s)?s:Vm(s),t.attrs[s])}function iS(e,t,n){const r=Ym(e,t,n);for(const s in e)if(Ye(e[s])||Ye(t[s])){const i=Ui.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class hO extends q_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$e}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Wi.has(n)){const r=z_(n);return r&&r.default||0}return n=rS.has(n)?n:Vm(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iS(t,n,r)}build(t,n,r){nS(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){fO(t,n,r,s)}mount(t){this.isSVGTag=sS(t.tagName),super.mount(t)}}const pO=Km.length;function oS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?oS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<pO;n++){const r=Km[n],s=e.props[r];(fa(s)||s===!1)&&(t[r]=s)}return t}function aS(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 mO=[...Gm].reverse(),gO=Gm.length;function yO(e){return t=>Promise.all(t.map(({animation:n,options:r})=>mF(e,n,r)))}function xO(e){let t=yO(e),n=I0(),r=!0,s=!1;const i=c=>(u,d)=>{var p;const h=Ss(e,d,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:y,...w}=h;u={...u,...w,...y}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,d=oS(e.parent)||{},h=[],p=new Set;let m={},y=1/0;for(let g=0;g<gO;g++){const x=mO[g],v=n[x],b=u[x]!==void 0?u[x]:d[x],S=fa(b),k=x===c?v.isActive:null;k===!1&&(y=g);let T=b===d[x]&&b!==u[x]&&S;if(T&&(r||s)&&e.manuallyAnimateOnMount&&(T=!1),v.protectedKeys={...m},!v.isActive&&k===null||!b&&!v.prevProp||_u(b)||typeof b=="boolean")continue;if(x==="exit"&&v.isActive&&k!==!0){v.prevResolvedValues&&(m={...m,...v.prevResolvedValues});continue}const P=vO(v.prevProp,b);let R=P||x===c&&v.isActive&&!T&&S||g>y&&S,j=!1;const I=Array.isArray(b)?b:[b];let M=I.reduce(i(x),{});k===!1&&(M={});const{prevResolvedValues:O={}}=v,z={...O,...M},E=A=>{R=!0,p.has(A)&&(j=!0,p.delete(A)),v.needsAnimating[A]=!0;const B=e.getValue(A);B&&(B.liveStyle=!1)};for(const A in z){const B=M[A],C=O[A];if(m.hasOwnProperty(A))continue;let $=!1;zh(B)&&zh(C)?$=!aS(B,C)||P:$=B!==C,$?B!=null?E(A):p.add(A):B!==void 0&&p.has(A)?E(A):v.protectedKeys[A]=!0}v.prevProp=b,v.prevResolvedValues=M,v.isActive&&(m={...m,...M}),(r||s)&&e.blockInitialAnimation&&(R=!1);const F=T&&P;R&&(!F||j)&&h.push(...I.map(A=>{const B={type:x};if(typeof A=="string"&&(r||s)&&!F&&e.manuallyAnimateOnMount&&e.parent){const{parent:C}=e,$=Ss(C,A);if(C.enteringChildren&&$){const{delayChildren:Q}=$.transition||{};B.delay=R_(C.enteringChildren,e,Q)}}return{animation:A,options:B}}))}if(p.size){const g={};if(typeof u.initial!="boolean"){const x=Ss(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(g.transition=x.transition)}p.forEach(x=>{const v=e.getBaseTarget(x),b=e.getValue(x);b&&(b.liveStyle=!0),g[x]=v??null}),h.push({animation:g})}let w=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?t(h):Promise.resolve()}function l(c,u){var h;if(n[c].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const d=a(c);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=I0(),s=!0}}}function vO(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!aS(t,e):!1}function rs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function I0(){return{animate:rs(!0),whileInView:rs(),whileHover:rs(),whileTap:rs(),whileDrag:rs(),whileFocus:rs(),exit:rs()}}function Qh(e,t){e.min=t.min,e.max=t.max}function an(e,t){Qh(e.x,t.x),Qh(e.y,t.y)}function M0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const lS=1e-4,wO=1-lS,bO=1+lS,cS=.01,kO=0-cS,_O=0+cS;function ct(e){return e.max-e.min}function SO(e,t,n){return Math.abs(e-t)<=n}function A0(e,t,n,r=.5){e.origin=r,e.originPoint=me(t.min,t.max,e.origin),e.scale=ct(n)/ct(t),e.translate=me(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wO&&e.scale<=bO||isNaN(e.scale))&&(e.scale=1),(e.translate>=kO&&e.translate<=_O||isNaN(e.translate))&&(e.translate=0)}function $o(e,t,n,r){A0(e.x,t.x,n.x,r?r.originX:void 0),A0(e.y,t.y,n.y,r?r.originY:void 0)}function L0(e,t,n,r=0){const s=r?me(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ct(t)}function CO(e,t,n,r){L0(e.x,t.x,n.x,r==null?void 0:r.x),L0(e.y,t.y,n.y,r==null?void 0:r.y)}function D0(e,t,n,r=0){const s=r?me(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ct(t)}function Gc(e,t,n,r){D0(e.x,t.x,n.x,r==null?void 0:r.x),D0(e.y,t.y,n.y,r==null?void 0:r.y)}function F0(e,t,n,r,s){return e-=t,e=Hc(e,1/n,r),s!==void 0&&(e=Hc(e,1/s,r)),e}function PO(e,t=0,n=1,r=.5,s,i=e,o=e){if(An.test(t)&&(t=parseFloat(t),t=me(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=me(i.min,i.max,r);e===i&&(a-=t),e.min=F0(e.min,t,n,a,s),e.max=F0(e.max,t,n,a,s)}function O0(e,t,[n,r,s],i,o){PO(e,t[n],t[r],t[s],t.scale,i,o)}const jO=["x","scaleX","originX"],EO=["y","scaleY","originY"];function z0(e,t,n,r){O0(e.x,t,jO,n?n.x:void 0,r?r.x:void 0),O0(e.y,t,EO,n?n.y:void 0,r?r.y:void 0)}function $0(e){return e.translate===0&&e.scale===1}function uS(e){return $0(e.x)&&$0(e.y)}function B0(e,t){return e.min===t.min&&e.max===t.max}function TO(e,t){return B0(e.x,t.x)&&B0(e.y,t.y)}function V0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function dS(e,t){return V0(e.x,t.x)&&V0(e.y,t.y)}function U0(e){return ct(e.x)/ct(e.y)}function W0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function jn(e){return[e("x"),e("y")]}function RO(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,pathRotation:d,rotateX:h,rotateY:p,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const fS=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],NO=fS.length,H0=e=>typeof e=="string"?parseFloat(e):e,G0=e=>typeof e=="number"||K.test(e);function IO(e,t,n,r,s,i){s?(e.opacity=me(0,n.opacity??1,MO(r)),e.opacityExit=me(t.opacity??1,0,AO(r))):i&&(e.opacity=me(t.opacity??1,n.opacity??1,r));for(let o=0;o<NO;o++){const a=fS[o];let l=K0(t,a),c=K0(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||G0(l)===G0(c)?(e[a]=Math.max(me(H0(l),H0(c),r),0),(An.test(c)||An.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=me(t.rotate||0,n.rotate||0,r))}function K0(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const MO=hS(0,.5,s_),AO=hS(.5,.95,Zt);function hS(e,t,n){return r=>r<e?0:r>t?1:n(ua(e,t,r))}function LO(e,t,n){const r=Ye(e)?e:Mi(e);return r.start($m("",r,t,n)),r.animation}function ha(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const DO=(e,t)=>e.depth-t.depth;class FO{constructor(){this.children=[],this.isDirty=!1}add(t){jm(this.children,t),this.isDirty=!0}remove(t){Fc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(DO),this.isDirty=!1,this.children.forEach(t)}}function OO(e,t){const n=lt.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Gr(r),e(i-t))};return ge.setup(r,!0),()=>Gr(r)}function Jl(e){return Ye(e)?e.get():e}class zO{constructor(){this.members=[]}add(t){jm(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Fc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Fc(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){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Zl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},qd=["","X","Y","Z"],$O=1e3;let BO=0;function Yd(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function pS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=L_(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ge,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&pS(r)}function mS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=BO++,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(WO),this.nodes.forEach(YO),this.nodes.forEach(XO),this.nodes.forEach(HO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new FO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Tm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Hm(o)&&!WF(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const h=()=>this.root.updateBlockedByResize=!1;ge.read(()=>{d=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=OO(h,250),Zl.hasAnimatedSinceResize&&(Zl.hasAnimatedSinceResize=!1,this.nodes.forEach(Y0)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||nz,{onLayoutAnimationStart:y,onLayoutAnimationComplete:w}=c.getProps(),g=!this.targetLayout||!dS(this.targetLayout,p),x=!d&&h;if(this.options.layoutRoot||this.resumeFrom||x||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...zm(m,"layout"),onPlay:y,onComplete:w};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,x,v.path)}else d||Y0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Gr(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(JO),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&pS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(KO),this.nodes.forEach(Q0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(q0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(QO),this.nodes.forEach(qO),this.nodes.forEach(VO),this.nodes.forEach(UO)):this.nodes.forEach(q0),this.clearAllSnapshots();const a=lt.now();qe.delta=Dn(0,1e3/60,a-qe.timestamp),qe.timestamp=a,qe.isProcessing=!0,Bd.update.process(qe),Bd.preRender.process(qe),Bd.render.process(qe),qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Um.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(GO),this.sharedNodes.forEach(ZO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ge.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ge.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ct(this.snapshot.measuredBox.x)&&!ct(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=$e()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!uS(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||cs(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),rz(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return $e();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(sz))){const{scroll:u}=this.root;u&&(Tn(a.x,u.offset.x),Tn(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=$e();if(an(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&an(a,o),Tn(a.x,d.offset.x),Tn(a.y,d.offset.y))}return a}applyTransform(o,a=!1,l){var u,d;const c=l||$e();an(c,o);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Tn(c.x,-p.scroll.offset.x),Tn(c.y,-p.scroll.offset.y)),cs(p.latestValues)&&Xl(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return cs(this.latestValues)&&Xl(c,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),c}removeTransform(o){var l;const a=$e();an(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!cs(u.latestValues))continue;let d;u.instance&&(Hh(u.latestValues)&&u.updateSnapshot(),d=$e(),an(d,u.measurePageBox())),z0(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,d)}return cs(this.latestValues)&&z0(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==qe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!this.layout||!(u||d))return;this.resolvedRelativeTargetAt=qe.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=$e(),this.targetWithTransforms=$e()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),CO(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):an(this.target,this.layout.layoutBox),J_(this.target,this.targetDelta)):an(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Hh(this.parent.latestValues)||X_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$e(),this.relativeTargetOrigin=$e(),Gc(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),an(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===qe.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;an(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;eO(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=$e());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(M0(this.prevProjectionDelta.x,this.projectionDelta.x),M0(this.prevProjectionDelta.y,this.projectionDelta.y)),$o(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!W0(this.projectionDelta.x,this.prevProjectionDelta.x)||!W0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ui(),this.projectionDelta=ui(),this.projectionDeltaWithTransform=ui()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=ui();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=$e(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,w=m!==y,g=this.getStack(),x=!g||g.members.length<=1,v=!!(w&&!x&&this.options.crossfade===!0&&!this.path.some(tz));this.animationProgress=0;let b;const S=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=k=>{const T=k/1e3,P=S==null?void 0:S(T);P?(h.x.translate=P.x,h.x.scale=me(o.x.scale,1,T),h.x.origin=o.x.origin,h.x.originPoint=o.x.originPoint,h.y.translate=P.y,h.y.scale=me(o.y.scale,1,T),h.y.origin=o.y.origin,h.y.originPoint=o.y.originPoint):(X0(h.x,o.x,T),X0(h.y,o.y,T)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gc(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),ez(this.relativeTarget,this.relativeTargetOrigin,p,T),b&&TO(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=$e()),an(b,this.relativeTarget)),w&&(this.animationValues=d,IO(d,u,this.latestValues,T,v,x)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=d),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Gr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ge.update(()=>{Zl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Mi(0)),this.motionValue.jump(0,!1),this.currentAnimation=LO(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($O),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&gS(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||$e();const d=ct(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=ct(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}an(a,l),Xl(a,u),$o(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new zO),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Yd("z",o,c,this.animationValues);for(let u=0;u<qd.length;u++)Yd(`rotate${qd[u]}`,o,c,this.animationValues),Yd(`skew${qd[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Jl(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Jl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!cs(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=RO(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),o.transform=d;const{x:h,y:p}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in Kh){if(u[m]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:g}=Kh[m],x=d==="none"?u[m]:y(u[m],c);if(w){const v=w.length;for(let b=0;b<v;b++)o[w[b]]=x}else g?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=c===this?Jl(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Q0),this.root.sharedNodes.clear()}}}function VO(e){e.updateLayout()}function UO(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")jn(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=ct(h);h.min=r[d].min,h.max=h.min+p});else if(i==="x"||i==="y"){const d=i==="x"?"y":"x";Qh(o?t.measuredBox[d]:t.layoutBox[d],r[d])}else gS(i,t.layoutBox,r)&&jn(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=ct(r[d]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=ui();$o(a,r,t.layoutBox);const l=ui();o?$o(l,e.applyTransform(s,!0),t.measuredBox):$o(l,r,t.layoutBox);const c=!uS(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:p}=d;if(h&&p){const m=e.options.layoutAnchor||void 0,y=$e();Gc(y,t.layoutBox,h.layoutBox,m);const w=$e();Gc(w,r,p.layoutBox,m),dS(y,w)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function WO(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 HO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function GO(e){e.clearSnapshot()}function Q0(e){e.clearMeasurements()}function KO(e){e.isLayoutDirty=!0,e.updateLayout()}function q0(e){e.isLayoutDirty=!1}function QO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function qO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Y0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YO(e){e.resolveTargetDelta()}function XO(e){e.calcProjection()}function JO(e){e.resetSkewAndRotation()}function ZO(e){e.removeLeadSnapshot()}function X0(e,t,n){e.translate=me(t.translate,0,n),e.scale=me(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function J0(e,t,n,r){e.min=me(t.min,n.min,r),e.max=me(t.max,n.max,r)}function ez(e,t,n,r){J0(e.x,t.x,n.x,r),J0(e.y,t.y,n.y,r)}function tz(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const nz={duration:.45,ease:[.4,0,.1,1]},Z0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ev=Z0("applewebkit/")&&!Z0("chrome/")?Math.round:Zt;function tv(e){e.min=ev(e.min),e.max=ev(e.max)}function rz(e){tv(e.x),tv(e.y)}function gS(e,t,n){return e==="position"||e==="preserve-aspect"&&!SO(U0(t),U0(n),.2)}function sz(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const iz=mS({attachResizeListener:(e,t)=>ha(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Xd={current:void 0},yS=mS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xd.current){const e=new iz({});e.mount(window),e.setOptions({layoutScroll:!0}),Xd.current=e}return Xd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Xm=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function nv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function oz(...e){return t=>{let n=!1;const r=e.map(s=>{const i=nv(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():nv(e[s],null)}}}}function az(...e){return _.useCallback(oz(...e),e)}class lz extends _.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Kl(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Kl(r)&&r.offsetWidth||0,i=Kl(r)&&r.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left,a.bottom=i-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function cz({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=_.useId(),a=_.useRef(null),l=_.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=_.useContext(Xm),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),d=az(a,u);return _.useInsertionEffect(()=>{const{width:p,height:m,top:y,left:w,right:g,bottom:x,direction:v}=l.current;if(t||i===!1||!a.current||!p||!m)return;const b=v==="rtl",S=n==="left"?b?`right: ${g}`:`left: ${w}`:b?`left: ${w}`:`right: ${g}`,k=r==="bottom"?`bottom: ${x}`:`top: ${y}`;a.current.dataset.motionPopId=o;const T=document.createElement("style");c&&(T.nonce=c);const P=s??document.head;return P.appendChild(T),T.sheet&&T.sheet.insertRule(`
70
+ `},s),i}function lM(e,t){return e&&"run"in e?async function(n,r){const s=wx(n,{file:r,...t});await e.run(s,r)}:function(n,r){return wx(n,{file:r,...e||t})}}function bx(e){if(e)throw e}var Vl=Object.prototype.hasOwnProperty,fk=Object.prototype.toString,kx=Object.defineProperty,_x=Object.getOwnPropertyDescriptor,Sx=function(t){return typeof Array.isArray=="function"?Array.isArray(t):fk.call(t)==="[object Array]"},Cx=function(t){if(!t||fk.call(t)!=="[object Object]")return!1;var n=Vl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Vl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||Vl.call(t,s)},Px=function(t,n){kx&&n.name==="__proto__"?kx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},jx=function(t,n){if(n==="__proto__")if(Vl.call(t,n)){if(_x)return _x(t,n).value}else return;return t[n]},cM=function e(){var t,n,r,s,i,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=jx(a,n),s=jx(t,n),a!==s&&(u&&s&&(Cx(s)||(i=Sx(s)))?(i?(i=!1,o=r&&Sx(r)?r:[]):o=r&&Cx(r)?r:{},Px(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&Px(a,{name:n,newValue:s}));return a};const _d=qc(cM);function wh(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 uM(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(l,...c){const u=e[++i];let d=-1;if(l){o(l);return}for(;++d<s.length;)(c[d]===null||c[d]===void 0)&&(c[d]=s[d]);s=c,u?dM(u,a)(...c):o(null,...c)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function dM(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(s);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return s(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(o,...a){n||(n=!0,t(o,...a))}function i(o){s(null,o)}}const Pn={basename:fM,dirname:hM,extname:pM,join:mM,sep:"/"};function fM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');wa(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else o<0&&(i=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(r=s):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function hM(e){if(wa(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 pM(e){wa(e);let t=e.length,n=-1,r=0,s=-1,i=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function mM(...e){let t=-1,n;for(;++t<e.length;)wa(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":gM(n)}function gM(e){wa(e);const t=e.codePointAt(0)===47;let n=yM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yM(e,t){let n="",r=0,s=-1,i=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||i===1))if(s!==o-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=o,i=0;continue}}else if(n.length>0){n="",r=0,s=o,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,i=0}else a===46&&i>-1?i++:i=-1}return n}function wa(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xM={cwd:vM};function vM(){return"/"}function bh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function wM(e){if(typeof e=="string")e=new URL(e);else if(!bh(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 bM(e)}function bM(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Sd=["history","path","basename","stem","extname","dirname"];class hk{constructor(t){let n;t?bh(t)?n={path:t}:typeof t=="string"||kM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Sd.length;){const i=Sd[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)Sd.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Pn.basename(this.path):void 0}set basename(t){Pd(t,"basename"),Cd(t,"basename"),this.path=Pn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Pn.dirname(this.path):void 0}set dirname(t){Ex(this.basename,"dirname"),this.path=Pn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Pn.extname(this.path):void 0}set extname(t){if(Cd(t,"extname"),Ex(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=Pn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){bh(t)&&(t=wM(t)),Pd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Pn.basename(this.path,this.extname):void 0}set stem(t){Pd(t,"stem"),Cd(t,"stem"),this.path=Pn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new ot(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Cd(e,t){if(e&&e.includes(Pn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Pn.sep+"`")}function Pd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ex(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function kM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _M=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},SM={}.hasOwnProperty;class gm extends _M{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=uM()}copy(){const t=new gm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(_d(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Td("data",this.frozen),this.namespace[t]=n,this):SM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Td("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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=il(t),r=this.parser||this.Parser;return jd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),jd("process",this.parser||this.Parser),Ed("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=il(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const p=d,m=r.stringify(p,h);jM(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?o(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),jd("processSync",this.parser||this.Parser),Ed("processSync",this.compiler||this.Compiler),this.process(t,s),Rx("processSync","process",n),r;function s(i,o){n=!0,bx(i),r=o}}run(t,n,r){Tx(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(o,a){const l=il(n);s.run(t,l,c);function c(u,d,h){const p=d||t;u?a(u):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),Rx("runSync","run",r),s;function i(o,a){bx(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=il(n),s=this.compiler||this.Compiler;return Ed("stringify",s),Tx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Td("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))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");a(c.plugins),c.settings&&(s.settings=_d(!0,s.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const y=r[h][1];wh(y)&&wh(p)&&(p=_d(!0,y,p)),r[h]=[c,p,...m]}}}}const CM=new gm().freeze();function jd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ed(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Td(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 Tx(e){if(!wh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Rx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function il(e){return PM(e)?e:new hk(e)}function PM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jM(e){return typeof e=="string"||EM(e)}function EM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nx=[],Ix={allowDangerousHtml:!0},RM=/^(https?|ircs?|mailto|xmpp)$/i,NM=[{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 IM(e){const t=MM(e),n=AM(e);return LM(t.runSync(t.parse(n),n),e)}function MM(e){const t=e.rehypePlugins||Nx,n=e.remarkPlugins||Nx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ix}:Ix;return CM().use(fI).use(n).use(lM,r).use(t)}function AM(e){const t=e.children||"",n=new hk;return typeof t=="string"&&(n.value=t),n}function LM(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||DM;for(const u of NM)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+TM+u.id,void 0);return dk(e,c),H2(e,{Fragment:f.Fragment,components:s,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return o?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in wd)if(Object.hasOwn(wd,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],y=wd[p];(y===null||y.includes(u.tagName))&&(u.properties[p]=l(String(m||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(u,d,h)),p&&h&&typeof d=="number")return a&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function DM(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||RM.test(e.slice(0,t))?e:""}const Rd=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,FM={p:({children:e})=>f.jsx("p",{className:"mb-4",children:e}),strong:({children:e})=>f.jsx("strong",{className:"font-bold",children:e}),h1:({children:e})=>f.jsx("h1",{className:Rd("text-lg"),children:e}),h2:({children:e})=>f.jsx("h2",{className:Rd("text-[1.3rem]"),children:e}),h3:({children:e})=>f.jsx("h3",{className:Rd("text-[1.1rem]"),children:e}),a:({children:e,href:t})=>f.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-watercolor-amber-dark",children:e}),code:({children:e})=>f.jsx("code",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-[3px] py-[0.1em] px-[0.35em]",children:e}),pre:({children:e})=>f.jsx("pre",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-md py-3 px-4 overflow-x-auto mb-4",children:e}),ul:({children:e})=>f.jsx("ul",{className:"list-disc mb-4 pl-[1.4rem]",children:e}),ol:({children:e})=>f.jsx("ol",{className:"list-decimal mb-4 pl-[1.4rem]",children:e}),li:({children:e})=>f.jsx("li",{className:"mb-[0.4rem]",children:e}),blockquote:({children:e})=>f.jsx("blockquote",{className:"mb-4 pl-4 border-l-[3px] border-solid border-black/[15%] opacity-[0.85]",children:e})},pk=({children:e})=>f.jsx(IM,{components:FM,children:e}),OM={},Mx=e=>{let t;const n=new Set,r=(u,d)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const p=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(OM?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,s,l);return l},zM=e=>e?Mx(e):Mx,mk={},{useDebugValue:$M}=bi,{useSyncExternalStoreWithSelector:BM}=yT;let Ax=!1;const VM=e=>e;function UM(e,t=VM,n){(mk?"production":void 0)!=="production"&&n&&!Ax&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ax=!0);const r=BM(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return $M(r),r}const WM=e=>{(mk?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?zM(e):e,n=(r,s)=>UM(t,r,s);return Object.assign(n,t),n},HM=e=>WM;let gk="";function GM(e){gk=e}function K(e){return`${gk}${e}`}const yk=async()=>{const e=await fetch(K("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},KM=async()=>{const e=await fetch(K("/api/agent/auth-status"));return e.ok?await e.json():null},W9=async()=>{try{const e=await fetch(K("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},H9=async e=>{try{const t=await fetch(K(`/api/connections/connect?id=${encodeURIComponent(e)}`),{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},xk=async()=>{try{const e=await fetch(K("/api/config"));return e.ok?e.json():null}catch{return null}},G9=async e=>{try{const t=await fetch(K("/api/config"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)return{ok:!0};const n=await t.json().catch(()=>null);return{ok:!1,error:n==null?void 0:n.error}}catch(t){return{ok:!1,error:t.message}}},QM=async()=>{try{const e=await fetch(K("/api/icon"));if(!e.ok)return null;const t=await e.blob();return new Promise(n=>{const r=new FileReader;r.onloadend=()=>n(r.result),r.readAsDataURL(t)})}catch{return null}},K9=async e=>{try{return(await fetch(K("/api/icon"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},qM=async()=>{try{const e=await fetch(K("/api/package-name"));return e.ok?e.json():null}catch{return null}},On=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},YM=async()=>(await fetch(K("/api/agent/status"))).json(),XM=async()=>(await fetch(K("/api/agent/reconcile-queue"))).json(),JM=async(e,t)=>{const n=await fetch(K("/api/agent/launch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await On(n)},ZM=async(e,t)=>{const n=await fetch(K("/api/agent/launch-audit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await On(n)},eA=async(e,t)=>{const n=await fetch(K("/api/agent/launch-reconcile"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await On(n)},tA=async(e,t)=>{const n=await fetch(K("/api/agent/launch-draft"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await On(n)},nA=async(e,t)=>{const n=await fetch(K("/api/agent/launch-extend"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await On(n)},rA=async e=>{const t=await fetch(K("/api/agent/launch-suggest"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await On(t)},sA=async()=>{const e=await fetch(K("/api/agent/launch-reconcile-all"),{method:"POST"});await On(e)},iA=async e=>{const t=await fetch(K("/api/agent/launch-run-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await On(t)},oA=async e=>{const t=await fetch(K("/api/agent/launch-fix-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await On(t)},aA=async(e,t,n)=>{const r=await fetch(K("/api/agent/feedback-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,text:t,context:n})}),s=await r.json();if(!r.ok)throw new Error(s.error??"Failed to send message");return s},Lx=async(e,t,n,r)=>{const s=await fetch(K("/api/agent/feedback-promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,index:t,target:n,note:r})});if(!s.ok){const i=await s.json().catch(()=>null);throw new Error((i==null?void 0:i.error)??`Failed to promote message (${s.status})`)}},lA=async e=>{const t=await fetch(K("/api/agent/feedback-summarize"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)??`Failed to summarize feedback (${t.status})`);return n},cA=async(e,t)=>{const n=await fetch(K("/api/agent/feedback-undo"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,commitSha:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to undo edit");return r},uA=async e=>{const t=await fetch(K("/api/agent/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await On(t,"Stop failed")},dA=async()=>(await fetch(K("/api/agent/login-relay/start"),{method:"POST"})).json(),fA=async()=>(await fetch(K("/api/agent/login-relay/status"))).json(),hA=async()=>{await fetch(K("/api/agent/login-relay/cancel"),{method:"POST"})};function Jt(e,t,n,r=()=>({}),s){return async()=>{s&&e({[s]:!0});try{const i=await t();e({...n(i),...s&&{[s]:!1}})}catch(i){e({...r(i),...s&&{[s]:!1}})}}}function ur(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let pA=0;const Dx=()=>`preview-${++pA}`;function mA(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:Jt(e,KM,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await YM();e({agentStatus:n});const r=t().pendingReconcile,s=r?n.find(o=>o.taskKind==="reconcile"&&o.planId===r.planId):void 0;r&&s&&(s.status==="done"?(await t().loadPlans(),e(o=>({reconcileQueue:[...o.reconcileQueue,{...r,previewId:Dx()}],pendingReconcile:null}))):s.status==="error"&&e({pendingReconcile:null}));const i=n.find(o=>o.taskKind==="batch-reconcile");if((i==null?void 0:i.status)==="done"&&!t().batchReconcileConsumed){const o=await XM();o&&o.length>0&&(await t().loadPlans(),e(a=>({reconcileQueue:[...a.reconcileQueue,...o.map(l=>({planId:l.planId,before:l.before,previewId:Dx()}))]}))),e({batchReconcileConsumed:!0})}}catch{}},launchAgent:ur(t,JM),launchPlanAudit:ur(t,ZM),launchPlanReconcile:async(n,r,s)=>{const i=t().pendingReconcile;if(i)throw new Error(i.planId===n?"A reconcile is already in progress for this plan":"A reconcile is already in progress for another plan");if(t().reconcileQueue.some(o=>o.planId===n))throw new Error("Review the pending reconcile for this plan first");e({pendingReconcile:{planId:n,before:s}});try{await eA(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:ur(t,tA),launchIdeaExtend:ur(t,nA),launchBatchReconcile:ur(t,async()=>{e({batchReconcileConsumed:!1}),await sA()}),launchSuggestIdeas:ur(t,rA),launchRunAll:ur(t,iA),launchFixReview:ur(t,oA),stopAgent:async n=>{try{await uA(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await dA();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:Jt(e,fA,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await hA()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}const gA=async()=>(await fetch(K("/api/tasks"))).json(),Q9=async e=>{const t=await fetch(K(`/api/tasks/output?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},yA=async()=>(await fetch(K("/api/suggestions"))).json(),xA=async e=>{const t=await fetch(K("/api/suggestions/promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to promote suggestion"}));throw new Error(n.error)}return t.json()},vA=async e=>{const t=await fetch(K("/api/suggestions/dismiss"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to dismiss suggestion"}));throw new Error(n.error)}},wA=async()=>(await fetch(K("/api/docs"))).json(),vk=async()=>{const e=await fetch(K("/api/roadmap"));if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},bA=async(e,t,n,r)=>{const s=await fetch(K("/api/roadmap/promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,item:t,subject:n,candidateName:r})});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to promote roadmap item"}));throw new Error(i.error)}return s.json()},q9=async(e,t,n)=>{const r=await fetch(K("/api/roadmap/items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,name:t,description:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap item"}));throw new Error(s.error)}},Y9=async(e,t,n)=>{const r=await fetch(K("/api/roadmap/candidates"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,itemName:t,name:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap candidate"}));throw new Error(s.error)}},kA=async()=>(await fetch(K("/api/consistency"))).json(),wk=async()=>(await fetch(K("/api/ideas"))).json(),_A=async()=>(await fetch(K("/api/archivable-ideas"))).json(),SA=async e=>{const t=await fetch(K("/api/ideas/archive"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to archive ideas");return n},bk=async e=>{const t=await fetch(K("/api/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create idea");return n.id},kk=async(e,t)=>{const n=await fetch(K("/api/ideas/check-overlap"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e,candidates:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to check overlap");return r},CA=async()=>{const e=await fetch(K("/api/ideas/prioritise"),{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},PA=async()=>{const e=await fetch(K("/api/parked-questions"));if(!e.ok)throw new Error(`Failed to fetch parked questions: ${e.status}`);return e.json()},_k=async()=>(await fetch(K("/api/plans"))).json(),jA=async e=>{await fetch(K("/api/plans"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},EA=async(e,t)=>{const n=await fetch(K(`/api/plans?title=${encodeURIComponent(e)}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>null);throw new Error((r==null?void 0:r.error)??`Failed to update plan (${n.status})`)}},TA=async()=>{const e=await fetch(K("/api/releases"));if(!e.ok)throw new Error("Failed to load releases");const{versions:t}=await e.json();return t},X9=async e=>{const t=await fetch(K(`/api/release-notes?version=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load release notes");return t.json()};function RA(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await wA();e({repoDocs:n.files,repoDocsLoading:!1});const{activeDocTitle:r}=t();if(!r){const s=["MAIN.md","README.md"].find(i=>n.files.some(o=>o.name===i));s&&e({activeDocTitle:s})}}catch{e({repoDocs:[],repoDocsLoading:!1})}},activeDocTitle:null,setActiveDocTitle:n=>e({activeDocTitle:n}),docSearchQuery:"",setDocSearchQuery:n=>e({docSearchQuery:n}),releaseVersions:[],releaseVersionsLoading:!0,loadReleaseVersions:async()=>{e({releaseVersionsLoading:!0});try{const n=await TA();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}function NA(e,t){return{ideaEntries:[],loadIdeas:Jt(e,wk,n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:Jt(e,_A,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await SA(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function IA(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:Jt(e,PA,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const Ic=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=Math.floor((Date.now()-t.getTime())/864e5);return n<=0?"today":n===1?"yesterday":n<7?`${n}d ago`:n<30?`${Math.floor(n/7)}w ago`:n<365?`${Math.floor(n/30)}mo ago`:`${Math.floor(n/365)}y ago`},Sk=e=>{if(e.length===0)return null;const t=e.filter(n=>n.done).length;return{done:t,total:e.length,pct:Math.round(t/e.length*100)}},Ck=e=>Sk(e.phases),Fx=e=>{var t;return((t=Ck(e))==null?void 0:t.pct)??null},MA=e=>Sk([...e.phases,...e.fixes??[]]),AA=(e,t)=>{const n=MA(e);if(!n)return null;const r=Math.min(n.total,n.done+t);return{done:n.done,total:n.total,pct:r/n.total*100}},ym=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,xm=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:ym(e.id,t)?"in-progress":e.status,LA=e=>!e.pr&&e.status!=="done"&&e.status!=="dropped"&&e.status!=="review"&&e.phases.length>0&&e.phases.every(t=>t.done)&&(e.fixes??[]).every(t=>t.done),DA=(e,t)=>{if(e)return e.find(n=>n.status==="in-progress"||n.status==="review")};function Nd(e,t){const n=e.split(/(\s+)/).filter(u=>u!==""),r=t.split(/(\s+)/).filter(u=>u!==""),s=n.length,i=r.length,o=Array.from({length:s+1},()=>new Array(i+1).fill(0));for(let u=s-1;u>=0;u--)for(let d=i-1;d>=0;d--)o[u][d]=n[u]===r[d]?o[u+1][d+1]+1:Math.max(o[u+1][d],o[u][d+1]);const a=[];let l=0,c=0;for(;l<s&&c<i;)n[l]===r[c]?(a.push({type:"same",text:n[l]}),l++,c++):o[l+1][c]>=o[l][c+1]?(a.push({type:"removed",text:n[l]}),l++):(a.push({type:"added",text:r[c]}),c++);for(;l<s;)a.push({type:"removed",text:n[l]}),l++;for(;c<i;)a.push({type:"added",text:r[c]}),c++;return FA(a)}function FA(e){const t=[];for(const n of e){const r=t[t.length-1];r&&r.type===n.type?r.text+=n.text:t.push({...n})}return t}const OA=["idea","planned","in-progress","review","done","dropped"],zA=["feat","fix","chore","docs","refactor"],J9=["claude-code","opencode"],$A={"claude-code":"Claude Code",opencode:"OpenCode"},Z9={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},eH={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"}},BA=["in-progress","review","planned","idea"],VA=["open"],vm={statuses:BA,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:VA,subject:null},Ox={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},ol=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},zx=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},$x=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},Id=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},Bx=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),Fo=(e,t)=>t===null||e===t,wm=(e,t,n,r="asc")=>{if(n==="order")return e.order!==void 0&&t.order!==void 0?(r==="desc"?-1:1)*(e.order-t.order):e.order!==void 0?-1:t.order!==void 0?1:zx(e)-zx(t);const s=(()=>{switch(n){case"status":{const i=Ox[e.status]-Ox[t.status];return i!==0?i:ol(t)-ol(e)}case"updated":return ol(t)-ol(e);case"title":return e.title.localeCompare(t.title);case"id":return $x(e)-$x(t);case"progress":return(Fx(t)??-1)-(Fx(e)??-1);default:return 0}})();return r==="desc"?-s:s},kh=(e,t)=>{const n={};for(const r of e)for(const s of t(r))n[String(s)]=(n[String(s)]??0)+1;return n},Ul=(e,t=vm)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=kh(e.filter(a=>Bx(a,n)&&Id(a,t.search)&&Fo(a.subject,t.subject)),a=>[a.status]);for(const a of OA)s[a]??(s[a]=0);const i=kh(e.filter(a=>r.has(a.status)&&Id(a,t.search)&&Fo(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&Bx(a,n)&&Id(a,t.search)&&Fo(a.subject,t.subject)).sort((a,l)=>wm(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},UA=["open","done","dropped"],WA={open:"idea",done:"done",dropped:"dropped"},Md=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},HA=e=>e.type==="plan"?e.plan.subject:e.idea.subject,GA=e=>e.type==="plan"?e.plan.order:e.idea.order,KA=e=>{const t=e.type==="plan"?e.plan.updated??e.plan.created:e.idea.created,n=new Date(t??"").getTime();return Number.isNaN(n)?0:n},Vx=(e,t)=>e.reduce((n,r)=>{const s=GA(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),Ux=e=>e.reduce((t,n)=>Math.max(t,KA(n)),0),QA=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=HA(l);if(!c||n&&!n.includes(c)){s.push(l);continue}r.has(c)||r.set(c,[]),(a=r.get(c))==null||a.push(l)}const i=t==="desc"?-1:1,o=[...r.entries()].map(([l,c])=>({subject:l,rows:c})).sort((l,c)=>{const u=Vx(l.rows,t),d=Vx(c.rows,t);return u!==void 0&&d!==void 0?i*(u-d):u!==void 0?-1:d!==void 0?1:Ux(c.rows)-Ux(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},Wx=e=>e.type==="plan"?e.plan:e.type==="note"?{title:e.idea.title,id:e.idea.id??void 0,status:WA[e.idea.status??"open"],created:e.idea.created??"",tags:[],body:e.idea.body,phases:[],order:e.idea.order}:{...(e.children.length>0?[...e.children].sort((n,r)=>wm(n,r,"status"))[0]:void 0)??{status:"idea",created:e.idea.created??"",tags:[],body:e.idea.body,phases:[]},title:e.idea.title,id:e.idea.id??void 0,order:e.idea.order},qA=(e,t,n=vm)=>{const{statusCounts:r,tagCounts:s}=Ul(e,n),i=t.filter(p=>p.kind==="note"),o=t.filter(p=>p.kind!=="note"),a=new Set(o.map(p=>p.id).filter(p=>!!p)),l=new Map,c=[];for(const p of e)if(p.idea&&a.has(p.idea)){const m=l.get(p.idea)??[];m.push(p),l.set(p.idea,m)}else c.push(p);const u=new Set(n.noteStatuses),d=kh(i.filter(p=>Md(p,n.search)),p=>[p.status??"open"]);for(const p of UA)d[p]??(d[p]=0);const h=Ul(c,n).rows.map(p=>({type:"plan",plan:p}));for(const p of o){const m=p.id?l.get(p.id)??[]:[],y=Ul(m,n).rows;!Fo(p.subject,n.subject)&&y.length===0||y.length===0&&(m.length>0||!Md(p,n.search))||h.push({type:"idea-group",idea:p,children:y})}for(const p of i)u.has(p.status??"open")&&Md(p,n.search)&&Fo(p.subject,n.subject)&&h.push({type:"note",idea:p});return h.sort((p,m)=>wm(Wx(p),Wx(m),n.sortKey,n.sortDirection)),{rows:h,statusCounts:r,tagCounts:s,noteStatusCounts:d}},YA=.2,XA=5,Pk=3,jk=2,Ek=1,JA=Pk+jk+Ek,ZA=new Set(["a","an","the","and","or","of","to","in","on","for","is","at","with","this","that","it","as","be","by","are","was","were","from","into","so","but","not","its"]),al=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!ZA.has(n));return new Set(t)},Ad=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function eL(e,t,n={}){const{threshold:r=YA,limit:s=XA}=n,i=al(e);if(i.size===0)return[];const o=[];for(const a of t){const l=al(a.title),c=al(a.body),u=al((a.tags??[]).join(" ")),h=(Ad(i,l)*Pk+Ad(i,u)*jk+Ad(i,c)*Ek)/(i.size*JA);h>=r&&o.push({candidate:a,score:h})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const tL=e=>{if(!e.file)return;const t=e.line_start??e.line;if(!t)return e.file;const n=e.line_end&&e.line_end!==t?`-${e.line_end}`:"";return`${e.file}:${t}${n}`},nL=(e,t)=>{const n=e.description??e.title??e.summary;if(!(n!=null&&n.trim()))throw new Error(`Finding ${t+1} has no description/title/summary`);const r=[tL(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},rL=e=>{let t;try{t=JSON.parse(e)}catch{throw new Error("Not valid JSON")}const n=Array.isArray(t)?t:Array.isArray(t==null?void 0:t.findings)?t.findings:null;if(!n)throw new Error('Expected a JSON array of findings, or an object with a "findings" array');if(n.length===0)throw new Error("No findings to add");return n.map((r,s)=>nL(r,s))};function sL(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:Jt(e,_k,n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:vm,togglePlanStatus:n=>e(r=>({planFilters:{...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]}})),togglePlanTag:n=>e(r=>({planFilters:{...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]}})),toggleNoteStatus:n=>e(r=>({planFilters:{...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]}})),setPlanSearch:n=>e(r=>({planFilters:{...r.planFilters,search:n}})),setSubjectFilter:n=>e(r=>({planFilters:{...r.planFilters,subject:n}})),setPlanSortKey:n=>e(r=>({planFilters:{...r.planFilters,sortKey:n}})),togglePlanSortDirection:()=>e(n=>({planFilters:{...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc"}})),detailView:"details",setDetailView:n=>e({detailView:n})}}const iL={horizons:[],statuses:[]},oL=e=>[...new Set(e.links.map(t=>t.status))],Tk=(e,t)=>t.length===0||e.links.some(n=>t.includes(n.status)),Rk=(e,t)=>t.length===0||t.includes(e),tH=(e,t)=>e.horizons.filter(n=>Rk(n.title,t.horizons)).map(n=>({...n,items:n.items.filter(r=>Tk(r,t.statuses))})),nH=(e,t)=>Object.fromEntries(e.horizons.map(n=>[n.title,n.items.filter(r=>Tk(r,t.statuses)).length])),rH=(e,t)=>{const n={};for(const r of e.horizons)if(Rk(r.title,t.horizons))for(const s of r.items)for(const i of oL(s))n[i]=(n[i]??0)+1;return n};function aL(e,t){return{roadmap:null,roadmapLoading:!1,roadmapError:null,loadRoadmap:Jt(e,vk,n=>({roadmap:n,roadmapError:null}),n=>({roadmapError:String(n)}),"roadmapLoading"),roadmapFilters:iL,toggleRoadmapHorizon:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,horizons:r.roadmapFilters.horizons.includes(n)?r.roadmapFilters.horizons.filter(s=>s!==n):[...r.roadmapFilters.horizons,n]}})),toggleRoadmapStatus:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,statuses:r.roadmapFilters.statuses.includes(n)?r.roadmapFilters.statuses.filter(s=>s!==n):[...r.roadmapFilters.statuses,n]}}))}}async function Xr(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const lL=async()=>{const e=await fetch(K("/api/git/status"));return await Xr(e,"Failed to load git status"),e.json()},sH=async()=>{const e=await fetch(K("/api/git/diff"));return await Xr(e,"Failed to load diff"),(await e.json()).files},Nk=async(e,t,n)=>{const r=await fetch(K("/api/git/commit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n})});await Xr(r,"Commit failed")},cL=async()=>{const e=await fetch(K("/api/git/push"),{method:"POST"});await Xr(e,"Push failed")},Ik=async e=>{const t=await fetch(K("/api/git/suggest-commit-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await Xr(t,"Failed to suggest a commit message"),t.json()},uL=async()=>{const e=await fetch(K("/api/git/sync"),{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Xr(e,"Sync failed"),{ok:!0}},dL=async()=>{const e=await fetch(K("/api/git/pull"),{method:"POST"});await Xr(e,"Pull failed")},fL=async()=>{const e=await fetch(K("/api/git/fix-divergence"),{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Xr(e,"Fix failed"),{ok:!0}},hL=async e=>{const t=await fetch(K("/api/git/resolve-conflict"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});try{return await t.json()}catch{return{ok:!1,error:`Unexpected response (status ${t.status})`}}},pL=async e=>{const t=await fetch(K("/api/git/branch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return n.branch},mL=async()=>(await fetch(K("/api/status"))).json(),gL=async e=>{await fetch(K(`/api/status/check?name=${e}`),{method:"POST"})},yL=async()=>{await fetch(K("/api/status/fix"),{method:"POST"})},xL=async()=>{const e=await fetch(K("/api/refresh"),{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function vL(e,t){return{status:null,refreshing:!1,loadStatus:Jt(e,mL,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await xL().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadGitStatus(),t().loadAgentStatus(),t().loadAgentAuthStatus()]);const n=t().plansError;return n?{ok:!1,error:n}:{ok:!0}}finally{e({refreshing:!1})}},runCheck:async n=>{try{await gL(n)}catch{}},fixQuality:async()=>{try{await yL()}catch{}},commitInFlight:!1,setCommitInFlight:n=>e({commitInFlight:n}),activeGitAction:null,setActiveGitAction:n=>e({activeGitAction:n}),quickCommit:async()=>{const{gitStatus:n,loadGitStatus:r,commitInFlight:s}=t();if(s)return{ok:!1,error:"A commit is already in progress"};if(!n||n.length===0)return{ok:!1,error:"Nothing to commit"};const i=n.map(o=>o.path);e({commitInFlight:!0});try{const{title:o,message:a}=await Ik(i);return await Nk(i,o,a||void 0),await r()?{ok:!0,title:o}:{ok:!0,title:o,warning:"Committed, but the git status refresh failed — reload to confirm"}}catch(o){return{ok:!1,error:o.message}}finally{e({commitInFlight:!1})}},consistency:[],loadConsistency:Jt(e,kA,n=>({consistency:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a}=await lL();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a}),!0}catch{return!1}},capabilities:[],loadCapabilities:Jt(e,yk,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function wL(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:Jt(e,yA,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await xA(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await vA(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await bA(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await CA();return await t().refreshAll(),n}}}function bL(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:Jt(e,gA,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const L=HM()((e,t)=>({...sL(e),...aL(e),...NA(e,t),...wL(e,t),...bL(e),...RA(e,t),...vL(e,t),...mA(e,t),...IA(e)})),bm=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),Jr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),kL=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},_L=e=>e.capabilities.filter(t=>t.status!=="ok").length,SL=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1},CL=e=>{var t;return((t=e.agentStatus.find(n=>n.rateLimit))==null?void 0:t.rateLimit)??null};function PL(e){return e.includes("running")?"running":e.includes("fail")?"fail":e.every(t=>t==="stale")?"stale":"pass"}function Mk(e){var t,n,r,s;return{qualityStatus:PL([((t=e==null?void 0:e.lint)==null?void 0:t.status)??"stale",((n=e==null?void 0:e.format)==null?void 0:n.status)??"stale"]),testStatus:((r=e==null?void 0:e.test)==null?void 0:r.status)??"stale",consistencyStatus:((s=e==null?void 0:e.consistency)==null?void 0:s.status)??"stale"}}function Ak(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Ak(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jL(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Ak(e))&&(r&&(r+=" "),r+=t);return r}const km="-",EL=e=>{const t=RL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(km);return a[0]===""&&a.length!==1&&a.shift(),Lk(a,t)||TL(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Lk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Lk(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(km);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Hx=/^\[(.+)\]$/,TL=e=>{if(Hx.test(e)){const t=Hx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},RL=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return IL(Object.entries(e.classGroups),n).forEach(([i,o])=>{_h(o,r,i,t)}),r},_h=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Gx(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(NL(s)){_h(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{_h(o,Gx(t,i),n,r)})})},Gx=(e,t)=>{let n=e;return t.split(km).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},NL=e=>e.isThemeGetter,IL=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,ML=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},Dk="!",AL=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,u=0,d;for(let w=0;w<a.length;w++){let g=a[w];if(c===0){if(g===s&&(r||a.slice(w,w+i)===t)){l.push(a.slice(u,w)),u=w+i;continue}if(g==="/"){d=w;continue}}g==="["?c++:g==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(Dk),m=p?h.substring(1):h,y=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:o}):o},LL=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},DL=e=>({cache:ML(e.cacheSize),parseClassName:AL(e),...EL(e)}),FL=/\s+/,OL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(FL);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let m=!!p,y=r(m?h.substring(0,p):h);if(!y){if(!m){a=c+(a.length>0?" "+a:a);continue}if(y=r(h),!y){a=c+(a.length>0?" "+a:a);continue}m=!1}const w=LL(u).join(":"),g=d?w+Dk:w,x=g+y;if(i.includes(x))continue;i.push(x);const v=s(y,m);for(let b=0;b<v.length;++b){const S=v[b];i.push(g+S)}a=c+(a.length>0?" "+a:a)}return a};function zL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Fk(t))&&(r&&(r+=" "),r+=n);return r}const Fk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Fk(e[r]))&&(n&&(n+=" "),n+=t);return n};function $L(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,d)=>d(u),e());return n=DL(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=OL(l,n);return s(l,u),u}return function(){return i(zL.apply(null,arguments))}}const be=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ok=/^\[(?:([a-z-]+):)?(.+)\]$/i,BL=/^\d+\/\d+$/,VL=new Set(["px","full","screen"]),UL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WL=/\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$/,HL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,GL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vn=e=>wi(e)||VL.has(e)||BL.test(e),dr=e=>Bi(e,"length",tD),wi=e=>!!e&&!Number.isNaN(Number(e)),Ld=e=>Bi(e,"number",wi),fo=e=>!!e&&Number.isInteger(Number(e)),QL=e=>e.endsWith("%")&&wi(e.slice(0,-1)),re=e=>Ok.test(e),fr=e=>UL.test(e),qL=new Set(["length","size","percentage"]),YL=e=>Bi(e,qL,zk),XL=e=>Bi(e,"position",zk),JL=new Set(["image","url"]),ZL=e=>Bi(e,JL,rD),eD=e=>Bi(e,"",nD),ho=()=>!0,Bi=(e,t,n)=>{const r=Ok.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},tD=e=>WL.test(e)&&!HL.test(e),zk=()=>!1,nD=e=>GL.test(e),rD=e=>KL.test(e),sD=()=>{const e=be("colors"),t=be("spacing"),n=be("blur"),r=be("brightness"),s=be("borderColor"),i=be("borderRadius"),o=be("borderSpacing"),a=be("borderWidth"),l=be("contrast"),c=be("grayscale"),u=be("hueRotate"),d=be("invert"),h=be("gap"),p=be("gradientColorStops"),m=be("gradientColorStopPositions"),y=be("inset"),w=be("margin"),g=be("opacity"),x=be("padding"),v=be("saturate"),b=be("scale"),S=be("sepia"),k=be("skew"),T=be("space"),P=be("translate"),R=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",re,t],M=()=>[re,t],O=()=>["",Vn,dr],z=()=>["auto",wi,re],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",re],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[wi,re];return{cacheSize:500,separator:":",theme:{colors:[ho],spacing:[Vn,dr],blur:["none","",fr,re],brightness:$(),borderColor:[e],borderRadius:["none","","full",fr,re],borderSpacing:M(),borderWidth:O(),contrast:$(),grayscale:B(),hueRotate:$(),invert:B(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[QL,dr],inset:I(),margin:I(),opacity:$(),padding:M(),saturate:$(),scale:$(),sepia:B(),skew:$(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[fr]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:[...E(),re]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fo,re]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",fo,re]}],"grid-cols":[{"grid-cols":[ho]}],"col-start-end":[{col:["auto",{span:["full",fo,re]},re]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[ho]}],"row-start-end":[{row:["auto",{span:[fo,re]},re]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[fr]},fr]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fr,dr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ld]}],"font-family":[{font:[ho]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",wi,Ld]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vn,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vn,dr]}],"underline-offset":[{"underline-offset":["auto",Vn,re]}],"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:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),XL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",YL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ZL]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:F()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[Vn,re]}],"outline-w":[{outline:[Vn,dr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Vn,dr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fr,eD]}],"shadow-color":[{shadow:[ho]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fr,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[fo,re]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],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",re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Vn,dr,Ld]}],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"]}}},iD=$L(sD);function Dd(e,t,n){if(e&&e.length){const[r,s]=t,i=Math.PI/180*n,o=Math.cos(i),a=Math.sin(i);for(const l of e){const[c,u]=l;l[0]=(c-r)*o-(u-s)*a+r,l[1]=(c-r)*a+(u-s)*o+s}}}function oD(e,t){return e[0]===t[0]&&e[1]===t[1]}function aD(e,t,n,r=1){const s=n,i=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,a=[0,0];if(s)for(const c of o)Dd(c,a,s);const l=function(c,u,d){const h=[];for(const x of c){const v=[...x];oD(v[0],v[v.length-1])||v.push([v[0][0],v[0][1]]),v.length>2&&h.push(v)}const p=[];u=Math.max(u,.1);const m=[];for(const x of h)for(let v=0;v<x.length-1;v++){const b=x[v],S=x[v+1];if(b[1]!==S[1]){const k=Math.min(b[1],S[1]);m.push({ymin:k,ymax:Math.max(b[1],S[1]),x:k===b[1]?b[0]:S[0],islope:(S[0]-b[0])/(S[1]-b[1])})}}if(m.sort((x,v)=>x.ymin<v.ymin?-1:x.ymin>v.ymin?1:x.x<v.x?-1:x.x>v.x?1:x.ymax===v.ymax?0:(x.ymax-v.ymax)/Math.abs(x.ymax-v.ymax)),!m.length)return p;let y=[],w=m[0].ymin,g=0;for(;y.length||m.length;){if(m.length){let x=-1;for(let v=0;v<m.length&&!(m[v].ymin>w);v++)x=v;m.splice(0,x+1).forEach(v=>{y.push({s:w,edge:v})})}if(y=y.filter(x=>!(x.edge.ymax<=w)),y.sort((x,v)=>x.edge.x===v.edge.x?0:(x.edge.x-v.edge.x)/Math.abs(x.edge.x-v.edge.x)),(d!==1||g%u==0)&&y.length>1)for(let x=0;x<y.length;x+=2){const v=x+1;if(v>=y.length)break;const b=y[x].edge,S=y[v].edge;p.push([[Math.round(b.x),w],[Math.round(S.x),w]])}w+=d,y.forEach(x=>{x.edge.x=x.edge.x+d*x.edge.islope}),g++}return p}(o,i,r);if(s){for(const c of o)Dd(c,a,-s);(function(c,u,d){const h=[];c.forEach(p=>h.push(...p)),Dd(h,u,d)})(l,a,-s)}return l}function ba(e,t){var n;const r=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let i=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(i=s),aD(e,s,r,i||1)}class _m{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=ba(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(t,n){const r=[];for(const s of t)r.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],n));return r}}function wu(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class lD extends _m{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=ba(t,Object.assign({},n,{hachureGap:r})),i=Math.PI/180*n.hachureAngle,o=[],a=.5*r*Math.cos(i),l=.5*r*Math.sin(i);for(const[c,u]of s)wu([c,u])&&o.push([[c[0]-a,c[1]+l],[...u]],[[c[0]+a,c[1]-l],[...u]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class cD extends _m{fillPolygons(t,n){const r=this._fillPolygons(t,n),s=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),i=this._fillPolygons(t,s);return r.ops=r.ops.concat(i.ops),r}}class uD{constructor(t){this.helper=t}fillPolygons(t,n){const r=ba(t,n=Object.assign({},n,{hachureAngle:0}));return this.dotsOnLines(r,n)}dotsOnLines(t,n){const r=[];let s=n.hachureGap;s<0&&(s=4*n.strokeWidth),s=Math.max(s,.1);let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const o=s/4;for(const a of t){const l=wu(a),c=l/s,u=Math.ceil(c)-1,d=l-u*s,h=(a[0][0]+a[1][0])/2-s/4,p=Math.min(a[0][1],a[1][1]);for(let m=0;m<u;m++){const y=p+d+m*s,w=h-o+2*Math.random()*o,g=y-o+2*Math.random()*o,x=this.helper.ellipse(w,g,i,i,n);r.push(...x.ops)}}return{type:"fillSketch",ops:r}}}class dD{constructor(t){this.helper=t}fillPolygons(t,n){const r=ba(t,n);return{type:"fillSketch",ops:this.dashedLine(r,n)}}dashedLine(t,n){const r=n.dashOffset<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashOffset,s=n.dashGap<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashGap,i=[];return t.forEach(o=>{const a=wu(o),l=Math.floor(a/(r+s)),c=(a+s-l*(r+s))/2;let u=o[0],d=o[1];u[0]>d[0]&&(u=o[1],d=o[0]);const h=Math.atan((d[1]-u[1])/(d[0]-u[0]));for(let p=0;p<l;p++){const m=p*(r+s),y=m+r,w=[u[0]+m*Math.cos(h)+c*Math.cos(h),u[1]+m*Math.sin(h)+c*Math.sin(h)],g=[u[0]+y*Math.cos(h)+c*Math.cos(h),u[1]+y*Math.sin(h)+c*Math.sin(h)];i.push(...this.helper.doubleLineOps(w[0],w[1],g[0],g[1],n))}}),i}}class fD{constructor(t){this.helper=t}fillPolygons(t,n){const r=n.hachureGap<0?4*n.strokeWidth:n.hachureGap,s=n.zigzagOffset<0?r:n.zigzagOffset,i=ba(t,n=Object.assign({},n,{hachureGap:r+s}));return{type:"fillSketch",ops:this.zigzagLines(i,s,n)}}zigzagLines(t,n,r){const s=[];return t.forEach(i=>{const o=wu(i),a=Math.round(o/(2*n));let l=i[0],c=i[1];l[0]>c[0]&&(l=i[1],c=i[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<a;d++){const h=2*d*n,p=2*(d+1)*n,m=Math.sqrt(2*Math.pow(n,2)),y=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],w=[l[0]+p*Math.cos(u),l[1]+p*Math.sin(u)],g=[y[0]+m*Math.cos(u+Math.PI/4),y[1]+m*Math.sin(u+Math.PI/4)];s.push(...this.helper.doubleLineOps(y[0],y[1],g[0],g[1],r),...this.helper.doubleLineOps(g[0],g[1],w[0],w[1],r))}}),s}}const ht={};class hD{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const pD=0,Fd=1,Kx=2,ll={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Od(e,t){return e.type===t}function Sm(e){const t=[],n=function(o){const a=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))a[a.length]={type:pD,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];a[a.length]={type:Fd,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:Kx,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!Od(i,Kx);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return Sm("M0,0"+e);s++,o=ll[i.text],r=i.text}else Od(i,Fd)?o=ll[r]:(s++,o=ll[i.text],r=i.text);if(!(s+o<n.length))throw new Error("Path data ended short");for(let l=s;l<s+o;l++){const c=n[l];if(!Od(c,Fd))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof ll[r]!="number")throw new Error("Bad segment: "+r);{const l={key:r,data:a};t.push(l),s+=o,i=n[s],r==="M"&&(r="L"),r==="m"&&(r="l")}}return t}function $k(e){let t=0,n=0,r=0,s=0;const i=[];for(const{key:o,data:a}of e)switch(o){case"M":i.push({key:"M",data:[...a]}),[t,n]=a,[r,s]=a;break;case"m":t+=a[0],n+=a[1],i.push({key:"M",data:[t,n]}),r=t,s=n;break;case"L":i.push({key:"L",data:[...a]}),[t,n]=a;break;case"l":t+=a[0],n+=a[1],i.push({key:"L",data:[t,n]});break;case"C":i.push({key:"C",data:[...a]}),t=a[4],n=a[5];break;case"c":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"C",data:l}),t=l[4],n=l[5];break}case"Q":i.push({key:"Q",data:[...a]}),t=a[2],n=a[3];break;case"q":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"Q",data:l}),t=l[2],n=l[3];break}case"A":i.push({key:"A",data:[...a]}),t=a[5],n=a[6];break;case"a":t+=a[5],n+=a[6],i.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],t,n]});break;case"H":i.push({key:"H",data:[...a]}),t=a[0];break;case"h":t+=a[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...a]}),n=a[0];break;case"v":n+=a[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...a]}),t=a[2],n=a[3];break;case"s":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"S",data:l}),t=l[2],n=l[3];break}case"T":i.push({key:"T",data:[...a]}),t=a[0],n=a[1];break;case"t":t+=a[0],n+=a[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=s}return i}function Bk(e){const t=[];let n="",r=0,s=0,i=0,o=0,a=0,l=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,s]=u,[i,o]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],s=u[5],a=u[2],l=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,s]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,s]});break;case"V":s=u[0],t.push({key:"L",data:[r,s]});break;case"S":{let d=0,h=0;n==="C"||n==="S"?(d=r+(r-a),h=s+(s-l)):(d=r,h=s),t.push({key:"C",data:[d,h,...u]}),a=u[0],l=u[1],r=u[2],s=u[3];break}case"T":{const[d,h]=u;let p=0,m=0;n==="Q"||n==="T"?(p=r+(r-a),m=s+(s-l)):(p=r,m=s);const y=r+2*(p-r)/3,w=s+2*(m-s)/3,g=d+2*(p-d)/3,x=h+2*(m-h)/3;t.push({key:"C",data:[y,w,g,x,d,h]}),a=p,l=m,r=d,s=h;break}case"Q":{const[d,h,p,m]=u,y=r+2*(d-r)/3,w=s+2*(h-s)/3,g=p+2*(d-p)/3,x=m+2*(h-m)/3;t.push({key:"C",data:[y,w,g,x,p,m]}),a=d,l=h,r=p,s=m;break}case"A":{const d=Math.abs(u[0]),h=Math.abs(u[1]),p=u[2],m=u[3],y=u[4],w=u[5],g=u[6];d===0||h===0?(t.push({key:"C",data:[r,s,w,g,w,g]}),r=w,s=g):(r!==w||s!==g)&&(Vk(r,s,w,g,d,h,p,m,y).forEach(function(x){t.push({key:"C",data:x})}),r=w,s=g);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function po(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Vk(e,t,n,r,s,i,o,a,l,c){const u=(d=o,Math.PI*d/180);var d;let h=[],p=0,m=0,y=0,w=0;if(c)[p,m,y,w]=c;else{[e,t]=po(e,t,-u),[n,r]=po(n,r,-u);const O=(e-n)/2,z=(t-r)/2;let E=O*O/(s*s)+z*z/(i*i);E>1&&(E=Math.sqrt(E),s*=E,i*=E);const F=s*s,V=i*i,A=F*V-F*z*z-V*O*O,B=F*z*z+V*O*O,C=(a===l?-1:1)*Math.sqrt(Math.abs(A/B));y=C*s*z/i+(e+n)/2,w=C*-i*O/s+(t+r)/2,p=Math.asin(parseFloat(((t-w)/i).toFixed(9))),m=Math.asin(parseFloat(((r-w)/i).toFixed(9))),e<y&&(p=Math.PI-p),n<y&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),l&&p>m&&(p-=2*Math.PI),!l&&m>p&&(m-=2*Math.PI)}let g=m-p;if(Math.abs(g)>120*Math.PI/180){const O=m,z=n,E=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=Vk(n=y+s*Math.cos(m),r=w+i*Math.sin(m),z,E,s,i,o,0,l,[m,O,y,w])}g=m-p;const x=Math.cos(p),v=Math.sin(p),b=Math.cos(m),S=Math.sin(m),k=Math.tan(g/4),T=4/3*s*k,P=4/3*i*k,R=[e,t],j=[e+T*v,t-P*x],I=[n+T*S,r-P*b],M=[n,r];if(j[0]=2*R[0]-j[0],j[1]=2*R[1]-j[1],c)return[j,I,M].concat(h);{h=[j,I,M].concat(h);const O=[];for(let z=0;z<h.length;z+=3){const E=po(h[z][0],h[z][1],u),F=po(h[z+1][0],h[z+1][1],u),V=po(h[z+2][0],h[z+2][1],u);O.push([E[0],E[1],F[0],F[1],V[0],V[1]])}return O}}const mD={randOffset:function(e,t){return X(e,t)},randOffsetWithRange:function(e,t,n){return Mc(e,t,n)},ellipse:function(e,t,n,r,s){const i=Wk(n,r,s);return Sh(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return Wr(e,t,n,r,s,!0)}};function Uk(e,t,n,r,s){return{type:"path",ops:Wr(e,t,n,r,s)}}function Wl(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...Wr(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...Wr(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?Uk(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function gD(e,t,n,r,s){return function(i,o){return Wl(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function Qx(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=cl(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:cl(n[0],1.5*(1+.22*t.roughness),Xx(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=cl(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:cl(o,1.5*(1+.22*t.roughness),Xx(t));for(const c of a)c.op!=="move"&&r.push(c);for(const c of l)c.op!=="move"&&s.push(c)}}return{type:"path",ops:r.concat(s)}}return{type:"path",ops:[]}}function Wk(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/s;let o=Math.abs(e/2),a=Math.abs(t/2);const l=1-n.curveFitting;return o+=X(o*l,n),a+=X(a*l,n),{increment:i,rx:o,ry:a}}function Sh(e,t,n,r){const[s,i]=Jx(r.increment,e,t,r.rx,r.ry,1,r.increment*Mc(.1,Mc(.4,1,n),n),n);let o=Ac(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=Jx(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Ac(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function qx(e,t,n,r,s,i,o,a,l){const c=e,u=t;let d=Math.abs(n/2),h=Math.abs(r/2);d+=X(.01*d,l),h+=X(.01*h,l);let p=s,m=i;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);const y=2*Math.PI/l.curveStepCount,w=Math.min(y/2,(m-p)/2),g=Zx(w,c,u,d,h,p,m,1,l);if(!l.disableMultiStroke){const x=Zx(w,c,u,d,h,p,m,1.5,l);g.push(...x)}return o&&(a?g.push(...Wr(c,u,c+d*Math.cos(p),u+h*Math.sin(p),l),...Wr(c,u,c+d*Math.cos(m),u+h*Math.sin(m),l)):g.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+d*Math.cos(p),u+h*Math.sin(p)]})),{type:"path",ops:g}}function Yx(e,t){const n=Bk($k(Sm(e))),r=[];let s=[0,0],i=[0,0];for(const{key:o,data:a}of n)switch(o){case"M":i=[a[0],a[1]],s=[a[0],a[1]];break;case"L":r.push(...Wr(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[l,c,u,d,h,p]=a;r.push(...yD(l,c,u,d,h,p,i,t)),i=[h,p];break}case"Z":r.push(...Wr(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function zd(e,t){const n=[];for(const r of e)if(r.length){const s=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+X(s,t),r[0][1]+X(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+X(s,t),r[o][1]+X(s,t)]})}}return{type:"fillPath",ops:n}}function Vs(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!ht[s])switch(s){case"zigzag":ht[s]||(ht[s]=new lD(r));break;case"cross-hatch":ht[s]||(ht[s]=new cD(r));break;case"dots":ht[s]||(ht[s]=new uD(r));break;case"dashed":ht[s]||(ht[s]=new dD(r));break;case"zigzag-line":ht[s]||(ht[s]=new fD(r));break;default:s="hachure",ht[s]||(ht[s]=new _m(r))}return ht[s]}(t,mD).fillPolygons(e,t)}function Xx(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Hk(e){return e.randomizer||(e.randomizer=new hD(e.seed||0)),e.randomizer.next()}function Mc(e,t,n,r=1){return n.roughness*r*(Hk(n)*(t-e)+e)}function X(e,t,n=1){return Mc(-e,e,t,n)}function Wr(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=Ch(e,t,n,r,s,!0,!1);if(o)return a;const l=Ch(e,t,n,r,s,!0,!0);return a.concat(l)}function Ch(e,t,n,r,s,i,o){const a=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(a);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let u=s.maxRandomnessOffset||0;u*u*100>a&&(u=l/10);const d=u/2,h=.2+.2*Hk(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;p=X(p,s,c),m=X(m,s,c);const y=[],w=()=>X(d,s,c),g=()=>X(u,s,c),x=s.preserveVertices;return o?y.push({op:"move",data:[e+(x?0:w()),t+(x?0:w())]}):y.push({op:"move",data:[e+(x?0:X(u,s,c)),t+(x?0:X(u,s,c))]}),o?y.push({op:"bcurveTo",data:[p+e+(n-e)*h+w(),m+t+(r-t)*h+w(),p+e+2*(n-e)*h+w(),m+t+2*(r-t)*h+w(),n+(x?0:w()),r+(x?0:w())]}):y.push({op:"bcurveTo",data:[p+e+(n-e)*h+g(),m+t+(r-t)*h+g(),p+e+2*(n-e)*h+g(),m+t+2*(r-t)*h+g(),n+(x?0:g()),r+(x?0:g())]}),y}function cl(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+X(t,n),e[0][1]+X(t,n)]),r.push([e[0][0]+X(t,n),e[0][1]+X(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+X(t,n),e[s][1]+X(t,n)]),s===e.length-1&&r.push([e[s][0]+X(t,n),e[s][1]+X(t,n)]);return Ac(r,null,n)}function Ac(e,t,n){const r=e.length,s=[];if(r>3){const i=[],o=1-n.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let a=1;a+2<r;a++){const l=e[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*e[a+1][0]-o*e[a-1][0])/6,l[1]+(o*e[a+1][1]-o*e[a-1][1])/6],i[2]=[e[a+1][0]+(o*e[a][0]-o*e[a+2][0])/6,e[a+1][1]+(o*e[a][1]-o*e[a+2][1])/6],i[3]=[e[a+1][0],e[a+1][1]],s.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}}else r===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&s.push(...Ch(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function Jx(e,t,n,r,s,i,o,a){const l=[],c=[];if(a.roughness===0){e/=4,c.push([t+r*Math.cos(-e),n+s*Math.sin(-e)]);for(let u=0;u<=2*Math.PI;u+=e){const d=[t+r*Math.cos(u),n+s*Math.sin(u)];l.push(d),c.push(d)}c.push([t+r*Math.cos(0),n+s*Math.sin(0)]),c.push([t+r*Math.cos(e),n+s*Math.sin(e)])}else{const u=X(.5,a)-Math.PI/2;c.push([X(i,a)+t+.9*r*Math.cos(u-e),X(i,a)+n+.9*s*Math.sin(u-e)]);const d=2*Math.PI+u-.01;for(let h=u;h<d;h+=e){const p=[X(i,a)+t+r*Math.cos(h),X(i,a)+n+s*Math.sin(h)];l.push(p),c.push(p)}c.push([X(i,a)+t+r*Math.cos(u+2*Math.PI+.5*o),X(i,a)+n+s*Math.sin(u+2*Math.PI+.5*o)]),c.push([X(i,a)+t+.98*r*Math.cos(u+o),X(i,a)+n+.98*s*Math.sin(u+o)]),c.push([X(i,a)+t+.9*r*Math.cos(u+.5*o),X(i,a)+n+.9*s*Math.sin(u+.5*o)])}return[c,l]}function Zx(e,t,n,r,s,i,o,a,l){const c=i+X(.1,l),u=[];u.push([X(a,l)+t+.9*r*Math.cos(c-e),X(a,l)+n+.9*s*Math.sin(c-e)]);for(let d=c;d<=o;d+=e)u.push([X(a,l)+t+r*Math.cos(d),X(a,l)+n+s*Math.sin(d)]);return u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),Ac(u,null,l)}function yD(e,t,n,r,s,i,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const d=a.disableMultiStroke?1:2,h=a.preserveVertices;for(let p=0;p<d;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(h?0:X(c[0],a)),o[1]+(h?0:X(c[0],a))]}),u=h?[s,i]:[s+X(c[p],a),i+X(c[p],a)],l.push({op:"bcurveTo",data:[e+X(c[p],a),t+X(c[p],a),n+X(c[p],a),r+X(c[p],a),u[0],u[1]]});return l}function mo(e){return[...e]}function e0(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(n===3)r.push(mo(e[0]),mo(e[1]),mo(e[2]),mo(e[2]));else{const s=[];s.push(e[0],e[0]);for(let a=1;a<e.length;a++)s.push(e[a]),a===e.length-1&&s.push(e[a]);const i=[],o=1-t;r.push(mo(s[0]));for(let a=1;a+2<s.length;a++){const l=s[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*s[a+1][0]-o*s[a-1][0])/6,l[1]+(o*s[a+1][1]-o*s[a-1][1])/6],i[2]=[s[a+1][0]+(o*s[a][0]-o*s[a+2][0])/6,s[a+1][1]+(o*s[a][1]-o*s[a+2][1])/6],i[3]=[s[a+1][0],s[a+1][1]],r.push(i[1],i[2],i[3])}}return r}function Hl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function xD(e,t,n){const r=Hl(t,n);if(r===0)return Hl(e,t);let s=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return s=Math.max(0,Math.min(1,s)),Hl(e,ls(t,n,s))}function ls(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Ph(e,t,n,r){const s=r||[];if(function(a,l){const c=a[l+0],u=a[l+1],d=a[l+2],h=a[l+3];let p=3*u[0]-2*c[0]-h[0];p*=p;let m=3*u[1]-2*c[1]-h[1];m*=m;let y=3*d[0]-2*h[0]-c[0];y*=y;let w=3*d[1]-2*h[1]-c[1];return w*=w,p<y&&(p=y),m<w&&(m=w),p+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Hl(i,o))>1&&s.push(a)):s.push(a),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],u=e[t+2],d=e[t+3],h=ls(l,c,.5),p=ls(c,u,.5),m=ls(u,d,.5),y=ls(h,p,.5),w=ls(p,m,.5),g=ls(y,w,.5);Ph([l,h,y,g],0,n,s),Ph([g,w,m,d],0,n,s)}var i,o;return s}function vD(e,t){return Lc(e,0,e.length,t)}function Lc(e,t,n,r,s){const i=s||[],o=e[t],a=e[n-1];let l=0,c=1;for(let u=t+1;u<n-1;++u){const d=xD(e[u],o,a);d>l&&(l=d,c=u)}return Math.sqrt(l)>r?(Lc(e,t,c+1,r,i),Lc(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function $d(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)Ph(e,3*i,t,r);return n&&n>0?Lc(r,0,r.length,n):r}const Tt="none";let Dc=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}}line(t,n,r,s,i){const o=this._o(i);return this._d("line",[Uk(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=gD(t,n,r,s,o);if(o.fill){const c=[[t,n],[t+r,n],[t+r,n+s],[t,n+s]];o.fillStyle==="solid"?a.push(zd([c],o)):a.push(Vs([c],o))}return o.stroke!==Tt&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=Wk(r,s,o),c=Sh(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=Sh(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(Vs([c.estimatedPoints],o));return o.stroke!==Tt&&a.push(c.opset),this._d("ellipse",a,o)}circle(t,n,r,s){const i=this.ellipse(t,n,r,r,s);return i.shape="circle",i}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[Wl(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],d=qx(t,n,r,s,i,o,a,!0,c);if(a&&c.fill)if(c.fillStyle==="solid"){const h=Object.assign({},c);h.disableMultiStroke=!0;const p=qx(t,n,r,s,i,o,!0,!1,h);p.type="fillPath",u.push(p)}else u.push(function(h,p,m,y,w,g,x){const v=h,b=p;let S=Math.abs(m/2),k=Math.abs(y/2);S+=X(.01*S,x),k+=X(.01*k,x);let T=w,P=g;for(;T<0;)T+=2*Math.PI,P+=2*Math.PI;P-T>2*Math.PI&&(T=0,P=2*Math.PI);const R=(P-T)/x.curveStepCount,j=[];for(let I=T;I<=P;I+=R)j.push([v+S*Math.cos(I),b+k*Math.sin(I)]);return j.push([v+S*Math.cos(P),b+k*Math.sin(P)]),j.push([v,b]),Vs([j],x)}(t,n,r,s,i,o,c));return c.stroke!==Tt&&u.push(d),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=Qx(t,r);if(r.fill&&r.fill!==Tt)if(r.fillStyle==="solid"){const o=Qx(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],a=t;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const c of l)c.length<3?o.push(...c):c.length===3?o.push(...$d(e0([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...$d(e0(c),10,(1+r.roughness)/2))}o.length&&s.push(Vs([o],r))}return r.stroke!==Tt&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=Wl(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(zd([t],r)):s.push(Vs([t],r))),r.stroke!==Tt&&s.push(i),this._d("polygon",s,r)}path(t,n){const r=this._o(n),s=[];if(!t)return this._d("path",s,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=r.fill&&r.fill!=="transparent"&&r.fill!==Tt,o=r.stroke!==Tt,a=!!(r.simplification&&r.simplification<1),l=function(u,d,h){const p=Bk($k(Sm(u))),m=[];let y=[],w=[0,0],g=[];const x=()=>{g.length>=4&&y.push(...$d(g,d)),g=[]},v=()=>{x(),y.length&&(m.push(y),y=[])};for(const{key:S,data:k}of p)switch(S){case"M":v(),w=[k[0],k[1]],y.push(w);break;case"L":x(),y.push([k[0],k[1]]);break;case"C":if(!g.length){const T=y.length?y[y.length-1]:w;g.push([T[0],T[1]])}g.push([k[0],k[1]]),g.push([k[2],k[3]]),g.push([k[4],k[5]]);break;case"Z":x(),y.push([w[0],w[1]])}if(v(),!h)return m;const b=[];for(const S of m){const k=vD(S,h);k.length&&b.push(k)}return b}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=Yx(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=Yx(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else s.push(zd(l,r));else s.push(Vs(l,r));return o&&(a?l.forEach(u=>{s.push(Wl(u,!1,r))}):s.push(c)),this._d("path",s,r)}opsToPath(t,n){let r="";for(const s of t.ops){const i=typeof n=="number"&&n>=0?s.data.map(o=>+o.toFixed(n)):s.data;switch(s.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,s=[];for(const i of n){let o=null;switch(i.type){case"path":o={d:this.opsToPath(i),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Tt};break;case"fillPath":o={d:this.opsToPath(i),stroke:Tt,strokeWidth:0,fill:r.fill||Tt};break;case"fillSketch":o=this.fillSketch(i,r)}o&&s.push(o)}return s}fillSketch(t,n){let r=n.fillWeight;return r<0&&(r=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||Tt,strokeWidth:r,fill:Tt}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},wD=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Dc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const o of n)switch(o.type){case"path":s.save(),s.strokeStyle=r.stroke==="none"?"transparent":r.stroke,s.lineWidth=r.strokeWidth,r.strokeLineDash&&s.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(s.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(s,o,i),s.restore();break;case"fillPath":{s.save(),s.fillStyle=r.fill||"";const a=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,o,i,a),s.restore();break}case"fillSketch":this.fillSketch(s,o,r)}}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=s,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,s="nonzero"){t.beginPath();for(const i of n.ops){const o=typeof r=="number"&&r>=0?i.data.map(a=>+a.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}n.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o),o}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o),o}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o),o}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i),i}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r),r}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r),r}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c),c}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r),r}path(t,n){const r=this.gen.path(t,n);return this.draw(r),r}};const ul="http://www.w3.org/2000/svg";class bD{constructor(t,n){this.svg=t,this.gen=new Dc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(ul,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(ul,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke",r.stroke),l.setAttribute("stroke-width",r.strokeWidth+""),l.setAttribute("fill","none"),r.strokeLineDash&&l.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":l=s.createElementNS(ul,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",r.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(s,a,r)}l&&i.appendChild(l)}return i}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const i=t.createElementNS(ul,"path");return i.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",s+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o)}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o)}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o)}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i)}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r)}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r)}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c)}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r)}path(t,n){const r=this.gen.path(t,n);return this.draw(r)}}var kD={canvas:(e,t)=>new wD(e,t),svg:(e,t)=>new bD(e,t),generator:e=>new Dc(e),newSeed:()=>Dc.newSeed()};const Cm=_.createContext({});function Pm(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const _D=typeof window<"u",Gk=_D?_.useLayoutEffect:_.useEffect,bu=_.createContext(null);function jm(e,t){e.indexOf(t)===-1&&e.push(t)}function Fc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Dn=(e,t,n)=>n>t?t:n<e?e:n;let Em=()=>{};const Hr={},Kk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Qk=e=>typeof e=="object"&&e!==null,qk=e=>/^0[^.\s]+$/u.test(e);function Yk(e){let t;return()=>(t===void 0&&(t=e()),t)}const Zt=e=>e,ka=(...e)=>e.reduce((t,n)=>r=>n(t(r))),ua=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Tm{constructor(){this.subscriptions=[]}add(t){return jm(this.subscriptions,t),()=>Fc(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Dt=e=>e*1e3,Yt=e=>e/1e3,Xk=(e,t)=>t?e*(1e3/t):0,Jk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,SD=1e-7,CD=12;function PD(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Jk(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>SD&&++a<CD);return o}function _a(e,t,n,r){if(e===t&&n===r)return Zt;const s=i=>PD(i,0,1,e,n);return i=>i===0||i===1?i:Jk(s(i),t,r)}const Zk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,e_=e=>t=>1-e(1-t),t_=_a(.33,1.53,.69,.99),Rm=e_(t_),n_=Zk(Rm),r_=e=>e>=1?1:(e*=2)<1?.5*Rm(e):.5*(2-Math.pow(2,-10*(e-1))),Nm=e=>1-Math.sin(Math.acos(e)),s_=e_(Nm),i_=Zk(Nm),jD=_a(.42,0,1,1),ED=_a(0,0,.58,1),o_=_a(.42,0,.58,1),TD=e=>Array.isArray(e)&&typeof e[0]!="number",a_=e=>Array.isArray(e)&&typeof e[0]=="number",RD={linear:Zt,easeIn:jD,easeInOut:o_,easeOut:ED,circIn:Nm,circInOut:i_,circOut:s_,backIn:Rm,backInOut:n_,backOut:t_,anticipate:r_},ND=e=>typeof e=="string",t0=e=>{if(a_(e)){Em(e.length===4);const[t,n,r,s]=e;return _a(t,n,r,s)}else if(ND(e))return RD[e];return e},dl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ID(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,h=!1)=>{const m=h&&s?n:r;return d&&o.add(u),m.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,s){i=!0;return}s=!0;const d=n;n=r,r=d,n.forEach(l),n.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const MD=40;function l_(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=dl.reduce((v,b)=>(v[b]=ID(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:m}=o,y=()=>{const v=Hr.useManualTiming,b=v?s.timestamp:performance.now();n=!1,v||(s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,MD),1)),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),d.process(s),h.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(y))},w=()=>{n=!0,r=!0,s.isProcessing||e(y)};return{schedule:dl.reduce((v,b)=>{const S=o[b];return v[b]=(k,T=!1,P=!1)=>(n||w(),S.schedule(k,T,P)),v},{}),cancel:v=>{for(let b=0;b<dl.length;b++)o[dl[b]].cancel(v)},state:s,steps:o}}const{schedule:ye,cancel:Gr,state:Ye,steps:Bd}=l_(typeof requestAnimationFrame<"u"?requestAnimationFrame:Zt,!0);let Gl;function AD(){Gl=void 0}const lt={now:()=>(Gl===void 0&&lt.set(Ye.isProcessing||Hr.useManualTiming?Ye.timestamp:performance.now()),Gl),set:e=>{Gl=e,queueMicrotask(AD)}},c_=e=>t=>typeof t=="string"&&t.startsWith(e),u_=c_("--"),LD=c_("var(--"),Im=e=>LD(e)?DD.test(e.split("/*")[0].trim()):!1,DD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function n0(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Vi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},da={...Vi,transform:e=>Dn(0,1,e)},fl={...Vi,default:1},Oo=e=>Math.round(e*1e5)/1e5,Mm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function FD(e){return e==null}const OD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Am=(e,t)=>n=>!!(typeof n=="string"&&OD.test(n)&&n.startsWith(e)||t&&!FD(n)&&Object.prototype.hasOwnProperty.call(n,t)),d_=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Mm);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},zD=e=>Dn(0,255,e),Vd={...Vi,transform:e=>Math.round(zD(e))},ms={test:Am("rgb","red"),parse:d_("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Vd.transform(e)+", "+Vd.transform(t)+", "+Vd.transform(n)+", "+Oo(da.transform(r))+")"};function $D(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const jh={test:Am("#"),parse:$D,transform:ms.transform},Sa=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Hn=Sa("deg"),An=Sa("%"),Q=Sa("px"),BD=Sa("vh"),VD=Sa("vw"),r0={...An,parse:e=>An.parse(e)/100,transform:e=>An.transform(e*100)},li={test:Am("hsl","hue"),parse:d_("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+An.transform(Oo(t))+", "+An.transform(Oo(n))+", "+Oo(da.transform(r))+")"},ze={test:e=>ms.test(e)||jh.test(e)||li.test(e),parse:e=>ms.test(e)?ms.parse(e):li.test(e)?li.parse(e):jh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ms.transform(e):li.transform(e),getAnimatableNone:e=>{const t=ze.parse(e);return t.alpha=0,ze.transform(t)}},UD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function WD(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Mm))==null?void 0:t.length)||0)+(((n=e.match(UD))==null?void 0:n.length)||0)>0}const f_="number",h_="color",HD="var",GD="var(",s0="${}",KD=/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 Ii(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(KD,l=>(ze.test(l)?(r.color.push(i),s.push(h_),n.push(ze.parse(l))):l.startsWith(GD)?(r.var.push(i),s.push(HD),n.push(l)):(r.number.push(i),s.push(f_),n.push(parseFloat(l))),++i,s0)).split(s0);return{values:n,split:a,indexes:r,types:s}}function QD(e){return Ii(e).values}function p_({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===f_?s+=Oo(r[i]):o===h_?s+=ze.transform(r[i]):s+=r[i]}return s}}function qD(e){return p_(Ii(e))}const YD=e=>typeof e=="number"?0:ze.test(e)?ze.getAnimatableNone(e):e,XD=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:YD(e);function JD(e){const t=Ii(e);return p_(t)(t.values.map((r,s)=>XD(r,t.split[s])))}const yn={test:WD,parse:QD,createTransformer:qD,getAnimatableNone:JD};function Ud(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 ZD({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Ud(l,a,e+1/3),i=Ud(l,a,e),o=Ud(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Oc(e,t){return n=>n>0?t:e}const ge=(e,t,n)=>e+(t-e)*n,Wd=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},e3=[jh,ms,li],t3=e=>e3.find(t=>t.test(e));function i0(e){const t=t3(e);if(!t)return!1;let n=t.parse(e);return t===li&&(n=ZD(n)),n}const o0=(e,t)=>{const n=i0(e),r=i0(t);if(!n||!r)return Oc(e,t);const s={...n};return i=>(s.red=Wd(n.red,r.red,i),s.green=Wd(n.green,r.green,i),s.blue=Wd(n.blue,r.blue,i),s.alpha=ge(n.alpha,r.alpha,i),ms.transform(s))},Eh=new Set(["none","hidden"]);function n3(e,t){return Eh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function r3(e,t){return n=>ge(e,t,n)}function Lm(e){return typeof e=="number"?r3:typeof e=="string"?Im(e)?Oc:ze.test(e)?o0:o3:Array.isArray(e)?m_:typeof e=="object"?ze.test(e)?o0:s3:Oc}function m_(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Lm(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function s3(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Lm(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function i3(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],a=e.values[o]??0;n[s]=a,r[i]++}return n}const o3=(e,t)=>{const n=yn.createTransformer(t),r=Ii(e),s=Ii(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Eh.has(e)&&!s.values.length||Eh.has(t)&&!r.values.length?n3(e,t):ka(m_(i3(r,s),s.values),n):Oc(e,t)};function g_(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ge(e,t,n):Lm(e)(e,t)}const a3=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ye.update(t,n),stop:()=>Gr(t),now:()=>Ye.isProcessing?Ye.timestamp:lt.now()}},y_=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},zc=2e4;function Dm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zc;)t+=n,r=e.next(t);return t>=zc?1/0:t}function l3(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Dm(r),zc);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Yt(s)}}const Me={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};function Th(e,t){return e*Math.sqrt(1-t*t)}const c3=12;function u3(e,t,n){let r=n;for(let s=1;s<c3;s++)r=r-e(r)/t(r);return r}const Hd=.001;function d3({duration:e=Me.duration,bounce:t=Me.bounce,velocity:n=Me.velocity,mass:r=Me.mass}){let s,i,o=1-t;o=Dn(Me.minDamping,Me.maxDamping,o),e=Dn(Me.minDuration,Me.maxDuration,Yt(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,p=Th(c,o),m=Math.exp(-d);return Hd-h/p*m},i=c=>{const d=c*o*e,h=d*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-d),y=Th(Math.pow(c,2),o);return(-s(c)+Hd>0?-1:1)*((h-p)*m)/y}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Hd+u*d},i=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=u3(s,i,a);if(e=Dt(e),isNaN(l))return{stiffness:Me.stiffness,damping:Me.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const f3=["duration","bounce"],h3=["stiffness","damping","mass"];function a0(e,t){return t.some(n=>e[n]!==void 0)}function p3(e){let t={velocity:Me.velocity,stiffness:Me.stiffness,damping:Me.damping,mass:Me.mass,isResolvedFromDuration:!1,...e};if(!a0(e,h3)&&a0(e,f3))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Dn(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Me.mass,stiffness:s,damping:i}}else{const n=d3({...e,velocity:0});t={...t,...n,mass:Me.mass},t.isResolvedFromDuration=!0}return t}function $c(e=Me.visualDuration,t=Me.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=p3({...n,velocity:-Yt(n.velocity||0)}),m=h||0,y=c/(2*Math.sqrt(l*u)),w=o-i,g=Yt(Math.sqrt(l/u)),x=Math.abs(w)<5;r||(r=x?Me.restSpeed.granular:Me.restSpeed.default),s||(s=x?Me.restDelta.granular:Me.restDelta.default);let v,b,S,k,T,P;if(y<1)S=Th(g,y),k=(m+y*g*w)/S,v=j=>{const I=Math.exp(-y*g*j);return o-I*(k*Math.sin(S*j)+w*Math.cos(S*j))},T=y*g*k+w*S,P=y*g*w-k*S,b=j=>Math.exp(-y*g*j)*(T*Math.sin(S*j)+P*Math.cos(S*j));else if(y===1){v=I=>o-Math.exp(-g*I)*(w+(m+g*w)*I);const j=m+g*w;b=I=>Math.exp(-g*I)*(g*j*I-m)}else{const j=g*Math.sqrt(y*y-1);v=z=>{const E=Math.exp(-y*g*z),F=Math.min(j*z,300);return o-E*((m+y*g*w)*Math.sinh(F)+j*w*Math.cosh(F))/j};const I=(m+y*g*w)/j,M=y*g*I-w*j,O=y*g*w-I*j;b=z=>{const E=Math.exp(-y*g*z),F=Math.min(j*z,300);return E*(M*Math.sinh(F)+O*Math.cosh(F))}}const R={calculatedDuration:p&&d||null,velocity:j=>Dt(b(j)),next:j=>{if(!p&&y<1){const M=Math.exp(-y*g*j),O=Math.sin(S*j),z=Math.cos(S*j),E=o-M*(k*O+w*z),F=Dt(M*(T*O+P*z));return a.done=Math.abs(F)<=r&&Math.abs(o-E)<=s,a.value=a.done?o:E,a}const I=v(j);if(p)a.done=j>=d;else{const M=Dt(b(j));a.done=Math.abs(M)<=r&&Math.abs(o-I)<=s}return a.value=a.done?o:I,a},toString:()=>{const j=Math.min(Dm(R),zc),I=y_(M=>R.next(j*M).value,j,30);return j+"ms "+I},toTransition:()=>{}};return R}$c.applyToOptions=e=>{const t=l3(e,100,$c);return e.ease=t.ease,e.duration=Dt(t.duration),e.type="keyframes",e};const m3=5;function x_(e,t,n){const r=Math.max(t-m3,0);return Xk(n-e(r),t-r)}function Rh({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let y=n*t;const w=d+y,g=o===void 0?w:o(w);g!==w&&(y=g-d);const x=P=>-y*Math.exp(-P/r),v=P=>g+x(P),b=P=>{const R=x(P),j=v(P);h.done=Math.abs(R)<=c,h.value=h.done?g:j};let S,k;const T=P=>{p(h.value)&&(S=P,k=$c({keyframes:[h.value,m(h.value)],velocity:x_(v,P,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:P=>{let R=!1;return!k&&S===void 0&&(R=!0,b(P),T(P)),S!==void 0&&P>=S?k.next(P-S):(!R&&b(P),h)}}}function g3(e,t,n){const r=[],s=n||Hr.mix||g_,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Zt:t;a=ka(l,a)}r.push(a)}return r}function y3(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Em(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=g3(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const h=ua(e[d],e[d+1],u);return a[d](h)};return n?u=>c(Dn(e[0],e[i-1],u)):c}function x3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ua(0,t,r);e.push(ge(n,1,s))}}function v3(e){const t=[0];return x3(t,e.length-1),t}function w3(e,t){return e.map(n=>n*t)}function b3(e,t){return e.map(()=>t||o_).splice(0,e.length-1)}function zo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=TD(r)?r.map(t0):t0(r),i={done:!1,value:t[0]},o=w3(n&&n.length===t.length?n:v3(t),e),a=y3(o,t,{ease:Array.isArray(s)?s:b3(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const k3=e=>e!==null;function ku(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(k3),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const _3={decay:Rh,inertia:Rh,tween:zo,keyframes:zo,spring:$c};function v_(e){typeof e.type=="string"&&(e.type=_3[e.type])}class Fm{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 S3=e=>e/100;class Bc extends Fm{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==lt.now()&&this.tick(lt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;v_(t);const{type:n=zo,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||zo;l!==zo&&typeof a[0]!="number"&&(this.mixKeyframes=ka(S3,g_(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Dm(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}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:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:h,repeatDelay:p,type:m,onUpdate:y,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,b=r;if(d){const P=Math.min(this.currentTime,s)/a;let R=Math.floor(P),j=P%1;!j&&P>=1&&(j=1),j===1&&R--,R=Math.min(R,d+1),!!(R%2)&&(h==="reverse"?(j=1-j,p&&(j-=p/a)):h==="mirror"&&(b=o)),v=Dn(0,1,j)*a}let S;x?(this.delayState.value=u[0],S=this.delayState):S=b.next(v),i&&!x&&(S.value=i(S.value));let{done:k}=S;!x&&l!==null&&(k=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return T&&m!==Rh&&(S.value=ku(u,this.options,w,this.speed)),y&&y(S.value),T&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Yt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Yt(t)}get time(){return Yt(this.currentTime)}set time(t){t=Dt(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),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return x_(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(lt.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Yt(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=a3,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(lt.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 C3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const gs=e=>e*180/Math.PI,Nh=e=>{const t=gs(Math.atan2(e[1],e[0]));return Ih(t)},P3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Nh,rotateZ:Nh,skewX:e=>gs(Math.atan(e[1])),skewY:e=>gs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ih=e=>(e=e%360,e<0&&(e+=360),e),l0=Nh,c0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),u0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),j3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:c0,scaleY:u0,scale:e=>(c0(e)+u0(e))/2,rotateX:e=>Ih(gs(Math.atan2(e[6],e[5]))),rotateY:e=>Ih(gs(Math.atan2(-e[2],e[0]))),rotateZ:l0,rotate:l0,skewX:e=>gs(Math.atan(e[4])),skewY:e=>gs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Mh(e){return e.includes("scale")?1:0}function Ah(e,t){if(!e||e==="none")return Mh(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=j3,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=P3,s=a}if(!s)return Mh(t);const i=r[t],o=s[1].split(",").map(T3);return typeof i=="function"?i(o):o[i]}const E3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Ah(n,t)};function T3(e){return parseFloat(e.trim())}const Ui=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wi=new Set([...Ui,"pathRotation"]),d0=e=>e===Vi||e===Q,R3=new Set(["x","y","z"]),N3=Ui.filter(e=>!R3.has(e));function I3(e){const t=[];return N3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Nr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-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})=>Ah(t,"x"),y:(e,{transform:t})=>Ah(t,"y")};Nr.translateX=Nr.x;Nr.translateY=Nr.y;const _s=new Set;let Lh=!1,Dh=!1,Fh=!1;function w_(){if(Dh){const e=Array.from(_s).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=I3(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Dh=!1,Lh=!1,_s.forEach(e=>e.complete(Fh)),_s.clear()}function b_(){_s.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Dh=!0)})}function M3(){Fh=!0,b_(),w_(),Fh=!1}class Om{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(_s.add(this),Lh||(Lh=!0,ye.read(b_),ye.resolveKeyframes(w_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}C3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_s.delete(this)}cancel(){this.state==="scheduled"&&(_s.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const A3=e=>e.startsWith("--");function k_(e,t,n){A3(t)?e.style.setProperty(t,n):e.style[t]=n}const L3={};function __(e,t){const n=Yk(e);return()=>L3[t]??n()}const D3=__(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),S_=__(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),So=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,f0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:So([0,.65,.55,1]),circOut:So([.55,0,1,.45]),backIn:So([.31,.01,.66,-.59]),backOut:So([.33,1.53,.69,.99])};function C_(e,t){if(e)return typeof e=="function"?S_()?y_(e,t):"ease-out":a_(e)?So(e):Array.isArray(e)?e.map(n=>C_(n,t)||f0.easeOut):f0[e]}function F3(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=C_(a,s);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function P_(e){return typeof e=="function"&&"applyToOptions"in e}function O3({type:e,...t}){return P_(e)&&S_()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class j_ extends Fm{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,Em(typeof t.type!="string");const c=O3(t);this.animation=F3(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=ku(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),k_(n,r,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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 n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Yt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Yt(t)}get time(){return Yt(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Dt(t),n&&this.animation.pause()}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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&D3()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Zt):s(this)}}const E_={anticipate:r_,backInOut:n_,circInOut:i_};function z3(e){return e in E_}function $3(e){typeof e.ease=="string"&&z3(e.ease)&&(e.ease=E_[e.ease])}const Gd=10;class B3 extends j_{constructor(t){$3(t),v_(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Bc({...o,autoplay:!1}),l=Math.max(Gd,lt.now()-this.startTime),c=Dn(0,Gd,l-Gd),u=a.sample(l).value,{name:d}=this.options;i&&d&&k_(i,d,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const h0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(yn.test(e)||e==="0")&&!e.startsWith("url("));function V3(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 U3(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=h0(s,t),a=h0(i,t);return!o||!a?!1:V3(e)||(n==="spring"||P_(n))&&r}function Oh(e){e.duration=0,e.type="keyframes"}const T_=new Set(["opacity","clipPath","filter","transform"]),W3=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function H3(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&W3.test(e[t]))return!0;return!1}const G3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),K3=Yk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Q3(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return K3()&&n&&(T_.has(n)||G3.has(n)&&H3(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const q3=40;class Y3 extends Fm{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...d}){var m;super(),this.stop=()=>{var y,w;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=lt.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:u,...d},p=(u==null?void 0:u.KeyframeResolver)||Om;this.keyframeResolver=new p(a,(y,w,g)=>this.onKeyframesResolved(y,w,h,!g),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var g,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=lt.now();let d=!0;U3(t,i,o,a)||(d=!1,(Hr.instantAnimations||!l)&&(u==null||u(ku(t,r,n))),t[0]=t[t.length-1],Oh(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>q3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=d&&!c&&Q3(p),y=(x=(g=p.motionValue)==null?void 0:g.owner)==null?void 0:x.current;let w;if(m)try{w=new B3({...p,element:y})}catch{w=new Bc(p)}else w=new Bc(p);w.finished.then(()=>{this.notifyFinished()}).catch(Zt),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}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(),M3()),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()}}function R_(e,t,n,r=0,s=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const p0=30,X3=e=>!isNaN(parseFloat(e));class J3{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=lt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=lt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=X3(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 Tm);const r=this.events[t].add(n);return t==="change"?()=>{r(),ye.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=lt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>p0)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,p0);return Xk(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 Mi(e,t){return new J3(e,t)}function N_(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function zm(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?N_(n,e):n}const Z3={type:"spring",stiffness:500,damping:25,restSpeed:10},eF=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),tF={type:"keyframes",duration:.8},nF={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},rF=(e,{keyframes:t})=>t.length>2?tF:Wi.has(e)?e.startsWith("scale")?eF(t[1]):Z3:nF,sF=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function iF(e){for(const t in e)if(!sF.has(t))return!0;return!1}const $m=(e,t,n,r={},s,i)=>o=>{const a=zm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Dt(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};iF(a)||Object.assign(u,rF(e,u)),u.duration&&(u.duration=Dt(u.duration)),u.repeatDelay&&(u.repeatDelay=Dt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Oh(u),u.delay===0&&(d=!0)),(Hr.instantAnimations||Hr.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(d=!0,Oh(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const h=ku(u.keyframes,a);if(h!==void 0){ye.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new Bc(u):new Y3(u)},oF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function aF(e){const t=oF.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function I_(e,t,n=1){const[r,s]=aF(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Kk(o)?parseFloat(o):o}return Im(s)?I_(s,t,n+1):s}function m0(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Bm(e,t,n,r){if(typeof t=="function"){const[s,i]=m0(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=m0(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Ss(e,t,n){const r=e.getProps();return Bm(r,t,n!==void 0?n:r.custom,e)}const M_=new Set(["width","height","top","left","right","bottom",...Ui]),zh=e=>Array.isArray(e);function lF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Mi(n))}function cF(e){return zh(e)?e[e.length-1]||0:e}function uF(e,t){const n=Ss(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=cF(i[o]);lF(e,o,a)}}const Xe=e=>!!(e&&e.getVelocity);function dF(e){return!!(Xe(e)&&e.add)}function $h(e,t){const n=e.getValue("willChange");if(dF(n))return n.add(t);if(!n&&Hr.WillChange){const r=new Hr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Vm(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const fF="framerAppearId",A_="data-"+Vm(fF);function L_(e){return e.props[A_]}function hF({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function D_(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?N_(i,l):l;const c=i==null?void 0:i.reduceMotion,u=i==null?void 0:i.skipAnimations;r&&(i=r);const d=[],h=s&&e.animationState&&e.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(e,a,i,n,d);for(const m in a){const y=e.getValue(m,e.latestValues[m]??null),w=a[m];if(w===void 0||h&&hF(h,m))continue;const g={delay:n,...zm(i||{},m)};u&&(g.skipAnimations=!0);const x=y.get();if(x!==void 0&&!y.isAnimating()&&!Array.isArray(w)&&w===x&&!g.velocity){ye.update(()=>y.set(w));continue}let v=!1;if(window.MotionHandoffAnimation){const k=L_(e);if(k){const T=window.MotionHandoffAnimation(k,m,ye);T!==null&&(g.startTime=T,v=!0)}}$h(e,m);const b=c??e.shouldReduceMotion;y.start($m(m,y,w,b&&M_.has(m)?{type:!1}:g,e,v));const S=y.animation;S&&d.push(S)}if(o){const m=()=>ye.update(()=>{o&&uF(e,o)});d.length?Promise.all(d).then(m):m()}return d}function Bh(e,t,n={}){var l;const r=Ss(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(D_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=s;return pF(e,t,c,u,d,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[i,o]:[o,i];return c().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function pF(e,t,n=0,r=0,s=0,i=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Bh(l,t,{...o,delay:n+(typeof r=="function"?0:r)+R_(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function mF(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Bh(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Bh(e,t,n);else{const s=typeof t=="function"?Ss(e,t,n.custom):t;r=Promise.all(D_(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const gF={test:e=>e==="auto",parse:e=>e},F_=e=>t=>t.test(e),O_=[Vi,Q,An,Hn,VD,BD,gF],g0=e=>O_.find(F_(e));function yF(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||qk(e):!0}const xF=new Set(["brightness","contrast","saturate","opacity"]);function vF(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Mm)||[];if(!r)return e;const s=n.replace(r,"");let i=xF.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const wF=/\b([a-z-]*)\(.*?\)/gu,Vh={...yn,getAnimatableNone:e=>{const t=e.match(wF);return t?t.map(vF).join(" "):e}},Uh={...yn,getAnimatableNone:e=>{const t=yn.parse(e);return yn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},y0={...Vi,transform:Math.round},bF={rotate:Hn,pathRotation:Hn,rotateX:Hn,rotateY:Hn,rotateZ:Hn,scale:fl,scaleX:fl,scaleY:fl,scaleZ:fl,skew:Hn,skewX:Hn,skewY:Hn,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:da,originX:r0,originY:r0,originZ:Q},Vc={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,inset:Q,insetBlock:Q,insetBlockStart:Q,insetBlockEnd:Q,insetInline:Q,insetInlineStart:Q,insetInlineEnd:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,paddingBlock:Q,paddingBlockStart:Q,paddingBlockEnd:Q,paddingInline:Q,paddingInlineStart:Q,paddingInlineEnd:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,marginBlock:Q,marginBlockStart:Q,marginBlockEnd:Q,marginInline:Q,marginInlineStart:Q,marginInlineEnd:Q,fontSize:Q,backgroundPositionX:Q,backgroundPositionY:Q,...bF,zIndex:y0,fillOpacity:da,strokeOpacity:da,numOctaves:y0},kF={...Vc,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:Vh,WebkitFilter:Vh,mask:Uh,WebkitMask:Uh},z_=e=>kF[e],_F=new Set([Vh,Uh]);function $_(e,t){let n=z_(e);return _F.has(n)||(n=yn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const SF=new Set(["auto","none","0"]);function CF(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!SF.has(i)&&Ii(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=$_(n,s)}class PF extends Om{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let d=t[u];if(typeof d=="string"&&(d=d.trim(),Im(d))){const h=I_(d,n.current);h!==void 0&&(t[u]=h),u===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!M_.has(r)||t.length!==2)return;const[s,i]=t,o=g0(s),a=g0(i),l=n0(s),c=n0(i);if(l!==c&&Nr[r]){this.needsMeasurement=!0;return}if(o!==a)if(d0(o)&&d0(a))for(let u=0;u<t.length;u++){const d=t[u];typeof d=="string"&&(t[u]=parseFloat(d))}else Nr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||yF(t[s]))&&r.push(s);r.length&&CF(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=Nr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Nr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function B_(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const Wh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Kl(e){return Qk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Um}=l_(queueMicrotask,!1),dn={x:!1,y:!1};function V_(){return dn.x||dn.y}function jF(e){return e==="x"||e==="y"?dn[e]?null:(dn[e]=!0,()=>{dn[e]=!1}):dn.x||dn.y?null:(dn.x=dn.y=!0,()=>{dn.x=dn.y=!1})}function U_(e,t){const n=B_(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function EF(e){return!(e.pointerType==="touch"||V_())}function TF(e,t,n={}){const[r,s,i]=U_(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},d=w=>{c&&(c(w),c=void 0),u()},h=w=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,d(w))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=w=>{if(w.pointerType!=="touch"){if(a){l=!0;return}d(w)}},y=w=>{if(!EF(w))return;l=!1;const g=t(o,w);typeof g=="function"&&(c=g,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",y,s),o.addEventListener("pointerdown",p,s)}),i}const W_=(e,t)=>t?e===t?!0:W_(e,t.parentElement):!1,Wm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,RF=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function NF(e){return RF.has(e.tagName)||e.isContentEditable===!0}const IF=new Set(["INPUT","SELECT","TEXTAREA"]);function MF(e){return IF.has(e.tagName)||e.isContentEditable===!0}const Ql=new WeakSet;function x0(e){return t=>{t.key==="Enter"&&e(t)}}function Kd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const AF=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=x0(()=>{if(Ql.has(n))return;Kd(n,"down");const s=x0(()=>{Kd(n,"up")}),i=()=>Kd(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function v0(e){return Wm(e)&&!V_()}const w0=new WeakSet;function LF(e,t,n={}){const[r,s,i]=U_(e,n),o=a=>{const l=a.currentTarget;if(!v0(a)||w0.has(a))return;Ql.add(l),n.stopPropagation&&w0.add(a);const c=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),Ql.has(l)&&Ql.delete(l),v0(p)&&typeof c=="function"&&c(p,{success:m})},d=p=>{u(p,l===window||l===document||n.useGlobalTarget||W_(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",d,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Kl(a)&&(a.addEventListener("focus",c=>AF(c,s)),!NF(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Hm(e){return Qk(e)&&"ownerSVGElement"in e}const ql=new WeakMap;let xr;const H_=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Hm(r)&&"getBBox"in r?r.getBBox()[t]:r[n],DF=H_("inline","width","offsetWidth"),FF=H_("block","height","offsetHeight");function OF({target:e,borderBoxSize:t}){var n;(n=ql.get(e))==null||n.forEach(r=>{r(e,{get width(){return DF(e,t)},get height(){return FF(e,t)}})})}function zF(e){e.forEach(OF)}function $F(){typeof ResizeObserver>"u"||(xr=new ResizeObserver(zF))}function BF(e,t){xr||$F();const n=B_(e);return n.forEach(r=>{let s=ql.get(r);s||(s=new Set,ql.set(r,s)),s.add(t),xr==null||xr.observe(r)}),()=>{n.forEach(r=>{const s=ql.get(r);s==null||s.delete(t),s!=null&&s.size||xr==null||xr.unobserve(r)})}}const Yl=new Set;let ci;function VF(){ci=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yl.forEach(t=>t(e))},window.addEventListener("resize",ci)}function UF(e){return Yl.add(e),ci||VF(),()=>{Yl.delete(e),!Yl.size&&typeof ci=="function"&&(window.removeEventListener("resize",ci),ci=void 0)}}function b0(e,t){return typeof e=="function"?UF(e):BF(e,t)}function WF(e){return Hm(e)&&e.tagName==="svg"}const HF=[...O_,ze,yn],GF=e=>HF.find(F_(e)),k0=()=>({translate:0,scale:1,origin:0,originPoint:0}),ui=()=>({x:k0(),y:k0()}),_0=()=>({min:0,max:0}),Be=()=>({x:_0(),y:_0()}),KF=new WeakMap;function _u(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function fa(e){return typeof e=="string"||Array.isArray(e)}const Gm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Km=["initial",...Gm];function Su(e){return _u(e.animate)||Km.some(t=>fa(e[t]))}function G_(e){return!!(Su(e)||e.variants)}function QF(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Xe(s))e.addValue(r,s);else if(Xe(i))e.addValue(r,Mi(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Mi(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Uc={current:null},Qm={current:!1},qF=typeof window<"u";function K_(){if(Qm.current=!0,!!qF)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Uc.current=e.matches;e.addEventListener("change",t),t()}else Uc.current=!1}const S0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wc={};function Q_(e){Wc=e}function YF(){return Wc}class XF{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Om,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 p=lt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ye.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Su(n),this.isVariantNode=G_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];c[p]!==void 0&&Xe(m)&&m.set(c[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,KF.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((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Qm.current||K_(),this.shouldReduceMotion=Uc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Gr(this.notifyUpdate),Gr(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){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&T_.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,d=new j_({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:Dt(u)}),h=o(d);this.valueSubscriptions.set(t,()=>{h(),d.cancel()});return}const r=Wi.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ye.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}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 Wc){const n=Wc[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Be()}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<S0.length;r++){const s=S0[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=QF(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=Mi(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"&&(Kk(r)||qk(r))?r=parseFloat(r):!GF(r)&&yn.test(n)&&(r=$_(t,n)),this.setBaseTarget(t,Xe(r)?r.get():r)),Xe(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Bm(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Xe(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Tm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Um.render(this.render)}}class q_ extends XF{constructor(){super(...arguments),this.KeyframeResolver=PF}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[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;Xe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Y_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function JF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ZF(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 Qd(e){return e===void 0||e===1}function Hh({scale:e,scaleX:t,scaleY:n}){return!Qd(e)||!Qd(t)||!Qd(n)}function cs(e){return Hh(e)||X_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function X_(e){return C0(e.x)||C0(e.y)}function C0(e){return e&&e!=="0%"}function Hc(e,t,n){const r=e-n,s=t*r;return n+s}function P0(e,t,n,r,s){return s!==void 0&&(e=Hc(e,s,r)),Hc(e,n,r)+t}function Gh(e,t=0,n=1,r,s){e.min=P0(e.min,t,n,r,s),e.max=P0(e.max,t,n,r,s)}function J_(e,{x:t,y:n}){Gh(e.x,t.translate,t.scale,t.originPoint),Gh(e.y,n.translate,n.scale,n.originPoint)}const j0=.999999999999,E0=1.0000000000001;function eO(e,t,n,r=!1){var a;const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Tn(e.x,-i.scroll.offset.x),Tn(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,J_(e,o)),r&&cs(i.latestValues)&&Xl(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<E0&&t.x>j0&&(t.x=1),t.y<E0&&t.y>j0&&(t.y=1)}function Tn(e,t){e.min+=t,e.max+=t}function T0(e,t,n,r,s=.5){const i=ge(e.min,e.max,s);Gh(e,t,n,i,r)}function R0(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Xl(e,t,n){const r=n??e;T0(e.x,R0(t.x,r.x),t.scaleX,t.scale,t.originX),T0(e.y,R0(t.y,r.y),t.scaleY,t.scale,t.originY)}function Z_(e,t){return Y_(ZF(e.getBoundingClientRect(),t))}function tO(e,t,n){const r=Z_(e,n),{scroll:s}=t;return s&&(Tn(r.x,s.offset.x),Tn(r.y,s.offset.y)),r}const nO={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rO=Ui.length;function sO(e,t,n){let r="",s=!0;for(let o=0;o<rO;o++){const a=Ui[o],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const u=parseFloat(l);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=Wh(l,Vc[a]);if(!c){s=!1;const d=nO[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${Wh(i,Vc.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function qm(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Wi.has(l)){o=!0;continue}else if(u_(l)){s[l]=c;continue}else{const u=Wh(c,Vc[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=sO(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}function eS(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function N0(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const go={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Q.test(e))e=parseFloat(e);else return e;const n=N0(e,t.target.x),r=N0(e,t.target.y);return`${n}% ${r}%`}},iO={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=yn.parse(e);if(s.length>5)return r;const i=yn.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ge(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}},Kh={borderRadius:{...go,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:go,borderTopRightRadius:go,borderBottomLeftRadius:go,borderBottomRightRadius:go,boxShadow:iO};function tS(e,{layout:t,layoutId:n}){return Wi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Kh[e]||e==="opacity")}function Ym(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const a in r)(Xe(r[a])||s&&Xe(s[a])||tS(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function oO(e){return window.getComputedStyle(e)}class aO extends q_{constructor(){super(...arguments),this.type="html",this.renderInstance=eS}readValueFromInstance(t,n){var r;if(Wi.has(n))return(r=this.projection)!=null&&r.isProjecting?Mh(n):E3(t,n);{const s=oO(t),i=(u_(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Z_(t,n)}build(t,n,r){qm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ym(t,n,r)}}const lO={offset:"stroke-dashoffset",array:"stroke-dasharray"},cO={offset:"strokeDashoffset",array:"strokeDasharray"};function uO(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?lO:cO;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const dO=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function nS(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(qm(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox);for(const p of dO)d[p]!==void 0&&(h[p]=d[p],delete d[p]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),s!==void 0&&uO(d,s,i,o,!1)}const rS=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"]),sS=e=>typeof e=="string"&&e.toLowerCase()==="svg";function fO(e,t,n,r){eS(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(rS.has(s)?s:Vm(s),t.attrs[s])}function iS(e,t,n){const r=Ym(e,t,n);for(const s in e)if(Xe(e[s])||Xe(t[s])){const i=Ui.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class hO extends q_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Be}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Wi.has(n)){const r=z_(n);return r&&r.default||0}return n=rS.has(n)?n:Vm(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iS(t,n,r)}build(t,n,r){nS(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){fO(t,n,r,s)}mount(t){this.isSVGTag=sS(t.tagName),super.mount(t)}}const pO=Km.length;function oS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?oS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<pO;n++){const r=Km[n],s=e.props[r];(fa(s)||s===!1)&&(t[r]=s)}return t}function aS(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 mO=[...Gm].reverse(),gO=Gm.length;function yO(e){return t=>Promise.all(t.map(({animation:n,options:r})=>mF(e,n,r)))}function xO(e){let t=yO(e),n=I0(),r=!0,s=!1;const i=c=>(u,d)=>{var p;const h=Ss(e,d,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:y,...w}=h;u={...u,...w,...y}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,d=oS(e.parent)||{},h=[],p=new Set;let m={},y=1/0;for(let g=0;g<gO;g++){const x=mO[g],v=n[x],b=u[x]!==void 0?u[x]:d[x],S=fa(b),k=x===c?v.isActive:null;k===!1&&(y=g);let T=b===d[x]&&b!==u[x]&&S;if(T&&(r||s)&&e.manuallyAnimateOnMount&&(T=!1),v.protectedKeys={...m},!v.isActive&&k===null||!b&&!v.prevProp||_u(b)||typeof b=="boolean")continue;if(x==="exit"&&v.isActive&&k!==!0){v.prevResolvedValues&&(m={...m,...v.prevResolvedValues});continue}const P=vO(v.prevProp,b);let R=P||x===c&&v.isActive&&!T&&S||g>y&&S,j=!1;const I=Array.isArray(b)?b:[b];let M=I.reduce(i(x),{});k===!1&&(M={});const{prevResolvedValues:O={}}=v,z={...O,...M},E=A=>{R=!0,p.has(A)&&(j=!0,p.delete(A)),v.needsAnimating[A]=!0;const B=e.getValue(A);B&&(B.liveStyle=!1)};for(const A in z){const B=M[A],C=O[A];if(m.hasOwnProperty(A))continue;let $=!1;zh(B)&&zh(C)?$=!aS(B,C)||P:$=B!==C,$?B!=null?E(A):p.add(A):B!==void 0&&p.has(A)?E(A):v.protectedKeys[A]=!0}v.prevProp=b,v.prevResolvedValues=M,v.isActive&&(m={...m,...M}),(r||s)&&e.blockInitialAnimation&&(R=!1);const F=T&&P;R&&(!F||j)&&h.push(...I.map(A=>{const B={type:x};if(typeof A=="string"&&(r||s)&&!F&&e.manuallyAnimateOnMount&&e.parent){const{parent:C}=e,$=Ss(C,A);if(C.enteringChildren&&$){const{delayChildren:q}=$.transition||{};B.delay=R_(C.enteringChildren,e,q)}}return{animation:A,options:B}}))}if(p.size){const g={};if(typeof u.initial!="boolean"){const x=Ss(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(g.transition=x.transition)}p.forEach(x=>{const v=e.getBaseTarget(x),b=e.getValue(x);b&&(b.liveStyle=!0),g[x]=v??null}),h.push({animation:g})}let w=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?t(h):Promise.resolve()}function l(c,u){var h;if(n[c].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const d=a(c);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=I0(),s=!0}}}function vO(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!aS(t,e):!1}function rs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function I0(){return{animate:rs(!0),whileInView:rs(),whileHover:rs(),whileTap:rs(),whileDrag:rs(),whileFocus:rs(),exit:rs()}}function Qh(e,t){e.min=t.min,e.max=t.max}function an(e,t){Qh(e.x,t.x),Qh(e.y,t.y)}function M0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const lS=1e-4,wO=1-lS,bO=1+lS,cS=.01,kO=0-cS,_O=0+cS;function ct(e){return e.max-e.min}function SO(e,t,n){return Math.abs(e-t)<=n}function A0(e,t,n,r=.5){e.origin=r,e.originPoint=ge(t.min,t.max,e.origin),e.scale=ct(n)/ct(t),e.translate=ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wO&&e.scale<=bO||isNaN(e.scale))&&(e.scale=1),(e.translate>=kO&&e.translate<=_O||isNaN(e.translate))&&(e.translate=0)}function $o(e,t,n,r){A0(e.x,t.x,n.x,r?r.originX:void 0),A0(e.y,t.y,n.y,r?r.originY:void 0)}function L0(e,t,n,r=0){const s=r?ge(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ct(t)}function CO(e,t,n,r){L0(e.x,t.x,n.x,r==null?void 0:r.x),L0(e.y,t.y,n.y,r==null?void 0:r.y)}function D0(e,t,n,r=0){const s=r?ge(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ct(t)}function Gc(e,t,n,r){D0(e.x,t.x,n.x,r==null?void 0:r.x),D0(e.y,t.y,n.y,r==null?void 0:r.y)}function F0(e,t,n,r,s){return e-=t,e=Hc(e,1/n,r),s!==void 0&&(e=Hc(e,1/s,r)),e}function PO(e,t=0,n=1,r=.5,s,i=e,o=e){if(An.test(t)&&(t=parseFloat(t),t=ge(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ge(i.min,i.max,r);e===i&&(a-=t),e.min=F0(e.min,t,n,a,s),e.max=F0(e.max,t,n,a,s)}function O0(e,t,[n,r,s],i,o){PO(e,t[n],t[r],t[s],t.scale,i,o)}const jO=["x","scaleX","originX"],EO=["y","scaleY","originY"];function z0(e,t,n,r){O0(e.x,t,jO,n?n.x:void 0,r?r.x:void 0),O0(e.y,t,EO,n?n.y:void 0,r?r.y:void 0)}function $0(e){return e.translate===0&&e.scale===1}function uS(e){return $0(e.x)&&$0(e.y)}function B0(e,t){return e.min===t.min&&e.max===t.max}function TO(e,t){return B0(e.x,t.x)&&B0(e.y,t.y)}function V0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function dS(e,t){return V0(e.x,t.x)&&V0(e.y,t.y)}function U0(e){return ct(e.x)/ct(e.y)}function W0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function jn(e){return[e("x"),e("y")]}function RO(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,pathRotation:d,rotateX:h,rotateY:p,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const fS=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],NO=fS.length,H0=e=>typeof e=="string"?parseFloat(e):e,G0=e=>typeof e=="number"||Q.test(e);function IO(e,t,n,r,s,i){s?(e.opacity=ge(0,n.opacity??1,MO(r)),e.opacityExit=ge(t.opacity??1,0,AO(r))):i&&(e.opacity=ge(t.opacity??1,n.opacity??1,r));for(let o=0;o<NO;o++){const a=fS[o];let l=K0(t,a),c=K0(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||G0(l)===G0(c)?(e[a]=Math.max(ge(H0(l),H0(c),r),0),(An.test(c)||An.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ge(t.rotate||0,n.rotate||0,r))}function K0(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const MO=hS(0,.5,s_),AO=hS(.5,.95,Zt);function hS(e,t,n){return r=>r<e?0:r>t?1:n(ua(e,t,r))}function LO(e,t,n){const r=Xe(e)?e:Mi(e);return r.start($m("",r,t,n)),r.animation}function ha(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const DO=(e,t)=>e.depth-t.depth;class FO{constructor(){this.children=[],this.isDirty=!1}add(t){jm(this.children,t),this.isDirty=!0}remove(t){Fc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(DO),this.isDirty=!1,this.children.forEach(t)}}function OO(e,t){const n=lt.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Gr(r),e(i-t))};return ye.setup(r,!0),()=>Gr(r)}function Jl(e){return Xe(e)?e.get():e}class zO{constructor(){this.members=[]}add(t){jm(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Fc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Fc(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){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Zl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},qd=["","X","Y","Z"],$O=1e3;let BO=0;function Yd(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function pS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=L_(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&pS(r)}function mS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=BO++,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(WO),this.nodes.forEach(YO),this.nodes.forEach(XO),this.nodes.forEach(HO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new FO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Tm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Hm(o)&&!WF(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const h=()=>this.root.updateBlockedByResize=!1;ye.read(()=>{d=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=OO(h,250),Zl.hasAnimatedSinceResize&&(Zl.hasAnimatedSinceResize=!1,this.nodes.forEach(Y0)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||nz,{onLayoutAnimationStart:y,onLayoutAnimationComplete:w}=c.getProps(),g=!this.targetLayout||!dS(this.targetLayout,p),x=!d&&h;if(this.options.layoutRoot||this.resumeFrom||x||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...zm(m,"layout"),onPlay:y,onComplete:w};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,x,v.path)}else d||Y0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Gr(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(JO),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&pS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(KO),this.nodes.forEach(Q0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(q0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(QO),this.nodes.forEach(qO),this.nodes.forEach(VO),this.nodes.forEach(UO)):this.nodes.forEach(q0),this.clearAllSnapshots();const a=lt.now();Ye.delta=Dn(0,1e3/60,a-Ye.timestamp),Ye.timestamp=a,Ye.isProcessing=!0,Bd.update.process(Ye),Bd.preRender.process(Ye),Bd.render.process(Ye),Ye.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Um.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(GO),this.sharedNodes.forEach(ZO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ct(this.snapshot.measuredBox.x)&&!ct(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Be()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!uS(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||cs(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),rz(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return Be();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(sz))){const{scroll:u}=this.root;u&&(Tn(a.x,u.offset.x),Tn(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=Be();if(an(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&an(a,o),Tn(a.x,d.offset.x),Tn(a.y,d.offset.y))}return a}applyTransform(o,a=!1,l){var u,d;const c=l||Be();an(c,o);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Tn(c.x,-p.scroll.offset.x),Tn(c.y,-p.scroll.offset.y)),cs(p.latestValues)&&Xl(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return cs(this.latestValues)&&Xl(c,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),c}removeTransform(o){var l;const a=Be();an(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!cs(u.latestValues))continue;let d;u.instance&&(Hh(u.latestValues)&&u.updateSnapshot(),d=Be(),an(d,u.measurePageBox())),z0(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,d)}return cs(this.latestValues)&&z0(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==Ye.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!this.layout||!(u||d))return;this.resolvedRelativeTargetAt=Ye.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Be(),this.targetWithTransforms=Be()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),CO(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):an(this.target,this.layout.layoutBox),J_(this.target,this.targetDelta)):an(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Hh(this.parent.latestValues)||X_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Be(),this.relativeTargetOrigin=Be(),Gc(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),an(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ye.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;an(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;eO(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Be());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(M0(this.prevProjectionDelta.x,this.projectionDelta.x),M0(this.prevProjectionDelta.y,this.projectionDelta.y)),$o(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!W0(this.projectionDelta.x,this.prevProjectionDelta.x)||!W0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ui(),this.projectionDelta=ui(),this.projectionDeltaWithTransform=ui()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=ui();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Be(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,w=m!==y,g=this.getStack(),x=!g||g.members.length<=1,v=!!(w&&!x&&this.options.crossfade===!0&&!this.path.some(tz));this.animationProgress=0;let b;const S=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=k=>{const T=k/1e3,P=S==null?void 0:S(T);P?(h.x.translate=P.x,h.x.scale=ge(o.x.scale,1,T),h.x.origin=o.x.origin,h.x.originPoint=o.x.originPoint,h.y.translate=P.y,h.y.scale=ge(o.y.scale,1,T),h.y.origin=o.y.origin,h.y.originPoint=o.y.originPoint):(X0(h.x,o.x,T),X0(h.y,o.y,T)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gc(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),ez(this.relativeTarget,this.relativeTargetOrigin,p,T),b&&TO(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Be()),an(b,this.relativeTarget)),w&&(this.animationValues=d,IO(d,u,this.latestValues,T,v,x)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=d),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Gr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{Zl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Mi(0)),this.motionValue.jump(0,!1),this.currentAnimation=LO(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($O),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&gS(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Be();const d=ct(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=ct(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}an(a,l),Xl(a,u),$o(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new zO),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Yd("z",o,c,this.animationValues);for(let u=0;u<qd.length;u++)Yd(`rotate${qd[u]}`,o,c,this.animationValues),Yd(`skew${qd[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Jl(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Jl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!cs(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=RO(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),o.transform=d;const{x:h,y:p}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in Kh){if(u[m]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:g}=Kh[m],x=d==="none"?u[m]:y(u[m],c);if(w){const v=w.length;for(let b=0;b<v;b++)o[w[b]]=x}else g?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=c===this?Jl(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Q0),this.root.sharedNodes.clear()}}}function VO(e){e.updateLayout()}function UO(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")jn(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=ct(h);h.min=r[d].min,h.max=h.min+p});else if(i==="x"||i==="y"){const d=i==="x"?"y":"x";Qh(o?t.measuredBox[d]:t.layoutBox[d],r[d])}else gS(i,t.layoutBox,r)&&jn(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=ct(r[d]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=ui();$o(a,r,t.layoutBox);const l=ui();o?$o(l,e.applyTransform(s,!0),t.measuredBox):$o(l,r,t.layoutBox);const c=!uS(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:p}=d;if(h&&p){const m=e.options.layoutAnchor||void 0,y=Be();Gc(y,t.layoutBox,h.layoutBox,m);const w=Be();Gc(w,r,p.layoutBox,m),dS(y,w)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function WO(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 HO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function GO(e){e.clearSnapshot()}function Q0(e){e.clearMeasurements()}function KO(e){e.isLayoutDirty=!0,e.updateLayout()}function q0(e){e.isLayoutDirty=!1}function QO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function qO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Y0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YO(e){e.resolveTargetDelta()}function XO(e){e.calcProjection()}function JO(e){e.resetSkewAndRotation()}function ZO(e){e.removeLeadSnapshot()}function X0(e,t,n){e.translate=ge(t.translate,0,n),e.scale=ge(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function J0(e,t,n,r){e.min=ge(t.min,n.min,r),e.max=ge(t.max,n.max,r)}function ez(e,t,n,r){J0(e.x,t.x,n.x,r),J0(e.y,t.y,n.y,r)}function tz(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const nz={duration:.45,ease:[.4,0,.1,1]},Z0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ev=Z0("applewebkit/")&&!Z0("chrome/")?Math.round:Zt;function tv(e){e.min=ev(e.min),e.max=ev(e.max)}function rz(e){tv(e.x),tv(e.y)}function gS(e,t,n){return e==="position"||e==="preserve-aspect"&&!SO(U0(t),U0(n),.2)}function sz(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const iz=mS({attachResizeListener:(e,t)=>ha(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Xd={current:void 0},yS=mS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xd.current){const e=new iz({});e.mount(window),e.setOptions({layoutScroll:!0}),Xd.current=e}return Xd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Xm=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function nv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function oz(...e){return t=>{let n=!1;const r=e.map(s=>{const i=nv(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():nv(e[s],null)}}}}function az(...e){return _.useCallback(oz(...e),e)}class lz extends _.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Kl(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Kl(r)&&r.offsetWidth||0,i=Kl(r)&&r.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left,a.bottom=i-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function cz({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=_.useId(),a=_.useRef(null),l=_.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=_.useContext(Xm),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),d=az(a,u);return _.useInsertionEffect(()=>{const{width:p,height:m,top:y,left:w,right:g,bottom:x,direction:v}=l.current;if(t||i===!1||!a.current||!p||!m)return;const b=v==="rtl",S=n==="left"?b?`right: ${g}`:`left: ${w}`:b?`left: ${w}`:`right: ${g}`,k=r==="bottom"?`bottom: ${x}`:`top: ${y}`;a.current.dataset.motionPopId=o;const T=document.createElement("style");c&&(T.nonce=c);const P=s??document.head;return P.appendChild(T),T.sheet&&T.sheet.insertRule(`
71
71
  [data-motion-pop-id="${o}"] {
72
72
  position: absolute !important;
73
73
  width: ${p}px !important;
@@ -75,10 +75,10 @@ Error generating stack: `+i.message+`
75
75
  ${S}px !important;
76
76
  ${k}px !important;
77
77
  }
78
- `),()=>{var R;(R=a.current)==null||R.removeAttribute("data-motion-pop-id"),P.contains(T)&&P.removeChild(T)}},[t]),f.jsx(lz,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:_.cloneElement(e,{ref:d})})}const uz=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=Pm(dz),d=_.useId();let h=!0,p=_.useMemo(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:m=>{u.set(m,!0);for(const y of u.values())if(!y)return;r&&r()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,r]);return i&&h&&(p={...p}),_.useMemo(()=>{u.forEach((m,y)=>u.set(y,!1))},[n]),_.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=f.jsx(cz,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),f.jsx(bu.Provider,{value:p,children:e})};function dz(){return new Map}function xS(e=!0){const t=_.useContext(bu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=_.useId();_.useEffect(()=>{if(e)return s(i)},[e]);const o=_.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const hl=e=>e.key||"";function rv(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const vS=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,d]=xS(o),h=_.useMemo(()=>rv(e),[e]),p=o&&!u?[]:h.map(hl),m=_.useRef(!0),y=_.useRef(h),w=Pm(()=>new Map),g=_.useRef(new Set),[x,v]=_.useState(h),[b,S]=_.useState(h);Gk(()=>{m.current=!1,y.current=h;for(let P=0;P<b.length;P++){const R=hl(b[P]);p.includes(R)?(w.delete(R),g.current.delete(R)):w.get(R)!==!0&&w.set(R,!1)}},[b,p.length,p.join("-")]);const k=[];if(h!==x){let P=[...h];for(let R=0;R<b.length;R++){const j=b[R],I=hl(j);p.includes(I)||(P.splice(R,0,j),k.push(j))}return i==="wait"&&k.length&&(P=k),S(rv(P)),v(h),null}const{forceRender:T}=_.useContext(Cm);return f.jsx(f.Fragment,{children:b.map(P=>{const R=hl(P),j=o&&!u?!1:h===b||p.includes(R),I=()=>{if(g.current.has(R))return;if(w.has(R))g.current.add(R),w.set(R,!0);else return;let M=!0;w.forEach(O=>{O||(M=!1)}),M&&(T==null||T(),S(y.current),o&&(d==null||d()),r&&r())};return f.jsx(uz,{isPresent:j,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:j?void 0:I,anchorX:a,anchorY:l,children:P},R)})})},wS=_.createContext({strict:!1}),sv={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"]};let iv=!1;function fz(){if(iv)return;const e={};for(const t in sv)e[t]={isEnabled:n=>sv[t].some(r=>!!n[r])};Q_(e),iv=!0}function bS(){return fz(),YF()}function hz(e){const t=bS();for(const n in e)t[n]={...t[n],...e[n]};Q_(t)}const pz=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","propagate","ignoreStrict","viewport"]);function Kc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pz.has(e)}let kS=e=>!Kc(e);function mz(e){typeof e=="function"&&(kS=t=>t.startsWith("on")?!Kc(t):e(t))}try{mz(require("@emotion/is-prop-valid").default)}catch{}function gz(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Ye(e[s])||(kS(s)||n===!0&&Kc(s)||!t&&!Kc(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Cu=_.createContext({});function yz(e,t){if(Su(e)){const{initial:n,animate:r}=e;return{initial:n===!1||fa(n)?n:void 0,animate:fa(r)?r:void 0}}return e.inherit!==!1?t:{}}function xz(e){const{initial:t,animate:n}=yz(e,_.useContext(Cu));return _.useMemo(()=>({initial:t,animate:n}),[ov(t),ov(n)])}function ov(e){return Array.isArray(e)?e.join(" "):e}const Jm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _S(e,t,n){for(const r in t)!Ye(t[r])&&!tS(r,n)&&(e[r]=t[r])}function vz({transformTemplate:e},t){return _.useMemo(()=>{const n=Jm();return qm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function wz(e,t){const n=e.style||{},r={};return _S(r,n,e),Object.assign(r,vz(e,t)),r}function bz(e,t){const n={},r=wz(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 SS=()=>({...Jm(),attrs:{}});function kz(e,t,n,r){const s=_.useMemo(()=>{const i=SS();return nS(i,t,sS(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};_S(i,e.style,e),s.style={...i,...s.style}}return s}const _z=["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 Zm(e){return typeof e!="string"||e.includes("-")?!1:!!(_z.indexOf(e)>-1||/[A-Z]/u.test(e))}function Sz(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??Zm(e)?kz:bz)(t,r,s,e),c=gz(t,typeof e=="string",i),u=e!==_.Fragment?{...c,...l,ref:n}:{},{children:d}=t,h=_.useMemo(()=>Ye(d)?d.get():d,[d]);return _.createElement(e,{...u,children:h})}function Cz({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:Pz(n,r,s,e),renderState:t()}}function Pz(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Jl(i[h]);let{initial:o,animate:a}=e;const l=Su(e),c=G_(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!_u(d)){const h=Array.isArray(d)?d:[d];for(let p=0;p<h.length;p++){const m=Bm(e,h[p]);if(m){const{transitionEnd:y,transition:w,...g}=m;for(const x in g){let v=g[x];if(Array.isArray(v)){const b=u?v.length-1:0;v=v[b]}v!==null&&(s[x]=v)}for(const x in y)s[x]=y[x]}}}return s}const CS=e=>(t,n)=>{const r=_.useContext(Cu),s=_.useContext(bu),i=()=>Cz(e,t,r,s);return n?i():Pm(i)},jz=CS({scrapeMotionValuesFromProps:Ym,createRenderState:Jm}),Ez=CS({scrapeMotionValuesFromProps:iS,createRenderState:SS}),Tz=Symbol.for("motionComponentSymbol");function Rz(e,t,n){const r=_.useRef(n);_.useInsertionEffect(()=>{r.current=n});const s=_.useRef(null);return _.useCallback(i=>{var a;i&&((a=e.onMount)==null||a.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[t])}const PS=_.createContext({});function Qs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Nz(e,t,n,r,s,i){var v,b;const{visualElement:o}=_.useContext(Cu),a=_.useContext(wS),l=_.useContext(bu),c=_.useContext(Xm),u=c.reducedMotion,d=c.skipAnimations,h=_.useRef(null),p=_.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,y=_.useContext(PS);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&Iz(h.current,n,s,y);const w=_.useRef(!1);_.useInsertionEffect(()=>{m&&w.current&&m.update(n,l)});const g=n[A_],x=_.useRef(!!g&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,g))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,g)));return Gk(()=>{p.current=!0,m&&(w.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,g)}),x.current=!1),m.enteringChildren=void 0)}),m}function Iz(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:jS(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Qs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function jS(e){if(e)return e.options.allowProjection!==!1?e.projection:jS(e.parent)}function Jd(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&hz(r);const i=n?n==="svg":Zm(e),o=i?Ez:jz;function a(c,u){let d;const h={..._.useContext(Xm),...c,layoutId:Mz(c)},{isStatic:p}=h,m=xz(c),y=o(c,p);if(!p&&typeof window<"u"){Az();const w=Lz(h);d=w.MeasureLayout,m.visualElement=Nz(e,y,h,s,w.ProjectionNode,i)}return f.jsxs(Cu.Provider,{value:m,children:[d&&m.visualElement?f.jsx(d,{visualElement:m.visualElement,...h}):null,Sz(e,c,Rz(y,m.visualElement,u),y,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=_.forwardRef(a);return l[Tz]=e,l}function Mz({layoutId:e}){const t=_.useContext(Cm).id;return t&&e!==void 0?t+"-"+e:e}function Az(e,t){_.useContext(wS).strict}function Lz(e){const t=bS(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Dz(e,t){if(typeof Proxy>"u")return Jd;const n=new Map,r=(i,o)=>Jd(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Jd(o,void 0,e,t)),n.get(o))})}const Fz=(e,t)=>t.isSVG??Zm(e)?new hO(t):new aO(t,{allowProjection:e!==_.Fragment});class Oz extends Zr{constructor(t){super(t),t.animationState||(t.animationState=xO(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_u(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 zz=0;class $z extends Zr{constructor(){super(...arguments),this.id=zz++,this.isExitComplete=!1}update(){var i;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;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=Ss(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...d}=l;for(const h in d)(i=this.node.getValue(h))==null||i.jump(d[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Bz={animation:{Feature:Oz},exit:{Feature:$z}};function Ca(e){return{point:{x:e.pageX,y:e.pageY}}}const Vz=e=>t=>Wm(t)&&e(t,Ca(t));function Bo(e,t,n,r){return ha(e,t,Vz(n),r)}const ES=({current:e})=>e?e.ownerDocument.defaultView:null,av=(e,t)=>Math.abs(e-t);function Uz(e,t){const n=av(e.x,t.x),r=av(e.y,t.y);return Math.sqrt(n**2+r**2)}const lv=new Set(["auto","scroll"]);class TS{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=pl(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Zd(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=Uz(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:w}=p,{timestamp:g}=qe;this.history.push({...w,timestamp:g});const{onStart:x,onMove:v}=this.handlers;m||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=pl(m,this.transformPagePoint),ge.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:y,onSessionEnd:w,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Zd(p.type==="pointercancel"?this.lastMoveEventInfo:pl(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(p,x),w&&w(p,x)},!Wm(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Ca(t),c=pl(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=qe;this.history=[{...u,timestamp:d}];const{onSessionStart:h}=n;h&&h(t,Zd(c,this.history)),this.removeListeners=ka(Bo(this.contextWindow,"pointermove",this.handlePointerMove),Bo(this.contextWindow,"pointerup",this.handlePointerUp),Bo(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(lv.has(r.overflowX)||lv.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),ge.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Gr(this.updatePoint)}}function pl(e,t){return t?{point:t(e.point)}:e}function cv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zd({point:e},t){return{point:e,delta:cv(e,RS(t)),offset:cv(e,Wz(t)),velocity:Hz(t,.1)}}function Wz(e){return e[0]}function RS(e){return e[e.length-1]}function Hz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=RS(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Dt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Dt(t)*2&&(r=e[1]);const i=Yt(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Gz(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?me(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?me(n,e,r.max):Math.min(e,n)),e}function uv(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 Kz(e,{top:t,left:n,bottom:r,right:s}){return{x:uv(e.x,n,s),y:uv(e.y,t,r)}}function dv(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 Qz(e,t){return{x:dv(e.x,t.x),y:dv(e.y,t.y)}}function qz(e,t){let n=.5;const r=ct(e),s=ct(t);return s>r?n=ua(t.min,t.max-r,e.min):r>s&&(n=ua(e.min,e.max-s,t.min)),Dn(0,1,n)}function Yz(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 qh=.35;function Xz(e=qh){return e===!1?e=0:e===!0&&(e=qh),{x:fv(e,"left","right"),y:fv(e,"top","bottom")}}function fv(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 Jz=new WeakMap;class Zz{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=$e(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{n&&this.snapToCursor(Ca(d).point),this.stopAnimation()},o=(d,h)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jF(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),jn(g=>{let x=this.getAxisMotionValue(g).get()||0;if(An.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[g];b&&(x=ct(b)*(parseFloat(x)/100))}}this.originPoint[g]=x}),y&&ge.update(()=>y(d,h),!1,!0),$h(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:g}=h;if(m&&this.currentDirection===null){this.currentDirection=t$(g),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,g),this.updateAxis("y",h.point,g),this.visualElement.render(),w&&ge.update(()=>w(d,h),!1,!0)},l=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h,this.stop(d,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new TS(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:ES(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&ge.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!ml(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Gz(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Qs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Kz(r.layoutBox,t):this.constraints=!1,this.elastic=Xz(n),s!==this.constraints&&!Qs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&jn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Yz(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Qs(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=tO(r,s.root,this.visualElement.getTransformPagePoint());let o=Qz(s.layout.layoutBox,i);if(n){const a=n(JF(o));this.hasMutatedConstraints=!!a,a&&(o=Y_(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=jn(u=>{if(!ml(u,n,this.currentDirection))return;let d=l&&l[u]||{};(o===!0||o===u)&&(d={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return $h(this.visualElement,t),r.start($m(t,r,0,n,this.visualElement,!1))}stopAnimation(){jn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){jn(n=>{const{drag:r}=this.getProps();if(!ml(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=i.get()||0;i.set(t[n]-me(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Qs(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};jn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=qz({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),jn(o=>{if(!ml(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(me(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Jz.set(this.visualElement,this);const t=this.visualElement.current,n=Bo(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps(),h=c.target,p=h!==t&&MF(h);u&&d&&!p&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Qs(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=e$(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ge.read(s);const a=ha(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(jn(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=qh,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function pv(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function e$(e,t,n){const r=b0(e,pv(n)),s=b0(t,pv(n));return()=>{r(),s()}}function ml(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function t$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class n$ extends Zr{constructor(t){super(t),this.removeGroupControls=Zt,this.removeListeners=Zt,this.controls=new Zz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zt}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ef=e=>(t,n)=>{e&&ge.update(()=>e(t,n),!1,!0)};class r$ extends Zr{constructor(){super(...arguments),this.removePointerDownListener=Zt}onPointerDown(t){this.session=new TS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ES(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:ef(t),onStart:ef(n),onMove:ef(r),onEnd:(i,o)=>{delete this.session,s&&ge.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Bo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let tf=!1;class s$ extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),tf&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Zl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),tf=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ge.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Um.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;tf=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function NS(e){const[t,n]=xS(),r=_.useContext(Cm);return f.jsx(s$,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(PS),isPresent:t,safeToRemove:n})}const i$={pan:{Feature:r$},drag:{Feature:n$,ProjectionNode:yS,MeasureLayout:NS}};function mv(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ge.postRender(()=>i(t,Ca(t)))}class o$ extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=TF(t,(n,r)=>(mv(this.node,r,"Start"),s=>mv(this.node,s,"End"))))}unmount(){}}class a$ extends Zr{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=ka(ha(this.node.current,"focus",()=>this.onFocus()),ha(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function gv(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 s="onTap"+(n==="End"?"":n),i=r[s];i&&ge.postRender(()=>i(t,Ca(t)))}class l$ extends Zr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=LF(t,(s,i)=>(gv(this.node,i,"Start"),(o,{success:a})=>gv(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Yh=new WeakMap,nf=new WeakMap,c$=e=>{const t=Yh.get(e.target);t&&t(e)},u$=e=>{e.forEach(c$)};function d$({root:e,...t}){const n=e||document;nf.has(n)||nf.set(n,{});const r=nf.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(u$,{root:e,...t})),r[s]}function f$(e,t,n){const r=d$(t);return Yh.set(e,n),r.observe(e),()=>{Yh.delete(e),r.unobserve(e)}}const h$={some:0,all:1};class p$ extends Zr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:h$[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),p=u?d:h;p&&p(c)};this.stopObserver=f$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(m$(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function m$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const g$={inView:{Feature:p$},tap:{Feature:l$},focus:{Feature:a$},hover:{Feature:o$}},y$={layout:{ProjectionNode:yS,MeasureLayout:NS}},x$={...Bz,...g$,...i$,...y$},Ai=Dz(x$,Fz);function Pu(){!Qm.current&&K_();const[e]=_.useState(Uc.current);return e}function ju(e,t){const n=_.useRef(t);n.current=t,_.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const rf={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},X={bgBase:"#FDFCF8",bgSurface:"#FAF8F0",bgElevated:"#F5F1E6",textPrimary:"#1A1917",textSecondary:"#68635C",accentBlue:"#7C9CC0",accentBlueDark:"#51719B",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentRose:"#C98B8B",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",accentSlateDark:"#5E7080",canvasBase:"#F0EAD8",canvas300:"#E5DBC4",canvasDark:"#D6C9A8",washBlue:"#DEE4E5",washGreen:"#E3EADC",washAmber:"#F2E5D5",washRose:"#EFE0DA",washSlate:"#E1E4E0",chalkboardBg:"#142e22",chalkboardChalk:"#d4e8cb",chalkboardBorderBase:"#C8D2C3"};function nt(e,t){const n=e.replace("#",""),r=Number.parseInt(n.slice(0,2),16),s=Number.parseInt(n.slice(2,4),16),i=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${s}, ${i}, ${t})`}const v$={4:"1rem"};function q(...e){return iD(jL(e))}const w$={height:32,lineHeight:"32px",padding:"0 16px"},b$={white:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.97 0 0 0 0 0.96 0 0 0 0 0.95 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)' opacity='1'/%3E%3C/svg%3E")`,paper:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E")`,speckle:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='speckle'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23speckle)' opacity='0.14'/%3E%3C/svg%3E")`,parchment:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='par'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.55 0 0 0 0 0.48 0 0 0 0 0.35 0 0 0 0.45 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23par)' opacity='1'/%3E%3C/svg%3E")`,canvas:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='cv'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.62 0 0 0 0 0.60 0 0 0 0 0.52 0 0 0 0.42 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23cv)' opacity='1'/%3E%3C/svg%3E")`,kraft:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.50 0 0 0 0 0.35 0 0 0 0 0.20 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23k)' opacity='1'/%3E%3C/svg%3E")`,chalkboard:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.15 0 0 0 0 0.28 0 0 0 0 0.20 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='1'/%3E%3C/svg%3E")`},k$={white:X.bgBase,paper:X.bgSurface,speckle:X.bgSurface,parchment:X.bgElevated,canvas:X.canvasBase,kraft:X.canvas300,chalkboard:X.chalkboardBg},yv={white:X.bgElevated,paper:X.bgElevated,speckle:X.bgElevated,parchment:X.canvasBase,canvas:X.canvas300,kraft:X.canvasDark,chalkboard:X.chalkboardBg},_$={base:X.bgBase,surface:X.bgSurface,elevated:X.bgElevated,canvas:X.canvasBase,canvasDark:X.canvasDark,blue:X.washBlue,green:X.washGreen,amber:X.washAmber,rose:X.washRose,slate:X.washSlate},S$={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function IS(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=b$[n],o=t.fill?_$[t.fill]:t.shade?yv[n]:k$[n],a=S$[s],l={"--pui-texture-shade":yv[n],"--pui-texture-image":i};return r==="none"?{...l,backgroundColor:o,backgroundImage:i,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:r==="lines"?{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat",backgroundSize:"200px 200px, 100% 32px"}:{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px), repeating-linear-gradient(90deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat, repeat",backgroundSize:"200px 200px, 100% 32px, 32px 32px"}}function Pa(e){return IS(e)}function Hi(e,t="paper"){if(e!==!1)return Pa(e===!0?t:e)}function C$(e){const t=Tu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=8+Math.round(n*6),s=50,i=50,o=46,a=2+n*14,l=[];for(let c=0;c<r;c++){const u=c/r*Math.PI*2+(t()-.5)*.15*n,d=o+(t()-.5)*a*2;l.push({x:s+Math.cos(u)*d,y:i+Math.sin(u)*d})}return Eu(l)}function P$(e,t){const n=Tu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=8+Math.round(r*6),i=50,o=50,a=49,l=2+r*14,c=[];for(let u=0;u<s;u++){const d=u/s*Math.PI*2+(n()-.5)*.15*r,h=a+(n()-.5)*l*2;c.push({x:i+Math.cos(d)*h,y:o+Math.sin(d)*h})}return Eu(c)}function j$(e){const t=Tu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=3+Math.round(n*3),s=2,i=3+n*10,o=[],a=[{ax:s,ay:s,bx:100-s,by:s},{ax:100-s,ay:s,bx:100-s,by:100-s},{ax:100-s,ay:100-s,bx:s,by:100-s},{ax:s,ay:100-s,bx:s,by:s}];for(const l of a)for(let c=0;c<r;c++){const u=(c+.5)/r,d=l.ax+(l.bx-l.ax)*u,h=l.ay+(l.by-l.ay)*u,p=l.bx-l.ax,m=l.by-l.ay,y=Math.sqrt(p*p+m*m)||1,w=-m/y,g=p/y,x=(t()-.5)*i*2;o.push({x:d+w*x,y:h+g*x})}return Eu(o)}function E$(e,t){const n=Tu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=3+Math.round(r*3),i=0,o=3+r*10,a=[],l=[{ax:i,ay:i,bx:100-i,by:i},{ax:100-i,ay:i,bx:100-i,by:100-i},{ax:100-i,ay:100-i,bx:i,by:100-i},{ax:i,ay:100-i,bx:i,by:i}];for(const c of l)for(let u=0;u<s;u++){const d=(u+.5)/s,h=c.ax+(c.bx-c.ax)*d,p=c.ay+(c.by-c.ay)*d,m=c.bx-c.ax,y=c.by-c.ay,w=Math.sqrt(m*m+y*y)||1,g=-y/w,x=m/w,v=(n()-.5)*o*2;a.push({x:h+g*v,y:p+x*v})}return Eu(a)}function Eu(e){const t=e.length;if(t<3)return"";let n=`M ${hr(e[0].x)} ${hr(e[0].y)}`;for(let r=0;r<t;r++){const s=e[(r-1+t)%t],i=e[r],o=e[(r+1)%t],a=e[(r+2)%t],l=i.x+(o.x-s.x)/6,c=i.y+(o.y-s.y)/6,u=o.x-(a.x-i.x)/6,d=o.y-(a.y-i.y)/6;n+=` C ${hr(l)} ${hr(c)}, ${hr(u)} ${hr(d)}, ${hr(o.x)} ${hr(o.y)}`}return n+=" Z",n}function hr(e){return e.toFixed(2)}function Tu(e){let t=typeof e=="string"?T$(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function T$(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)||1}function Ru(){const e=_.useId();return _.useMemo(()=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return(t+1)/4294967296},[e])}function Gi(e){const t=Ru();return _.useMemo(()=>({blob:C$({seed:t,wobble:e}),ring:P$(t,e)}),[t,e])}const R$="button-module__button___Z331g",N$="button-module__blobBg___QQFzf",I$="button-module__blobFill___XwLjV",M$="button-module__blobRing___567UW",A$="button-module__isActive___FXNSJ",L$="button-module__primary___ppbyq",D$="button-module__secondary___esy5L",F$="button-module__ghost___NisA0",O$="button-module__danger___Wnvuq",z$="button-module__chalkboard___d3Nqb",$$="button-module__small___u7y8a",B$="button-module__medium___HBIAj",V$="button-module__large___RPzNy",U$="button-module__fullWidth___H0P0F",W$="button-module__iconLeft___s60SZ",H$="button-module__iconRight___75eFu",G$="button-module__label___pXAyM",Ut={button:R$,blobBg:N$,blobFill:I$,blobRing:M$,isActive:A$,primary:L$,secondary:D$,ghost:F$,danger:O$,chalkboard:z$,small:$$,medium:B$,large:V$,fullWidth:U$,iconLeft:W$,iconRight:H$,label:G$},te=_.forwardRef(function({variant:e="primary",surface:t="paper",size:n="medium",icon:r,iconRight:s,fullWidth:i=!1,wobble:o=.5,isActive:a=!1,children:l,className:c,...u},d){const h=Gi(o);return f.jsxs("button",{ref:d,type:"button",className:q(Ut.button,Ut[e],Ut[n],t==="chalkboard"&&Ut.chalkboard,a&&Ut.isActive,i&&Ut.fullWidth,c),...u,children:[f.jsxs("svg",{className:Ut.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:h.blob,className:Ut.blobFill}),f.jsx("path",{d:h.ring,className:Ut.blobRing})]}),r&&f.jsx("span",{className:Ut.iconLeft,children:r}),f.jsx("span",{className:Ut.label,children:l}),s&&f.jsx("span",{className:Ut.iconRight,children:s})]})});function eg(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const Fe=kD.generator(),K$="sketch-border-module__svg___whV4x",Q$="sketch-border-module__behind___lgdYV",q$="sketch-border-module__stroke___vAm-v",Y$="sketch-border-module__fill___zlpd6",gl={svg:K$,behind:Q$,stroke:q$,fill:Y$},X$=1.2,J$=.7;function _t({shape:e="rect",radius:t=9,roughness:n=1.2,bowing:r=1,strokeWidth:s=1,inset:i=2,fill:o=!1,clip:a=!1,smooth:l=!1,straight:c=!0,strokeInset:u=!0,className:d}){const[h]=_.useState(Math.random),p=_.useRef(null),[m,y]=_.useState(null);_.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(!v)return;const b=new ResizeObserver(()=>{const S=v.offsetWidth,k=v.offsetHeight;y(T=>T&&T.width===S&&T.height===k?T:{width:S,height:k})});return b.observe(v),()=>b.disconnect()},[]);const{parts:w,clipPath:g}=_.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const x=Math.max(1,Math.round(h*1e6)),v=x,b=x*2654435761%2147483647,S=R=>Fe.toPaths(Fe.path(R,{seed:v,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(j=>!j.fill||j.fill==="none").map(j=>({d:j.d,filled:!1}));if(l){const R={seed:v,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},j=M=>Fe.toPaths(M).filter(O=>!O.fill||O.fill==="none").map(O=>({d:O.d,filled:!1}));if(a){const M=yl(e,m,i,t,ss(b),n*1.1),O=u?xv(s,n):0,z=O?yl(e,m,i+O,t,ss(b),n*1.1):M;return{parts:j(Fe.path(z,{...R,preserveVertices:!0})),clipPath:M}}const I=e==="circle"?Fe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,R):Fe.path(sf(m,i,t,ss(v)),{...R,preserveVertices:!0});return{parts:j(I),clipPath:null}}if(a){if(c){const M=sf(m,i,t,ss(b)),O=Fe.toPaths(Fe.path(M,{seed:v,roughness:X$,bowing:J$,preserveVertices:!0,strokeWidth:s})).filter(z=>!z.fill||z.fill==="none").map(z=>({d:z.d,filled:!1}));return{parts:O.length?O:[{d:M,filled:!1}],clipPath:M}}const R=yl(e,m,i,t,ss(b),n*1.1),j=u?xv(s,n):0,I=j?yl(e,m,i+j,t,ss(b),n*1.1):R;return{parts:S(I),clipPath:R}}const k=(R,j)=>{const I=j?{fill:"#000",fillStyle:"solid"}:{},M=e==="circle"?Fe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:R,roughness:n,bowing:r,strokeWidth:s,...I}):Fe.path(sf(m,i,t,ss(R)),{seed:R,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...I});return Fe.toPaths(M)},T=o?k(b,!0).filter(R=>!!R.fill&&R.fill!=="none").map(R=>({d:R.d,filled:!0})):[],P=k(v,!1).filter(R=>!R.fill||R.fill==="none").map(R=>({d:R.d,filled:!1}));return{parts:[...T,...P],clipPath:null}},[m,h,a,l,c,e,t,n,r,s,i,o,u]);return _.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(v)return g?v.style.setProperty("--sketch-clip",`path("${g}")`):v.style.removeProperty("--sketch-clip"),()=>{v.style.removeProperty("--sketch-clip")}},[g]),f.jsx("svg",{ref:p,className:q(gl.svg,o&&gl.behind,d),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:w==null?void 0:w.map((x,v)=>x.filled?f.jsx("path",{className:gl.fill,d:x.d},`f-${v}`):f.jsx("path",{className:gl.stroke,d:x.d,strokeWidth:s},`s-${v}`))})}function xv(e,t){return e/2+t*1.5}function ss(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function yl(e,t,n,r,s,i){const o=t.width-n*2,a=t.height-n*2,l=t.width/2,c=t.height/2,u=()=>(s()-.5)*i*2,d=[];if(e==="circle")for(let h=0;h<16;h++){const p=h/16*Math.PI*2;d.push({x:l+Math.cos(p)*o/2+u(),y:c+Math.sin(p)*a/2+u()})}else{const h=Math.max(2,Math.min(r,o/2,a/2)),p=n,m=n,y=(x,v,b)=>{for(const S of[0,45,90]){const k=(b+S)*Math.PI/180;d.push({x:x+Math.cos(k)*h+u(),y:v+Math.sin(k)*h+u()})}},w=(x,v,b,S)=>{const k=Math.hypot(b-x,S-v),T=Math.min(12,Math.max(1,Math.round(k/160)));for(let P=1;P<=T;P++){const R=P/(T+1);d.push({x:x+(b-x)*R+u(),y:v+(S-v)*R+u()})}};y(p+h,m+h,180),w(p+h,m,p+o-h,m),y(p+o-h,m+h,270),w(p+o,m+h,p+o,m+a-h),y(p+o-h,m+a-h,0),w(p+o-h,m+a,p+h,m+a),y(p+h,m+a-h,90),w(p,m+a-h,p,m+h);const g=3;return vv([...d.slice(g),...d.slice(0,g)])}return vv(d)}function vv(e){const t=e.length;if(t<3)return"";const n=(s,i)=>Math.max(.001,Math.hypot(i.x-s.x,i.y-s.y)**.5);let r=`M ${e[0].x.toFixed(2)} ${e[0].y.toFixed(2)}`;for(let s=0;s<t;s++){const i=e[(s-1+t)%t],o=e[s],a=e[(s+1)%t],l=e[(s+2)%t],c=n(i,o),u=n(o,a),d=n(a,l),h=a.x-o.x+u*((o.x-i.x)/c-(a.x-i.x)/(c+u)),p=a.y-o.y+u*((o.y-i.y)/c-(a.y-i.y)/(c+u)),m=a.x-o.x+u*((l.x-a.x)/d-(l.x-o.x)/(u+d)),y=a.y-o.y+u*((l.y-a.y)/d-(l.y-o.y)/(u+d)),w=o.x+h/3,g=o.y+p/3,x=a.x-m/3,v=a.y-y/3;r+=` C ${w.toFixed(2)} ${g.toFixed(2)}, ${x.toFixed(2)} ${v.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function sf(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return Z$(t,t,e.width-t*2,e.height-t*2,s)}function Z$(e,t,n,r,s){const i=u=>Math.min(u,n/2,r/2),[o,a,l,c]=s.map(i);return[`M ${ye(e+o)} ${ye(t)}`,`L ${ye(e+n-a)} ${ye(t)}`,`Q ${ye(e+n)} ${ye(t)} ${ye(e+n)} ${ye(t+a)}`,`L ${ye(e+n)} ${ye(t+r-l)}`,`Q ${ye(e+n)} ${ye(t+r)} ${ye(e+n-l)} ${ye(t+r)}`,`L ${ye(e+c)} ${ye(t+r)}`,`Q ${ye(e)} ${ye(t+r)} ${ye(e)} ${ye(t+r-c)}`,`L ${ye(e)} ${ye(t+o)}`,`Q ${ye(e)} ${ye(t)} ${ye(e+o)} ${ye(t)}`,"Z"].join(" ")}function ye(e){return e.toFixed(2)}const St={surface:{radius:12,inset:2.5,roughness:.2,bowing:0,strokeWidth:1.3},field:{radius:8,inset:2,roughness:1.1,strokeWidth:1.3},control:{radius:6,inset:2,roughness:.5,bowing:.6,strokeWidth:1.4},pill:{radius:999,inset:2,roughness:.7,strokeWidth:1}},eB="page-module__page___-uHnG",tB="page-module__outlined___Wwtyg",nB="page-module__surface___sWfI6",rB="page-module__flat___HlOaY",sB="page-module__withAccent___lsv-m",iB="page-module__accentBlue___XxbMV",oB="page-module__accentGreen___Ne6Q8",aB="page-module__accentAmber___kLAwa",lB="page-module__accentRose___O9ZbZ",cB="page-module__accentSlate___xCB66",qs={page:eB,outlined:tB,surface:nB,flat:rB,withAccent:sB,accentBlue:iB,accentGreen:oB,accentAmber:aB,accentRose:lB,accentSlate:cB},uB=eg(qs),dB={all:14,top:14,none:2};function MS({children:e,className:t,style:n,texture:r=!0,withAccent:s=!1,accentColor:i="blue",rounded:o="all",outline:a=!1,sketch:l=!1}){const c=Hi(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return f.jsxs("div",{className:q(qs.page,a&&qs.outlined,s&&qs.withAccent,s&&uB[i],!l&&qs.flat,t),style:n,children:[f.jsx(_t,{clip:!0,...St.surface,radius:dB[o],straight:!l}),f.jsx("div",{className:qs.surface,style:c,children:e})]})}const fB="layout-module__layout___O1aWi",hB="layout-module__header___I-kxe",pB="layout-module__headerLeft___JChJQ",mB="layout-module__headerTitles___aqSUG",gB="layout-module__headerTitle___wvr39",yB="layout-module__headerSubtitle___6f5BD",xB="layout-module__headerActions___adC12",vB="layout-module__mobileToggle___4WpVG",wB="layout-module__body___tywNf",bB="layout-module__mobileOverlay___tzbBC",kB="layout-module__sidebar___8VKGq",_B="layout-module__sidebarOpen___47rtr",SB="layout-module__sidebarInner___tq2X6",CB="layout-module__logoArea___RLnC0",PB="layout-module__logoText___pAmfV",jB="layout-module__nav___FxcrZ",EB="layout-module__main___9z7bu",TB="layout-module__navIslandFixed___H4TwP",RB="layout-module__content___jL-VB",NB="layout-module__contentWithPage___vVdfN",IB="layout-module__footer___LyakU",MB="layout-module__footerText___8BYxc",Ne={layout:fB,header:hB,headerLeft:pB,headerTitles:mB,headerTitle:gB,headerSubtitle:yB,headerActions:xB,mobileToggle:vB,body:wB,mobileOverlay:bB,sidebar:kB,sidebarOpen:_B,sidebarInner:SB,logoArea:CB,logoText:PB,nav:jB,main:EB,navIslandFixed:TB,content:RB,contentWithPage:NB,footer:IB,footerText:MB};function AB(e){return!e||e==="plain"?{backgroundColor:"var(--pui-bg-base)"}:typeof e=="object"&&"image"in e?{backgroundImage:`url(${e.image})`,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:Pa(e)}function LB({children:e,showHeader:t=!0,showFooter:n=!1,showSidebar:r=!0,showPage:s=!0,background:i="paper",title:o,subtitle:a,headerActions:l,headerHeight:c,headerTexture:u,navigationItems:d=[],activeItemId:h,onNavigate:p,logo:m,footerContent:y,navigationIsland:w,style:g,bleedBottom:x=!0,routeKey:v,stackOpen:b}){const[S,k]=_.useState(!1),T=Pu();ju(S,()=>k(!1));const P=AB(i),R=r&&d.length>0,j=c!==void 0||u!==void 0?{...u!==void 0?Pa(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return f.jsxs("div",{className:Ne.layout,style:{...P,...g},children:[t&&f.jsxs("header",{className:Ne.header,style:j,children:[f.jsxs("div",{className:Ne.headerLeft,children:[R&&f.jsx("button",{type:"button",className:Ne.mobileToggle,onClick:()=>k(!0),"aria-label":"Open navigation",children:f.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})})}),f.jsxs("div",{className:Ne.headerTitles,children:[o&&f.jsx("h1",{className:Ne.headerTitle,children:o}),a&&f.jsx("span",{className:Ne.headerSubtitle,children:a})]})]}),l&&f.jsx("div",{className:Ne.headerActions,children:l})]}),f.jsxs("div",{className:Ne.body,children:[S&&f.jsx("button",{type:"button",className:Ne.mobileOverlay,onClick:()=>k(!1),"aria-label":"Close navigation",tabIndex:-1}),R&&f.jsx("aside",{className:q(Ne.sidebar,S&&Ne.sidebarOpen),children:f.jsxs("div",{className:Ne.sidebarInner,children:[f.jsx("div",{className:Ne.logoArea,children:m||f.jsx("span",{className:Ne.logoText,children:"Paper UI"})}),f.jsx("nav",{className:Ne.nav,"aria-label":"Main navigation",children:d.map(I=>{const M=I.id===h;return f.jsx(te,{variant:"ghost",size:"small",isActive:M,onClick:()=>{p==null||p(I),k(!1)},"aria-current":M?"page":void 0,icon:I.icon,style:w$,children:I.label},I.id)})})]})}),f.jsx("div",{className:Ne.main,children:f.jsx("main",{className:s?Ne.contentWithPage:Ne.content,style:x?{paddingBottom:0}:void 0,children:(()=>{const I=v!==void 0?f.jsx(vS,{mode:"wait",children:f.jsx(Ai.div,{initial:T?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:T?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},v)}):e;return s?f.jsx(MS,{rounded:x?"top":"all",style:x&&w?{paddingBottom:`calc(${rf.navIslandBottom} + ${rf.navIslandHeight} + ${v$[4]})`}:void 0,children:I}):I})()})})]}),w&&f.jsx("div",{className:Ne.navIslandFixed,children:b!==void 0?f.jsx(Ai.div,{animate:{x:b?`-${rf.stackPanelWidth/2}px`:0},transition:{duration:T?0:.3,ease:[.4,0,.2,1]},children:w}):w}),n&&f.jsx("footer",{className:Ne.footer,children:y||f.jsx("p",{className:Ne.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const DB="checkbox-module__wrapper___uLYMI",FB="checkbox-module__blobFill___mPJSR",OB="checkbox-module__input___Ptgt7",zB="checkbox-module__blobBg___bw3sn",$B="checkbox-module__labelLeft___-vAmH",BB="checkbox-module__box___yAh-r",VB="checkbox-module__checkmark___tTyBz",UB="checkbox-module__indeterminateLine___IosI-",WB="checkbox-module__boxWrapper___byjoS",HB="checkbox-module__icon___RO-yn",GB="checkbox-module__labelText___bAnLr",KB="checkbox-module__chalkboard___sv6SL",Rt={wrapper:DB,blobFill:FB,input:OB,blobBg:zB,labelLeft:$B,box:BB,checkmark:VB,indeterminateLine:UB,boxWrapper:WB,icon:HB,labelText:GB,chalkboard:KB},QB=_.forwardRef(function({label:e,labelPosition:t="right",indeterminate:n=!1,wobble:r=.4,surface:s="paper",className:i,checked:o,onChange:a,id:l,...c},u){const d=_.useId(),h=l??d,p=Gi(r),m=_.useRef(null);return _.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),f.jsxs("label",{className:q(Rt.wrapper,t==="left"&&Rt.labelLeft,s==="chalkboard"&&Rt.chalkboard,i),htmlFor:h,children:[f.jsxs("span",{className:Rt.boxWrapper,children:[f.jsx("input",{ref:y=>{m.current=y,typeof u=="function"?u(y):u&&(u.current=y)},id:h,type:"checkbox",className:Rt.input,checked:o,onChange:a,...c}),f.jsx("svg",{className:Rt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:p.blob,className:Rt.blobFill})}),f.jsxs("span",{className:Rt.box,"aria-hidden":"true",children:[f.jsx(_t,{smooth:!0,...St.control}),n?f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:f.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:Rt.indeterminateLine})}):f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:f.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:Rt.checkmark})})]})]}),e&&f.jsx("span",{className:Rt.labelText,children:e})]})}),qB="icon-button-module__iconButton___avg6i",YB="icon-button-module__blobBg___466Vy",XB="icon-button-module__blobFill___FTN1g",JB="icon-button-module__blobRing___hRdQb",ZB="icon-button-module__isActive___XlvtM",e4="icon-button-module__icon___h204x",t4="icon-button-module__ghost___Wbxog",n4="icon-button-module__danger___p0Xz5",r4="icon-button-module__small___bPnCU",s4="icon-button-module__medium___nOxPf",i4="icon-button-module__large___UBU5z",o4="icon-button-module__chalkboard___mi0sQ",Un={iconButton:qB,blobBg:YB,blobFill:XB,blobRing:JB,isActive:ZB,icon:e4,default:"icon-button-module__default___9frNR",ghost:t4,danger:n4,small:r4,medium:s4,large:i4,chalkboard:o4},Ct=_.forwardRef(function({icon:e,variant:t="default",surface:n="paper",size:r="medium",label:s,wobble:i=.5,isActive:o=!1,className:a,...l},c){const u=Gi(i);return f.jsxs("button",{ref:c,type:"button",className:q(Un.iconButton,Un[t],n==="chalkboard"&&Un.chalkboard,Un[r],o&&Un.isActive,a),"aria-label":s,title:s,...l,children:[f.jsxs("svg",{className:Un.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:u.blob,className:Un.blobFill}),f.jsx("path",{d:u.ring,className:Un.blobRing})]}),f.jsx("span",{className:Un.icon,children:e})]})}),a4="stamp-module__stamp___5qaNY",l4="stamp-module__small___BBlBg",c4="stamp-module__medium___HG2YD",u4="stamp-module__large___aUT0I",d4="stamp-module__blobBg___Mdrdd",f4="stamp-module__blobFill___QyCeB",h4="stamp-module__blobRing___EUDx7",p4="stamp-module__dot___qZyCR",m4="stamp-module__label___T89iH",g4="stamp-module__chalkboard___syI4T",pr={stamp:a4,small:l4,medium:c4,large:u4,blobBg:d4,blobFill:f4,blobRing:h4,dot:p4,label:m4,chalkboard:g4},of={neutral:{fill:nt(X.accentSlate,.14),text:X.accentSlateDark,ring:nt(X.accentSlateDark,.35)},info:{fill:nt(X.accentBlue,.14),text:X.accentBlueDark,ring:nt(X.accentBlueDark,.35)},success:{fill:nt(X.accentGreen,.16),text:X.accentGreenDark,ring:nt(X.accentGreenDark,.35)},warning:{fill:nt(X.accentAmber,.16),text:X.accentAmberDark,ring:nt(X.accentAmberDark,.4)},error:{fill:nt(X.accentRose,.16),text:X.accentRoseDark,ring:nt(X.accentRoseDark,.35)}},wv={fill:nt(X.chalkboardBorderBase,.1),ring:nt(X.chalkboardBorderBase,.35)};function Ee({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const c=Gi(o),u=a==="chalkboard",d=n?u?wv.ring:of[n].ring:void 0,h=s??(n?u?wv.fill:of[n].fill:"transparent"),p=i??(n&&!u?of[n].text:void 0);return f.jsxs("span",{className:q(pr.stamp,pr[t],u&&pr.chalkboard,l),style:p?{color:p}:void 0,children:[f.jsxs("svg",{className:pr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:c.blob,className:pr.blobFill,style:{fill:h}}),d&&f.jsx("path",{d:c.ring,className:pr.blobRing,style:{stroke:d}})]}),r&&f.jsx("span",{className:pr.dot,"aria-hidden":"true"}),f.jsx("span",{className:pr.label,children:e})]})}const y4="copy-button-module__copyButton___-hTo4",x4="copy-button-module__dark___O45N-",v4="copy-button-module__chalkboard___hW4aw",w4="copy-button-module__copied___XlHFr",xl={copyButton:y4,dark:x4,chalkboard:v4,copied:w4};function Xh({text:e,variant:t="light",surface:n="paper",className:r,...s}){const[i,o]=_.useState(!1),a=_.useCallback(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch(l){console.error("Failed to copy:",l)}},[e]);return f.jsx("button",{type:"button",onClick:a,className:q(xl.copyButton,t==="dark"&&xl.dark,n==="chalkboard"&&xl.chalkboard,i&&xl.copied,r),...s,children:i?"Copied!":"Copy"})}const b4="code-block-module__codeBlock___dq28o",k4="code-block-module__header___42Fek",_4="code-block-module__relative___oO-zy",S4="code-block-module__copyOverlay___PjAuq",C4="code-block-module__pre___zXzLZ",P4="code-block-module__chalkboard___bdo9J",j4="code-block-module__chalkboardHeader___3RiVd",E4="code-block-module__chalkboardPre___iRBFR",mr={codeBlock:b4,header:k4,relative:_4,copyOverlay:S4,pre:C4,chalkboard:P4,chalkboardHeader:j4,chalkboardPre:E4};function lH({code:e,filename:t,surface:n="paper"}){return f.jsxs("div",{className:q(mr.codeBlock,n==="chalkboard"&&mr.chalkboard),children:[t&&f.jsxs("div",{className:q(mr.header,n==="chalkboard"&&mr.chalkboardHeader),children:[f.jsx("span",{children:t}),f.jsx(Xh,{text:e,variant:"light",surface:n})]}),!t&&f.jsx("div",{className:mr.relative,children:f.jsx("div",{className:mr.copyOverlay,children:f.jsx(Xh,{text:e,variant:"dark",surface:n})})}),f.jsx("pre",{className:q(mr.pre,n==="chalkboard"&&mr.chalkboardPre),children:f.jsx("code",{children:e})})]})}function ja({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function AS({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M9 18h6"}),f.jsx("path",{d:"M10 22h4"}),f.jsx("path",{d:"M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14"})]})}function tg({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("polyline",{points:"20 6 9 17 4 12"})})}function T4({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),f.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function R4({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function N4({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),f.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function I4({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("polyline",{points:"9 18 15 12 9 6"})})}const M4="table-module__tableFrame___KP-90",A4="table-module__tableWrapper___gc3Y3",L4="table-module__toolbar___zhCel",D4="table-module__search___zIBk2",F4="table-module__searchIcon___ayhK8",O4="table-module__searchInput___PqsEG",z4="table-module__toolbarActions___EX6qS",$4="table-module__tableScroll___1gvc4",B4="table-module__table___tdU5g",V4="table-module__th___GQbKk",U4="table-module__td___WktB5",W4="table-module__tr___xeZno",H4="table-module__expandTh___uxkR4",G4="table-module__expandTd___VoBRC",K4="table-module__expandIcon___8V45X",Q4="table-module__expandable___R7o2l",q4="table-module__expandedRow___1TbTQ",Y4="table-module__expandedCell___sKAaD",X4="table-module__boardScroll___Y1yqm",J4="table-module__board___kFAI-",Z4="table-module__boardColumn___-W9bP",e5="table-module__boardColumnHeader___kY3Fj",t5="table-module__accentBlue___PEJ1V",n5="table-module__accentGreen___wJ53r",r5="table-module__accentAmber___Iezjv",s5="table-module__accentRose___W8zxc",i5="table-module__accentSlate___oUZCX",o5="table-module__boardColumnLabel___JBEed",a5="table-module__boardColumnCount___Pkpiq",l5="table-module__boardColumnBody___uAgRF",c5="table-module__boardRow___C1P60",u5="table-module__boardEmpty___IKv2W",d5="table-module__chalkboardFrame___xB3N5",f5="table-module__chalkboardWrapper___KjY5r",h5="table-module__chalkboard___v0m3A",ie={tableFrame:M4,tableWrapper:A4,toolbar:L4,search:D4,searchIcon:F4,searchInput:O4,toolbarActions:z4,tableScroll:$4,table:B4,th:V4,td:U4,tr:W4,expandTh:H4,expandTd:G4,expandIcon:K4,expandable:Q4,expandedRow:q4,expandedCell:Y4,boardScroll:X4,board:J4,boardColumn:Z4,boardColumnHeader:e5,accentBlue:t5,accentGreen:n5,accentAmber:r5,accentRose:s5,accentSlate:i5,boardColumnLabel:o5,boardColumnCount:a5,boardColumnBody:l5,boardRow:c5,boardEmpty:u5,chalkboardFrame:d5,chalkboardWrapper:f5,chalkboard:h5},p5=eg(ie);function m5({data:e=[],columns:t=[],board:n,surface:r="paper",texture:s=!0,toolbar:i,expandable:o,showExpandColumn:a=!0,rowKey:l,rowClassName:c,rowTexture:u,className:d}){const h=Hi(s,r==="chalkboard"?"chalkboard":"paper"),p=!!i,[m,y]=_.useState(new Set),w=v=>{y(b=>{const S=new Set(b);return S.has(v)?S.delete(v):S.add(v),S})},g=!!(o&&a),x=g?t.length+1:t.length;return f.jsxs("div",{className:q(ie.tableFrame,r==="chalkboard"&&ie.chalkboardFrame,d),children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsxs("div",{className:q(ie.tableWrapper,r==="chalkboard"&&ie.chalkboardWrapper),style:h,children:[p&&f.jsxs("div",{className:ie.toolbar,children:[i.search&&f.jsxs("div",{className:ie.search,children:[f.jsx(g5,{className:ie.searchIcon}),f.jsx("input",{type:"text",className:ie.searchInput,placeholder:i.search.placeholder??"Search...","aria-label":i.search.placeholder??"Search",value:i.search.value,onChange:v=>{var b,S;return(S=(b=i.search)==null?void 0:b.onChange)==null?void 0:S.call(b,v.target.value)}}),f.jsx(_t,{fill:!0,...St.field})]}),i.actions&&f.jsx("div",{className:ie.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?f.jsx("div",{className:ie.boardScroll,children:f.jsx("div",{className:ie.board,children:n.map(v=>f.jsxs("div",{className:ie.boardColumn,children:[f.jsxs("div",{className:q(ie.boardColumnHeader,r==="chalkboard"&&ie.chalkboard,v.accent&&p5[v.accent]),children:[f.jsx("span",{className:ie.boardColumnLabel,children:v.label}),f.jsx("span",{className:ie.boardColumnCount,children:v.items.length})]}),f.jsx("div",{className:ie.boardColumnBody,children:v.items.length===0?f.jsx("div",{className:ie.boardEmpty,children:v.emptyLabel??"empty"}):v.items.map((b,S)=>f.jsx("div",{className:q(ie.boardRow,r==="chalkboard"&&ie.chalkboard),children:v.renderItem(b,S,r)},v.getKey?v.getKey(b,S):S))})]},v.key))})}):f.jsx("div",{className:ie.tableScroll,children:f.jsxs("table",{className:q(ie.table,r==="chalkboard"&&ie.chalkboard),children:[f.jsxs("colgroup",{children:[g&&f.jsx("col",{style:{width:"48px"}}),t.map(v=>f.jsx("col",{style:v.width?{width:`${v.width*32}px`}:void 0},v.key))]}),f.jsx("thead",{children:f.jsxs("tr",{children:[g&&f.jsx("th",{className:q(ie.th,ie.expandTh),"aria-label":"Expand"}),t.map(v=>f.jsx("th",{className:ie.th,style:v.align?{textAlign:v.align}:void 0,children:v.header},v.key))]})}),f.jsx("tbody",{children:e.map((v,b)=>{const S=l?l(v,b):b,k=o==null?void 0:o.render(v,b,r),T=!!k,P=T&&m.has(S),R=u==null?void 0:u(v,b);return f.jsxs(_.Fragment,{children:[f.jsxs("tr",{className:q(ie.tr,T&&ie.expandable,c==null?void 0:c(v,b)),style:R?Pa(R):void 0,onClick:()=>T&&w(S),children:[g&&f.jsx("td",{className:q(ie.td,ie.expandTd),children:T&&f.jsx("button",{type:"button",className:ie.expandIcon,"aria-expanded":P,"aria-label":P?"Collapse row":"Expand row",onClick:j=>{j.stopPropagation(),w(S)},children:f.jsx(I4,{size:14})})}),t.map(j=>f.jsx("td",{className:ie.td,style:j.align?{textAlign:j.align}:void 0,children:j.cell(v,b,r)},j.key))]}),P&&f.jsx("tr",{className:ie.expandedRow,children:f.jsx("td",{colSpan:x,className:ie.expandedCell,children:k})})]},S)})})]})})]})]})}function g5({className:e}){return f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[f.jsx("circle",{cx:"11",cy:"11",r:"8"}),f.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}const y5="card-module__borderLayer___WSpJq",x5="card-module__elevated___uhWj9",v5="card-module__textureLayer___Kcofz",w5="card-module__flat___KnG5z",b5="card-module__small___HXUTr",k5="card-module__withAccent___2t7bV",_5="card-module__accentBlue___a1KIq",S5="card-module__accentGreen___RNWoA",C5="card-module__accentAmber___uMhom",P5="card-module__accentRose___VPI3t",j5="card-module__accentSlate___-l4jE",E5="card-module__chalkboard___bQ48O",vr={borderLayer:y5,default:"card-module__default___glPy-",elevated:x5,textureLayer:v5,flat:w5,small:b5,withAccent:k5,accentBlue:_5,accentGreen:S5,accentAmber:C5,accentRose:P5,accentSlate:j5,chalkboard:E5},T5=eg(vr);function Te({children:e,variant:t="default",surface:n="paper",size:r="medium",texture:s="parchment",fill:i,shade:o=!1,accent:a=!1,accentColor:l="blue",sketch:c=!1,className:u}){const d=n==="chalkboard"||s===!1?void 0:IS({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return f.jsxs("div",{className:q(vr.borderLayer,vr[t],n==="chalkboard"&&vr.chalkboard,vr[r],a&&vr.withAccent,a&&T5[l],!c&&vr.flat,u),children:[f.jsx(_t,{clip:!0,...St.surface,straight:!c}),f.jsx("div",{className:vr.textureLayer,style:d,children:e})]})}const R5="input-module__wrapper___xaEw6",N5="input-module__label___lu7R1",I5="input-module__field___khFpX",M5="input-module__input___h7K-F",A5="input-module__small___SkByh",L5="input-module__medium___0QPuV",D5="input-module__large___zGwRu",F5="input-module__error___QDqga",O5="input-module__disabled___K-5hi",z5="input-module__helperText___njeLH",$5="input-module__helperError___qDBpD",B5="input-module__chalkboard___Xh-5s",kn={wrapper:R5,label:N5,field:I5,input:M5,small:A5,medium:L5,large:D5,error:F5,disabled:O5,helperText:z5,helperError:$5,chalkboard:B5},Ea=_.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=_.useId(),u=o??c;return f.jsxs("div",{className:q(kn.wrapper,s==="chalkboard"&&kn.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:u,className:kn.label,children:e}),f.jsxs("span",{className:q(kn.field,kn[r],n&&kn.error,a.disabled&&kn.disabled),children:[f.jsx("input",{ref:l,id:u,className:kn.input,...a}),f.jsx(_t,{fill:!0,...St.field})]}),t&&f.jsx("span",{className:q(kn.helperText,n&&kn.helperError),children:t})]})}),V5="select-module__wrapper___Hc5F3",U5="select-module__label___ay-3s",W5="select-module__nativeSelect___UA2d-",H5="select-module__trigger___xMYHi",G5="select-module__open___w3mbZ",K5="select-module__triggerLabel___ihpER",Q5="select-module__placeholder___0VOFP",q5="select-module__small___iU9W9",Y5="select-module__chevron___0dCTg",X5="select-module__medium___B-XBN",J5="select-module__large___iII2c",Z5="select-module__chevronOpen___cFOYe",eV="select-module__error___P5RBk",tV="select-module__dropdown___Q-uK3",nV="select-module__slideDown___sT374",rV="select-module__options___HmrQ0",sV="select-module__option___vNnue",iV="select-module__optionDisabled___ex2zq",oV="select-module__optionSelected___tAFjn",aV="select-module__optionHighlighted___zYQLq",lV="select-module__helperText___r5gyn",cV="select-module__helperError___ydSPT",uV="select-module__chalkboard___sXBw8",Ae={wrapper:V5,label:U5,nativeSelect:W5,trigger:H5,open:G5,triggerLabel:K5,placeholder:Q5,small:q5,chevron:Y5,medium:X5,large:J5,chevronOpen:Z5,error:eV,dropdown:tV,slideDown:nV,options:rV,option:sV,optionDisabled:iV,optionSelected:oV,optionHighlighted:aV,helperText:lV,helperError:cV,chalkboard:uV};function LS({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",options:i,placeholder:o,value:a,defaultValue:l,onChange:c,name:u,disabled:d=!1,width:h,texture:p=!1,className:m}){const y=_.useId(),[w,g]=_.useState(!1),[x,v]=_.useState(-1),[b,S]=_.useState(l??""),[k,T]=_.useState(null),P=_.useRef(null),R=_.useRef(null),j=a!==void 0,I=j?a:b,M=i.find(C=>C.value===I),O=(M==null?void 0:M.label)??o??"Select...",z=_.useCallback(()=>{if(d)return;g(!0);const C=i.findIndex($=>$.value===I);v(C>=0?C:0)},[d,i,I]),E=_.useCallback(()=>{g(!1),v(-1)},[]),F=_.useCallback(C=>{var $;C.disabled||(j||S(C.value),c==null||c(C.value),E(),($=P.current)==null||$.focus())},[j,c,E]),V=_.useCallback(C=>{if(!d)switch(C.key){case"Enter":case" ":C.preventDefault(),w&&x>=0?F(i[x]):z();break;case"Escape":C.preventDefault(),w&&E();break;case"ArrowDown":C.preventDefault(),w?v($=>{let Q=$+1;for(;Q<i.length&&i[Q].disabled;)Q++;return Q<i.length?Q:$}):z();break;case"ArrowUp":C.preventDefault(),w?v($=>{let Q=$-1;for(;Q>=0&&i[Q].disabled;)Q--;return Q>=0?Q:$}):z();break;case"Home":if(C.preventDefault(),w){let $=0;for(;$<i.length&&i[$].disabled;)$++;$<i.length&&v($)}break;case"End":if(C.preventDefault(),w){let $=i.length-1;for(;$>=0&&i[$].disabled;)$--;$>=0&&v($)}break;case"Tab":w&&E();break}},[d,w,x,i,z,E,F]);_.useEffect(()=>{if(!w)return;const C=$=>{var Q,N;const le=$.target;(Q=P.current)!=null&&Q.contains(le)||(N=R.current)!=null&&N.contains(le)||E()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[w,E]),_.useEffect(()=>{if(!w||x<0||!R.current)return;const C=R.current.querySelector(`[data-option-index="${x}"]`);C==null||C.scrollIntoView({block:"nearest"})},[w,x]),_.useEffect(()=>{if(!w){T(null);return}const C=()=>{if(!P.current)return;const $=P.current.getBoundingClientRect();if($.bottom<0||$.top>window.innerHeight){E();return}T($)};return C(),document.addEventListener("scroll",C,{capture:!0,passive:!0}),window.addEventListener("resize",C,{passive:!0}),()=>{document.removeEventListener("scroll",C,{capture:!0}),window.removeEventListener("resize",C)}},[w,E]);const A=Hi(p),B=A?{"--sketch-fill":A.backgroundColor}:void 0;return f.jsxs("div",{className:q(Ae.wrapper,s==="chalkboard"&&Ae.chalkboard,m),style:h?{width:typeof h=="number"?`${h}px`:h}:void 0,children:[e&&f.jsx("label",{htmlFor:y,className:Ae.label,children:e}),f.jsxs("select",{id:y,name:u,className:Ae.nativeSelect,value:I,onChange:C=>c==null?void 0:c(C.target.value),disabled:d,"aria-hidden":"true",tabIndex:-1,children:[o&&f.jsx("option",{value:"",children:o}),i.map(C=>f.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value))]}),f.jsxs("button",{ref:P,type:"button",role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-controls":w?`${y}-listbox`:void 0,"aria-activedescendant":w&&x>=0?`${y}-option-${x}`:void 0,className:q(Ae.trigger,Ae[r],n&&Ae.error,w&&Ae.open,d&&Ae.disabled),onClick:()=>w?E():z(),onKeyDown:V,disabled:d,children:[f.jsx("span",{className:q(Ae.triggerLabel,!M&&Ae.placeholder),children:O}),f.jsx(dV,{className:q(Ae.chevron,w&&Ae.chevronOpen)}),f.jsx(_t,{fill:!0,...St.field})]}),w&&k&&Ms.createPortal(f.jsxs("div",{ref:R,id:`${y}-listbox`,role:"listbox",tabIndex:-1,className:Ae.dropdown,style:{...B,position:"fixed",top:k.bottom+6,left:k.left,width:k.width},onKeyDown:C=>{var $;C.key==="Escape"&&(C.preventDefault(),E(),($=P.current)==null||$.focus())},children:[f.jsx(_t,{fill:!0,...St.surface}),f.jsx("div",{className:Ae.options,children:i.map((C,$)=>f.jsx("div",{id:`${y}-option-${$}`,role:"option","aria-selected":C.value===I,tabIndex:-1,"data-option-index":$,className:q(Ae.option,C.value===I&&Ae.optionSelected,$===x&&Ae.optionHighlighted,C.disabled&&Ae.optionDisabled),onClick:Q=>{Q.stopPropagation(),F(C)},onMouseEnter:()=>v($),children:C.label},C.value))})]}),document.body),t&&f.jsx("span",{className:q(Ae.helperText,n&&Ae.helperError),children:t})]})}function dV({className:e}){return f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:f.jsx("polyline",{points:"6 9 12 15 18 9"})})}function DS({variant:e}){switch(e){case"info":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),f.jsx("circle",{cx:"12",cy:"8",r:"0.5",fill:"currentColor"})]});case"success":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),f.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]});case"warning":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),f.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),f.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});case"error":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),f.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}}const fV="alert-module__alert___j7ZRS",hV="alert-module__surface___IaVgU",pV="alert-module__iconWrapper___kLoxT",mV="alert-module__message___klR2U",gV="alert-module__dismiss___f2uoG",yV="alert-module__info___PBo1l",xV="alert-module__success___AVBKS",vV="alert-module__warning___zkMaJ",wV="alert-module__error___cxg96",bV="alert-module__chalkboard___7pgWk",is={alert:fV,surface:hV,iconWrapper:pV,message:mV,dismiss:gV,info:yV,success:xV,warning:vV,error:wV,chalkboard:bV};function FS({children:e,variant:t="info",surface:n="paper",texture:r="kraft",dismissible:s=!1,onDismiss:i,className:o}){const a=n==="chalkboard";return f.jsxs("div",{className:q(is.alert,is[t],a&&is.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:is.surface,style:a?void 0:Hi(r)}),f.jsx("span",{className:is.iconWrapper,children:f.jsx(DS,{variant:t})}),f.jsx("div",{className:is.message,children:e}),s&&f.jsx("button",{type:"button",className:is.dismiss,onClick:i,"aria-label":"Dismiss alert",children:f.jsx(ja,{size:16})})]})}const kV="modal-module__overlay___a52Ni",_V="modal-module__fadeIn___5OWd5",SV="modal-module__backdrop___RS4yj",CV="modal-module__modal___ZioOV",PV="modal-module__slideUp___vfFrm",jV="modal-module__small___hcxwF",EV="modal-module__medium___mjbM5",TV="modal-module__large___1dzyf",RV="modal-module__header___iP09B",NV="modal-module__title___nj06m",IV="modal-module__close___gQou9",MV="modal-module__body___Y-EdA",AV="modal-module__chalkboard___qY8qo",Wn={overlay:kV,fadeIn:_V,backdrop:SV,modal:CV,slideUp:PV,small:jV,medium:EV,large:TV,header:RV,title:NV,close:IV,body:MV,chalkboard:AV},LV='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ta({open:e,onClose:t,title:n,children:r,size:s="medium",surface:i="paper",texture:o=!1,className:a}){const l=_.useId(),c=_.useRef(null),u=_.useRef(null);if(ju(e,t),_.useEffect(()=>{var h;if(!e)return;u.current=document.activeElement,(h=c.current)==null||h.focus();const p=y=>{var w;if(y.key!=="Tab")return;const g=(w=c.current)==null?void 0:w.querySelectorAll(LV);if(!g||g.length===0){y.preventDefault();return}const x=g[0],v=g[g.length-1];y.shiftKey&&document.activeElement===x?(y.preventDefault(),v.focus()):!y.shiftKey&&document.activeElement===v&&(y.preventDefault(),x.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var y,w;document.removeEventListener("keydown",p),document.body.style.overflow=m,(w=(y=u.current)==null?void 0:y.focus)==null||w.call(y)}},[e]),!e||typeof document>"u")return null;const d=Hi(o);return Ms.createPortal(f.jsxs("div",{className:Wn.overlay,children:[f.jsx("button",{type:"button",className:Wn.backdrop,"aria-label":"Close modal",onClick:t}),f.jsxs("div",{ref:c,className:q(Wn.modal,Wn[s],i==="chalkboard"&&Wn.chalkboard,a),style:d,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[f.jsxs("div",{className:Wn.header,children:[n&&f.jsx("h2",{id:l,className:Wn.title,children:n}),f.jsx("button",{type:"button",className:Wn.close,onClick:t,"aria-label":"Close modal",children:f.jsx(ja,{size:18})})]}),f.jsx("div",{className:Wn.body,children:r})]})]}),document.body)}const DV="textarea-module__wrapper___NbiNO",FV="textarea-module__label___ejhyZ",OV="textarea-module__field___KluQf",zV="textarea-module__textarea___0y-7v",$V="textarea-module__resizeGrip___lONlE",BV="textarea-module__small___yPyr8",VV="textarea-module__medium___ezQxA",UV="textarea-module__large___xfeKi",WV="textarea-module__error___EkXKJ",HV="textarea-module__disabled___9CKbb",GV="textarea-module__helperText___l1sPh",KV="textarea-module__helperError___VfTLy",QV="textarea-module__chalkboard___zZ0X0",ln={wrapper:DV,label:FV,field:OV,textarea:zV,resizeGrip:$V,small:BV,medium:VV,large:UV,error:WV,disabled:HV,helperText:GV,helperError:KV,chalkboard:QV},qV=48,Nu=_.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=_.useId(),u=o??c,d=_.useRef(null),h=_.useCallback(m=>{d.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=_.useCallback(m=>{const y=d.current;if(!y)return;m.preventDefault();const w=m.clientY,g=y.offsetHeight,x=b=>{y.style.height=`${Math.max(qV,g+b.clientY-w)}px`},v=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",v)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",v)},[]);return f.jsxs("div",{className:q(ln.wrapper,s==="chalkboard"&&ln.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:u,className:ln.label,children:e}),f.jsxs("span",{className:q(ln.field,ln[r],n&&ln.error,a.disabled&&ln.disabled),children:[f.jsx("textarea",{ref:h,id:u,className:ln.textarea,...a}),f.jsx(_t,{fill:!0,...St.field}),!a.disabled&&f.jsx("span",{className:ln.resizeGrip,onPointerDown:p,"aria-hidden":"true",title:"Drag to resize",children:f.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M11 4.5 L4.5 11"}),f.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&f.jsx("span",{className:q(ln.helperText,n&&ln.helperError),children:t})]})}),YV="progress-module__track___a5BMO",XV="progress-module__svg___3U0-E",bv={track:YV,svg:XV},af=300,gr=1;function JV({value:e,max:t=100,color:n,height:r=6,surface:s="paper",className:i}){const o=t>0?Math.max(0,Math.min(100,Math.round(e/t*100))):0,a=s==="chalkboard",l=Math.max(1,Math.round(Ru()*1e6)),c=a?nt(X.chalkboardBorderBase,.16):nt(X.textPrimary,.12),u=n??(a?X.chalkboardChalk:X.textSecondary),d=_.useMemo(()=>Fe.toPaths(Fe.rectangle(gr,gr,af-gr*2,r-gr*2,{seed:l,roughness:2.2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1.5})),[l,c,r]),h=Math.max(o/100*(af-gr*2),0),p=_.useMemo(()=>h>0?Fe.toPaths(Fe.rectangle(gr,gr,h,r-gr*2,{seed:l+1,roughness:2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1})):[],[l,u,h,r]);return f.jsx("div",{className:q(bv.track,i),style:{height:r,borderRadius:r/2},children:f.jsxs("svg",{className:bv.svg,viewBox:`0 0 ${af} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[d.map((m,y)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y)),p.map((m,y)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y))]})})}function ZV(e){const t=Ru();return _.useMemo(()=>({blob:j$({seed:t,wobble:e}),ring:E$(t,e)}),[t,e])}const e6="list-item-module__listItem___-tw9O",t6="list-item-module__clickable___GLJmd",n6="list-item-module__blobBg___O3Mzh",r6="list-item-module__blobFill___dXHk1",s6="list-item-module__blobRing___S9mas",i6="list-item-module__active___UsL8O",o6="list-item-module__small___9dphK",a6="list-item-module__medium___yGZCr",l6="list-item-module__icon___2b4wU",c6="list-item-module__label___SIzJ4",u6="list-item-module__action___qGh0-",d6="list-item-module__chalkboard___qpWuM",Wt={listItem:e6,static:"list-item-module__static___qtEX6",clickable:t6,blobBg:n6,blobFill:r6,blobRing:s6,active:i6,small:o6,medium:a6,icon:l6,label:c6,action:u6,chalkboard:d6};function Qn({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=ZV(s),u=!!l.onClick;return f.jsxs("button",{type:"button",className:q(Wt.listItem,Wt[r],u&&Wt.clickable,!u&&!e&&Wt.static,e&&Wt.active,i==="chalkboard"&&Wt.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[f.jsxs("svg",{className:Wt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:c.blob,className:Wt.blobFill}),f.jsx("path",{d:c.ring,className:Wt.blobRing})]}),t&&f.jsx("span",{className:Wt.icon,children:t}),f.jsx("span",{className:Wt.label,children:o}),n&&f.jsx("span",{className:Wt.action,children:n})]})}const f6="icon-module__icon___2vrJz",h6="icon-module__blobBg___ENPYJ",p6="icon-module__blobFill___IPbwQ",m6="icon-module__blobRing___1awqV",g6="icon-module__content___TaZR6",y6="icon-module__small___Xp--F",x6="icon-module__medium___tCjMB",v6="icon-module__large___vBtP7",Us={icon:f6,blobBg:h6,blobFill:p6,blobRing:m6,content:g6,small:y6,medium:x6,large:v6},w6={small:20,medium:24,large:28};function b6({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=Gi(n),o=w6[t];return f.jsxs("span",{className:q(Us.icon,Us[t],s),children:[f.jsxs("svg",{className:Us.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:i.blob,className:Us.blobFill,style:r?{fill:r}:void 0}),f.jsx("path",{d:i.ring,className:Us.blobRing})]}),f.jsx("span",{className:Us.content,style:{width:o,height:o},children:e})]})}const k6="radio-module__wrapper___BB05E",_6="radio-module__blobFill___p5BX4",S6="radio-module__labelLeft___ijB93",C6="radio-module__input___M2nFJ",P6="radio-module__box___H7ofS",j6="radio-module__dot___jVJ-d",E6="radio-module__boxWrapper___Y3qis",T6="radio-module__blobBg___IR-M5",R6="radio-module__labelText___I-nu3",N6="radio-module__chalkboard___IIBqI",_n={wrapper:k6,blobFill:_6,labelLeft:S6,input:C6,box:P6,dot:j6,boxWrapper:E6,blobBg:T6,labelText:R6,chalkboard:N6};_.forwardRef(function({label:e,labelPosition:t="right",wobble:n=.4,surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=_.useId(),d=a??u,h=Gi(n);return f.jsxs("label",{className:q(_n.wrapper,t==="left"&&_n.labelLeft,r==="chalkboard"&&_n.chalkboard,s),htmlFor:d,children:[f.jsxs("span",{className:_n.boxWrapper,children:[f.jsx("input",{ref:c,id:d,type:"radio",className:_n.input,checked:i,onChange:o,...l}),f.jsx("svg",{className:_n.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:h.blob,className:_n.blobFill})}),f.jsxs("span",{className:_n.box,"aria-hidden":"true",children:[f.jsx(_t,{smooth:!0,shape:"circle",...St.control}),f.jsx("span",{className:_n.dot})]})]}),e&&f.jsx("span",{className:_n.labelText,children:e})]})});const I6="switch-module__wrapper___5-2P1",M6="switch-module__labelLeft___WlT-N",A6="switch-module__input___YKZRj",L6="switch-module__track___QNvnO",D6="switch-module__thumb___cunvF",F6="switch-module__small___WPIxc",O6="switch-module__medium___yPulW",z6="switch-module__large___VlKV1",$6="switch-module__labelText___9Qg39",B6="switch-module__chalkboard___qKTMz",yr={wrapper:I6,labelLeft:M6,input:A6,track:L6,thumb:D6,small:F6,medium:O6,large:z6,labelText:$6,chalkboard:B6},V6=_.forwardRef(function({label:e,labelPosition:t="right",size:n="medium",surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=_.useId(),d=a??u;return f.jsxs("label",{className:q(yr.wrapper,yr[n],t==="left"&&yr.labelLeft,r==="chalkboard"&&yr.chalkboard,s),htmlFor:d,children:[f.jsx("input",{ref:c,id:d,type:"checkbox",className:yr.input,checked:i,onChange:o,...l}),f.jsxs("span",{className:yr.track,"aria-hidden":"true",children:[f.jsx(_t,{...St.pill}),f.jsx("span",{className:yr.thumb})]}),e&&f.jsx("span",{className:yr.labelText,children:e})]})}),U6="spinner-module__spinner___FDTk2",W6="spinner-module__chalkboard___DLE1z",H6="spinner-module__svg___JnCWN",G6="spinner-module__track___xbnbo",K6="spinner-module__head___j5dWe",yo={spinner:U6,chalkboard:W6,svg:H6,track:G6,head:K6},Q6={small:18,medium:28,large:40},kv=25,q6=18,_v=Fe.toPaths(Fe.circle(kv,kv,q6*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function Rs({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=Q6[e];return f.jsx("span",{className:q(yo.spinner,r==="chalkboard"&&yo.chalkboard,s),role:"status","aria-label":n,children:f.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:yo.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[f.jsx("path",{className:yo.track,d:_v,fill:"none",pathLength:100,strokeLinecap:"round"}),f.jsx("path",{className:yo.head,d:_v,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const Y6="skeleton-module__skeleton___HCSvg",X6="skeleton-module__pulse___6eCq1",J6="skeleton-module__svg___OzxGp",Z6="skeleton-module__text___v17Nv",e8="skeleton-module__rect___wqIJy",t8="skeleton-module__circle___RCmyR",lf={skeleton:Y6,pulse:X6,svg:J6,text:Z6,rect:e8,circle:t8},Sv={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Ws=2;function cn({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Ru()*1e6)),l=o?nt(X.chalkboardBorderBase,.16):nt(X.textPrimary,.09),c=_.useMemo(()=>{const[,,u,d]=Sv[e],h=e==="circle"?Fe.ellipse(u/2,d/2,u-Ws*2,d-Ws*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):Fe.rectangle(Ws,Ws,u-Ws*2,d-Ws*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return Fe.toPaths(h)},[e,a,l]);return f.jsx("span",{className:q(lf.skeleton,lf[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:f.jsx("svg",{className:lf.svg,viewBox:Sv[e].join(" "),preserveAspectRatio:"none","aria-hidden":"true",children:c.map((u,d)=>f.jsx("path",{d:u.d,stroke:u.stroke,strokeWidth:u.strokeWidth,fill:u.fill},d))})})}const n8="divider-module__horizontal___tP3rG",r8="divider-module__line___KnBes",s8="divider-module__label___WiUwZ",i8="divider-module__vertical___wBSrT",o8="divider-module__chalkboard___gXTde",Hs={horizontal:n8,line:r8,label:s8,vertical:i8,chalkboard:o8};function Cv({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Hs.chalkboard;return e==="vertical"?f.jsx("span",{className:q(Hs.vertical,s,r),role:"separator","aria-orientation":"vertical"}):f.jsxs("div",{className:q(Hs.horizontal,s,r),role:"separator",children:[f.jsx("span",{className:Hs.line}),t!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:Hs.label,children:t}),f.jsx("span",{className:Hs.line})]})]})}const a8="tooltip-module__wrapper___XeVNe",l8="tooltip-module__tooltip___e-rkz",c8="tooltip-module__tooltipIn___CZbRw",u8="tooltip-module__top___78WWU",d8="tooltip-module__bottom___Irl3O",f8="tooltip-module__left___C1Ec4",h8="tooltip-module__right___oUA-Z",p8="tooltip-module__chalkboard___Um6dx",vl={wrapper:a8,tooltip:l8,tooltipIn:c8,top:u8,bottom:d8,left:f8,right:h8,chalkboard:p8},wl=8,bl=8,m8=typeof window>"u"?_.useEffect:_.useLayoutEffect;function g8(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+wl,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-wl-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+wl;break;default:r=e.top-wl-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,bl),window.innerWidth-n.width-bl),r=Math.min(Math.max(r,bl),window.innerHeight-n.height-bl),{top:r,left:s}}function Se({content:e,children:t,placement:n="top",delay:r=300,disabled:s=!1,surface:i="paper"}){const o=_.useId(),[a,l]=_.useState(!1),[c,u]=_.useState(!1),[d,h]=_.useState(!1),[p,m]=_.useState(null),[y,w]=_.useState(null),g=_.useRef(null),x=_.useRef(null),v=_.useRef(),b=!s&&!!e&&!d&&(a||c),S=()=>{clearTimeout(v.current),v.current=setTimeout(()=>l(!0),r)},k=()=>{clearTimeout(v.current),l(!1),h(!1)},T=()=>{h(!1),u(!0)},P=()=>{u(!1),h(!1)};ju(b,()=>h(!0)),_.useEffect(()=>{if(!b){m(null);return}const j=()=>{g.current&&m(g.current.getBoundingClientRect())};return j(),window.addEventListener("scroll",j,{capture:!0,passive:!0}),window.addEventListener("resize",j,{passive:!0}),()=>{window.removeEventListener("scroll",j,{capture:!0}),window.removeEventListener("resize",j)}},[b]),m8(()=>{if(!b){w(null);return}const j=x.current;j&&w({width:j.offsetWidth,height:j.offsetHeight})},[b,e,n]),_.useEffect(()=>()=>clearTimeout(v.current),[]);const R=t.props;return f.jsxs("span",{ref:g,className:vl.wrapper,onMouseEnter:S,onMouseLeave:k,onFocus:T,onBlur:P,children:[_.cloneElement(t,{"aria-describedby":b?o:R["aria-describedby"]}),b&&p&&typeof document<"u"&&Ms.createPortal(f.jsx("span",{ref:x,id:o,role:"tooltip",className:q(vl.tooltip,vl[n],i==="chalkboard"&&vl.chalkboard),style:y?{position:"fixed",...g8(p,n,y)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const y8="toast-module__stack___hDi0s",x8="toast-module__topLeft___Luw-F",v8="toast-module__topCenter___N1DwF",w8="toast-module__topRight___Dtgau",b8="toast-module__bottomLeft___Eb2lo",k8="toast-module__bottomCenter___gs-Yb",_8="toast-module__bottomRight___-0e2j",S8="toast-module__item___RFjtm",C8="toast-module__toastIn___9m9iN",P8="toast-module__card___ZCvJS",j8="toast-module__surface___mfMl0",E8="toast-module__iconWrapper___lnjcC",T8="toast-module__content___AlliM",R8="toast-module__title___1Oqh8",N8="toast-module__description___eiUSB",I8="toast-module__dismiss___tUGx4",M8="toast-module__info___Nh8S9",A8="toast-module__success___hlKLc",L8="toast-module__warning___XUMJt",D8="toast-module__error___pSFFC",F8="toast-module__chalkboard___c49gt",Ht={stack:y8,topLeft:x8,topCenter:v8,topRight:w8,bottomLeft:b8,bottomCenter:k8,bottomRight:_8,item:S8,toastIn:C8,card:P8,surface:j8,iconWrapper:E8,content:T8,title:R8,description:N8,dismiss:I8,info:M8,success:A8,warning:L8,error:D8,chalkboard:F8};function O8({record:e,surface:t="paper",onDismiss:n}){const r=_.useRef(e.duration),s=_.useRef(0),i=_.useRef(),o=_.useCallback(d=>{clearTimeout(i.current),!(d<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),d))},[n,e.id]);_.useEffect(()=>(o(e.duration),()=>clearTimeout(i.current)),[o,e.duration]);const a=()=>{i.current&&(clearTimeout(i.current),r.current-=Date.now()-s.current)},l=()=>o(r.current),c=t==="chalkboard",u=e.variant==="warning"||e.variant==="error"?"alert":"status";return f.jsx("div",{className:Ht.item,onMouseEnter:a,onMouseLeave:l,children:f.jsxs("div",{className:q(Ht.card,Ht[e.variant],c&&Ht.chalkboard),role:u,children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:Ht.surface,style:c?void 0:Hi("kraft")}),f.jsx("span",{className:Ht.iconWrapper,children:f.jsx(DS,{variant:e.variant})}),f.jsxs("div",{className:Ht.content,children:[e.title&&f.jsx("div",{className:Ht.title,children:e.title}),f.jsx("div",{className:Ht.description,children:e.description})]}),f.jsx("button",{type:"button",className:Ht.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:f.jsx(ja,{size:16})})]})})}const OS=_.createContext(null);function z8(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function $8({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[s,i]=_.useState([]),o=_.useRef(0),a=_.useCallback(u=>{i(d=>d.filter(h=>h.id!==u))},[]),l=_.useCallback(u=>{o.current+=1;const d=`toast-${o.current}`;return i(h=>[...h,{id:d,title:u.title,description:u.description,variant:u.variant??"info",duration:u.duration??r}]),d},[r]),c=t.startsWith("top")?[...s].reverse():s;return f.jsxs(OS.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&Ms.createPortal(f.jsx("div",{className:q(Ht.stack,Ht[z8(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>f.jsx(O8,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function We(){const e=_.useContext(OS);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const B8="breadcrumb-module__breadcrumb___r-ILp",V8="breadcrumb-module__list___V3YFy",U8="breadcrumb-module__item___dDwYf",W8="breadcrumb-module__link___CHC9k",H8="breadcrumb-module__linkButton___XoMW-",G8="breadcrumb-module__current___dprI9",K8="breadcrumb-module__separator___uLhtn",Q8="breadcrumb-module__chalkboard___COJpw",Sn={breadcrumb:B8,list:V8,item:U8,link:W8,linkButton:H8,current:G8,static:"breadcrumb-module__static___affaf",separator:K8,chalkboard:Q8};function Pv({items:e,surface:t="paper",className:n}){return f.jsx("nav",{"aria-label":"Breadcrumb",className:q(Sn.breadcrumb,t==="chalkboard"&&Sn.chalkboard,n),children:f.jsx("ol",{className:Sn.list,children:e.map((r,s)=>{const i=s===e.length-1;return f.jsxs("li",{className:Sn.item,children:[i?f.jsx("span",{className:Sn.current,"aria-current":"page",children:r.label}):r.href?f.jsx("a",{href:r.href,className:Sn.link,onClick:r.onClick,children:r.label}):r.onClick?f.jsx("button",{type:"button",className:q(Sn.link,Sn.linkButton),onClick:r.onClick,children:r.label}):f.jsx("span",{className:Sn.static,children:r.label}),!i&&f.jsx(q8,{className:Sn.separator})]},r.id)})})})}function q8({className:e}){return f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:f.jsx("polyline",{points:"9 18 15 12 9 6"})})}const Y8="menu-module__wrapper___WCtoy",X8="menu-module__menu___i40Wj",J8="menu-module__surface___SJbaB",Z8="menu-module__list___YjCfD",eU="menu-module__item___aqcgg",tU="menu-module__icon___1qUvA",nU="menu-module__label___MtQMh",rU="menu-module__danger___p9oZo",sU="menu-module__itemDisabled___HByLP",iU="menu-module__separator___g2uay",oU="menu-module__chalkboard___5jIwI",un={wrapper:Y8,menu:X8,surface:J8,list:Z8,item:eU,icon:tU,label:nU,danger:rU,itemDisabled:sU,separator:iU,chalkboard:oU},aU=6;function lU(e){return"type"in e&&e.type==="separator"}function zS({trigger:e,items:t,align:n="start",surface:r="paper",className:s}){const i=_.useId(),[o,a]=_.useState(!1),[l,c]=_.useState(null),u=_.useRef(null),d=_.useRef(null),h=_.useCallback(()=>{var g,x;(x=(g=u.current)==null?void 0:g.querySelector("button, a, [tabindex]"))==null||x.focus()},[]),p=_.useCallback(()=>a(!1),[]);ju(o,()=>{p(),h()}),_.useEffect(()=>{if(!o)return;const g=x=>{var v,b;const S=x.target;(v=u.current)!=null&&v.contains(S)||(b=d.current)!=null&&b.contains(S)||p()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,p]),_.useEffect(()=>{if(!o){c(null);return}const g=()=>{u.current&&c(u.current.getBoundingClientRect())};return g(),document.addEventListener("scroll",g,{capture:!0,passive:!0}),window.addEventListener("resize",g,{passive:!0}),()=>{document.removeEventListener("scroll",g,{capture:!0}),window.removeEventListener("resize",g)}},[o]),_.useEffect(()=>{var g,x;!o||!l||(x=(g=d.current)==null?void 0:g.querySelector('[role="menuitem"]:not(:disabled)'))==null||x.focus()},[o,l]);const m=g=>{var x,v,b,S,k;const T=Array.from(((x=d.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(T.length===0)return;const P=T.indexOf(document.activeElement);switch(g.key){case"ArrowDown":g.preventDefault(),(v=T[(P+1)%T.length])==null||v.focus();break;case"ArrowUp":g.preventDefault(),(b=T[(P-1+T.length)%T.length])==null||b.focus();break;case"Home":g.preventDefault(),(S=T[0])==null||S.focus();break;case"End":g.preventDefault(),(k=T[T.length-1])==null||k.focus();break;case"Tab":p();break}},y=g=>{var x;g.disabled||(p(),h(),(x=g.onSelect)==null||x.call(g))},w=e.props;return f.jsxs("span",{ref:u,className:un.wrapper,children:[_.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:g=>{var x;(x=w.onClick)==null||x.call(w,g),a(v=>!v)}}),o&&l&&typeof document<"u"&&Ms.createPortal(f.jsxs("div",{ref:d,id:i,role:"menu",className:q(un.menu,r==="chalkboard"&&un.chalkboard,s),style:{position:"fixed",top:l.bottom+aU,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:un.surface}),f.jsx("div",{className:un.list,children:t.map(g=>lU(g)?f.jsx("div",{role:"separator",className:un.separator},g.id):f.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:g.disabled,className:q(un.item,g.danger&&un.danger,g.disabled&&un.itemDisabled),onClick:()=>y(g),children:[g.icon&&f.jsx("span",{className:un.icon,children:g.icon}),f.jsx("span",{className:un.label,children:g.label})]},g.id))})]}),document.body)]})}function Ue(e){const t=e.split(`
79
- `).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}const $S="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",qn={pass:"#2d5a3b",fail:"#5a2d2d",running:"#5a4a2d"},Yn={pass:"#b5d6b5",fail:"#d6a0a0",running:"#d6c4a0"},cU=Ue,uU=8,dU="basis-[9.25rem]",fU=e=>{switch(e.taskKind){case"phase":return e.phaseIndex!==void 0?` — phase ${e.phaseIndex+1}`:"";case"audit":return" — audit";case"batch-reconcile":return" — batch reconcile";case"reconcile":return" — reconcile";case"fix-review":return" — fixing review comments";case"draft":return" — drafting";case"extend":return" — extending";case"commit-suggest":return" — suggesting commit message";case"overlap-check":return" — checking overlap";case"sync":return" — syncing to main";case"resolve-conflict":return" — resolving conflict";case"run-all":return" — run all phases";default:return""}},hU=({task:e,onStop:t})=>{const n=nn(),{toast:r}=We(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async l=>{l.stopPropagation();try{await t(e.id)}catch(c){r({title:"Failed to stop agent",description:Ue(c.message),variant:"error"})}},o={starting:qn.running,running:qn.running,stopping:qn.running,done:qn.pass,error:qn.fail,superseded:qn.running},a={starting:Yn.running,running:Yn.running,stopping:Yn.running,done:Yn.pass,error:Yn.fail,superseded:Yn.running};return f.jsx(Te,{surface:"chalkboard",size:"small",className:"stack-task-card",children:f.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),s())},className:"flex cursor-pointer items-center justify-between gap-2 rounded-[10px]",children:[f.jsxs("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:[e.planTitle,fU(e)," · ",$A[e.agentId]]}),f.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?f.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:f.jsx(Ee,{surface:"chalkboard",size:"small",fillColor:o.error,textColor:a.error,children:"stopped — agent signed out"})}):f.jsx(Ee,{surface:"chalkboard",size:"small",fillColor:o[e.status],textColor:a[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&f.jsx(Ct,{icon:f.jsx(ja,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})})},pU=()=>{const e=L(r=>r.agentStatus),t=L(r=>r.stopAgent),n=e.slice(0,uU);return f.jsxs("div",{className:"flex min-h-0 flex-auto flex-col p-6",children:[f.jsx("div",{className:$S,children:"Agent"}),f.jsx("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${dU} ${n.length>0?"justify-start":"justify-center"}`,children:n.length>0?n.map(r=>f.jsx(hU,{task:r,onStop:t},r.id)):f.jsx(Te,{surface:"chalkboard",size:"small",children:f.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})})})]})};function kl(e,t){const{toast:n}=We(),r=L(o=>o.activeGitAction),s=L(o=>o.setActiveGitAction),i=_.useCallback(async o=>{if(!L.getState().activeGitAction){s(e);try{await o()}catch(a){n({title:t,description:Ue(a.message),variant:"error"})}finally{s(null)}}},[n,t,e,s]);return[r===e,i]}function Iu(){const e=L(b=>b.loadGitStatus),t=L(b=>b.loadPlans),n=L(b=>b.loadIdeas),r=L(b=>b.activeGitAction!==null),{toast:s,dismiss:i}=We(),o=()=>Promise.all([e(),t(),n()]),[a,l]=kl("push","Push failed"),[c,u]=kl("sync","Sync failed"),[d,h]=kl("pull","Pull failed"),[p,m]=kl("fix-divergence","Fix failed"),y=_.useCallback((b,S)=>{if(S.recovering)return s({title:`${b} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in S){const{conflictPrompt:k,message:T}=S,P=s({title:`${b} hit a conflict`,description:f.jsxs("div",{className:"flex flex-col items-start gap-2",children:[f.jsx("span",{children:Ue(T)}),f.jsx(te,{size:"small",onClick:async()=>{const R=await hL(k).catch(j=>({ok:!1,error:Ue(j.message)}));R.ok&&i(P),s({title:R.ok?"Resolving conflict":"Could not start the agent",description:R.ok?"Handed off to the agent — see Stack for progress":R.error??"The agent did not start.",variant:R.ok?"warning":"error"})},children:"Ask the agent to resolve"})]}),variant:"error",duration:0});return!0}return!1},[s,i]);return{pushing:a,syncing:c,pulling:d,fixingDivergence:p,gitActionBusy:r,handlePush:()=>l(async()=>{await cL(),await e()}),handleSync:()=>u(async()=>{const b=await uL();if(!b.ok){if(y("Sync",b)){await e();return}throw new Error(b.message)}await o()}),handlePull:()=>h(async()=>{await dL(),await o()}),handleFixDivergence:()=>m(async()=>{const b=await fL();if(!b.ok){if(y("Fix",b)){await e();return}throw new Error(b.message)}await o()})}}function jv(e){const t=e.match(/Found (\d+) errors?\./);return t?Number(t[1]):0}function mU(e,t){const n=jv(e)+jv(t);return n>0?`${n} lint/format issue${n===1?"":"s"} found.`:"Lint or format check failed."}function gU(e){const t=e.match(/Tests\s+(\d+) failed/);return t?`${t[1]} test${t[1]==="1"?"":"s"} failed.`:"Tests failed."}const BS=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"m12 3-1.6 4.85a2 2 0 0 1-1.27 1.27L4.27 10.7l4.86 1.6a2 2 0 0 1 1.27 1.27L12 18.4l1.6-4.86a2 2 0 0 1 1.27-1.27l4.86-1.6-4.86-1.6a2 2 0 0 1-1.27-1.27L12 3Z"}),f.jsx("path",{d:"M19 3v3"}),f.jsx("path",{d:"M20.5 4.5h-3"})]}),VS=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M12 19V5"}),f.jsx("path",{d:"m5 12 7-7 7 7"})]}),US=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M12 5v14"}),f.jsx("path",{d:"m5 12 7 7 7-7"})]}),Mu=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"18",cy:"18",r:"3"}),f.jsx("circle",{cx:"6",cy:"6",r:"3"}),f.jsx("path",{d:"M6 9v5c0 .667 3 1 6 1s6-.333 6-1V9"}),f.jsx("path",{d:"M12 17v2"})]}),yU=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),f.jsx("polyline",{points:"21 3 21 9 15 9"})]}),WS=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[f.jsx("circle",{cx:"5",cy:"12",r:"2"}),f.jsx("circle",{cx:"12",cy:"12",r:"2"}),f.jsx("circle",{cx:"19",cy:"12",r:"2"})]}),xU=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"m18 4 3 3-3 3"}),f.jsx("path",{d:"M3 7h5.5a3 3 0 0 1 2.5 1.35L15 16.65A3 3 0 0 0 17.5 18H21"}),f.jsx("path",{d:"m18 20 3-3-3-3"}),f.jsx("path",{d:"M3 17h5.5a3 3 0 0 0 2.5-1.35"}),f.jsx("path",{d:"M13 8.35A3 3 0 0 1 15.5 7H21"})]}),vU=({size:e=12})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"10",cy:"10",r:"3"}),f.jsx("path",{d:"M2.5 10h4.5M13 10h4.5"})]}),wU=({size:e=12})=>f.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})}),ng=({size:e=14})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[f.jsx("title",{children:"Idea"}),f.jsx("path",{d:"M9 18h6M10 22h4M12 2a6 6 0 0 0-3.5 10.9c.53.4.9 1.03.9 1.72V15h5.2v-.38c0-.69.37-1.32.9-1.72A6 6 0 0 0 12 2Z"})]}),HS=({size:e=14})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[f.jsx("title",{children:"Note"}),f.jsx("path",{d:"M15 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z"}),f.jsx("path",{d:"M15 3v6h6"})]}),bU=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function kU(e){var s;if(!e||e.phases.length>0&&e.phases.every(i=>i.done))return{title:""};const t=((s=e.tags)==null?void 0:s.find(i=>bU.includes(i)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const _U=()=>{var M,O,z;const e=L(E=>E.status),t=L(E=>E.runCheck),n=L(E=>E.fixQuality),r=L(E=>E.consistency),s=L(E=>E.plans),i=L(E=>E.gitBranch),o=L(E=>E.gitAhead),a=L(E=>E.gitBehind),l=L(E=>E.gitDiverged),c=nn(),[u,d]=_.useState(!1),{fixingDivergence:h,gitActionBusy:p,handleFixDivergence:m}=Iu(),{qualityStatus:y,testStatus:w,consistencyStatus:g}=_.useMemo(()=>Mk(e),[e]),x=y==="running"||w==="running"||g==="running",v=r.length>0,b=_.useCallback(E=>E.planId?s==null?void 0:s.entries.find(F=>F.id===E.planId):void 0,[s==null?void 0:s.entries]),S=_.useCallback(E=>{const F=b(E);F&&c({to:"/plans/$planId",params:{planId:encodeURIComponent(F.title)}})},[b,c]),k={...qn,stale:"transparent"},T={...Yn,stale:void 0},P=x,R=v;`${((M=e==null?void 0:e.lint)==null?void 0:M.output)||"(none)"}${((O=e==null?void 0:e.format)==null?void 0:O.output)||"(none)"}`;const j=`Fix the failing tests in this repo. Output from the last test run:
78
+ `),()=>{var R;(R=a.current)==null||R.removeAttribute("data-motion-pop-id"),P.contains(T)&&P.removeChild(T)}},[t]),f.jsx(lz,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:_.cloneElement(e,{ref:d})})}const uz=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=Pm(dz),d=_.useId();let h=!0,p=_.useMemo(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:m=>{u.set(m,!0);for(const y of u.values())if(!y)return;r&&r()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,r]);return i&&h&&(p={...p}),_.useMemo(()=>{u.forEach((m,y)=>u.set(y,!1))},[n]),_.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=f.jsx(cz,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),f.jsx(bu.Provider,{value:p,children:e})};function dz(){return new Map}function xS(e=!0){const t=_.useContext(bu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=_.useId();_.useEffect(()=>{if(e)return s(i)},[e]);const o=_.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const hl=e=>e.key||"";function rv(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const vS=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,d]=xS(o),h=_.useMemo(()=>rv(e),[e]),p=o&&!u?[]:h.map(hl),m=_.useRef(!0),y=_.useRef(h),w=Pm(()=>new Map),g=_.useRef(new Set),[x,v]=_.useState(h),[b,S]=_.useState(h);Gk(()=>{m.current=!1,y.current=h;for(let P=0;P<b.length;P++){const R=hl(b[P]);p.includes(R)?(w.delete(R),g.current.delete(R)):w.get(R)!==!0&&w.set(R,!1)}},[b,p.length,p.join("-")]);const k=[];if(h!==x){let P=[...h];for(let R=0;R<b.length;R++){const j=b[R],I=hl(j);p.includes(I)||(P.splice(R,0,j),k.push(j))}return i==="wait"&&k.length&&(P=k),S(rv(P)),v(h),null}const{forceRender:T}=_.useContext(Cm);return f.jsx(f.Fragment,{children:b.map(P=>{const R=hl(P),j=o&&!u?!1:h===b||p.includes(R),I=()=>{if(g.current.has(R))return;if(w.has(R))g.current.add(R),w.set(R,!0);else return;let M=!0;w.forEach(O=>{O||(M=!1)}),M&&(T==null||T(),S(y.current),o&&(d==null||d()),r&&r())};return f.jsx(uz,{isPresent:j,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:j?void 0:I,anchorX:a,anchorY:l,children:P},R)})})},wS=_.createContext({strict:!1}),sv={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"]};let iv=!1;function fz(){if(iv)return;const e={};for(const t in sv)e[t]={isEnabled:n=>sv[t].some(r=>!!n[r])};Q_(e),iv=!0}function bS(){return fz(),YF()}function hz(e){const t=bS();for(const n in e)t[n]={...t[n],...e[n]};Q_(t)}const pz=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","propagate","ignoreStrict","viewport"]);function Kc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pz.has(e)}let kS=e=>!Kc(e);function mz(e){typeof e=="function"&&(kS=t=>t.startsWith("on")?!Kc(t):e(t))}try{mz(require("@emotion/is-prop-valid").default)}catch{}function gz(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Xe(e[s])||(kS(s)||n===!0&&Kc(s)||!t&&!Kc(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Cu=_.createContext({});function yz(e,t){if(Su(e)){const{initial:n,animate:r}=e;return{initial:n===!1||fa(n)?n:void 0,animate:fa(r)?r:void 0}}return e.inherit!==!1?t:{}}function xz(e){const{initial:t,animate:n}=yz(e,_.useContext(Cu));return _.useMemo(()=>({initial:t,animate:n}),[ov(t),ov(n)])}function ov(e){return Array.isArray(e)?e.join(" "):e}const Jm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _S(e,t,n){for(const r in t)!Xe(t[r])&&!tS(r,n)&&(e[r]=t[r])}function vz({transformTemplate:e},t){return _.useMemo(()=>{const n=Jm();return qm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function wz(e,t){const n=e.style||{},r={};return _S(r,n,e),Object.assign(r,vz(e,t)),r}function bz(e,t){const n={},r=wz(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 SS=()=>({...Jm(),attrs:{}});function kz(e,t,n,r){const s=_.useMemo(()=>{const i=SS();return nS(i,t,sS(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};_S(i,e.style,e),s.style={...i,...s.style}}return s}const _z=["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 Zm(e){return typeof e!="string"||e.includes("-")?!1:!!(_z.indexOf(e)>-1||/[A-Z]/u.test(e))}function Sz(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??Zm(e)?kz:bz)(t,r,s,e),c=gz(t,typeof e=="string",i),u=e!==_.Fragment?{...c,...l,ref:n}:{},{children:d}=t,h=_.useMemo(()=>Xe(d)?d.get():d,[d]);return _.createElement(e,{...u,children:h})}function Cz({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:Pz(n,r,s,e),renderState:t()}}function Pz(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Jl(i[h]);let{initial:o,animate:a}=e;const l=Su(e),c=G_(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!_u(d)){const h=Array.isArray(d)?d:[d];for(let p=0;p<h.length;p++){const m=Bm(e,h[p]);if(m){const{transitionEnd:y,transition:w,...g}=m;for(const x in g){let v=g[x];if(Array.isArray(v)){const b=u?v.length-1:0;v=v[b]}v!==null&&(s[x]=v)}for(const x in y)s[x]=y[x]}}}return s}const CS=e=>(t,n)=>{const r=_.useContext(Cu),s=_.useContext(bu),i=()=>Cz(e,t,r,s);return n?i():Pm(i)},jz=CS({scrapeMotionValuesFromProps:Ym,createRenderState:Jm}),Ez=CS({scrapeMotionValuesFromProps:iS,createRenderState:SS}),Tz=Symbol.for("motionComponentSymbol");function Rz(e,t,n){const r=_.useRef(n);_.useInsertionEffect(()=>{r.current=n});const s=_.useRef(null);return _.useCallback(i=>{var a;i&&((a=e.onMount)==null||a.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[t])}const PS=_.createContext({});function Qs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Nz(e,t,n,r,s,i){var v,b;const{visualElement:o}=_.useContext(Cu),a=_.useContext(wS),l=_.useContext(bu),c=_.useContext(Xm),u=c.reducedMotion,d=c.skipAnimations,h=_.useRef(null),p=_.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,y=_.useContext(PS);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&Iz(h.current,n,s,y);const w=_.useRef(!1);_.useInsertionEffect(()=>{m&&w.current&&m.update(n,l)});const g=n[A_],x=_.useRef(!!g&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,g))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,g)));return Gk(()=>{p.current=!0,m&&(w.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,g)}),x.current=!1),m.enteringChildren=void 0)}),m}function Iz(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:jS(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Qs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function jS(e){if(e)return e.options.allowProjection!==!1?e.projection:jS(e.parent)}function Jd(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&hz(r);const i=n?n==="svg":Zm(e),o=i?Ez:jz;function a(c,u){let d;const h={..._.useContext(Xm),...c,layoutId:Mz(c)},{isStatic:p}=h,m=xz(c),y=o(c,p);if(!p&&typeof window<"u"){Az();const w=Lz(h);d=w.MeasureLayout,m.visualElement=Nz(e,y,h,s,w.ProjectionNode,i)}return f.jsxs(Cu.Provider,{value:m,children:[d&&m.visualElement?f.jsx(d,{visualElement:m.visualElement,...h}):null,Sz(e,c,Rz(y,m.visualElement,u),y,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=_.forwardRef(a);return l[Tz]=e,l}function Mz({layoutId:e}){const t=_.useContext(Cm).id;return t&&e!==void 0?t+"-"+e:e}function Az(e,t){_.useContext(wS).strict}function Lz(e){const t=bS(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Dz(e,t){if(typeof Proxy>"u")return Jd;const n=new Map,r=(i,o)=>Jd(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Jd(o,void 0,e,t)),n.get(o))})}const Fz=(e,t)=>t.isSVG??Zm(e)?new hO(t):new aO(t,{allowProjection:e!==_.Fragment});class Oz extends Zr{constructor(t){super(t),t.animationState||(t.animationState=xO(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_u(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 zz=0;class $z extends Zr{constructor(){super(...arguments),this.id=zz++,this.isExitComplete=!1}update(){var i;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;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=Ss(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...d}=l;for(const h in d)(i=this.node.getValue(h))==null||i.jump(d[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Bz={animation:{Feature:Oz},exit:{Feature:$z}};function Ca(e){return{point:{x:e.pageX,y:e.pageY}}}const Vz=e=>t=>Wm(t)&&e(t,Ca(t));function Bo(e,t,n,r){return ha(e,t,Vz(n),r)}const ES=({current:e})=>e?e.ownerDocument.defaultView:null,av=(e,t)=>Math.abs(e-t);function Uz(e,t){const n=av(e.x,t.x),r=av(e.y,t.y);return Math.sqrt(n**2+r**2)}const lv=new Set(["auto","scroll"]);class TS{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=pl(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Zd(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=Uz(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:w}=p,{timestamp:g}=Ye;this.history.push({...w,timestamp:g});const{onStart:x,onMove:v}=this.handlers;m||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=pl(m,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:y,onSessionEnd:w,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Zd(p.type==="pointercancel"?this.lastMoveEventInfo:pl(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(p,x),w&&w(p,x)},!Wm(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Ca(t),c=pl(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Ye;this.history=[{...u,timestamp:d}];const{onSessionStart:h}=n;h&&h(t,Zd(c,this.history)),this.removeListeners=ka(Bo(this.contextWindow,"pointermove",this.handlePointerMove),Bo(this.contextWindow,"pointerup",this.handlePointerUp),Bo(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(lv.has(r.overflowX)||lv.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),ye.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Gr(this.updatePoint)}}function pl(e,t){return t?{point:t(e.point)}:e}function cv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zd({point:e},t){return{point:e,delta:cv(e,RS(t)),offset:cv(e,Wz(t)),velocity:Hz(t,.1)}}function Wz(e){return e[0]}function RS(e){return e[e.length-1]}function Hz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=RS(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Dt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Dt(t)*2&&(r=e[1]);const i=Yt(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Gz(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ge(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ge(n,e,r.max):Math.min(e,n)),e}function uv(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 Kz(e,{top:t,left:n,bottom:r,right:s}){return{x:uv(e.x,n,s),y:uv(e.y,t,r)}}function dv(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 Qz(e,t){return{x:dv(e.x,t.x),y:dv(e.y,t.y)}}function qz(e,t){let n=.5;const r=ct(e),s=ct(t);return s>r?n=ua(t.min,t.max-r,e.min):r>s&&(n=ua(e.min,e.max-s,t.min)),Dn(0,1,n)}function Yz(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 qh=.35;function Xz(e=qh){return e===!1?e=0:e===!0&&(e=qh),{x:fv(e,"left","right"),y:fv(e,"top","bottom")}}function fv(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 Jz=new WeakMap;class Zz{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=Be(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{n&&this.snapToCursor(Ca(d).point),this.stopAnimation()},o=(d,h)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jF(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),jn(g=>{let x=this.getAxisMotionValue(g).get()||0;if(An.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[g];b&&(x=ct(b)*(parseFloat(x)/100))}}this.originPoint[g]=x}),y&&ye.update(()=>y(d,h),!1,!0),$h(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:g}=h;if(m&&this.currentDirection===null){this.currentDirection=t$(g),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,g),this.updateAxis("y",h.point,g),this.visualElement.render(),w&&ye.update(()=>w(d,h),!1,!0)},l=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h,this.stop(d,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new TS(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:ES(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&ye.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!ml(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Gz(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Qs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Kz(r.layoutBox,t):this.constraints=!1,this.elastic=Xz(n),s!==this.constraints&&!Qs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&jn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Yz(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Qs(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=tO(r,s.root,this.visualElement.getTransformPagePoint());let o=Qz(s.layout.layoutBox,i);if(n){const a=n(JF(o));this.hasMutatedConstraints=!!a,a&&(o=Y_(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=jn(u=>{if(!ml(u,n,this.currentDirection))return;let d=l&&l[u]||{};(o===!0||o===u)&&(d={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return $h(this.visualElement,t),r.start($m(t,r,0,n,this.visualElement,!1))}stopAnimation(){jn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){jn(n=>{const{drag:r}=this.getProps();if(!ml(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=i.get()||0;i.set(t[n]-ge(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Qs(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};jn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=qz({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),jn(o=>{if(!ml(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ge(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Jz.set(this.visualElement,this);const t=this.visualElement.current,n=Bo(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps(),h=c.target,p=h!==t&&MF(h);u&&d&&!p&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Qs(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=e$(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ye.read(s);const a=ha(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(jn(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=qh,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function pv(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function e$(e,t,n){const r=b0(e,pv(n)),s=b0(t,pv(n));return()=>{r(),s()}}function ml(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function t$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class n$ extends Zr{constructor(t){super(t),this.removeGroupControls=Zt,this.removeListeners=Zt,this.controls=new Zz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zt}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ef=e=>(t,n)=>{e&&ye.update(()=>e(t,n),!1,!0)};class r$ extends Zr{constructor(){super(...arguments),this.removePointerDownListener=Zt}onPointerDown(t){this.session=new TS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ES(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:ef(t),onStart:ef(n),onMove:ef(r),onEnd:(i,o)=>{delete this.session,s&&ye.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Bo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let tf=!1;class s$ extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),tf&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Zl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),tf=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ye.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Um.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;tf=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function NS(e){const[t,n]=xS(),r=_.useContext(Cm);return f.jsx(s$,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(PS),isPresent:t,safeToRemove:n})}const i$={pan:{Feature:r$},drag:{Feature:n$,ProjectionNode:yS,MeasureLayout:NS}};function mv(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ye.postRender(()=>i(t,Ca(t)))}class o$ extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=TF(t,(n,r)=>(mv(this.node,r,"Start"),s=>mv(this.node,s,"End"))))}unmount(){}}class a$ extends Zr{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=ka(ha(this.node.current,"focus",()=>this.onFocus()),ha(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function gv(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 s="onTap"+(n==="End"?"":n),i=r[s];i&&ye.postRender(()=>i(t,Ca(t)))}class l$ extends Zr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=LF(t,(s,i)=>(gv(this.node,i,"Start"),(o,{success:a})=>gv(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Yh=new WeakMap,nf=new WeakMap,c$=e=>{const t=Yh.get(e.target);t&&t(e)},u$=e=>{e.forEach(c$)};function d$({root:e,...t}){const n=e||document;nf.has(n)||nf.set(n,{});const r=nf.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(u$,{root:e,...t})),r[s]}function f$(e,t,n){const r=d$(t);return Yh.set(e,n),r.observe(e),()=>{Yh.delete(e),r.unobserve(e)}}const h$={some:0,all:1};class p$ extends Zr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:h$[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),p=u?d:h;p&&p(c)};this.stopObserver=f$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(m$(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function m$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const g$={inView:{Feature:p$},tap:{Feature:l$},focus:{Feature:a$},hover:{Feature:o$}},y$={layout:{ProjectionNode:yS,MeasureLayout:NS}},x$={...Bz,...g$,...i$,...y$},Ai=Dz(x$,Fz);function Pu(){!Qm.current&&K_();const[e]=_.useState(Uc.current);return e}function ju(e,t){const n=_.useRef(t);n.current=t,_.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const rf={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},J={bgBase:"#FDFCF8",bgSurface:"#FAF8F0",bgElevated:"#F5F1E6",textPrimary:"#1A1917",textSecondary:"#68635C",accentBlue:"#7C9CC0",accentBlueDark:"#51719B",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentRose:"#C98B8B",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",accentSlateDark:"#5E7080",canvasBase:"#F0EAD8",canvas300:"#E5DBC4",canvasDark:"#D6C9A8",washBlue:"#DEE4E5",washGreen:"#E3EADC",washAmber:"#F2E5D5",washRose:"#EFE0DA",washSlate:"#E1E4E0",chalkboardBg:"#142e22",chalkboardChalk:"#d4e8cb",chalkboardBorderBase:"#C8D2C3"};function nt(e,t){const n=e.replace("#",""),r=Number.parseInt(n.slice(0,2),16),s=Number.parseInt(n.slice(2,4),16),i=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${s}, ${i}, ${t})`}const v$={4:"1rem"};function Y(...e){return iD(jL(e))}const w$={height:32,lineHeight:"32px",padding:"0 16px"},b$={white:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.97 0 0 0 0 0.96 0 0 0 0 0.95 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)' opacity='1'/%3E%3C/svg%3E")`,paper:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E")`,speckle:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='speckle'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23speckle)' opacity='0.14'/%3E%3C/svg%3E")`,parchment:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='par'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.55 0 0 0 0 0.48 0 0 0 0 0.35 0 0 0 0.45 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23par)' opacity='1'/%3E%3C/svg%3E")`,canvas:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='cv'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.62 0 0 0 0 0.60 0 0 0 0 0.52 0 0 0 0.42 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23cv)' opacity='1'/%3E%3C/svg%3E")`,kraft:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.50 0 0 0 0 0.35 0 0 0 0 0.20 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23k)' opacity='1'/%3E%3C/svg%3E")`,chalkboard:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.15 0 0 0 0 0.28 0 0 0 0 0.20 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='1'/%3E%3C/svg%3E")`},k$={white:J.bgBase,paper:J.bgSurface,speckle:J.bgSurface,parchment:J.bgElevated,canvas:J.canvasBase,kraft:J.canvas300,chalkboard:J.chalkboardBg},yv={white:J.bgElevated,paper:J.bgElevated,speckle:J.bgElevated,parchment:J.canvasBase,canvas:J.canvas300,kraft:J.canvasDark,chalkboard:J.chalkboardBg},_$={base:J.bgBase,surface:J.bgSurface,elevated:J.bgElevated,canvas:J.canvasBase,canvasDark:J.canvasDark,blue:J.washBlue,green:J.washGreen,amber:J.washAmber,rose:J.washRose,slate:J.washSlate},S$={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function IS(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=b$[n],o=t.fill?_$[t.fill]:t.shade?yv[n]:k$[n],a=S$[s],l={"--pui-texture-shade":yv[n],"--pui-texture-image":i};return r==="none"?{...l,backgroundColor:o,backgroundImage:i,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:r==="lines"?{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat",backgroundSize:"200px 200px, 100% 32px"}:{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px), repeating-linear-gradient(90deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat, repeat",backgroundSize:"200px 200px, 100% 32px, 32px 32px"}}function Pa(e){return IS(e)}function Hi(e,t="paper"){if(e!==!1)return Pa(e===!0?t:e)}function C$(e){const t=Tu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=8+Math.round(n*6),s=50,i=50,o=46,a=2+n*14,l=[];for(let c=0;c<r;c++){const u=c/r*Math.PI*2+(t()-.5)*.15*n,d=o+(t()-.5)*a*2;l.push({x:s+Math.cos(u)*d,y:i+Math.sin(u)*d})}return Eu(l)}function P$(e,t){const n=Tu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=8+Math.round(r*6),i=50,o=50,a=49,l=2+r*14,c=[];for(let u=0;u<s;u++){const d=u/s*Math.PI*2+(n()-.5)*.15*r,h=a+(n()-.5)*l*2;c.push({x:i+Math.cos(d)*h,y:o+Math.sin(d)*h})}return Eu(c)}function j$(e){const t=Tu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=3+Math.round(n*3),s=2,i=3+n*10,o=[],a=[{ax:s,ay:s,bx:100-s,by:s},{ax:100-s,ay:s,bx:100-s,by:100-s},{ax:100-s,ay:100-s,bx:s,by:100-s},{ax:s,ay:100-s,bx:s,by:s}];for(const l of a)for(let c=0;c<r;c++){const u=(c+.5)/r,d=l.ax+(l.bx-l.ax)*u,h=l.ay+(l.by-l.ay)*u,p=l.bx-l.ax,m=l.by-l.ay,y=Math.sqrt(p*p+m*m)||1,w=-m/y,g=p/y,x=(t()-.5)*i*2;o.push({x:d+w*x,y:h+g*x})}return Eu(o)}function E$(e,t){const n=Tu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=3+Math.round(r*3),i=0,o=3+r*10,a=[],l=[{ax:i,ay:i,bx:100-i,by:i},{ax:100-i,ay:i,bx:100-i,by:100-i},{ax:100-i,ay:100-i,bx:i,by:100-i},{ax:i,ay:100-i,bx:i,by:i}];for(const c of l)for(let u=0;u<s;u++){const d=(u+.5)/s,h=c.ax+(c.bx-c.ax)*d,p=c.ay+(c.by-c.ay)*d,m=c.bx-c.ax,y=c.by-c.ay,w=Math.sqrt(m*m+y*y)||1,g=-y/w,x=m/w,v=(n()-.5)*o*2;a.push({x:h+g*v,y:p+x*v})}return Eu(a)}function Eu(e){const t=e.length;if(t<3)return"";let n=`M ${hr(e[0].x)} ${hr(e[0].y)}`;for(let r=0;r<t;r++){const s=e[(r-1+t)%t],i=e[r],o=e[(r+1)%t],a=e[(r+2)%t],l=i.x+(o.x-s.x)/6,c=i.y+(o.y-s.y)/6,u=o.x-(a.x-i.x)/6,d=o.y-(a.y-i.y)/6;n+=` C ${hr(l)} ${hr(c)}, ${hr(u)} ${hr(d)}, ${hr(o.x)} ${hr(o.y)}`}return n+=" Z",n}function hr(e){return e.toFixed(2)}function Tu(e){let t=typeof e=="string"?T$(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function T$(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)||1}function Ru(){const e=_.useId();return _.useMemo(()=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return(t+1)/4294967296},[e])}function Gi(e){const t=Ru();return _.useMemo(()=>({blob:C$({seed:t,wobble:e}),ring:P$(t,e)}),[t,e])}const R$="button-module__button___Z331g",N$="button-module__blobBg___QQFzf",I$="button-module__blobFill___XwLjV",M$="button-module__blobRing___567UW",A$="button-module__isActive___FXNSJ",L$="button-module__primary___ppbyq",D$="button-module__secondary___esy5L",F$="button-module__ghost___NisA0",O$="button-module__danger___Wnvuq",z$="button-module__chalkboard___d3Nqb",$$="button-module__small___u7y8a",B$="button-module__medium___HBIAj",V$="button-module__large___RPzNy",U$="button-module__fullWidth___H0P0F",W$="button-module__iconLeft___s60SZ",H$="button-module__iconRight___75eFu",G$="button-module__label___pXAyM",Ut={button:R$,blobBg:N$,blobFill:I$,blobRing:M$,isActive:A$,primary:L$,secondary:D$,ghost:F$,danger:O$,chalkboard:z$,small:$$,medium:B$,large:V$,fullWidth:U$,iconLeft:W$,iconRight:H$,label:G$},ne=_.forwardRef(function({variant:e="primary",surface:t="paper",size:n="medium",icon:r,iconRight:s,fullWidth:i=!1,wobble:o=.5,isActive:a=!1,children:l,className:c,...u},d){const h=Gi(o);return f.jsxs("button",{ref:d,type:"button",className:Y(Ut.button,Ut[e],Ut[n],t==="chalkboard"&&Ut.chalkboard,a&&Ut.isActive,i&&Ut.fullWidth,c),...u,children:[f.jsxs("svg",{className:Ut.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:h.blob,className:Ut.blobFill}),f.jsx("path",{d:h.ring,className:Ut.blobRing})]}),r&&f.jsx("span",{className:Ut.iconLeft,children:r}),f.jsx("span",{className:Ut.label,children:l}),s&&f.jsx("span",{className:Ut.iconRight,children:s})]})});function eg(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const Oe=kD.generator(),K$="sketch-border-module__svg___whV4x",Q$="sketch-border-module__behind___lgdYV",q$="sketch-border-module__stroke___vAm-v",Y$="sketch-border-module__fill___zlpd6",gl={svg:K$,behind:Q$,stroke:q$,fill:Y$},X$=1.2,J$=.7;function _t({shape:e="rect",radius:t=9,roughness:n=1.2,bowing:r=1,strokeWidth:s=1,inset:i=2,fill:o=!1,clip:a=!1,smooth:l=!1,straight:c=!0,strokeInset:u=!0,className:d}){const[h]=_.useState(Math.random),p=_.useRef(null),[m,y]=_.useState(null);_.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(!v)return;const b=new ResizeObserver(()=>{const S=v.offsetWidth,k=v.offsetHeight;y(T=>T&&T.width===S&&T.height===k?T:{width:S,height:k})});return b.observe(v),()=>b.disconnect()},[]);const{parts:w,clipPath:g}=_.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const x=Math.max(1,Math.round(h*1e6)),v=x,b=x*2654435761%2147483647,S=R=>Oe.toPaths(Oe.path(R,{seed:v,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(j=>!j.fill||j.fill==="none").map(j=>({d:j.d,filled:!1}));if(l){const R={seed:v,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},j=M=>Oe.toPaths(M).filter(O=>!O.fill||O.fill==="none").map(O=>({d:O.d,filled:!1}));if(a){const M=yl(e,m,i,t,ss(b),n*1.1),O=u?xv(s,n):0,z=O?yl(e,m,i+O,t,ss(b),n*1.1):M;return{parts:j(Oe.path(z,{...R,preserveVertices:!0})),clipPath:M}}const I=e==="circle"?Oe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,R):Oe.path(sf(m,i,t,ss(v)),{...R,preserveVertices:!0});return{parts:j(I),clipPath:null}}if(a){if(c){const M=sf(m,i,t,ss(b)),O=Oe.toPaths(Oe.path(M,{seed:v,roughness:X$,bowing:J$,preserveVertices:!0,strokeWidth:s})).filter(z=>!z.fill||z.fill==="none").map(z=>({d:z.d,filled:!1}));return{parts:O.length?O:[{d:M,filled:!1}],clipPath:M}}const R=yl(e,m,i,t,ss(b),n*1.1),j=u?xv(s,n):0,I=j?yl(e,m,i+j,t,ss(b),n*1.1):R;return{parts:S(I),clipPath:R}}const k=(R,j)=>{const I=j?{fill:"#000",fillStyle:"solid"}:{},M=e==="circle"?Oe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:R,roughness:n,bowing:r,strokeWidth:s,...I}):Oe.path(sf(m,i,t,ss(R)),{seed:R,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...I});return Oe.toPaths(M)},T=o?k(b,!0).filter(R=>!!R.fill&&R.fill!=="none").map(R=>({d:R.d,filled:!0})):[],P=k(v,!1).filter(R=>!R.fill||R.fill==="none").map(R=>({d:R.d,filled:!1}));return{parts:[...T,...P],clipPath:null}},[m,h,a,l,c,e,t,n,r,s,i,o,u]);return _.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(v)return g?v.style.setProperty("--sketch-clip",`path("${g}")`):v.style.removeProperty("--sketch-clip"),()=>{v.style.removeProperty("--sketch-clip")}},[g]),f.jsx("svg",{ref:p,className:Y(gl.svg,o&&gl.behind,d),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:w==null?void 0:w.map((x,v)=>x.filled?f.jsx("path",{className:gl.fill,d:x.d},`f-${v}`):f.jsx("path",{className:gl.stroke,d:x.d,strokeWidth:s},`s-${v}`))})}function xv(e,t){return e/2+t*1.5}function ss(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function yl(e,t,n,r,s,i){const o=t.width-n*2,a=t.height-n*2,l=t.width/2,c=t.height/2,u=()=>(s()-.5)*i*2,d=[];if(e==="circle")for(let h=0;h<16;h++){const p=h/16*Math.PI*2;d.push({x:l+Math.cos(p)*o/2+u(),y:c+Math.sin(p)*a/2+u()})}else{const h=Math.max(2,Math.min(r,o/2,a/2)),p=n,m=n,y=(x,v,b)=>{for(const S of[0,45,90]){const k=(b+S)*Math.PI/180;d.push({x:x+Math.cos(k)*h+u(),y:v+Math.sin(k)*h+u()})}},w=(x,v,b,S)=>{const k=Math.hypot(b-x,S-v),T=Math.min(12,Math.max(1,Math.round(k/160)));for(let P=1;P<=T;P++){const R=P/(T+1);d.push({x:x+(b-x)*R+u(),y:v+(S-v)*R+u()})}};y(p+h,m+h,180),w(p+h,m,p+o-h,m),y(p+o-h,m+h,270),w(p+o,m+h,p+o,m+a-h),y(p+o-h,m+a-h,0),w(p+o-h,m+a,p+h,m+a),y(p+h,m+a-h,90),w(p,m+a-h,p,m+h);const g=3;return vv([...d.slice(g),...d.slice(0,g)])}return vv(d)}function vv(e){const t=e.length;if(t<3)return"";const n=(s,i)=>Math.max(.001,Math.hypot(i.x-s.x,i.y-s.y)**.5);let r=`M ${e[0].x.toFixed(2)} ${e[0].y.toFixed(2)}`;for(let s=0;s<t;s++){const i=e[(s-1+t)%t],o=e[s],a=e[(s+1)%t],l=e[(s+2)%t],c=n(i,o),u=n(o,a),d=n(a,l),h=a.x-o.x+u*((o.x-i.x)/c-(a.x-i.x)/(c+u)),p=a.y-o.y+u*((o.y-i.y)/c-(a.y-i.y)/(c+u)),m=a.x-o.x+u*((l.x-a.x)/d-(l.x-o.x)/(u+d)),y=a.y-o.y+u*((l.y-a.y)/d-(l.y-o.y)/(u+d)),w=o.x+h/3,g=o.y+p/3,x=a.x-m/3,v=a.y-y/3;r+=` C ${w.toFixed(2)} ${g.toFixed(2)}, ${x.toFixed(2)} ${v.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function sf(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return Z$(t,t,e.width-t*2,e.height-t*2,s)}function Z$(e,t,n,r,s){const i=u=>Math.min(u,n/2,r/2),[o,a,l,c]=s.map(i);return[`M ${xe(e+o)} ${xe(t)}`,`L ${xe(e+n-a)} ${xe(t)}`,`Q ${xe(e+n)} ${xe(t)} ${xe(e+n)} ${xe(t+a)}`,`L ${xe(e+n)} ${xe(t+r-l)}`,`Q ${xe(e+n)} ${xe(t+r)} ${xe(e+n-l)} ${xe(t+r)}`,`L ${xe(e+c)} ${xe(t+r)}`,`Q ${xe(e)} ${xe(t+r)} ${xe(e)} ${xe(t+r-c)}`,`L ${xe(e)} ${xe(t+o)}`,`Q ${xe(e)} ${xe(t)} ${xe(e+o)} ${xe(t)}`,"Z"].join(" ")}function xe(e){return e.toFixed(2)}const St={surface:{radius:12,inset:2.5,roughness:.2,bowing:0,strokeWidth:1.3},field:{radius:8,inset:2,roughness:1.1,strokeWidth:1.3},control:{radius:6,inset:2,roughness:.5,bowing:.6,strokeWidth:1.4},pill:{radius:999,inset:2,roughness:.7,strokeWidth:1}},eB="page-module__page___-uHnG",tB="page-module__outlined___Wwtyg",nB="page-module__surface___sWfI6",rB="page-module__flat___HlOaY",sB="page-module__withAccent___lsv-m",iB="page-module__accentBlue___XxbMV",oB="page-module__accentGreen___Ne6Q8",aB="page-module__accentAmber___kLAwa",lB="page-module__accentRose___O9ZbZ",cB="page-module__accentSlate___xCB66",qs={page:eB,outlined:tB,surface:nB,flat:rB,withAccent:sB,accentBlue:iB,accentGreen:oB,accentAmber:aB,accentRose:lB,accentSlate:cB},uB=eg(qs),dB={all:14,top:14,none:2};function MS({children:e,className:t,style:n,texture:r=!0,withAccent:s=!1,accentColor:i="blue",rounded:o="all",outline:a=!1,sketch:l=!1}){const c=Hi(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return f.jsxs("div",{className:Y(qs.page,a&&qs.outlined,s&&qs.withAccent,s&&uB[i],!l&&qs.flat,t),style:n,children:[f.jsx(_t,{clip:!0,...St.surface,radius:dB[o],straight:!l}),f.jsx("div",{className:qs.surface,style:c,children:e})]})}const fB="layout-module__layout___O1aWi",hB="layout-module__header___I-kxe",pB="layout-module__headerLeft___JChJQ",mB="layout-module__headerTitles___aqSUG",gB="layout-module__headerTitle___wvr39",yB="layout-module__headerSubtitle___6f5BD",xB="layout-module__headerActions___adC12",vB="layout-module__mobileToggle___4WpVG",wB="layout-module__body___tywNf",bB="layout-module__mobileOverlay___tzbBC",kB="layout-module__sidebar___8VKGq",_B="layout-module__sidebarOpen___47rtr",SB="layout-module__sidebarInner___tq2X6",CB="layout-module__logoArea___RLnC0",PB="layout-module__logoText___pAmfV",jB="layout-module__nav___FxcrZ",EB="layout-module__main___9z7bu",TB="layout-module__navIslandFixed___H4TwP",RB="layout-module__content___jL-VB",NB="layout-module__contentWithPage___vVdfN",IB="layout-module__footer___LyakU",MB="layout-module__footerText___8BYxc",Ie={layout:fB,header:hB,headerLeft:pB,headerTitles:mB,headerTitle:gB,headerSubtitle:yB,headerActions:xB,mobileToggle:vB,body:wB,mobileOverlay:bB,sidebar:kB,sidebarOpen:_B,sidebarInner:SB,logoArea:CB,logoText:PB,nav:jB,main:EB,navIslandFixed:TB,content:RB,contentWithPage:NB,footer:IB,footerText:MB};function AB(e){return!e||e==="plain"?{backgroundColor:"var(--pui-bg-base)"}:typeof e=="object"&&"image"in e?{backgroundImage:`url(${e.image})`,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:Pa(e)}function LB({children:e,showHeader:t=!0,showFooter:n=!1,showSidebar:r=!0,showPage:s=!0,background:i="paper",title:o,subtitle:a,headerActions:l,headerHeight:c,headerTexture:u,navigationItems:d=[],activeItemId:h,onNavigate:p,logo:m,footerContent:y,navigationIsland:w,style:g,bleedBottom:x=!0,routeKey:v,stackOpen:b}){const[S,k]=_.useState(!1),T=Pu();ju(S,()=>k(!1));const P=AB(i),R=r&&d.length>0,j=c!==void 0||u!==void 0?{...u!==void 0?Pa(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return f.jsxs("div",{className:Ie.layout,style:{...P,...g},children:[t&&f.jsxs("header",{className:Ie.header,style:j,children:[f.jsxs("div",{className:Ie.headerLeft,children:[R&&f.jsx("button",{type:"button",className:Ie.mobileToggle,onClick:()=>k(!0),"aria-label":"Open navigation",children:f.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})})}),f.jsxs("div",{className:Ie.headerTitles,children:[o&&f.jsx("h1",{className:Ie.headerTitle,children:o}),a&&f.jsx("span",{className:Ie.headerSubtitle,children:a})]})]}),l&&f.jsx("div",{className:Ie.headerActions,children:l})]}),f.jsxs("div",{className:Ie.body,children:[S&&f.jsx("button",{type:"button",className:Ie.mobileOverlay,onClick:()=>k(!1),"aria-label":"Close navigation",tabIndex:-1}),R&&f.jsx("aside",{className:Y(Ie.sidebar,S&&Ie.sidebarOpen),children:f.jsxs("div",{className:Ie.sidebarInner,children:[f.jsx("div",{className:Ie.logoArea,children:m||f.jsx("span",{className:Ie.logoText,children:"Paper UI"})}),f.jsx("nav",{className:Ie.nav,"aria-label":"Main navigation",children:d.map(I=>{const M=I.id===h;return f.jsx(ne,{variant:"ghost",size:"small",isActive:M,onClick:()=>{p==null||p(I),k(!1)},"aria-current":M?"page":void 0,icon:I.icon,style:w$,children:I.label},I.id)})})]})}),f.jsx("div",{className:Ie.main,children:f.jsx("main",{className:s?Ie.contentWithPage:Ie.content,style:x?{paddingBottom:0}:void 0,children:(()=>{const I=v!==void 0?f.jsx(vS,{mode:"wait",children:f.jsx(Ai.div,{initial:T?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:T?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},v)}):e;return s?f.jsx(MS,{rounded:x?"top":"all",style:x&&w?{paddingBottom:`calc(${rf.navIslandBottom} + ${rf.navIslandHeight} + ${v$[4]})`}:void 0,children:I}):I})()})})]}),w&&f.jsx("div",{className:Ie.navIslandFixed,children:b!==void 0?f.jsx(Ai.div,{animate:{x:b?`-${rf.stackPanelWidth/2}px`:0},transition:{duration:T?0:.3,ease:[.4,0,.2,1]},children:w}):w}),n&&f.jsx("footer",{className:Ie.footer,children:y||f.jsx("p",{className:Ie.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const DB="checkbox-module__wrapper___uLYMI",FB="checkbox-module__blobFill___mPJSR",OB="checkbox-module__input___Ptgt7",zB="checkbox-module__blobBg___bw3sn",$B="checkbox-module__labelLeft___-vAmH",BB="checkbox-module__box___yAh-r",VB="checkbox-module__checkmark___tTyBz",UB="checkbox-module__indeterminateLine___IosI-",WB="checkbox-module__boxWrapper___byjoS",HB="checkbox-module__icon___RO-yn",GB="checkbox-module__labelText___bAnLr",KB="checkbox-module__chalkboard___sv6SL",Rt={wrapper:DB,blobFill:FB,input:OB,blobBg:zB,labelLeft:$B,box:BB,checkmark:VB,indeterminateLine:UB,boxWrapper:WB,icon:HB,labelText:GB,chalkboard:KB},QB=_.forwardRef(function({label:e,labelPosition:t="right",indeterminate:n=!1,wobble:r=.4,surface:s="paper",className:i,checked:o,onChange:a,id:l,...c},u){const d=_.useId(),h=l??d,p=Gi(r),m=_.useRef(null);return _.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),f.jsxs("label",{className:Y(Rt.wrapper,t==="left"&&Rt.labelLeft,s==="chalkboard"&&Rt.chalkboard,i),htmlFor:h,children:[f.jsxs("span",{className:Rt.boxWrapper,children:[f.jsx("input",{ref:y=>{m.current=y,typeof u=="function"?u(y):u&&(u.current=y)},id:h,type:"checkbox",className:Rt.input,checked:o,onChange:a,...c}),f.jsx("svg",{className:Rt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:p.blob,className:Rt.blobFill})}),f.jsxs("span",{className:Rt.box,"aria-hidden":"true",children:[f.jsx(_t,{smooth:!0,...St.control}),n?f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:f.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:Rt.indeterminateLine})}):f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:f.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:Rt.checkmark})})]})]}),e&&f.jsx("span",{className:Rt.labelText,children:e})]})}),qB="icon-button-module__iconButton___avg6i",YB="icon-button-module__blobBg___466Vy",XB="icon-button-module__blobFill___FTN1g",JB="icon-button-module__blobRing___hRdQb",ZB="icon-button-module__isActive___XlvtM",e4="icon-button-module__icon___h204x",t4="icon-button-module__ghost___Wbxog",n4="icon-button-module__danger___p0Xz5",r4="icon-button-module__small___bPnCU",s4="icon-button-module__medium___nOxPf",i4="icon-button-module__large___UBU5z",o4="icon-button-module__chalkboard___mi0sQ",Un={iconButton:qB,blobBg:YB,blobFill:XB,blobRing:JB,isActive:ZB,icon:e4,default:"icon-button-module__default___9frNR",ghost:t4,danger:n4,small:r4,medium:s4,large:i4,chalkboard:o4},Ct=_.forwardRef(function({icon:e,variant:t="default",surface:n="paper",size:r="medium",label:s,wobble:i=.5,isActive:o=!1,className:a,...l},c){const u=Gi(i);return f.jsxs("button",{ref:c,type:"button",className:Y(Un.iconButton,Un[t],n==="chalkboard"&&Un.chalkboard,Un[r],o&&Un.isActive,a),"aria-label":s,title:s,...l,children:[f.jsxs("svg",{className:Un.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:u.blob,className:Un.blobFill}),f.jsx("path",{d:u.ring,className:Un.blobRing})]}),f.jsx("span",{className:Un.icon,children:e})]})}),a4="stamp-module__stamp___5qaNY",l4="stamp-module__small___BBlBg",c4="stamp-module__medium___HG2YD",u4="stamp-module__large___aUT0I",d4="stamp-module__blobBg___Mdrdd",f4="stamp-module__blobFill___QyCeB",h4="stamp-module__blobRing___EUDx7",p4="stamp-module__dot___qZyCR",m4="stamp-module__label___T89iH",g4="stamp-module__chalkboard___syI4T",pr={stamp:a4,small:l4,medium:c4,large:u4,blobBg:d4,blobFill:f4,blobRing:h4,dot:p4,label:m4,chalkboard:g4},of={neutral:{fill:nt(J.accentSlate,.14),text:J.accentSlateDark,ring:nt(J.accentSlateDark,.35)},info:{fill:nt(J.accentBlue,.14),text:J.accentBlueDark,ring:nt(J.accentBlueDark,.35)},success:{fill:nt(J.accentGreen,.16),text:J.accentGreenDark,ring:nt(J.accentGreenDark,.35)},warning:{fill:nt(J.accentAmber,.16),text:J.accentAmberDark,ring:nt(J.accentAmberDark,.4)},error:{fill:nt(J.accentRose,.16),text:J.accentRoseDark,ring:nt(J.accentRoseDark,.35)}},wv={fill:nt(J.chalkboardBorderBase,.1),ring:nt(J.chalkboardBorderBase,.35)};function Te({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const c=Gi(o),u=a==="chalkboard",d=n?u?wv.ring:of[n].ring:void 0,h=s??(n?u?wv.fill:of[n].fill:"transparent"),p=i??(n&&!u?of[n].text:void 0);return f.jsxs("span",{className:Y(pr.stamp,pr[t],u&&pr.chalkboard,l),style:p?{color:p}:void 0,children:[f.jsxs("svg",{className:pr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:c.blob,className:pr.blobFill,style:{fill:h}}),d&&f.jsx("path",{d:c.ring,className:pr.blobRing,style:{stroke:d}})]}),r&&f.jsx("span",{className:pr.dot,"aria-hidden":"true"}),f.jsx("span",{className:pr.label,children:e})]})}const y4="copy-button-module__copyButton___-hTo4",x4="copy-button-module__dark___O45N-",v4="copy-button-module__chalkboard___hW4aw",w4="copy-button-module__copied___XlHFr",xl={copyButton:y4,dark:x4,chalkboard:v4,copied:w4};function Xh({text:e,variant:t="light",surface:n="paper",className:r,...s}){const[i,o]=_.useState(!1),a=_.useCallback(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch(l){console.error("Failed to copy:",l)}},[e]);return f.jsx("button",{type:"button",onClick:a,className:Y(xl.copyButton,t==="dark"&&xl.dark,n==="chalkboard"&&xl.chalkboard,i&&xl.copied,r),...s,children:i?"Copied!":"Copy"})}const b4="code-block-module__codeBlock___dq28o",k4="code-block-module__header___42Fek",_4="code-block-module__relative___oO-zy",S4="code-block-module__copyOverlay___PjAuq",C4="code-block-module__pre___zXzLZ",P4="code-block-module__chalkboard___bdo9J",j4="code-block-module__chalkboardHeader___3RiVd",E4="code-block-module__chalkboardPre___iRBFR",mr={codeBlock:b4,header:k4,relative:_4,copyOverlay:S4,pre:C4,chalkboard:P4,chalkboardHeader:j4,chalkboardPre:E4};function lH({code:e,filename:t,surface:n="paper"}){return f.jsxs("div",{className:Y(mr.codeBlock,n==="chalkboard"&&mr.chalkboard),children:[t&&f.jsxs("div",{className:Y(mr.header,n==="chalkboard"&&mr.chalkboardHeader),children:[f.jsx("span",{children:t}),f.jsx(Xh,{text:e,variant:"light",surface:n})]}),!t&&f.jsx("div",{className:mr.relative,children:f.jsx("div",{className:mr.copyOverlay,children:f.jsx(Xh,{text:e,variant:"dark",surface:n})})}),f.jsx("pre",{className:Y(mr.pre,n==="chalkboard"&&mr.chalkboardPre),children:f.jsx("code",{children:e})})]})}function ja({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function AS({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M9 18h6"}),f.jsx("path",{d:"M10 22h4"}),f.jsx("path",{d:"M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14"})]})}function tg({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("polyline",{points:"20 6 9 17 4 12"})})}function T4({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),f.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function R4({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function N4({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),f.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function I4({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("polyline",{points:"9 18 15 12 9 6"})})}const M4="table-module__tableFrame___KP-90",A4="table-module__tableWrapper___gc3Y3",L4="table-module__toolbar___zhCel",D4="table-module__search___zIBk2",F4="table-module__searchIcon___ayhK8",O4="table-module__searchInput___PqsEG",z4="table-module__toolbarActions___EX6qS",$4="table-module__tableScroll___1gvc4",B4="table-module__table___tdU5g",V4="table-module__th___GQbKk",U4="table-module__td___WktB5",W4="table-module__tr___xeZno",H4="table-module__expandTh___uxkR4",G4="table-module__expandTd___VoBRC",K4="table-module__expandIcon___8V45X",Q4="table-module__expandable___R7o2l",q4="table-module__expandedRow___1TbTQ",Y4="table-module__expandedCell___sKAaD",X4="table-module__boardScroll___Y1yqm",J4="table-module__board___kFAI-",Z4="table-module__boardColumn___-W9bP",e5="table-module__boardColumnHeader___kY3Fj",t5="table-module__accentBlue___PEJ1V",n5="table-module__accentGreen___wJ53r",r5="table-module__accentAmber___Iezjv",s5="table-module__accentRose___W8zxc",i5="table-module__accentSlate___oUZCX",o5="table-module__boardColumnLabel___JBEed",a5="table-module__boardColumnCount___Pkpiq",l5="table-module__boardColumnBody___uAgRF",c5="table-module__boardRow___C1P60",u5="table-module__boardEmpty___IKv2W",d5="table-module__chalkboardFrame___xB3N5",f5="table-module__chalkboardWrapper___KjY5r",h5="table-module__chalkboard___v0m3A",oe={tableFrame:M4,tableWrapper:A4,toolbar:L4,search:D4,searchIcon:F4,searchInput:O4,toolbarActions:z4,tableScroll:$4,table:B4,th:V4,td:U4,tr:W4,expandTh:H4,expandTd:G4,expandIcon:K4,expandable:Q4,expandedRow:q4,expandedCell:Y4,boardScroll:X4,board:J4,boardColumn:Z4,boardColumnHeader:e5,accentBlue:t5,accentGreen:n5,accentAmber:r5,accentRose:s5,accentSlate:i5,boardColumnLabel:o5,boardColumnCount:a5,boardColumnBody:l5,boardRow:c5,boardEmpty:u5,chalkboardFrame:d5,chalkboardWrapper:f5,chalkboard:h5},p5=eg(oe);function m5({data:e=[],columns:t=[],board:n,surface:r="paper",texture:s=!0,toolbar:i,expandable:o,showExpandColumn:a=!0,rowKey:l,rowClassName:c,rowTexture:u,className:d}){const h=Hi(s,r==="chalkboard"?"chalkboard":"paper"),p=!!i,[m,y]=_.useState(new Set),w=v=>{y(b=>{const S=new Set(b);return S.has(v)?S.delete(v):S.add(v),S})},g=!!(o&&a),x=g?t.length+1:t.length;return f.jsxs("div",{className:Y(oe.tableFrame,r==="chalkboard"&&oe.chalkboardFrame,d),children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsxs("div",{className:Y(oe.tableWrapper,r==="chalkboard"&&oe.chalkboardWrapper),style:h,children:[p&&f.jsxs("div",{className:oe.toolbar,children:[i.search&&f.jsxs("div",{className:oe.search,children:[f.jsx(g5,{className:oe.searchIcon}),f.jsx("input",{type:"text",className:oe.searchInput,placeholder:i.search.placeholder??"Search...","aria-label":i.search.placeholder??"Search",value:i.search.value,onChange:v=>{var b,S;return(S=(b=i.search)==null?void 0:b.onChange)==null?void 0:S.call(b,v.target.value)}}),f.jsx(_t,{fill:!0,...St.field})]}),i.actions&&f.jsx("div",{className:oe.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?f.jsx("div",{className:oe.boardScroll,children:f.jsx("div",{className:oe.board,children:n.map(v=>f.jsxs("div",{className:oe.boardColumn,children:[f.jsxs("div",{className:Y(oe.boardColumnHeader,r==="chalkboard"&&oe.chalkboard,v.accent&&p5[v.accent]),children:[f.jsx("span",{className:oe.boardColumnLabel,children:v.label}),f.jsx("span",{className:oe.boardColumnCount,children:v.items.length})]}),f.jsx("div",{className:oe.boardColumnBody,children:v.items.length===0?f.jsx("div",{className:oe.boardEmpty,children:v.emptyLabel??"empty"}):v.items.map((b,S)=>f.jsx("div",{className:Y(oe.boardRow,r==="chalkboard"&&oe.chalkboard),children:v.renderItem(b,S,r)},v.getKey?v.getKey(b,S):S))})]},v.key))})}):f.jsx("div",{className:oe.tableScroll,children:f.jsxs("table",{className:Y(oe.table,r==="chalkboard"&&oe.chalkboard),children:[f.jsxs("colgroup",{children:[g&&f.jsx("col",{style:{width:"48px"}}),t.map(v=>f.jsx("col",{style:v.width?{width:`${v.width*32}px`}:void 0},v.key))]}),f.jsx("thead",{children:f.jsxs("tr",{children:[g&&f.jsx("th",{className:Y(oe.th,oe.expandTh),"aria-label":"Expand"}),t.map(v=>f.jsx("th",{className:oe.th,style:v.align?{textAlign:v.align}:void 0,children:v.header},v.key))]})}),f.jsx("tbody",{children:e.map((v,b)=>{const S=l?l(v,b):b,k=o==null?void 0:o.render(v,b,r),T=!!k,P=T&&m.has(S),R=u==null?void 0:u(v,b);return f.jsxs(_.Fragment,{children:[f.jsxs("tr",{className:Y(oe.tr,T&&oe.expandable,c==null?void 0:c(v,b)),style:R?Pa(R):void 0,onClick:()=>T&&w(S),children:[g&&f.jsx("td",{className:Y(oe.td,oe.expandTd),children:T&&f.jsx("button",{type:"button",className:oe.expandIcon,"aria-expanded":P,"aria-label":P?"Collapse row":"Expand row",onClick:j=>{j.stopPropagation(),w(S)},children:f.jsx(I4,{size:14})})}),t.map(j=>f.jsx("td",{className:oe.td,style:j.align?{textAlign:j.align}:void 0,children:j.cell(v,b,r)},j.key))]}),P&&f.jsx("tr",{className:oe.expandedRow,children:f.jsx("td",{colSpan:x,className:oe.expandedCell,children:k})})]},S)})})]})})]})]})}function g5({className:e}){return f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[f.jsx("circle",{cx:"11",cy:"11",r:"8"}),f.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}const y5="card-module__borderLayer___WSpJq",x5="card-module__elevated___uhWj9",v5="card-module__textureLayer___Kcofz",w5="card-module__flat___KnG5z",b5="card-module__small___HXUTr",k5="card-module__withAccent___2t7bV",_5="card-module__accentBlue___a1KIq",S5="card-module__accentGreen___RNWoA",C5="card-module__accentAmber___uMhom",P5="card-module__accentRose___VPI3t",j5="card-module__accentSlate___-l4jE",E5="card-module__chalkboard___bQ48O",vr={borderLayer:y5,default:"card-module__default___glPy-",elevated:x5,textureLayer:v5,flat:w5,small:b5,withAccent:k5,accentBlue:_5,accentGreen:S5,accentAmber:C5,accentRose:P5,accentSlate:j5,chalkboard:E5},T5=eg(vr);function Re({children:e,variant:t="default",surface:n="paper",size:r="medium",texture:s="parchment",fill:i,shade:o=!1,accent:a=!1,accentColor:l="blue",sketch:c=!1,className:u}){const d=n==="chalkboard"||s===!1?void 0:IS({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return f.jsxs("div",{className:Y(vr.borderLayer,vr[t],n==="chalkboard"&&vr.chalkboard,vr[r],a&&vr.withAccent,a&&T5[l],!c&&vr.flat,u),children:[f.jsx(_t,{clip:!0,...St.surface,straight:!c}),f.jsx("div",{className:vr.textureLayer,style:d,children:e})]})}const R5="input-module__wrapper___xaEw6",N5="input-module__label___lu7R1",I5="input-module__field___khFpX",M5="input-module__input___h7K-F",A5="input-module__small___SkByh",L5="input-module__medium___0QPuV",D5="input-module__large___zGwRu",F5="input-module__error___QDqga",O5="input-module__disabled___K-5hi",z5="input-module__helperText___njeLH",$5="input-module__helperError___qDBpD",B5="input-module__chalkboard___Xh-5s",kn={wrapper:R5,label:N5,field:I5,input:M5,small:A5,medium:L5,large:D5,error:F5,disabled:O5,helperText:z5,helperError:$5,chalkboard:B5},Ea=_.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=_.useId(),u=o??c;return f.jsxs("div",{className:Y(kn.wrapper,s==="chalkboard"&&kn.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:u,className:kn.label,children:e}),f.jsxs("span",{className:Y(kn.field,kn[r],n&&kn.error,a.disabled&&kn.disabled),children:[f.jsx("input",{ref:l,id:u,className:kn.input,...a}),f.jsx(_t,{fill:!0,...St.field})]}),t&&f.jsx("span",{className:Y(kn.helperText,n&&kn.helperError),children:t})]})}),V5="select-module__wrapper___Hc5F3",U5="select-module__label___ay-3s",W5="select-module__nativeSelect___UA2d-",H5="select-module__trigger___xMYHi",G5="select-module__open___w3mbZ",K5="select-module__triggerLabel___ihpER",Q5="select-module__placeholder___0VOFP",q5="select-module__small___iU9W9",Y5="select-module__chevron___0dCTg",X5="select-module__medium___B-XBN",J5="select-module__large___iII2c",Z5="select-module__chevronOpen___cFOYe",eV="select-module__error___P5RBk",tV="select-module__dropdown___Q-uK3",nV="select-module__slideDown___sT374",rV="select-module__options___HmrQ0",sV="select-module__option___vNnue",iV="select-module__optionDisabled___ex2zq",oV="select-module__optionSelected___tAFjn",aV="select-module__optionHighlighted___zYQLq",lV="select-module__helperText___r5gyn",cV="select-module__helperError___ydSPT",uV="select-module__chalkboard___sXBw8",Le={wrapper:V5,label:U5,nativeSelect:W5,trigger:H5,open:G5,triggerLabel:K5,placeholder:Q5,small:q5,chevron:Y5,medium:X5,large:J5,chevronOpen:Z5,error:eV,dropdown:tV,slideDown:nV,options:rV,option:sV,optionDisabled:iV,optionSelected:oV,optionHighlighted:aV,helperText:lV,helperError:cV,chalkboard:uV};function LS({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",options:i,placeholder:o,value:a,defaultValue:l,onChange:c,name:u,disabled:d=!1,width:h,texture:p=!1,className:m}){const y=_.useId(),[w,g]=_.useState(!1),[x,v]=_.useState(-1),[b,S]=_.useState(l??""),[k,T]=_.useState(null),P=_.useRef(null),R=_.useRef(null),j=a!==void 0,I=j?a:b,M=i.find(C=>C.value===I),O=(M==null?void 0:M.label)??o??"Select...",z=_.useCallback(()=>{if(d)return;g(!0);const C=i.findIndex($=>$.value===I);v(C>=0?C:0)},[d,i,I]),E=_.useCallback(()=>{g(!1),v(-1)},[]),F=_.useCallback(C=>{var $;C.disabled||(j||S(C.value),c==null||c(C.value),E(),($=P.current)==null||$.focus())},[j,c,E]),V=_.useCallback(C=>{if(!d)switch(C.key){case"Enter":case" ":C.preventDefault(),w&&x>=0?F(i[x]):z();break;case"Escape":C.preventDefault(),w&&E();break;case"ArrowDown":C.preventDefault(),w?v($=>{let q=$+1;for(;q<i.length&&i[q].disabled;)q++;return q<i.length?q:$}):z();break;case"ArrowUp":C.preventDefault(),w?v($=>{let q=$-1;for(;q>=0&&i[q].disabled;)q--;return q>=0?q:$}):z();break;case"Home":if(C.preventDefault(),w){let $=0;for(;$<i.length&&i[$].disabled;)$++;$<i.length&&v($)}break;case"End":if(C.preventDefault(),w){let $=i.length-1;for(;$>=0&&i[$].disabled;)$--;$>=0&&v($)}break;case"Tab":w&&E();break}},[d,w,x,i,z,E,F]);_.useEffect(()=>{if(!w)return;const C=$=>{var q,N;const ce=$.target;(q=P.current)!=null&&q.contains(ce)||(N=R.current)!=null&&N.contains(ce)||E()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[w,E]),_.useEffect(()=>{if(!w||x<0||!R.current)return;const C=R.current.querySelector(`[data-option-index="${x}"]`);C==null||C.scrollIntoView({block:"nearest"})},[w,x]),_.useEffect(()=>{if(!w){T(null);return}const C=()=>{if(!P.current)return;const $=P.current.getBoundingClientRect();if($.bottom<0||$.top>window.innerHeight){E();return}T($)};return C(),document.addEventListener("scroll",C,{capture:!0,passive:!0}),window.addEventListener("resize",C,{passive:!0}),()=>{document.removeEventListener("scroll",C,{capture:!0}),window.removeEventListener("resize",C)}},[w,E]);const A=Hi(p),B=A?{"--sketch-fill":A.backgroundColor}:void 0;return f.jsxs("div",{className:Y(Le.wrapper,s==="chalkboard"&&Le.chalkboard,m),style:h?{width:typeof h=="number"?`${h}px`:h}:void 0,children:[e&&f.jsx("label",{htmlFor:y,className:Le.label,children:e}),f.jsxs("select",{id:y,name:u,className:Le.nativeSelect,value:I,onChange:C=>c==null?void 0:c(C.target.value),disabled:d,"aria-hidden":"true",tabIndex:-1,children:[o&&f.jsx("option",{value:"",children:o}),i.map(C=>f.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value))]}),f.jsxs("button",{ref:P,type:"button",role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-controls":w?`${y}-listbox`:void 0,"aria-activedescendant":w&&x>=0?`${y}-option-${x}`:void 0,className:Y(Le.trigger,Le[r],n&&Le.error,w&&Le.open,d&&Le.disabled),onClick:()=>w?E():z(),onKeyDown:V,disabled:d,children:[f.jsx("span",{className:Y(Le.triggerLabel,!M&&Le.placeholder),children:O}),f.jsx(dV,{className:Y(Le.chevron,w&&Le.chevronOpen)}),f.jsx(_t,{fill:!0,...St.field})]}),w&&k&&Ms.createPortal(f.jsxs("div",{ref:R,id:`${y}-listbox`,role:"listbox",tabIndex:-1,className:Le.dropdown,style:{...B,position:"fixed",top:k.bottom+6,left:k.left,width:k.width},onKeyDown:C=>{var $;C.key==="Escape"&&(C.preventDefault(),E(),($=P.current)==null||$.focus())},children:[f.jsx(_t,{fill:!0,...St.surface}),f.jsx("div",{className:Le.options,children:i.map((C,$)=>f.jsx("div",{id:`${y}-option-${$}`,role:"option","aria-selected":C.value===I,tabIndex:-1,"data-option-index":$,className:Y(Le.option,C.value===I&&Le.optionSelected,$===x&&Le.optionHighlighted,C.disabled&&Le.optionDisabled),onClick:q=>{q.stopPropagation(),F(C)},onMouseEnter:()=>v($),children:C.label},C.value))})]}),document.body),t&&f.jsx("span",{className:Y(Le.helperText,n&&Le.helperError),children:t})]})}function dV({className:e}){return f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:f.jsx("polyline",{points:"6 9 12 15 18 9"})})}function DS({variant:e}){switch(e){case"info":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),f.jsx("circle",{cx:"12",cy:"8",r:"0.5",fill:"currentColor"})]});case"success":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),f.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]});case"warning":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),f.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),f.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});case"error":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),f.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}}const fV="alert-module__alert___j7ZRS",hV="alert-module__surface___IaVgU",pV="alert-module__iconWrapper___kLoxT",mV="alert-module__message___klR2U",gV="alert-module__dismiss___f2uoG",yV="alert-module__info___PBo1l",xV="alert-module__success___AVBKS",vV="alert-module__warning___zkMaJ",wV="alert-module__error___cxg96",bV="alert-module__chalkboard___7pgWk",is={alert:fV,surface:hV,iconWrapper:pV,message:mV,dismiss:gV,info:yV,success:xV,warning:vV,error:wV,chalkboard:bV};function FS({children:e,variant:t="info",surface:n="paper",texture:r="kraft",dismissible:s=!1,onDismiss:i,className:o}){const a=n==="chalkboard";return f.jsxs("div",{className:Y(is.alert,is[t],a&&is.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:is.surface,style:a?void 0:Hi(r)}),f.jsx("span",{className:is.iconWrapper,children:f.jsx(DS,{variant:t})}),f.jsx("div",{className:is.message,children:e}),s&&f.jsx("button",{type:"button",className:is.dismiss,onClick:i,"aria-label":"Dismiss alert",children:f.jsx(ja,{size:16})})]})}const kV="modal-module__overlay___a52Ni",_V="modal-module__fadeIn___5OWd5",SV="modal-module__backdrop___RS4yj",CV="modal-module__modal___ZioOV",PV="modal-module__slideUp___vfFrm",jV="modal-module__small___hcxwF",EV="modal-module__medium___mjbM5",TV="modal-module__large___1dzyf",RV="modal-module__header___iP09B",NV="modal-module__title___nj06m",IV="modal-module__close___gQou9",MV="modal-module__body___Y-EdA",AV="modal-module__chalkboard___qY8qo",Wn={overlay:kV,fadeIn:_V,backdrop:SV,modal:CV,slideUp:PV,small:jV,medium:EV,large:TV,header:RV,title:NV,close:IV,body:MV,chalkboard:AV},LV='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ta({open:e,onClose:t,title:n,children:r,size:s="medium",surface:i="paper",texture:o=!1,className:a}){const l=_.useId(),c=_.useRef(null),u=_.useRef(null);if(ju(e,t),_.useEffect(()=>{var h;if(!e)return;u.current=document.activeElement,(h=c.current)==null||h.focus();const p=y=>{var w;if(y.key!=="Tab")return;const g=(w=c.current)==null?void 0:w.querySelectorAll(LV);if(!g||g.length===0){y.preventDefault();return}const x=g[0],v=g[g.length-1];y.shiftKey&&document.activeElement===x?(y.preventDefault(),v.focus()):!y.shiftKey&&document.activeElement===v&&(y.preventDefault(),x.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var y,w;document.removeEventListener("keydown",p),document.body.style.overflow=m,(w=(y=u.current)==null?void 0:y.focus)==null||w.call(y)}},[e]),!e||typeof document>"u")return null;const d=Hi(o);return Ms.createPortal(f.jsxs("div",{className:Wn.overlay,children:[f.jsx("button",{type:"button",className:Wn.backdrop,"aria-label":"Close modal",onClick:t}),f.jsxs("div",{ref:c,className:Y(Wn.modal,Wn[s],i==="chalkboard"&&Wn.chalkboard,a),style:d,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[f.jsxs("div",{className:Wn.header,children:[n&&f.jsx("h2",{id:l,className:Wn.title,children:n}),f.jsx("button",{type:"button",className:Wn.close,onClick:t,"aria-label":"Close modal",children:f.jsx(ja,{size:18})})]}),f.jsx("div",{className:Wn.body,children:r})]})]}),document.body)}const DV="textarea-module__wrapper___NbiNO",FV="textarea-module__label___ejhyZ",OV="textarea-module__field___KluQf",zV="textarea-module__textarea___0y-7v",$V="textarea-module__resizeGrip___lONlE",BV="textarea-module__small___yPyr8",VV="textarea-module__medium___ezQxA",UV="textarea-module__large___xfeKi",WV="textarea-module__error___EkXKJ",HV="textarea-module__disabled___9CKbb",GV="textarea-module__helperText___l1sPh",KV="textarea-module__helperError___VfTLy",QV="textarea-module__chalkboard___zZ0X0",ln={wrapper:DV,label:FV,field:OV,textarea:zV,resizeGrip:$V,small:BV,medium:VV,large:UV,error:WV,disabled:HV,helperText:GV,helperError:KV,chalkboard:QV},qV=48,Nu=_.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=_.useId(),u=o??c,d=_.useRef(null),h=_.useCallback(m=>{d.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=_.useCallback(m=>{const y=d.current;if(!y)return;m.preventDefault();const w=m.clientY,g=y.offsetHeight,x=b=>{y.style.height=`${Math.max(qV,g+b.clientY-w)}px`},v=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",v)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",v)},[]);return f.jsxs("div",{className:Y(ln.wrapper,s==="chalkboard"&&ln.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:u,className:ln.label,children:e}),f.jsxs("span",{className:Y(ln.field,ln[r],n&&ln.error,a.disabled&&ln.disabled),children:[f.jsx("textarea",{ref:h,id:u,className:ln.textarea,...a}),f.jsx(_t,{fill:!0,...St.field}),!a.disabled&&f.jsx("span",{className:ln.resizeGrip,onPointerDown:p,"aria-hidden":"true",title:"Drag to resize",children:f.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M11 4.5 L4.5 11"}),f.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&f.jsx("span",{className:Y(ln.helperText,n&&ln.helperError),children:t})]})}),YV="progress-module__track___a5BMO",XV="progress-module__svg___3U0-E",bv={track:YV,svg:XV},af=300,gr=1;function JV({value:e,max:t=100,color:n,height:r=6,surface:s="paper",className:i}){const o=t>0?Math.max(0,Math.min(100,Math.round(e/t*100))):0,a=s==="chalkboard",l=Math.max(1,Math.round(Ru()*1e6)),c=a?nt(J.chalkboardBorderBase,.16):nt(J.textPrimary,.12),u=n??(a?J.chalkboardChalk:J.textSecondary),d=_.useMemo(()=>Oe.toPaths(Oe.rectangle(gr,gr,af-gr*2,r-gr*2,{seed:l,roughness:2.2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1.5})),[l,c,r]),h=Math.max(o/100*(af-gr*2),0),p=_.useMemo(()=>h>0?Oe.toPaths(Oe.rectangle(gr,gr,h,r-gr*2,{seed:l+1,roughness:2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1})):[],[l,u,h,r]);return f.jsx("div",{className:Y(bv.track,i),style:{height:r,borderRadius:r/2},children:f.jsxs("svg",{className:bv.svg,viewBox:`0 0 ${af} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[d.map((m,y)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y)),p.map((m,y)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y))]})})}function ZV(e){const t=Ru();return _.useMemo(()=>({blob:j$({seed:t,wobble:e}),ring:E$(t,e)}),[t,e])}const e6="list-item-module__listItem___-tw9O",t6="list-item-module__clickable___GLJmd",n6="list-item-module__blobBg___O3Mzh",r6="list-item-module__blobFill___dXHk1",s6="list-item-module__blobRing___S9mas",i6="list-item-module__active___UsL8O",o6="list-item-module__small___9dphK",a6="list-item-module__medium___yGZCr",l6="list-item-module__icon___2b4wU",c6="list-item-module__label___SIzJ4",u6="list-item-module__action___qGh0-",d6="list-item-module__chalkboard___qpWuM",Wt={listItem:e6,static:"list-item-module__static___qtEX6",clickable:t6,blobBg:n6,blobFill:r6,blobRing:s6,active:i6,small:o6,medium:a6,icon:l6,label:c6,action:u6,chalkboard:d6};function Qn({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=ZV(s),u=!!l.onClick;return f.jsxs("button",{type:"button",className:Y(Wt.listItem,Wt[r],u&&Wt.clickable,!u&&!e&&Wt.static,e&&Wt.active,i==="chalkboard"&&Wt.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[f.jsxs("svg",{className:Wt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:c.blob,className:Wt.blobFill}),f.jsx("path",{d:c.ring,className:Wt.blobRing})]}),t&&f.jsx("span",{className:Wt.icon,children:t}),f.jsx("span",{className:Wt.label,children:o}),n&&f.jsx("span",{className:Wt.action,children:n})]})}const f6="icon-module__icon___2vrJz",h6="icon-module__blobBg___ENPYJ",p6="icon-module__blobFill___IPbwQ",m6="icon-module__blobRing___1awqV",g6="icon-module__content___TaZR6",y6="icon-module__small___Xp--F",x6="icon-module__medium___tCjMB",v6="icon-module__large___vBtP7",Us={icon:f6,blobBg:h6,blobFill:p6,blobRing:m6,content:g6,small:y6,medium:x6,large:v6},w6={small:20,medium:24,large:28};function b6({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=Gi(n),o=w6[t];return f.jsxs("span",{className:Y(Us.icon,Us[t],s),children:[f.jsxs("svg",{className:Us.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:i.blob,className:Us.blobFill,style:r?{fill:r}:void 0}),f.jsx("path",{d:i.ring,className:Us.blobRing})]}),f.jsx("span",{className:Us.content,style:{width:o,height:o},children:e})]})}const k6="radio-module__wrapper___BB05E",_6="radio-module__blobFill___p5BX4",S6="radio-module__labelLeft___ijB93",C6="radio-module__input___M2nFJ",P6="radio-module__box___H7ofS",j6="radio-module__dot___jVJ-d",E6="radio-module__boxWrapper___Y3qis",T6="radio-module__blobBg___IR-M5",R6="radio-module__labelText___I-nu3",N6="radio-module__chalkboard___IIBqI",_n={wrapper:k6,blobFill:_6,labelLeft:S6,input:C6,box:P6,dot:j6,boxWrapper:E6,blobBg:T6,labelText:R6,chalkboard:N6};_.forwardRef(function({label:e,labelPosition:t="right",wobble:n=.4,surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=_.useId(),d=a??u,h=Gi(n);return f.jsxs("label",{className:Y(_n.wrapper,t==="left"&&_n.labelLeft,r==="chalkboard"&&_n.chalkboard,s),htmlFor:d,children:[f.jsxs("span",{className:_n.boxWrapper,children:[f.jsx("input",{ref:c,id:d,type:"radio",className:_n.input,checked:i,onChange:o,...l}),f.jsx("svg",{className:_n.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:h.blob,className:_n.blobFill})}),f.jsxs("span",{className:_n.box,"aria-hidden":"true",children:[f.jsx(_t,{smooth:!0,shape:"circle",...St.control}),f.jsx("span",{className:_n.dot})]})]}),e&&f.jsx("span",{className:_n.labelText,children:e})]})});const I6="switch-module__wrapper___5-2P1",M6="switch-module__labelLeft___WlT-N",A6="switch-module__input___YKZRj",L6="switch-module__track___QNvnO",D6="switch-module__thumb___cunvF",F6="switch-module__small___WPIxc",O6="switch-module__medium___yPulW",z6="switch-module__large___VlKV1",$6="switch-module__labelText___9Qg39",B6="switch-module__chalkboard___qKTMz",yr={wrapper:I6,labelLeft:M6,input:A6,track:L6,thumb:D6,small:F6,medium:O6,large:z6,labelText:$6,chalkboard:B6},V6=_.forwardRef(function({label:e,labelPosition:t="right",size:n="medium",surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=_.useId(),d=a??u;return f.jsxs("label",{className:Y(yr.wrapper,yr[n],t==="left"&&yr.labelLeft,r==="chalkboard"&&yr.chalkboard,s),htmlFor:d,children:[f.jsx("input",{ref:c,id:d,type:"checkbox",className:yr.input,checked:i,onChange:o,...l}),f.jsxs("span",{className:yr.track,"aria-hidden":"true",children:[f.jsx(_t,{...St.pill}),f.jsx("span",{className:yr.thumb})]}),e&&f.jsx("span",{className:yr.labelText,children:e})]})}),U6="spinner-module__spinner___FDTk2",W6="spinner-module__chalkboard___DLE1z",H6="spinner-module__svg___JnCWN",G6="spinner-module__track___xbnbo",K6="spinner-module__head___j5dWe",yo={spinner:U6,chalkboard:W6,svg:H6,track:G6,head:K6},Q6={small:18,medium:28,large:40},kv=25,q6=18,_v=Oe.toPaths(Oe.circle(kv,kv,q6*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function Rs({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=Q6[e];return f.jsx("span",{className:Y(yo.spinner,r==="chalkboard"&&yo.chalkboard,s),role:"status","aria-label":n,children:f.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:yo.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[f.jsx("path",{className:yo.track,d:_v,fill:"none",pathLength:100,strokeLinecap:"round"}),f.jsx("path",{className:yo.head,d:_v,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const Y6="skeleton-module__skeleton___HCSvg",X6="skeleton-module__pulse___6eCq1",J6="skeleton-module__svg___OzxGp",Z6="skeleton-module__text___v17Nv",e8="skeleton-module__rect___wqIJy",t8="skeleton-module__circle___RCmyR",lf={skeleton:Y6,pulse:X6,svg:J6,text:Z6,rect:e8,circle:t8},Sv={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Ws=2;function cn({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Ru()*1e6)),l=o?nt(J.chalkboardBorderBase,.16):nt(J.textPrimary,.09),c=_.useMemo(()=>{const[,,u,d]=Sv[e],h=e==="circle"?Oe.ellipse(u/2,d/2,u-Ws*2,d-Ws*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):Oe.rectangle(Ws,Ws,u-Ws*2,d-Ws*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return Oe.toPaths(h)},[e,a,l]);return f.jsx("span",{className:Y(lf.skeleton,lf[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:f.jsx("svg",{className:lf.svg,viewBox:Sv[e].join(" "),preserveAspectRatio:"none","aria-hidden":"true",children:c.map((u,d)=>f.jsx("path",{d:u.d,stroke:u.stroke,strokeWidth:u.strokeWidth,fill:u.fill},d))})})}const n8="divider-module__horizontal___tP3rG",r8="divider-module__line___KnBes",s8="divider-module__label___WiUwZ",i8="divider-module__vertical___wBSrT",o8="divider-module__chalkboard___gXTde",Hs={horizontal:n8,line:r8,label:s8,vertical:i8,chalkboard:o8};function Cv({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Hs.chalkboard;return e==="vertical"?f.jsx("span",{className:Y(Hs.vertical,s,r),role:"separator","aria-orientation":"vertical"}):f.jsxs("div",{className:Y(Hs.horizontal,s,r),role:"separator",children:[f.jsx("span",{className:Hs.line}),t!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:Hs.label,children:t}),f.jsx("span",{className:Hs.line})]})]})}const a8="tooltip-module__wrapper___XeVNe",l8="tooltip-module__tooltip___e-rkz",c8="tooltip-module__tooltipIn___CZbRw",u8="tooltip-module__top___78WWU",d8="tooltip-module__bottom___Irl3O",f8="tooltip-module__left___C1Ec4",h8="tooltip-module__right___oUA-Z",p8="tooltip-module__chalkboard___Um6dx",vl={wrapper:a8,tooltip:l8,tooltipIn:c8,top:u8,bottom:d8,left:f8,right:h8,chalkboard:p8},wl=8,bl=8,m8=typeof window>"u"?_.useEffect:_.useLayoutEffect;function g8(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+wl,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-wl-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+wl;break;default:r=e.top-wl-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,bl),window.innerWidth-n.width-bl),r=Math.min(Math.max(r,bl),window.innerHeight-n.height-bl),{top:r,left:s}}function Ce({content:e,children:t,placement:n="top",delay:r=300,disabled:s=!1,surface:i="paper"}){const o=_.useId(),[a,l]=_.useState(!1),[c,u]=_.useState(!1),[d,h]=_.useState(!1),[p,m]=_.useState(null),[y,w]=_.useState(null),g=_.useRef(null),x=_.useRef(null),v=_.useRef(),b=!s&&!!e&&!d&&(a||c),S=()=>{clearTimeout(v.current),v.current=setTimeout(()=>l(!0),r)},k=()=>{clearTimeout(v.current),l(!1),h(!1)},T=()=>{h(!1),u(!0)},P=()=>{u(!1),h(!1)};ju(b,()=>h(!0)),_.useEffect(()=>{if(!b){m(null);return}const j=()=>{g.current&&m(g.current.getBoundingClientRect())};return j(),window.addEventListener("scroll",j,{capture:!0,passive:!0}),window.addEventListener("resize",j,{passive:!0}),()=>{window.removeEventListener("scroll",j,{capture:!0}),window.removeEventListener("resize",j)}},[b]),m8(()=>{if(!b){w(null);return}const j=x.current;j&&w({width:j.offsetWidth,height:j.offsetHeight})},[b,e,n]),_.useEffect(()=>()=>clearTimeout(v.current),[]);const R=t.props;return f.jsxs("span",{ref:g,className:vl.wrapper,onMouseEnter:S,onMouseLeave:k,onFocus:T,onBlur:P,children:[_.cloneElement(t,{"aria-describedby":b?o:R["aria-describedby"]}),b&&p&&typeof document<"u"&&Ms.createPortal(f.jsx("span",{ref:x,id:o,role:"tooltip",className:Y(vl.tooltip,vl[n],i==="chalkboard"&&vl.chalkboard),style:y?{position:"fixed",...g8(p,n,y)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const y8="toast-module__stack___hDi0s",x8="toast-module__topLeft___Luw-F",v8="toast-module__topCenter___N1DwF",w8="toast-module__topRight___Dtgau",b8="toast-module__bottomLeft___Eb2lo",k8="toast-module__bottomCenter___gs-Yb",_8="toast-module__bottomRight___-0e2j",S8="toast-module__item___RFjtm",C8="toast-module__toastIn___9m9iN",P8="toast-module__card___ZCvJS",j8="toast-module__surface___mfMl0",E8="toast-module__iconWrapper___lnjcC",T8="toast-module__content___AlliM",R8="toast-module__title___1Oqh8",N8="toast-module__description___eiUSB",I8="toast-module__dismiss___tUGx4",M8="toast-module__info___Nh8S9",A8="toast-module__success___hlKLc",L8="toast-module__warning___XUMJt",D8="toast-module__error___pSFFC",F8="toast-module__chalkboard___c49gt",Ht={stack:y8,topLeft:x8,topCenter:v8,topRight:w8,bottomLeft:b8,bottomCenter:k8,bottomRight:_8,item:S8,toastIn:C8,card:P8,surface:j8,iconWrapper:E8,content:T8,title:R8,description:N8,dismiss:I8,info:M8,success:A8,warning:L8,error:D8,chalkboard:F8};function O8({record:e,surface:t="paper",onDismiss:n}){const r=_.useRef(e.duration),s=_.useRef(0),i=_.useRef(),o=_.useCallback(d=>{clearTimeout(i.current),!(d<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),d))},[n,e.id]);_.useEffect(()=>(o(e.duration),()=>clearTimeout(i.current)),[o,e.duration]);const a=()=>{i.current&&(clearTimeout(i.current),r.current-=Date.now()-s.current)},l=()=>o(r.current),c=t==="chalkboard",u=e.variant==="warning"||e.variant==="error"?"alert":"status";return f.jsx("div",{className:Ht.item,onMouseEnter:a,onMouseLeave:l,children:f.jsxs("div",{className:Y(Ht.card,Ht[e.variant],c&&Ht.chalkboard),role:u,children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:Ht.surface,style:c?void 0:Hi("kraft")}),f.jsx("span",{className:Ht.iconWrapper,children:f.jsx(DS,{variant:e.variant})}),f.jsxs("div",{className:Ht.content,children:[e.title&&f.jsx("div",{className:Ht.title,children:e.title}),f.jsx("div",{className:Ht.description,children:e.description})]}),f.jsx("button",{type:"button",className:Ht.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:f.jsx(ja,{size:16})})]})})}const OS=_.createContext(null);function z8(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function $8({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[s,i]=_.useState([]),o=_.useRef(0),a=_.useCallback(u=>{i(d=>d.filter(h=>h.id!==u))},[]),l=_.useCallback(u=>{o.current+=1;const d=`toast-${o.current}`;return i(h=>[...h,{id:d,title:u.title,description:u.description,variant:u.variant??"info",duration:u.duration??r}]),d},[r]),c=t.startsWith("top")?[...s].reverse():s;return f.jsxs(OS.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&Ms.createPortal(f.jsx("div",{className:Y(Ht.stack,Ht[z8(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>f.jsx(O8,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function He(){const e=_.useContext(OS);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const B8="breadcrumb-module__breadcrumb___r-ILp",V8="breadcrumb-module__list___V3YFy",U8="breadcrumb-module__item___dDwYf",W8="breadcrumb-module__link___CHC9k",H8="breadcrumb-module__linkButton___XoMW-",G8="breadcrumb-module__current___dprI9",K8="breadcrumb-module__separator___uLhtn",Q8="breadcrumb-module__chalkboard___COJpw",Sn={breadcrumb:B8,list:V8,item:U8,link:W8,linkButton:H8,current:G8,static:"breadcrumb-module__static___affaf",separator:K8,chalkboard:Q8};function Pv({items:e,surface:t="paper",className:n}){return f.jsx("nav",{"aria-label":"Breadcrumb",className:Y(Sn.breadcrumb,t==="chalkboard"&&Sn.chalkboard,n),children:f.jsx("ol",{className:Sn.list,children:e.map((r,s)=>{const i=s===e.length-1;return f.jsxs("li",{className:Sn.item,children:[i?f.jsx("span",{className:Sn.current,"aria-current":"page",children:r.label}):r.href?f.jsx("a",{href:r.href,className:Sn.link,onClick:r.onClick,children:r.label}):r.onClick?f.jsx("button",{type:"button",className:Y(Sn.link,Sn.linkButton),onClick:r.onClick,children:r.label}):f.jsx("span",{className:Sn.static,children:r.label}),!i&&f.jsx(q8,{className:Sn.separator})]},r.id)})})})}function q8({className:e}){return f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:f.jsx("polyline",{points:"9 18 15 12 9 6"})})}const Y8="menu-module__wrapper___WCtoy",X8="menu-module__menu___i40Wj",J8="menu-module__surface___SJbaB",Z8="menu-module__list___YjCfD",eU="menu-module__item___aqcgg",tU="menu-module__icon___1qUvA",nU="menu-module__label___MtQMh",rU="menu-module__danger___p9oZo",sU="menu-module__itemDisabled___HByLP",iU="menu-module__separator___g2uay",oU="menu-module__chalkboard___5jIwI",un={wrapper:Y8,menu:X8,surface:J8,list:Z8,item:eU,icon:tU,label:nU,danger:rU,itemDisabled:sU,separator:iU,chalkboard:oU},aU=6;function lU(e){return"type"in e&&e.type==="separator"}function zS({trigger:e,items:t,align:n="start",surface:r="paper",className:s}){const i=_.useId(),[o,a]=_.useState(!1),[l,c]=_.useState(null),u=_.useRef(null),d=_.useRef(null),h=_.useCallback(()=>{var g,x;(x=(g=u.current)==null?void 0:g.querySelector("button, a, [tabindex]"))==null||x.focus()},[]),p=_.useCallback(()=>a(!1),[]);ju(o,()=>{p(),h()}),_.useEffect(()=>{if(!o)return;const g=x=>{var v,b;const S=x.target;(v=u.current)!=null&&v.contains(S)||(b=d.current)!=null&&b.contains(S)||p()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,p]),_.useEffect(()=>{if(!o){c(null);return}const g=()=>{u.current&&c(u.current.getBoundingClientRect())};return g(),document.addEventListener("scroll",g,{capture:!0,passive:!0}),window.addEventListener("resize",g,{passive:!0}),()=>{document.removeEventListener("scroll",g,{capture:!0}),window.removeEventListener("resize",g)}},[o]),_.useEffect(()=>{var g,x;!o||!l||(x=(g=d.current)==null?void 0:g.querySelector('[role="menuitem"]:not(:disabled)'))==null||x.focus()},[o,l]);const m=g=>{var x,v,b,S,k;const T=Array.from(((x=d.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(T.length===0)return;const P=T.indexOf(document.activeElement);switch(g.key){case"ArrowDown":g.preventDefault(),(v=T[(P+1)%T.length])==null||v.focus();break;case"ArrowUp":g.preventDefault(),(b=T[(P-1+T.length)%T.length])==null||b.focus();break;case"Home":g.preventDefault(),(S=T[0])==null||S.focus();break;case"End":g.preventDefault(),(k=T[T.length-1])==null||k.focus();break;case"Tab":p();break}},y=g=>{var x;g.disabled||(p(),h(),(x=g.onSelect)==null||x.call(g))},w=e.props;return f.jsxs("span",{ref:u,className:un.wrapper,children:[_.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:g=>{var x;(x=w.onClick)==null||x.call(w,g),a(v=>!v)}}),o&&l&&typeof document<"u"&&Ms.createPortal(f.jsxs("div",{ref:d,id:i,role:"menu",className:Y(un.menu,r==="chalkboard"&&un.chalkboard,s),style:{position:"fixed",top:l.bottom+aU,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:un.surface}),f.jsx("div",{className:un.list,children:t.map(g=>lU(g)?f.jsx("div",{role:"separator",className:un.separator},g.id):f.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:g.disabled,className:Y(un.item,g.danger&&un.danger,g.disabled&&un.itemDisabled),onClick:()=>y(g),children:[g.icon&&f.jsx("span",{className:un.icon,children:g.icon}),f.jsx("span",{className:un.label,children:g.label})]},g.id))})]}),document.body)]})}function We(e){const t=e.split(`
79
+ `).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}const $S="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",qn={pass:"#2d5a3b",fail:"#5a2d2d",running:"#5a4a2d"},Yn={pass:"#b5d6b5",fail:"#d6a0a0",running:"#d6c4a0"},cU=We,uU=8,dU="basis-[9.25rem]",fU=e=>{switch(e.taskKind){case"phase":return e.phaseIndex!==void 0?` — phase ${e.phaseIndex+1}`:"";case"audit":return" — audit";case"batch-reconcile":return" — batch reconcile";case"reconcile":return" — reconcile";case"fix-review":return" — fixing review comments";case"draft":return" — drafting";case"extend":return" — extending";case"commit-suggest":return" — suggesting commit message";case"overlap-check":return" — checking overlap";case"sync":return" — syncing to main";case"resolve-conflict":return" — resolving conflict";case"run-all":return" — run all phases";default:return""}},hU=({task:e,onStop:t})=>{const n=nn(),{toast:r}=He(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async l=>{l.stopPropagation();try{await t(e.id)}catch(c){r({title:"Failed to stop agent",description:We(c.message),variant:"error"})}},o={starting:qn.running,running:qn.running,stopping:qn.running,done:qn.pass,error:qn.fail,superseded:qn.running},a={starting:Yn.running,running:Yn.running,stopping:Yn.running,done:Yn.pass,error:Yn.fail,superseded:Yn.running};return f.jsx(Re,{surface:"chalkboard",size:"small",className:"stack-task-card",children:f.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),s())},className:"flex cursor-pointer items-center justify-between gap-2 rounded-[10px]",children:[f.jsxs("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:[e.planTitle,fU(e)," · ",$A[e.agentId]]}),f.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?f.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:f.jsx(Te,{surface:"chalkboard",size:"small",fillColor:o.error,textColor:a.error,children:"stopped — agent signed out"})}):f.jsx(Te,{surface:"chalkboard",size:"small",fillColor:o[e.status],textColor:a[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&f.jsx(Ct,{icon:f.jsx(ja,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})})},pU=()=>{const e=L(r=>r.agentStatus),t=L(r=>r.stopAgent),n=e.slice(0,uU);return f.jsxs("div",{className:"flex min-h-0 flex-auto flex-col p-6",children:[f.jsx("div",{className:$S,children:"Agent"}),f.jsx("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${dU} ${n.length>0?"justify-start":"justify-center"}`,children:n.length>0?n.map(r=>f.jsx(hU,{task:r,onStop:t},r.id)):f.jsx(Re,{surface:"chalkboard",size:"small",children:f.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})})})]})};function kl(e,t){const{toast:n}=He(),r=L(o=>o.activeGitAction),s=L(o=>o.setActiveGitAction),i=_.useCallback(async o=>{if(!L.getState().activeGitAction){s(e);try{await o()}catch(a){n({title:t,description:We(a.message),variant:"error"})}finally{s(null)}}},[n,t,e,s]);return[r===e,i]}function Iu(){const e=L(b=>b.loadGitStatus),t=L(b=>b.loadPlans),n=L(b=>b.loadIdeas),r=L(b=>b.activeGitAction!==null),{toast:s,dismiss:i}=He(),o=()=>Promise.all([e(),t(),n()]),[a,l]=kl("push","Push failed"),[c,u]=kl("sync","Sync failed"),[d,h]=kl("pull","Pull failed"),[p,m]=kl("fix-divergence","Fix failed"),y=_.useCallback((b,S)=>{if(S.recovering)return s({title:`${b} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in S){const{conflictPrompt:k,message:T}=S,P=s({title:`${b} hit a conflict`,description:f.jsxs("div",{className:"flex flex-col items-start gap-2",children:[f.jsx("span",{children:We(T)}),f.jsx(ne,{size:"small",onClick:async()=>{const R=await hL(k).catch(j=>({ok:!1,error:We(j.message)}));R.ok&&i(P),s({title:R.ok?"Resolving conflict":"Could not start the agent",description:R.ok?"Handed off to the agent — see Stack for progress":R.error??"The agent did not start.",variant:R.ok?"warning":"error"})},children:"Ask the agent to resolve"})]}),variant:"error",duration:0});return!0}return!1},[s,i]);return{pushing:a,syncing:c,pulling:d,fixingDivergence:p,gitActionBusy:r,handlePush:()=>l(async()=>{await cL(),await e()}),handleSync:()=>u(async()=>{const b=await uL();if(!b.ok){if(y("Sync",b)){await e();return}throw new Error(b.message)}await o()}),handlePull:()=>h(async()=>{await dL(),await o()}),handleFixDivergence:()=>m(async()=>{const b=await fL();if(!b.ok){if(y("Fix",b)){await e();return}throw new Error(b.message)}await o()})}}function jv(e){const t=e.match(/Found (\d+) errors?\./);return t?Number(t[1]):0}function mU(e,t){const n=jv(e)+jv(t);return n>0?`${n} lint/format issue${n===1?"":"s"} found.`:"Lint or format check failed."}function gU(e){const t=e.match(/Tests\s+(\d+) failed/);return t?`${t[1]} test${t[1]==="1"?"":"s"} failed.`:"Tests failed."}const BS=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"m12 3-1.6 4.85a2 2 0 0 1-1.27 1.27L4.27 10.7l4.86 1.6a2 2 0 0 1 1.27 1.27L12 18.4l1.6-4.86a2 2 0 0 1 1.27-1.27l4.86-1.6-4.86-1.6a2 2 0 0 1-1.27-1.27L12 3Z"}),f.jsx("path",{d:"M19 3v3"}),f.jsx("path",{d:"M20.5 4.5h-3"})]}),VS=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M12 19V5"}),f.jsx("path",{d:"m5 12 7-7 7 7"})]}),US=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M12 5v14"}),f.jsx("path",{d:"m5 12 7 7 7-7"})]}),Mu=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"18",cy:"18",r:"3"}),f.jsx("circle",{cx:"6",cy:"6",r:"3"}),f.jsx("path",{d:"M6 9v5c0 .667 3 1 6 1s6-.333 6-1V9"}),f.jsx("path",{d:"M12 17v2"})]}),yU=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),f.jsx("polyline",{points:"21 3 21 9 15 9"})]}),WS=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[f.jsx("circle",{cx:"5",cy:"12",r:"2"}),f.jsx("circle",{cx:"12",cy:"12",r:"2"}),f.jsx("circle",{cx:"19",cy:"12",r:"2"})]}),xU=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"m18 4 3 3-3 3"}),f.jsx("path",{d:"M3 7h5.5a3 3 0 0 1 2.5 1.35L15 16.65A3 3 0 0 0 17.5 18H21"}),f.jsx("path",{d:"m18 20 3-3-3-3"}),f.jsx("path",{d:"M3 17h5.5a3 3 0 0 0 2.5-1.35"}),f.jsx("path",{d:"M13 8.35A3 3 0 0 1 15.5 7H21"})]}),vU=({size:e=12})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"10",cy:"10",r:"3"}),f.jsx("path",{d:"M2.5 10h4.5M13 10h4.5"})]}),wU=({size:e=12})=>f.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})}),ng=({size:e=14})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[f.jsx("title",{children:"Idea"}),f.jsx("path",{d:"M9 18h6M10 22h4M12 2a6 6 0 0 0-3.5 10.9c.53.4.9 1.03.9 1.72V15h5.2v-.38c0-.69.37-1.32.9-1.72A6 6 0 0 0 12 2Z"})]}),HS=({size:e=14})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[f.jsx("title",{children:"Note"}),f.jsx("path",{d:"M15 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z"}),f.jsx("path",{d:"M15 3v6h6"})]}),bU=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function kU(e){var s;if(!e||e.phases.length>0&&e.phases.every(i=>i.done))return{title:""};const t=((s=e.tags)==null?void 0:s.find(i=>bU.includes(i)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const _U=()=>{var M,O,z;const e=L(E=>E.status),t=L(E=>E.runCheck),n=L(E=>E.fixQuality),r=L(E=>E.consistency),s=L(E=>E.plans),i=L(E=>E.gitBranch),o=L(E=>E.gitAhead),a=L(E=>E.gitBehind),l=L(E=>E.gitDiverged),c=nn(),[u,d]=_.useState(!1),{fixingDivergence:h,gitActionBusy:p,handleFixDivergence:m}=Iu(),{qualityStatus:y,testStatus:w,consistencyStatus:g}=_.useMemo(()=>Mk(e),[e]),x=y==="running"||w==="running"||g==="running",v=r.length>0,b=_.useCallback(E=>E.planId?s==null?void 0:s.entries.find(F=>F.id===E.planId):void 0,[s==null?void 0:s.entries]),S=_.useCallback(E=>{const F=b(E);F&&c({to:"/plans/$planId",params:{planId:encodeURIComponent(F.title)}})},[b,c]),k={...qn,stale:"transparent"},T={...Yn,stale:void 0},P=x,R=v;`${((M=e==null?void 0:e.lint)==null?void 0:M.output)||"(none)"}${((O=e==null?void 0:e.format)==null?void 0:O.output)||"(none)"}`;const j=`Fix the failing tests in this repo. Output from the last test run:
80
80
 
81
- ${((z=e==null?void 0:e.test)==null?void 0:z.output)||"(no output captured)"}`,I=E=>f.jsx(Se,{content:E.title,surface:"chalkboard",children:f.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] ${P?"cursor-not-allowed":"cursor-pointer"} ${P&&E.status!=="running"?"opacity-50":"opacity-100"}`,onClick:()=>{P||E.onClick()},disabled:P,children:f.jsxs(Ee,{surface:"chalkboard",size:"small",fillColor:k[E.status],textColor:T[E.status],children:[E.label,f.jsx("span",{className:E.status==="running"?"visible":"invisible",children:"…"})]})})});return f.jsxs("div",{className:"flex-none flex flex-col gap-3",children:[f.jsxs("div",{className:"flex gap-2 flex-wrap justify-center",children:[I({label:"Quality",status:y,title:"Code style & formatting (Biome lint + format). Click to run.",onClick:()=>{t("lint"),t("format")}}),I({label:"Tests",status:w,title:"Unit tests (Vitest). Click to run.",onClick:()=>t("test")}),I({label:"Consistency",status:g,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",onClick:()=>t("consistency")}),f.jsxs("div",{children:[f.jsx(Se,{content:R?"Plan/idea doc findings — orphan subjects, title style & stale references. Click to show.":"Plan/idea docs — no findings (orphan subjects, title style, stale references).",surface:"chalkboard",children:f.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 ${R?"enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] cursor-pointer":"cursor-default"}`,disabled:!R,"aria-expanded":R?u:void 0,"aria-controls":"stack-doc-findings",onClick:()=>{R&&d(E=>!E)},children:f.jsx(Ee,{surface:"chalkboard",size:"small",fillColor:R?qn.fail:qn.pass,textColor:R?Yn.fail:Yn.pass,children:"Docs"})})}),u&&R&&f.jsx("div",{id:"stack-doc-findings",className:"mt-2 flex flex-col gap-2",children:r.map((E,F)=>f.jsx("div",{className:"font-mono text-2xs text-desk-text-muted",children:b(E)?f.jsx("button",{type:"button",onClick:()=>S(E),className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer [font:inherit] text-left",children:E.message}):f.jsx("span",{className:"text-left",children:E.message})},`${E.kind}-${E.title}-${F}`))})]})]}),(()=>{var V,A,B;let E,F=null;return P?E=f.jsx("span",{className:"text-desk-text-muted",children:"Running checks…"}):l?(E=f.jsxs("span",{className:"text-desk-text-muted",children:[i," has diverged from origin (",o," local, ",a," remote)"]}),F=f.jsx("button",{type:"button",onClick:m,disabled:p,className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 [font:inherit]",children:h?"Fixing…":"Suggested fix: Fix git issues"})):y==="fail"?(E=f.jsx("span",{className:"text-desk-text-muted",children:mU(((V=e==null?void 0:e.lint)==null?void 0:V.output)??"",((A=e==null?void 0:e.format)==null?void 0:A.output)??"")}),F=f.jsx("button",{type:"button",onClick:n,className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer [font:inherit]",children:"Suggested fix: run biome --write"})):w==="fail"?(E=f.jsx("span",{className:"text-desk-text-muted",children:gU(((B=e==null?void 0:e.test)==null?void 0:B.output)??"")}),F=f.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",f.jsx(Xh,{text:j,surface:"chalkboard"})]})):g==="fail"?(E=f.jsx("span",{className:"text-desk-text-muted",children:"Codebase consistency failed (knip / dependency-cruiser)."}),F=f.jsx("span",{className:"text-desk-text-muted opacity-80",children:"Run pnpm run consistency for details."})):v?E=f.jsx("span",{className:"text-desk-text-muted",children:"Plan doc issues — see the Docs stamp."}):y==="pass"&&w==="pass"&&g==="pass"?E=f.jsx("span",{className:"text-chalk-pass-text",children:"All checks passing."}):E=f.jsx("span",{className:"text-desk-text-muted opacity-60",children:"Checks haven't run yet."}),f.jsxs("div",{className:"text-center flex flex-col gap-1 font-handwritten text-sm",children:[E,f.jsx("span",{className:F?"visible":"invisible",children:F??" "})]})})()]})},SU=({count:e})=>{const t=nn();return f.jsxs("button",{type:"button",onClick:()=>t({to:"/diff"}),className:"block mx-auto bg-none bg-transparent border-none p-0 text-center font-mono text-xs text-desk-text-muted underline cursor-pointer",children:[e," file",e===1?"":"s"," changed"]})},CU=({files:e})=>{const t=L(S=>S.plans),n=L(S=>S.agentStatus),r=L(S=>S.loadGitStatus),s=L(S=>S.commitInFlight),i=L(S=>S.setCommitInFlight),{toast:o}=We(),[a,l]=_.useState(""),[c,u]=_.useState(!1),[d,h]=_.useState(!1),[p,m]=_.useState(null),y=_.useMemo(()=>DA(t==null?void 0:t.entries),[t==null?void 0:t.entries]),{title:w}=_.useMemo(()=>kU(y),[y]);_.useEffect(()=>{w&&!a&&l(w)},[w,a]);const g=_.useRef(null),x=_.useRef(null);_.useEffect(()=>{if(g.current===null){if(n.length===0)return;g.current=new Set(n.filter(k=>k.suggestedCommit).map(k=>k.id))}const S=n.find(k=>{var T;return k.suggestedCommit&&!((T=g.current)!=null&&T.has(k.id))});!(S!=null&&S.suggestedCommit)||x.current===S.id||(x.current=S.id,l(S.suggestedCommit.title))},[n]);const v=_.useCallback(async()=>{if(!(!a.trim()||s)){u(!0),i(!0);try{await Nk(e,a.trim()),l(""),await r()}catch(S){o({title:"Commit failed",description:cU(S.message),variant:"error"}),await r()}finally{u(!1),i(!1)}}},[a,e,r,s,i,o]),b=_.useCallback(async()=>{if(e.length!==0){h(!0),m(null);try{const S=await Ik(e);l(S.title)}catch(S){m(S.message)}finally{h(!1)}}},[e]);return f.jsxs(f.Fragment,{children:[p&&f.jsx(FS,{surface:"chalkboard",dismissible:!0,onDismiss:()=>m(null),children:p}),f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx("div",{className:"flex-1",children:f.jsx(Ea,{surface:"chalkboard",size:"small",placeholder:"Commit title",value:a,onChange:S=>l(S.currentTarget.value)})}),f.jsx(Ct,{icon:f.jsx(BS,{size:16}),surface:"chalkboard",size:"small",label:"Suggest title and message from the diff",disabled:e.length===0||d,onClick:b,wobble:d?1:0})]}),f.jsx(te,{surface:"chalkboard",size:"small",fullWidth:!0,disabled:e.length===0||!a.trim()||c||s,onClick:v,children:c||s?"Committing…":"Commit"})]})},PU=()=>{const{syncing:e,gitActionBusy:t,handleSync:n}=Iu();return f.jsx(te,{surface:"chalkboard",size:"small",fullWidth:!0,icon:f.jsx(Mu,{size:14}),disabled:t,onClick:n,children:e?"Syncing…":"Branch merged — sync to main"})},jU=({gitAhead:e,gitBranchHygiene:t})=>{const{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=Iu();return e>0?f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"opacity-50 text-xs m-0",children:["All changes committed — ",e," commit",e===1?"":"s"," ready to push."]}),f.jsx(te,{surface:"chalkboard",size:"small",icon:f.jsx(VS,{size:14}),disabled:i,onClick:o,children:n?"Pushing…":`Push ${e} commit${e===1?"":"s"}`})]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"opacity-50 text-xs m-0",children:"No changed files."}),f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx(Se,{content:t==="clean-on-main"?"Already on clean main":void 0,surface:"chalkboard",children:f.jsx(te,{surface:"chalkboard",size:"small",icon:f.jsx(Mu,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),f.jsx(te,{surface:"chalkboard",size:"small",icon:f.jsx(US,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})]})},EU=()=>{const e=L(s=>s.gitStatus),t=L(s=>s.gitAhead),n=L(s=>s.gitBranchHygiene),r=_.useMemo(()=>(e==null?void 0:e.map(s=>s.path))??[],[e]);return f.jsxs("div",{className:"flex-none flex flex-col p-6",children:[f.jsx("div",{className:$S,children:"Deliver"}),f.jsxs(Te,{surface:"chalkboard",size:"small",children:[f.jsx(_U,{}),e&&e.length>0?f.jsxs(f.Fragment,{children:[f.jsx(SU,{count:e.length}),f.jsx("div",{className:"flex-shrink-0 flex flex-col gap-3 mt-3",children:n==="stale-merged"?f.jsx(PU,{}):f.jsx(CU,{files:r})})]}):f.jsx("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-3",children:f.jsx(jU,{gitAhead:t,gitBranchHygiene:n})})]})]})},TU=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,s=L(k=>k.loadPlans),i=L(k=>k.status),o=L(k=>k.loadStatus),a=L(k=>k.consistency),l=L(k=>k.loadConsistency),c=L(k=>k.loadGitStatus),u=L(k=>k.agentStatus),d=L(k=>k.loadAgentStatus),h=L(k=>k.loadSuggestions),p=L(k=>k.loadArchivableIdeas),m=Pu(),y=_.useRef({loadPlans:s,loadStatus:o,loadConsistency:l,loadGitStatus:c,loadAgentStatus:d,loadSuggestions:h,loadArchivableIdeas:p});_.useEffect(()=>{y.current={loadPlans:s,loadStatus:o,loadConsistency:l,loadGitStatus:c,loadAgentStatus:d,loadSuggestions:h,loadArchivableIdeas:p}}),_.useEffect(()=>{y.current.loadStatus(),y.current.loadConsistency(),y.current.loadGitStatus(),y.current.loadAgentStatus(),y.current.loadArchivableIdeas()},[]),_.useEffect(()=>{const k=()=>{y.current.loadPlans(),y.current.loadGitStatus()};return window.addEventListener("focus",k),()=>window.removeEventListener("focus",k)},[]),_.useEffect(()=>{const k=new EventSource("/api/activity/stream"),T={},P=(R,j,I)=>{T[R]&&clearTimeout(T[R]),T[R]=setTimeout(j,I)};return k.onmessage=R=>{const j=JSON.parse(R.data);if(j.type==="status"){P("status",()=>y.current.loadStatus(),80);return}if(j.type==="agent"){P("agent",()=>y.current.loadAgentStatus(),120);return}j.message==="changed"&&P("activity",()=>{y.current.loadPlans(),y.current.loadSuggestions(),y.current.loadStatus(),y.current.loadConsistency(),y.current.loadGitStatus(),y.current.loadAgentStatus(),y.current.loadArchivableIdeas()},250)},()=>{for(const R of Object.values(T))R&&clearTimeout(R);k.close()}},[]);const{qualityStatus:w,testStatus:g,consistencyStatus:x}=_.useMemo(()=>Mk(i),[i]),v=a.length>0,b=w==="fail"||g==="fail"||x==="fail"||v,S=u.some(k=>k.status==="running"||k.status==="starting"||k.status==="stopping");return f.jsxs(f.Fragment,{children:[f.jsx(vS,{children:!r&&f.jsx(Ai.div,{initial:m?void 0:{opacity:0,x:20},animate:{opacity:1,x:0},exit:m?void 0:{opacity:0,x:20},transition:{duration:m?0:.2,ease:"easeOut"},className:"fixed right-0 top-[var(--pc-stack-toggle-top,50%)] z-[300] rounded-l-md shadow-[-2px_0_8px_rgba(0,0,0,0.15)] bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",style:{transform:"translateY(-50%)"},children:f.jsx(Ct,{icon:S?f.jsx(Rs,{size:"small",surface:"chalkboard",label:"Agent running"}):b?f.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 rounded-full bg-chalk-fail-text shadow-[0_0_6px_rgba(214,160,160,0.9)]"}):f.jsx("span",{className:"text-2xs",children:"S"}),surface:"chalkboard",size:"small",label:S?"Open stack panel — agent running":b?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${S?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":b?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})})}),f.jsxs(Ai.div,{animate:{x:r?0:"100%"},transition:{duration:m?0:.3,ease:[.4,0,.2,1]},className:"fixed inset-y-0 right-0 z-[300] flex w-[min(480px,100vw)] flex-col overflow-hidden border-l-4 border-paper-950/[12%] text-desk-text bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",children:[f.jsxs("div",{className:"flex h-20 shrink-0 items-center justify-between px-6",children:[f.jsx("span",{className:"font-display-luminari text-base font-bold text-desk-chalk",children:"Stack"}),!n&&f.jsx(Ct,{icon:f.jsx("span",{className:"text-sm leading-none",children:"×"}),surface:"chalkboard",size:"small",label:"Close stack panel",onClick:t,className:"h-7 w-7 border border-desk-border"})]}),f.jsx(Cv,{surface:"chalkboard"}),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(pU,{}),f.jsx(Cv,{surface:"chalkboard"}),f.jsx(EU,{})]})]})]})},RU=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),NU=()=>{const[e,t]=_.useState(null),[n,r]=_.useState(null),[s,i]=_.useState(!0);return _.useEffect(()=>{let o=!1;return i(!0),Promise.all([qM().then(a=>{!o&&a&&t(RU(a))}),QM().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},IU=["repo-docs","release-notes"],MU=["subjects","setup","merge-policy"];function rg(){const{planId:e}=Oi({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function AU(){const{ideaId:e}=Oi({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function LU(){const{section:e}=Oi({strict:!1});return IU.includes(e)?e:null}function cH(){const{section:e}=Oi({strict:!1});return MU.includes(e)?e:null}function uH(){const e=LU(),t=L(r=>r.activeDocTitle),n=L(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}const DU=250;function GS(e,t,n={}){const{debounceMs:r=DU,...s}=n,[i,o]=_.useState(e);_.useEffect(()=>{const c=setTimeout(()=>o(e),r);return()=>clearTimeout(c)},[e,r]);const{threshold:a,limit:l}=s;return _.useMemo(()=>eL(i,t,{threshold:a,limit:l}),[i,t,a,l])}const KS=()=>{const[e,t]=_.useState([]),[n,r]=_.useState(!0),[s,i]=_.useState(!0);return _.useEffect(()=>{let o=!1;return xk().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},FU=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=NU();return f.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n?f.jsx("img",{src:n,alt:"",className:`object-contain shrink-0 ${e==="sm"?"w-[18px] h-[18px]":"w-[20px] h-[20px]"}`}):f.jsx(b6,{icon:f.jsx(R4,{}),size:"small"}),f.jsx("span",{className:`font-display-luminari font-semibold whitespace-nowrap overflow-hidden text-ellipsis min-w-0 ${e==="sm"?"text-sm":"text-md"}`,children:r?"Loading…":t??"Paper Camp"})]})},OU=()=>{const[e,t]=_.useState(null);return _.useEffect(()=>{},[]),e?f.jsxs("div",{role:"alert",className:"bg-watercolor-rose-dark text-desk-text py-2 px-4 text-2xs font-mono shrink-0",children:["Server failed to reload — restart `pnpm dev` to pick up the change. ",e]}):null};function QS(e,t=0){return e?{duration:0,ease:"easeOut"}:{duration:.18,ease:"easeOut",delay:t}}function qS(e,t={y:8}){return{initial:e?void 0:{opacity:0,...t},animate:{opacity:1,x:0,y:0}}}const zU=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const s=Pu(),i=_.useRef(null);return _.useEffect(()=>{if(!n)return;const o=a=>{a.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n,r]),_.useEffect(()=>{var a;if(!n)return;const o=document.activeElement;return(a=i.current)==null||a.focus(),()=>{var l;return(l=o==null?void 0:o.focus)==null?void 0:l.call(o)}},[n]),f.jsxs(f.Fragment,{children:[n&&f.jsx("button",{type:"button",className:"lg:hidden fixed inset-0 z-[290] cursor-default border-none p-0 bg-ink-900/[40%] backdrop-blur-sm",onClick:r,"aria-label":"Close sidebar",tabIndex:-1}),f.jsx("aside",{ref:i,role:n?"dialog":void 0,"aria-modal":n||void 0,"aria-label":"Sidebar navigation",tabIndex:-1,className:`fixed inset-y-0 left-0 z-[300] w-[224px] shrink-0 flex flex-col overflow-hidden transition-transform duration-300 ease-out lg:sticky lg:inset-auto lg:top-0 lg:z-auto lg:translate-x-0 h-[var(--pc-sidebar-h,100%)] ${n?"translate-x-0":"-translate-x-full"} ${n?"bg-[var(--pui-bg-base)] shadow-[2px_0_12px_rgba(0,0,0,0.15)]":"bg-transparent"}`,children:f.jsx("div",{className:"flex-1 overflow-y-auto pt-5 relative",children:f.jsx(Ai.div,{...qS(s,{x:-8}),transition:QS(s,.08),children:t},e)})})]})};function cf(e){return e==="allowed"?"allowed":/reject|block|exceed|denied/i.test(e)?"rejected":"warning"}function $U(e){return e<1e12?e*1e3:e}function BU(e){const t=[`Claude usage: ${e.status}`];return e.rateLimitType&&t.push(e.rateLimitType),e.resetsAt!==void 0&&t.push(`resets ${new Date($U(e.resetsAt)).toLocaleTimeString()}`),e.overage&&t.push("overage on"),t.join(" · ")}const VU={...Pa("kraft"),display:"flex",alignItems:"center",gap:"0.75rem",height:"2rem",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"0.75rem",flexShrink:0,boxSizing:"border-box",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap"},UU={display:"flex",alignItems:"center",gap:"0.75rem",flexShrink:0},WU={display:"flex",alignItems:"center",gap:"0.25rem"},HU={opacity:.5},GU={color:"var(--pui-text-primary)"},Ev={opacity:.6},KU={flex:1},Tv={display:"flex",alignItems:"center",gap:"0.5rem",flexShrink:0},_l={fontSize:"0.75rem"},Rv={background:"none",backgroundColor:"transparent",border:"none",padding:0,cursor:"pointer"},QU=({gitBranch:e,gitAhead:t,changedFileCount:n,agentActive:r,activeTaskStatus:s,agentNotSignedIn:i,capabilityGapCount:o,rateLimit:a,gitBranchHygiene:l,commitInFlight:c,gitActionBusy:u,pushing:d,syncing:h,pulling:p,onSync:m,onPush:y,onPull:w,onQuickCommit:g,onOpenSetup:x,trailing:v})=>f.jsxs("div",{style:VU,children:[f.jsxs("div",{style:UU,children:[f.jsxs("span",{style:WU,children:[f.jsx("span",{style:HU,children:"⌥"}),f.jsx("code",{style:GU,children:e??"no branch"})]}),t>0&&f.jsxs("span",{style:Ev,children:["↑",t]}),f.jsx("span",{style:Ev,children:n>0?`${n} changed`:"clean"}),r&&f.jsx(Rs,{size:"small",label:`Agent ${s}…`}),i&&f.jsx(Se,{content:"Sign in from Settings → Connections so agent tasks can run",children:f.jsx("button",{type:"button",onClick:x,style:Rv,children:f.jsx(Ee,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&f.jsx(Se,{content:"Some features are disabled — open Setup to fix",children:f.jsx("button",{type:"button",onClick:x,style:Rv,children:f.jsxs(Ee,{size:"small",variant:"warning",children:["Setup (",o,")"]})})}),a&&cf(a.status)!=="allowed"&&f.jsx(Se,{content:BU(a),children:f.jsx(Ee,{size:"small",variant:cf(a.status)==="rejected"?"error":"warning",children:cf(a.status)==="rejected"?"Claude limit reached":"Claude usage warning"})})]}),f.jsx("div",{style:KU}),v&&f.jsx("div",{style:Tv,children:v}),f.jsxs("div",{style:Tv,children:[f.jsx(Se,{content:l==="clean-on-main"?"Already on clean main":"Sync to main",children:f.jsx(te,{variant:"ghost",size:"small",icon:f.jsx(Mu,{}),style:_l,disabled:u||l==="clean-on-main",onClick:m,children:h?"Syncing…":"Sync to main"})}),f.jsx(Se,{content:"Push commits to origin",children:f.jsx(te,{variant:"ghost",size:"small",icon:f.jsx(VS,{}),style:_l,disabled:u||t===0,onClick:y,children:d?"Pushing…":t>0?`Push (${t})`:"Push"})}),f.jsx(Se,{content:"Fast-forward the current branch from origin",children:f.jsx(te,{variant:"ghost",size:"small",icon:f.jsx(US,{}),style:_l,disabled:u,onClick:w,children:p?"Pulling…":"Pull"})}),f.jsx(Se,{content:"Commit all changes with an auto-suggested message",children:f.jsx(te,{variant:"ghost",size:"small",icon:f.jsx(vU,{}),style:_l,disabled:c||n===0,onClick:g,children:c?"Committing…":n>0?`Commit (${n})`:"Commit"})})]})]}),qU=()=>{const e=L(P=>P.agentStatus),t=L(P=>P.gitStatus),n=L(P=>P.gitBranch),r=L(P=>P.gitAhead),s=L(P=>P.gitBranchHygiene),i=L(P=>P.quickCommit),o=L(P=>P.commitInFlight),a=L(_L),l=L(SL),c=L(CL),{pushing:u,syncing:d,pulling:h,gitActionBusy:p,handlePush:m,handleSync:y,handlePull:w}=Iu(),{toast:g}=We(),x=nn(),v=e.find(P=>P.status==="running"||P.status==="starting"||P.status==="stopping"),b=v!==void 0,S=(t==null?void 0:t.length)??0,k=async()=>{if(o||S===0)return;const P=await i();P.ok?g({title:"Committed",description:P.warning??P.title,variant:P.warning?"warning":"success"}):g({title:"Commit failed",description:P.error,variant:"error"})},T=()=>x({to:"/settings/$section",params:{section:"setup"}});return f.jsx(QU,{gitBranch:n,gitAhead:r,changedFileCount:S,agentActive:b,activeTaskStatus:v==null?void 0:v.status,agentNotSignedIn:l,capabilityGapCount:a,rateLimit:c,gitBranchHygiene:s,commitInFlight:o,gitActionBusy:p,pushing:u,syncing:d,pulling:h,onSync:y,onPush:m,onPull:w,onQuickCommit:k,onOpenSetup:T})},YU=({children:e})=>f.jsx("h1",{className:"text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1]",children:e}),XU=3*6e4,JU=(e,t)=>{const n=L(o=>o.loadPlans),r=e.thread??[],s=r[r.length-1],i=e.id;_.useEffect(()=>{if(!i||!s||s.kind!=="chat")return;const o=setTimeout(()=>{lA(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},XU);return()=>clearTimeout(o)},[t,i,s,n])},Ra=()=>{const e=L(i=>i.loadPlans),{toast:t}=We(),[n,r]=_.useState(!1);return{patch:async(i,o,a)=>{r(!0);try{return await EA(i,o),await e(),!0}catch(l){return t({title:(a==null?void 0:a.errorTitle)??"Update failed",description:l.message,variant:"error"}),!1}finally{r(!1)}},updating:n}},ZU=e=>{const t=L(a=>a.loadPlans),{toast:n}=We(),[r,s]=_.useState(null);return{promotingIndex:r,promoteToDurable:async(a,l)=>{if(!(!e.id||r!==null)){s(a);try{await Lx(e.id,a,l),await t()}catch(c){n({title:"Promote failed",description:Ue(c.message),variant:"error"})}finally{s(null)}}},promoteToIdea:async(a,l)=>{if(!e.id||r!==null)return!1;s(a);try{const c=await bk(l);return await Lx(e.id,a,"log",`Captured as ${c}: ${l.title}`).catch(()=>{}),await t(),!0}catch(c){return n({title:"Promote failed",description:Ue(c.message),variant:"error"}),!1}finally{s(null)}}}},Jh=.95,eW=3e4,Zh={implement:{from:0,to:.6},verify:{from:.6,to:.9},checkbox:{from:.95,to:.95}};function tW(e){const t=[...e].sort((r,s)=>r-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function nW(e){const t=e.filter(s=>s.taskKind==="phase"&&s.outcome==="done").map(s=>Date.parse(s.endedAt)-Date.parse(s.startedAt)).filter(s=>Number.isFinite(s)&&s>0);if(t.length===0)return{};const n=tW(t),r={};for(const s of["implement","verify"]){const i=Zh[s].to-Zh[s].from;r[s]=n*i/Jh}return r}function rW({anchor:e,anchorEnteredAt:t,lastStreamAt:n,now:r,medians:s}){if(!e)return 0;const i=Zh[e],o=Math.min(i.from,Jh),a=s==null?void 0:s[e];if(!a||a<=0||t===void 0||i.to===i.from)return o;const l=n===void 0?r:Math.min(r,n+eW),c=Math.min(1,Math.max(0,l-t)/a);return Math.min(i.from+c*(i.to-i.from),Jh)}const sW=new Set(["starting","running","stopping"]),iW=1e3;function oW(e,t){const n=e!==void 0&&e.phaseIndex!==void 0&&sW.has(e.status),[r,s]=_.useState(()=>Date.now());return _.useEffect(()=>{if(!n)return;const i=setInterval(()=>s(Date.now()),iW);return()=>clearInterval(i)},[n]),!n||(e==null?void 0:e.phaseIndex)===void 0?null:{index:e.phaseIndex,fraction:rW({anchor:e.phaseAnchor,anchorEnteredAt:e.anchorEnteredAt,lastStreamAt:e.lastStreamAt,now:r,medians:nW(t)})}}const aW=(e,{reload:t,notify:n})=>{const[r,s]=_.useState(!1),[i,o]=_.useState(!1),[a,l]=_.useState(null);return _.useEffect(()=>{l(null)},[e.id]),{sending:r,send:async d=>{if(!e.id)return!1;s(!0),l(null);try{const h={route:window.location.pathname,focusedIdeaId:e.id,viewport:{width:window.innerWidth,height:window.innerHeight}},{error:p,undo:m}=await aA(e.id,d,h);return await t(),m&&l(m),p&&n({title:"Agent did not reply",description:Ue(p),variant:"error"}),!0}catch(h){return n({title:"Message failed to send",description:Ue(h.message),variant:"error"}),!1}finally{s(!1)}},undo:a,undoing:i,undoEdit:async()=>{if(!(!e.id||!a)){o(!0);try{const{error:d}=await cA(e.id,a.commitSha);if(d){n({title:"Undo failed",description:Ue(d),variant:"error"});return}l(null),await t()}catch(d){n({title:"Undo failed",description:Ue(d.message),variant:"error"})}finally{o(!1)}}}}},lW=async e=>{const t=await fetch(`/api/trail?id=${encodeURIComponent(e)}`);if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},cW=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{if(n(null),!e)return;let r=!1;return lW(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t};function YS(){const[e,t]=_.useState("idle"),[n,r]=_.useState(null),s=_.useRef(null),i=_.useCallback(async a=>{s.current&&clearTimeout(s.current),t("loading"),r(null);try{await a(),t("success"),s.current=setTimeout(()=>{t("idle")},2e3)}catch(l){t("error"),r(l.message),s.current=setTimeout(()=>{t("idle"),r(null)},4e3)}},[]),o=_.useCallback(()=>{s.current&&clearTimeout(s.current),t("idle"),r(null)},[]);return{state:e,errorMessage:n,run:i,reset:o,loading:e==="loading",success:e==="success"}}const sg="Keep phases short: 3-7 phases, each a one-line imperative title. Add a description only when the phase isn't self-explanatory, and keep it to one sentence. Never restate the idea's body and never summarise the work you did.",XS="A title is a noun/verb phrase, at most 40 characters (roughly 3-6 words), no em-dash subtitles or trailing clauses — the symptom, mechanism, and detail belong in the body's first paragraph, not the title.";function uW(e){const t=e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
81
+ ${((z=e==null?void 0:e.test)==null?void 0:z.output)||"(no output captured)"}`,I=E=>f.jsx(Ce,{content:E.title,surface:"chalkboard",children:f.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] ${P?"cursor-not-allowed":"cursor-pointer"} ${P&&E.status!=="running"?"opacity-50":"opacity-100"}`,onClick:()=>{P||E.onClick()},disabled:P,children:f.jsxs(Te,{surface:"chalkboard",size:"small",fillColor:k[E.status],textColor:T[E.status],children:[E.label,f.jsx("span",{className:E.status==="running"?"visible":"invisible",children:"…"})]})})});return f.jsxs("div",{className:"flex-none flex flex-col gap-3",children:[f.jsxs("div",{className:"flex gap-2 flex-wrap justify-center",children:[I({label:"Quality",status:y,title:"Code style & formatting (Biome lint + format). Click to run.",onClick:()=>{t("lint"),t("format")}}),I({label:"Tests",status:w,title:"Unit tests (Vitest). Click to run.",onClick:()=>t("test")}),I({label:"Consistency",status:g,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",onClick:()=>t("consistency")}),f.jsxs("div",{children:[f.jsx(Ce,{content:R?"Plan/idea doc findings — orphan subjects, title style & stale references. Click to show.":"Plan/idea docs — no findings (orphan subjects, title style, stale references).",surface:"chalkboard",children:f.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 ${R?"enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] cursor-pointer":"cursor-default"}`,disabled:!R,"aria-expanded":R?u:void 0,"aria-controls":"stack-doc-findings",onClick:()=>{R&&d(E=>!E)},children:f.jsx(Te,{surface:"chalkboard",size:"small",fillColor:R?qn.fail:qn.pass,textColor:R?Yn.fail:Yn.pass,children:"Docs"})})}),u&&R&&f.jsx("div",{id:"stack-doc-findings",className:"mt-2 flex flex-col gap-2",children:r.map((E,F)=>f.jsx("div",{className:"font-mono text-2xs text-desk-text-muted",children:b(E)?f.jsx("button",{type:"button",onClick:()=>S(E),className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer [font:inherit] text-left",children:E.message}):f.jsx("span",{className:"text-left",children:E.message})},`${E.kind}-${E.title}-${F}`))})]})]}),(()=>{var V,A,B;let E,F=null;return P?E=f.jsx("span",{className:"text-desk-text-muted",children:"Running checks…"}):l?(E=f.jsxs("span",{className:"text-desk-text-muted",children:[i," has diverged from origin (",o," local, ",a," remote)"]}),F=f.jsx("button",{type:"button",onClick:m,disabled:p,className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 [font:inherit]",children:h?"Fixing…":"Suggested fix: Fix git issues"})):y==="fail"?(E=f.jsx("span",{className:"text-desk-text-muted",children:mU(((V=e==null?void 0:e.lint)==null?void 0:V.output)??"",((A=e==null?void 0:e.format)==null?void 0:A.output)??"")}),F=f.jsx("button",{type:"button",onClick:n,className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer [font:inherit]",children:"Suggested fix: run biome --write"})):w==="fail"?(E=f.jsx("span",{className:"text-desk-text-muted",children:gU(((B=e==null?void 0:e.test)==null?void 0:B.output)??"")}),F=f.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",f.jsx(Xh,{text:j,surface:"chalkboard"})]})):g==="fail"?(E=f.jsx("span",{className:"text-desk-text-muted",children:"Codebase consistency failed (knip / dependency-cruiser)."}),F=f.jsx("span",{className:"text-desk-text-muted opacity-80",children:"Run pnpm run consistency for details."})):v?E=f.jsx("span",{className:"text-desk-text-muted",children:"Plan doc issues — see the Docs stamp."}):y==="pass"&&w==="pass"&&g==="pass"?E=f.jsx("span",{className:"text-chalk-pass-text",children:"All checks passing."}):E=f.jsx("span",{className:"text-desk-text-muted opacity-60",children:"Checks haven't run yet."}),f.jsxs("div",{className:"text-center flex flex-col gap-1 font-handwritten text-sm",children:[E,f.jsx("span",{className:F?"visible":"invisible",children:F??" "})]})})()]})},SU=({count:e})=>{const t=nn();return f.jsxs("button",{type:"button",onClick:()=>t({to:"/diff"}),className:"block mx-auto bg-none bg-transparent border-none p-0 text-center font-mono text-xs text-desk-text-muted underline cursor-pointer",children:[e," file",e===1?"":"s"," changed"]})},CU=({files:e})=>{const t=L(S=>S.plans),n=L(S=>S.agentStatus),r=L(S=>S.loadGitStatus),s=L(S=>S.commitInFlight),i=L(S=>S.setCommitInFlight),{toast:o}=He(),[a,l]=_.useState(""),[c,u]=_.useState(!1),[d,h]=_.useState(!1),[p,m]=_.useState(null),y=_.useMemo(()=>DA(t==null?void 0:t.entries),[t==null?void 0:t.entries]),{title:w}=_.useMemo(()=>kU(y),[y]);_.useEffect(()=>{w&&!a&&l(w)},[w,a]);const g=_.useRef(null),x=_.useRef(null);_.useEffect(()=>{if(g.current===null){if(n.length===0)return;g.current=new Set(n.filter(k=>k.suggestedCommit).map(k=>k.id))}const S=n.find(k=>{var T;return k.suggestedCommit&&!((T=g.current)!=null&&T.has(k.id))});!(S!=null&&S.suggestedCommit)||x.current===S.id||(x.current=S.id,l(S.suggestedCommit.title))},[n]);const v=_.useCallback(async()=>{if(!(!a.trim()||s)){u(!0),i(!0);try{await Nk(e,a.trim()),l(""),await r()}catch(S){o({title:"Commit failed",description:cU(S.message),variant:"error"}),await r()}finally{u(!1),i(!1)}}},[a,e,r,s,i,o]),b=_.useCallback(async()=>{if(e.length!==0){h(!0),m(null);try{const S=await Ik(e);l(S.title)}catch(S){m(S.message)}finally{h(!1)}}},[e]);return f.jsxs(f.Fragment,{children:[p&&f.jsx(FS,{surface:"chalkboard",dismissible:!0,onDismiss:()=>m(null),children:p}),f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx("div",{className:"flex-1",children:f.jsx(Ea,{surface:"chalkboard",size:"small",placeholder:"Commit title",value:a,onChange:S=>l(S.currentTarget.value)})}),f.jsx(Ct,{icon:f.jsx(BS,{size:16}),surface:"chalkboard",size:"small",label:"Suggest title and message from the diff",disabled:e.length===0||d,onClick:b,wobble:d?1:0})]}),f.jsx(ne,{surface:"chalkboard",size:"small",fullWidth:!0,disabled:e.length===0||!a.trim()||c||s,onClick:v,children:c||s?"Committing…":"Commit"})]})},PU=()=>{const{syncing:e,gitActionBusy:t,handleSync:n}=Iu();return f.jsx(ne,{surface:"chalkboard",size:"small",fullWidth:!0,icon:f.jsx(Mu,{size:14}),disabled:t,onClick:n,children:e?"Syncing…":"Branch merged — sync to main"})},jU=({gitAhead:e,gitBranchHygiene:t})=>{const{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=Iu();return e>0?f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"opacity-50 text-xs m-0",children:["All changes committed — ",e," commit",e===1?"":"s"," ready to push."]}),f.jsx(ne,{surface:"chalkboard",size:"small",icon:f.jsx(VS,{size:14}),disabled:i,onClick:o,children:n?"Pushing…":`Push ${e} commit${e===1?"":"s"}`})]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"opacity-50 text-xs m-0",children:"No changed files."}),f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx(Ce,{content:t==="clean-on-main"?"Already on clean main":void 0,surface:"chalkboard",children:f.jsx(ne,{surface:"chalkboard",size:"small",icon:f.jsx(Mu,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),f.jsx(ne,{surface:"chalkboard",size:"small",icon:f.jsx(US,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})]})},EU=()=>{const e=L(s=>s.gitStatus),t=L(s=>s.gitAhead),n=L(s=>s.gitBranchHygiene),r=_.useMemo(()=>(e==null?void 0:e.map(s=>s.path))??[],[e]);return f.jsxs("div",{className:"flex-none flex flex-col p-6",children:[f.jsx("div",{className:$S,children:"Deliver"}),f.jsxs(Re,{surface:"chalkboard",size:"small",children:[f.jsx(_U,{}),e&&e.length>0?f.jsxs(f.Fragment,{children:[f.jsx(SU,{count:e.length}),f.jsx("div",{className:"flex-shrink-0 flex flex-col gap-3 mt-3",children:n==="stale-merged"?f.jsx(PU,{}):f.jsx(CU,{files:r})})]}):f.jsx("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-3",children:f.jsx(jU,{gitAhead:t,gitBranchHygiene:n})})]})]})},TU=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,s=L(k=>k.loadPlans),i=L(k=>k.status),o=L(k=>k.loadStatus),a=L(k=>k.consistency),l=L(k=>k.loadConsistency),c=L(k=>k.loadGitStatus),u=L(k=>k.agentStatus),d=L(k=>k.loadAgentStatus),h=L(k=>k.loadSuggestions),p=L(k=>k.loadArchivableIdeas),m=Pu(),y=_.useRef({loadPlans:s,loadStatus:o,loadConsistency:l,loadGitStatus:c,loadAgentStatus:d,loadSuggestions:h,loadArchivableIdeas:p});_.useEffect(()=>{y.current={loadPlans:s,loadStatus:o,loadConsistency:l,loadGitStatus:c,loadAgentStatus:d,loadSuggestions:h,loadArchivableIdeas:p}}),_.useEffect(()=>{y.current.loadStatus(),y.current.loadConsistency(),y.current.loadGitStatus(),y.current.loadAgentStatus(),y.current.loadArchivableIdeas()},[]),_.useEffect(()=>{const k=()=>{y.current.loadPlans(),y.current.loadGitStatus()};return window.addEventListener("focus",k),()=>window.removeEventListener("focus",k)},[]),_.useEffect(()=>{const k=new EventSource("/api/activity/stream"),T={},P=(R,j,I)=>{T[R]&&clearTimeout(T[R]),T[R]=setTimeout(j,I)};return k.onmessage=R=>{const j=JSON.parse(R.data);if(j.type==="status"){P("status",()=>y.current.loadStatus(),80);return}if(j.type==="agent"){P("agent",()=>y.current.loadAgentStatus(),120);return}j.message==="changed"&&P("activity",()=>{y.current.loadPlans(),y.current.loadSuggestions(),y.current.loadStatus(),y.current.loadConsistency(),y.current.loadGitStatus(),y.current.loadAgentStatus(),y.current.loadArchivableIdeas()},250)},()=>{for(const R of Object.values(T))R&&clearTimeout(R);k.close()}},[]);const{qualityStatus:w,testStatus:g,consistencyStatus:x}=_.useMemo(()=>Mk(i),[i]),v=a.length>0,b=w==="fail"||g==="fail"||x==="fail"||v,S=u.some(k=>k.status==="running"||k.status==="starting"||k.status==="stopping");return f.jsxs(f.Fragment,{children:[f.jsx(vS,{children:!r&&f.jsx(Ai.div,{initial:m?void 0:{opacity:0,x:20},animate:{opacity:1,x:0},exit:m?void 0:{opacity:0,x:20},transition:{duration:m?0:.2,ease:"easeOut"},className:"fixed right-0 top-[var(--pc-stack-toggle-top,50%)] z-[300] rounded-l-md shadow-[-2px_0_8px_rgba(0,0,0,0.15)] bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",style:{transform:"translateY(-50%)"},children:f.jsx(Ct,{icon:S?f.jsx(Rs,{size:"small",surface:"chalkboard",label:"Agent running"}):b?f.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 rounded-full bg-chalk-fail-text shadow-[0_0_6px_rgba(214,160,160,0.9)]"}):f.jsx("span",{className:"text-2xs",children:"S"}),surface:"chalkboard",size:"small",label:S?"Open stack panel — agent running":b?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${S?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":b?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})})}),f.jsxs(Ai.div,{animate:{x:r?0:"100%"},transition:{duration:m?0:.3,ease:[.4,0,.2,1]},className:"fixed inset-y-0 right-0 z-[300] flex w-[min(480px,100vw)] flex-col overflow-hidden border-l-4 border-paper-950/[12%] text-desk-text bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",children:[f.jsxs("div",{className:"flex h-20 shrink-0 items-center justify-between px-6",children:[f.jsx("span",{className:"font-display-luminari text-base font-bold text-desk-chalk",children:"Stack"}),!n&&f.jsx(Ct,{icon:f.jsx("span",{className:"text-sm leading-none",children:"×"}),surface:"chalkboard",size:"small",label:"Close stack panel",onClick:t,className:"h-7 w-7 border border-desk-border"})]}),f.jsx(Cv,{surface:"chalkboard"}),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(pU,{}),f.jsx(Cv,{surface:"chalkboard"}),f.jsx(EU,{})]})]})]})},RU=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),NU=()=>{const[e,t]=_.useState(null),[n,r]=_.useState(null),[s,i]=_.useState(!0);return _.useEffect(()=>{let o=!1;return i(!0),Promise.all([qM().then(a=>{!o&&a&&t(RU(a))}),QM().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},IU=["repo-docs","release-notes"],MU=["subjects","setup","merge-policy"];function rg(){const{planId:e}=Oi({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function AU(){const{ideaId:e}=Oi({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function LU(){const{section:e}=Oi({strict:!1});return IU.includes(e)?e:null}function cH(){const{section:e}=Oi({strict:!1});return MU.includes(e)?e:null}function uH(){const e=LU(),t=L(r=>r.activeDocTitle),n=L(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}const DU=250;function GS(e,t,n={}){const{debounceMs:r=DU,...s}=n,[i,o]=_.useState(e);_.useEffect(()=>{const c=setTimeout(()=>o(e),r);return()=>clearTimeout(c)},[e,r]);const{threshold:a,limit:l}=s;return _.useMemo(()=>eL(i,t,{threshold:a,limit:l}),[i,t,a,l])}const KS=()=>{const[e,t]=_.useState([]),[n,r]=_.useState(!0),[s,i]=_.useState(!0);return _.useEffect(()=>{let o=!1;return xk().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},FU=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=NU();return f.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n?f.jsx("img",{src:n,alt:"",className:`object-contain shrink-0 ${e==="sm"?"w-[18px] h-[18px]":"w-[20px] h-[20px]"}`}):f.jsx(b6,{icon:f.jsx(R4,{}),size:"small"}),f.jsx("span",{className:`font-display-luminari font-semibold whitespace-nowrap overflow-hidden text-ellipsis min-w-0 ${e==="sm"?"text-sm":"text-md"}`,children:r?"Loading…":t??"Paper Camp"})]})},OU=()=>{const[e,t]=_.useState(null);return _.useEffect(()=>{},[]),e?f.jsxs("div",{role:"alert",className:"bg-watercolor-rose-dark text-desk-text py-2 px-4 text-2xs font-mono shrink-0",children:["Server failed to reload — restart `pnpm dev` to pick up the change. ",e]}):null};function QS(e,t=0){return e?{duration:0,ease:"easeOut"}:{duration:.18,ease:"easeOut",delay:t}}function qS(e,t={y:8}){return{initial:e?void 0:{opacity:0,...t},animate:{opacity:1,x:0,y:0}}}const zU=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const s=Pu(),i=_.useRef(null);return _.useEffect(()=>{if(!n)return;const o=a=>{a.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n,r]),_.useEffect(()=>{var a;if(!n)return;const o=document.activeElement;return(a=i.current)==null||a.focus(),()=>{var l;return(l=o==null?void 0:o.focus)==null?void 0:l.call(o)}},[n]),f.jsxs(f.Fragment,{children:[n&&f.jsx("button",{type:"button",className:"lg:hidden fixed inset-0 z-[290] cursor-default border-none p-0 bg-ink-900/[40%] backdrop-blur-sm",onClick:r,"aria-label":"Close sidebar",tabIndex:-1}),f.jsx("aside",{ref:i,role:n?"dialog":void 0,"aria-modal":n||void 0,"aria-label":"Sidebar navigation",tabIndex:-1,className:`fixed inset-y-0 left-0 z-[300] w-[224px] shrink-0 flex flex-col overflow-hidden transition-transform duration-300 ease-out lg:sticky lg:inset-auto lg:top-0 lg:z-auto lg:translate-x-0 h-[var(--pc-sidebar-h,100%)] ${n?"translate-x-0":"-translate-x-full"} ${n?"bg-[var(--pui-bg-base)] shadow-[2px_0_12px_rgba(0,0,0,0.15)]":"bg-transparent"}`,children:f.jsx("div",{className:"flex-1 overflow-y-auto pt-5 relative",children:f.jsx(Ai.div,{...qS(s,{x:-8}),transition:QS(s,.08),children:t},e)})})]})};function cf(e){return e==="allowed"?"allowed":/reject|block|exceed|denied/i.test(e)?"rejected":"warning"}function $U(e){return e<1e12?e*1e3:e}function BU(e){const t=[`Claude usage: ${e.status}`];return e.rateLimitType&&t.push(e.rateLimitType),e.resetsAt!==void 0&&t.push(`resets ${new Date($U(e.resetsAt)).toLocaleTimeString()}`),e.overage&&t.push("overage on"),t.join(" · ")}const VU={...Pa("kraft"),display:"flex",alignItems:"center",gap:"0.75rem",height:"2rem",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"0.75rem",flexShrink:0,boxSizing:"border-box",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap"},UU={display:"flex",alignItems:"center",gap:"0.75rem",flexShrink:0},WU={display:"flex",alignItems:"center",gap:"0.25rem"},HU={opacity:.5},GU={color:"var(--pui-text-primary)"},Ev={opacity:.6},KU={flex:1},Tv={display:"flex",alignItems:"center",gap:"0.5rem",flexShrink:0},_l={fontSize:"0.75rem"},Rv={background:"none",backgroundColor:"transparent",border:"none",padding:0,cursor:"pointer"},QU=({gitBranch:e,gitAhead:t,changedFileCount:n,agentActive:r,activeTaskStatus:s,agentNotSignedIn:i,capabilityGapCount:o,rateLimit:a,gitBranchHygiene:l,commitInFlight:c,gitActionBusy:u,pushing:d,syncing:h,pulling:p,onSync:m,onPush:y,onPull:w,onQuickCommit:g,onOpenSetup:x,trailing:v})=>f.jsxs("div",{style:VU,children:[f.jsxs("div",{style:UU,children:[f.jsxs("span",{style:WU,children:[f.jsx("span",{style:HU,children:"⌥"}),f.jsx("code",{style:GU,children:e??"no branch"})]}),t>0&&f.jsxs("span",{style:Ev,children:["↑",t]}),f.jsx("span",{style:Ev,children:n>0?`${n} changed`:"clean"}),r&&f.jsx(Rs,{size:"small",label:`Agent ${s}…`}),i&&f.jsx(Ce,{content:"Sign in from Settings → Connections so agent tasks can run",children:f.jsx("button",{type:"button",onClick:x,style:Rv,children:f.jsx(Te,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&f.jsx(Ce,{content:"Some features are disabled — open Setup to fix",children:f.jsx("button",{type:"button",onClick:x,style:Rv,children:f.jsxs(Te,{size:"small",variant:"warning",children:["Setup (",o,")"]})})}),a&&cf(a.status)!=="allowed"&&f.jsx(Ce,{content:BU(a),children:f.jsx(Te,{size:"small",variant:cf(a.status)==="rejected"?"error":"warning",children:cf(a.status)==="rejected"?"Claude limit reached":"Claude usage warning"})})]}),f.jsx("div",{style:KU}),v&&f.jsx("div",{style:Tv,children:v}),f.jsxs("div",{style:Tv,children:[f.jsx(Ce,{content:l==="clean-on-main"?"Already on clean main":"Sync to main",children:f.jsx(ne,{variant:"ghost",size:"small",icon:f.jsx(Mu,{}),style:_l,disabled:u||l==="clean-on-main",onClick:m,children:h?"Syncing…":"Sync to main"})}),f.jsx(Ce,{content:"Push commits to origin",children:f.jsx(ne,{variant:"ghost",size:"small",icon:f.jsx(VS,{}),style:_l,disabled:u||t===0,onClick:y,children:d?"Pushing…":t>0?`Push (${t})`:"Push"})}),f.jsx(Ce,{content:"Fast-forward the current branch from origin",children:f.jsx(ne,{variant:"ghost",size:"small",icon:f.jsx(US,{}),style:_l,disabled:u,onClick:w,children:p?"Pulling…":"Pull"})}),f.jsx(Ce,{content:"Commit all changes with an auto-suggested message",children:f.jsx(ne,{variant:"ghost",size:"small",icon:f.jsx(vU,{}),style:_l,disabled:c||n===0,onClick:g,children:c?"Committing…":n>0?`Commit (${n})`:"Commit"})})]})]}),qU=()=>{const e=L(P=>P.agentStatus),t=L(P=>P.gitStatus),n=L(P=>P.gitBranch),r=L(P=>P.gitAhead),s=L(P=>P.gitBranchHygiene),i=L(P=>P.quickCommit),o=L(P=>P.commitInFlight),a=L(_L),l=L(SL),c=L(CL),{pushing:u,syncing:d,pulling:h,gitActionBusy:p,handlePush:m,handleSync:y,handlePull:w}=Iu(),{toast:g}=He(),x=nn(),v=e.find(P=>P.status==="running"||P.status==="starting"||P.status==="stopping"),b=v!==void 0,S=(t==null?void 0:t.length)??0,k=async()=>{if(o||S===0)return;const P=await i();P.ok?g({title:"Committed",description:P.warning??P.title,variant:P.warning?"warning":"success"}):g({title:"Commit failed",description:P.error,variant:"error"})},T=()=>x({to:"/settings/$section",params:{section:"setup"}});return f.jsx(QU,{gitBranch:n,gitAhead:r,changedFileCount:S,agentActive:b,activeTaskStatus:v==null?void 0:v.status,agentNotSignedIn:l,capabilityGapCount:a,rateLimit:c,gitBranchHygiene:s,commitInFlight:o,gitActionBusy:p,pushing:u,syncing:d,pulling:h,onSync:y,onPush:m,onPull:w,onQuickCommit:k,onOpenSetup:T})},YU=({children:e})=>f.jsx("h1",{className:"text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1]",children:e}),XU=3*6e4,JU=(e,t)=>{const n=L(o=>o.loadPlans),r=e.thread??[],s=r[r.length-1],i=e.id;_.useEffect(()=>{if(!i||!s||s.kind!=="chat")return;const o=setTimeout(()=>{lA(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},XU);return()=>clearTimeout(o)},[t,i,s,n])},Ra=()=>{const e=L(i=>i.loadPlans),{toast:t}=He(),[n,r]=_.useState(!1);return{patch:async(i,o,a)=>{r(!0);try{return await EA(i,o),await e(),!0}catch(l){return t({title:(a==null?void 0:a.errorTitle)??"Update failed",description:l.message,variant:"error"}),!1}finally{r(!1)}},updating:n}},ZU=e=>{const t=L(a=>a.loadPlans),{toast:n}=He(),[r,s]=_.useState(null);return{promotingIndex:r,promoteToDurable:async(a,l)=>{if(!(!e.id||r!==null)){s(a);try{await Lx(e.id,a,l),await t()}catch(c){n({title:"Promote failed",description:We(c.message),variant:"error"})}finally{s(null)}}},promoteToIdea:async(a,l)=>{if(!e.id||r!==null)return!1;s(a);try{const c=await bk(l);return await Lx(e.id,a,"log",`Captured as ${c}: ${l.title}`).catch(()=>{}),await t(),!0}catch(c){return n({title:"Promote failed",description:We(c.message),variant:"error"}),!1}finally{s(null)}}}},Jh=.95,eW=3e4,Zh={implement:{from:0,to:.6},verify:{from:.6,to:.9},checkbox:{from:.95,to:.95}};function tW(e){const t=[...e].sort((r,s)=>r-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function nW(e){const t=e.filter(s=>s.taskKind==="phase"&&s.outcome==="done").map(s=>Date.parse(s.endedAt)-Date.parse(s.startedAt)).filter(s=>Number.isFinite(s)&&s>0);if(t.length===0)return{};const n=tW(t),r={};for(const s of["implement","verify"]){const i=Zh[s].to-Zh[s].from;r[s]=n*i/Jh}return r}function rW({anchor:e,anchorEnteredAt:t,lastStreamAt:n,now:r,medians:s}){if(!e)return 0;const i=Zh[e],o=Math.min(i.from,Jh),a=s==null?void 0:s[e];if(!a||a<=0||t===void 0||i.to===i.from)return o;const l=n===void 0?r:Math.min(r,n+eW),c=Math.min(1,Math.max(0,l-t)/a);return Math.min(i.from+c*(i.to-i.from),Jh)}const sW=new Set(["starting","running","stopping"]),iW=1e3;function oW(e,t){const n=e!==void 0&&e.phaseIndex!==void 0&&sW.has(e.status),[r,s]=_.useState(()=>Date.now());return _.useEffect(()=>{if(!n)return;const i=setInterval(()=>s(Date.now()),iW);return()=>clearInterval(i)},[n]),!n||(e==null?void 0:e.phaseIndex)===void 0?null:{index:e.phaseIndex,fraction:rW({anchor:e.phaseAnchor,anchorEnteredAt:e.anchorEnteredAt,lastStreamAt:e.lastStreamAt,now:r,medians:nW(t)})}}const aW=(e,{reload:t,notify:n})=>{const[r,s]=_.useState(!1),[i,o]=_.useState(!1),[a,l]=_.useState(null);return _.useEffect(()=>{l(null)},[e.id]),{sending:r,send:async d=>{if(!e.id)return!1;s(!0),l(null);try{const h={route:window.location.pathname,focusedIdeaId:e.id,viewport:{width:window.innerWidth,height:window.innerHeight}},{error:p,undo:m}=await aA(e.id,d,h);return await t(),m&&l(m),p&&n({title:"Agent did not reply",description:We(p),variant:"error"}),!0}catch(h){return n({title:"Message failed to send",description:We(h.message),variant:"error"}),!1}finally{s(!1)}},undo:a,undoing:i,undoEdit:async()=>{if(!(!e.id||!a)){o(!0);try{const{error:d}=await cA(e.id,a.commitSha);if(d){n({title:"Undo failed",description:We(d),variant:"error"});return}l(null),await t()}catch(d){n({title:"Undo failed",description:We(d.message),variant:"error"})}finally{o(!1)}}}}},lW=async e=>{const t=await fetch(K(`/api/trail?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},cW=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{if(n(null),!e)return;let r=!1;return lW(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t};function YS(){const[e,t]=_.useState("idle"),[n,r]=_.useState(null),s=_.useRef(null),i=_.useCallback(async a=>{s.current&&clearTimeout(s.current),t("loading"),r(null);try{await a(),t("success"),s.current=setTimeout(()=>{t("idle")},2e3)}catch(l){t("error"),r(l.message),s.current=setTimeout(()=>{t("idle"),r(null)},4e3)}},[]),o=_.useCallback(()=>{s.current&&clearTimeout(s.current),t("idle"),r(null)},[]);return{state:e,errorMessage:n,run:i,reset:o,loading:e==="loading",success:e==="success"}}const sg="Keep phases short: 3-7 phases, each a one-line imperative title. Add a description only when the phase isn't self-explanatory, and keep it to one sentence. Never restate the idea's body and never summarise the work you did.",XS="A title is a noun/verb phrase, at most 40 characters (roughly 3-6 words), no em-dash subtitles or trailing clauses — the symptom, mechanism, and detail belong in the body's first paragraph, not the title.";function uW(e){const t=e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
82
82
  `),n=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
83
83
  `):"(none)",r=e.clarifications&&e.clarifications.length>0?e.clarifications.map(s=>`- ${s.date}: ${s.text}`).join(`
84
84
  `):"(none)";return`You are auditing the plan "${e.title}" (${e.id??"no id"}) for missing phases. The plan is a single file at papercamp/ideas/${e.id??"<ID>"}.md — if it is not there, it is archived at papercamp/ideas/archive/${e.id??"<ID>"}.md. Edit only that file.
@@ -198,10 +198,10 @@ Task:
198
198
  Rules:
199
199
  - Append only — never modify, reorder, or delete any existing line in suggestions.md.
200
200
  - Never create papercamp/ideas/ files or touch ideas/index.md — a suggestion is not an idea until a human promotes it.
201
- - Never touch any other file in the repo.`}const Au=({idea:e,otherPlans:t})=>{const n=L(d=>d.launchPlanDraft),r=L(Jr),{state:s,errorMessage:i,run:o}=YS(),{toast:a}=We(),l=()=>{const d=e.id;d&&o(async()=>{try{await n(d,pW(e,t))}catch(h){throw a({title:"Draft failed",description:Ue(h.message),variant:"error"}),h}})},c=s==="loading"?"Drafting…":s==="success"?"Draft sent!":s==="error"?"Draft failed":"Draft plan",u=s==="error"?i??"Draft failed":e.id?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return f.jsx(Se,{content:u,children:f.jsx(te,{variant:"ghost",size:"small",onClick:l,disabled:s==="loading"||!e.id||!r,className:s==="error"?"text-watercolor-rose-dark":"text-ink-500",children:c})})},ZS=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=_.useRef(null),[s,i]=_.useState(!1),[o,a]=_.useState(!1);return _.useLayoutEffect(()=>i(!1),[n]),_.useLayoutEffect(()=>{if(s)return;const l=r.current;if(!l)return;const c=()=>a(l.scrollHeight-l.clientHeight>1);c();const u=new ResizeObserver(c);return u.observe(l),()=>u.disconnect()},[s,n]),f.jsxs("div",{children:[f.jsx("div",{ref:r,className:s?void 0:`line-clamp-[${t}]`,children:e}),o&&f.jsx("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":s,className:"self-start bg-none bg-transparent border-none py-1 px-0 [font:inherit] text-xs opacity-60 cursor-pointer underline",children:s?"Show less":"Show more"})]})},gW={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},yW=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>f.jsx(f.Fragment,{children:e.map((o,a)=>{const l=gW[o.kind],c=o.from==="agent",u=a===e.length-1,d=[{id:"decision",label:"Promote to decision",icon:f.jsx(tg,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:f.jsx(HS,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:f.jsx(AS,{size:16}),onSelect:()=>s==null?void 0:s(a,"idea")}];return f.jsxs("div",{className:`flex flex-col gap-1 ${c?"items-start":"items-end"}`,children:[f.jsx("div",{className:"max-w-[85%]",children:f.jsx(Te,{size:"small",surface:"paper",texture:c?"kraft":l?"canvas":"parchment",shade:c,accent:!c,accentColor:l?"rose":"blue",children:f.jsx(ZS,{collapsedLines:o.kind==="chat"?1:3,resetKey:`${o.kind}-${o.date??""}-${a}`,children:o.text})})}),f.jsxs("div",{className:"flex items-center gap-2",children:[c&&f.jsx(Ee,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&f.jsx(Se,{content:"Revert this run's plan edit",children:f.jsx(te,{size:"small",variant:"ghost",onClick:r,disabled:n,children:n?"Undoing…":"Undo"})}),o.date&&f.jsx("span",{className:"text-sm font-semibold opacity-[0.45]",children:o.date}),l&&f.jsx(Ee,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?f.jsx(Rs,{size:"small",label:"Promoting…"}):f.jsx(zS,{align:"end",trigger:f.jsx(Ct,{icon:f.jsx(WS,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:d}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),es=({id:e})=>e?f.jsx(Ee,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,eC={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},og={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},ir={idea:{fill:"rgba(138, 155, 168, 0.25)",text:"#5E7080"},planned:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},"in-progress":{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F"},review:{fill:"rgba(155, 122, 181, 0.25)",text:"#7B5E9E"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},tC={open:"Open",done:"Done",dropped:"Dropped"},Qc={open:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},xW={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},Nv={draft:{fill:"rgba(138, 155, 168, 0.25)",text:"#5E7080"},open:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},closed:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"},merged:{fill:"rgba(155, 122, 181, 0.25)",text:"#7B5E9E"}},vW={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},Iv={approved:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},"changes-requested":{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"},"review-required":{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F"}},nC=({pr:e})=>f.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:t=>t.stopPropagation(),className:"no-underline inline-flex",children:f.jsx(Ee,{size:"small",fillColor:Nv[e.state].fill,textColor:Nv[e.state].text,children:f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx(wU,{}),"#",e.number," ",xW[e.state]]})})}),rC=({pct:e,color:t,height:n=6})=>f.jsx(JV,{value:e,color:t,height:n}),Mv={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},Av={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},Sl=({reached:e,label:t,tooltip:n,href:r})=>{const s=f.jsx(Ee,{size:"small",fillColor:e?Mv.fill:Av.fill,textColor:e?Mv.text:Av.text,children:t}),i=r?f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),className:"no-underline inline-flex",children:s}):s;return n?f.jsx(Se,{content:n,children:i}):i},uf=()=>f.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),Lv=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function wW(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const bW=({trail:e,released:t})=>{var l,c;const{taskRuns:n,commits:r,pr:s,releaseLine:i}=e,o=i.data?wW(i.data):void 0,a=t?`Released ${t}`:o?`Released ${o.hash}`:"Release";return f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx(Sl,{reached:n.reached,label:n.data?Lv(n.data.length,"task run"):"Tasks",tooltip:(l=n.data)==null?void 0:l.map(u=>u.taskKind).join(", ")}),f.jsx(uf,{}),f.jsx(Sl,{reached:r.reached,label:r.data?Lv(r.data.length,"commit"):"Commits",tooltip:(c=r.data)==null?void 0:c.join(`
202
- `)}),f.jsx(uf,{}),s.data?f.jsx(nC,{pr:s.data}):f.jsx(Sl,{reached:!1,label:"PR"}),f.jsx(uf,{}),f.jsx(Sl,{reached:i.reached||!!t,label:a,tooltip:i.data,href:o==null?void 0:o.url})]})},kW=({pr:e})=>{const{reviewDecision:t,unresolvedThreadCount:n,hasNewCommentsSincePush:r}=e;return!t&&!n?null:f.jsxs("span",{className:"inline-flex items-center gap-2",children:[t&&f.jsx(Ee,{size:"small",fillColor:Iv[t].fill,textColor:Iv[t].text,children:vW[t]}),!!n&&f.jsxs(Ee,{size:"small",fillColor:ir["in-progress"].fill,textColor:ir["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},sC=({open:e,onClose:t,onAdd:n,initialContent:r})=>{const[s,i]=_.useState(""),[o,a]=_.useState(""),[l,c]=_.useState(!1),[u,d]=_.useState(!1),[h,p]=_.useState(null),[m,y]=_.useState(null),[w,g]=_.useState(!1),[x,v]=_.useState(null),[b,S]=_.useState(null),k=L(E=>{var F;return((F=E.plans)==null?void 0:F.entries)??[]}),{patch:T}=Ra(),P=nn(),R=GS(s,k.map(E=>({id:E.id,title:E.title,body:E.body,tags:E.tags,log:E.log})));_.useEffect(()=>{e&&(i(""),a(r??""),c(!1),d(!1),p(null),g(!1),v(null),S(null))},[e,r]);const j=E=>{t(),P({to:"/plans/$planId",params:{planId:encodeURIComponent(E)}})},I=async()=>{const E=`${s.trim()}${o.trim()?`
201
+ - Never touch any other file in the repo.`}const Au=({idea:e,otherPlans:t})=>{const n=L(d=>d.launchPlanDraft),r=L(Jr),{state:s,errorMessage:i,run:o}=YS(),{toast:a}=He(),l=()=>{const d=e.id;d&&o(async()=>{try{await n(d,pW(e,t))}catch(h){throw a({title:"Draft failed",description:We(h.message),variant:"error"}),h}})},c=s==="loading"?"Drafting…":s==="success"?"Draft sent!":s==="error"?"Draft failed":"Draft plan",u=s==="error"?i??"Draft failed":e.id?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return f.jsx(Ce,{content:u,children:f.jsx(ne,{variant:"ghost",size:"small",onClick:l,disabled:s==="loading"||!e.id||!r,className:s==="error"?"text-watercolor-rose-dark":"text-ink-500",children:c})})},ZS=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=_.useRef(null),[s,i]=_.useState(!1),[o,a]=_.useState(!1);return _.useLayoutEffect(()=>i(!1),[n]),_.useLayoutEffect(()=>{if(s)return;const l=r.current;if(!l)return;const c=()=>a(l.scrollHeight-l.clientHeight>1);c();const u=new ResizeObserver(c);return u.observe(l),()=>u.disconnect()},[s,n]),f.jsxs("div",{children:[f.jsx("div",{ref:r,className:s?void 0:`line-clamp-[${t}]`,children:e}),o&&f.jsx("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":s,className:"self-start bg-none bg-transparent border-none py-1 px-0 [font:inherit] text-xs opacity-60 cursor-pointer underline",children:s?"Show less":"Show more"})]})},gW={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},yW=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>f.jsx(f.Fragment,{children:e.map((o,a)=>{const l=gW[o.kind],c=o.from==="agent",u=a===e.length-1,d=[{id:"decision",label:"Promote to decision",icon:f.jsx(tg,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:f.jsx(HS,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:f.jsx(AS,{size:16}),onSelect:()=>s==null?void 0:s(a,"idea")}];return f.jsxs("div",{className:`flex flex-col gap-1 ${c?"items-start":"items-end"}`,children:[f.jsx("div",{className:"max-w-[85%]",children:f.jsx(Re,{size:"small",surface:"paper",texture:c?"kraft":l?"canvas":"parchment",shade:c,accent:!c,accentColor:l?"rose":"blue",children:f.jsx(ZS,{collapsedLines:o.kind==="chat"?1:3,resetKey:`${o.kind}-${o.date??""}-${a}`,children:o.text})})}),f.jsxs("div",{className:"flex items-center gap-2",children:[c&&f.jsx(Te,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&f.jsx(Ce,{content:"Revert this run's plan edit",children:f.jsx(ne,{size:"small",variant:"ghost",onClick:r,disabled:n,children:n?"Undoing…":"Undo"})}),o.date&&f.jsx("span",{className:"text-sm font-semibold opacity-[0.45]",children:o.date}),l&&f.jsx(Te,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?f.jsx(Rs,{size:"small",label:"Promoting…"}):f.jsx(zS,{align:"end",trigger:f.jsx(Ct,{icon:f.jsx(WS,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:d}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),es=({id:e})=>e?f.jsx(Te,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,eC={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},og={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},ir={idea:{fill:"rgba(138, 155, 168, 0.25)",text:"#5E7080"},planned:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},"in-progress":{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F"},review:{fill:"rgba(155, 122, 181, 0.25)",text:"#7B5E9E"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},tC={open:"Open",done:"Done",dropped:"Dropped"},Qc={open:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},xW={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},Nv={draft:{fill:"rgba(138, 155, 168, 0.25)",text:"#5E7080"},open:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},closed:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"},merged:{fill:"rgba(155, 122, 181, 0.25)",text:"#7B5E9E"}},vW={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},Iv={approved:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},"changes-requested":{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"},"review-required":{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F"}},nC=({pr:e})=>f.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:t=>t.stopPropagation(),className:"no-underline inline-flex",children:f.jsx(Te,{size:"small",fillColor:Nv[e.state].fill,textColor:Nv[e.state].text,children:f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx(wU,{}),"#",e.number," ",xW[e.state]]})})}),rC=({pct:e,color:t,height:n=6})=>f.jsx(JV,{value:e,color:t,height:n}),Mv={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},Av={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},Sl=({reached:e,label:t,tooltip:n,href:r})=>{const s=f.jsx(Te,{size:"small",fillColor:e?Mv.fill:Av.fill,textColor:e?Mv.text:Av.text,children:t}),i=r?f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),className:"no-underline inline-flex",children:s}):s;return n?f.jsx(Ce,{content:n,children:i}):i},uf=()=>f.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),Lv=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function wW(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const bW=({trail:e,released:t})=>{var l,c;const{taskRuns:n,commits:r,pr:s,releaseLine:i}=e,o=i.data?wW(i.data):void 0,a=t?`Released ${t}`:o?`Released ${o.hash}`:"Release";return f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx(Sl,{reached:n.reached,label:n.data?Lv(n.data.length,"task run"):"Tasks",tooltip:(l=n.data)==null?void 0:l.map(u=>u.taskKind).join(", ")}),f.jsx(uf,{}),f.jsx(Sl,{reached:r.reached,label:r.data?Lv(r.data.length,"commit"):"Commits",tooltip:(c=r.data)==null?void 0:c.join(`
202
+ `)}),f.jsx(uf,{}),s.data?f.jsx(nC,{pr:s.data}):f.jsx(Sl,{reached:!1,label:"PR"}),f.jsx(uf,{}),f.jsx(Sl,{reached:i.reached||!!t,label:a,tooltip:i.data,href:o==null?void 0:o.url})]})},kW=({pr:e})=>{const{reviewDecision:t,unresolvedThreadCount:n,hasNewCommentsSincePush:r}=e;return!t&&!n?null:f.jsxs("span",{className:"inline-flex items-center gap-2",children:[t&&f.jsx(Te,{size:"small",fillColor:Iv[t].fill,textColor:Iv[t].text,children:vW[t]}),!!n&&f.jsxs(Te,{size:"small",fillColor:ir["in-progress"].fill,textColor:ir["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},sC=({open:e,onClose:t,onAdd:n,initialContent:r})=>{const[s,i]=_.useState(""),[o,a]=_.useState(""),[l,c]=_.useState(!1),[u,d]=_.useState(!1),[h,p]=_.useState(null),[m,y]=_.useState(null),[w,g]=_.useState(!1),[x,v]=_.useState(null),[b,S]=_.useState(null),k=L(E=>{var F;return((F=E.plans)==null?void 0:F.entries)??[]}),{patch:T}=Ra(),P=nn(),R=GS(s,k.map(E=>({id:E.id,title:E.title,body:E.body,tags:E.tags,log:E.log})));_.useEffect(()=>{e&&(i(""),a(r??""),c(!1),d(!1),p(null),g(!1),v(null),S(null))},[e,r]);const j=E=>{t(),P({to:"/plans/$planId",params:{planId:encodeURIComponent(E)}})},I=async()=>{const E=`${s.trim()}${o.trim()?`
203
203
 
204
- ${o.trim()}`:""}`;if(E){g(!0),S(null),v(null);try{const F=k.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));v(await kk(E,F))}catch(F){S(F.message)}finally{g(!1)}}},M=E=>{const F=k.find(V=>V.id===E);F&&j(F.title)},O=async(E,F,V)=>{y(E);const B={date:new Date().toISOString().slice(0,10),text:s.trim()},C=await T(F,{log:[...V??[],B]},{errorTitle:"Extend failed"});y(null),C&&t()},z=async E=>{if(E.preventDefault(),!(!s.trim()||u)){p(null),d(!0);try{await n({title:s.trim(),content:o.trim()||void 0,kind:l?"note":void 0}),t()}catch(F){p(F.message)}finally{d(!1)}}};return f.jsx(Ta,{open:e,onClose:t,title:"New idea",size:"small",children:f.jsxs("form",{onSubmit:z,className:"flex flex-col gap-4",children:[f.jsx(Ea,{label:"Title",value:s,onChange:E=>i(E.target.value),placeholder:"Idea title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:u,autoFocus:!0,required:!0}),R.length>0&&f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),R.map(({candidate:E})=>{const F={id:E.id??null,title:E.title,body:E.body,log:E.log},V=k.filter(A=>A.id!==E.id);return f.jsx(Te,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(es,{id:E.id}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:E.title})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",size:"small",onClick:()=>j(E.title),children:"Open it"}),f.jsx(te,{type:"button",variant:"ghost",size:"small",disabled:!E.id||!s.trim()||m!==null,onClick:()=>E.id&&O(E.id,E.title,E.log),children:m===E.id?"Extending…":"Extend it instead"}),f.jsx(Au,{idea:F,otherPlans:V})]})]})},E.id??E.title)})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{children:f.jsx(te,{type:"button",variant:"ghost",size:"small",disabled:!s.trim()||w,onClick:I,children:w?"Checking overlap…":"Check overlap"})}),b&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:b}),x&&f.jsx(Te,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"font-semibold",children:x.verdict==="new"?"Looks genuinely new":x.verdict==="extend"?`Extends ${x.targetId??"an existing idea"}`:`Belongs inside ${x.targetId??"an existing idea"}`}),f.jsx("span",{className:"text-sm opacity-80",children:x.reasoning}),x.targetId&&f.jsx("div",{className:"flex justify-end",children:f.jsx(te,{type:"button",variant:"ghost",size:"small",onClick:()=>M(x.targetId),children:"Open it"})})]})})]}),f.jsx(Nu,{label:"Description",value:o,onChange:E=>a(E.target.value),placeholder:"Optional details…",disabled:u,rows:4}),f.jsx(V6,{label:"Just a note (no plan needed)",checked:l,onChange:E=>c(E.target.checked),disabled:u}),h&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:h}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),f.jsx(te,{type:"submit",variant:"primary",disabled:!s.trim()||u,children:"Add"})]})]})})},_W=({suggestion:e,onClose:t})=>{const n=L(u=>u.promoteSuggestion),r=L(u=>u.launchIdeaExtend),[s,i]=_.useState(!1),[o,a]=_.useState(null),{toast:l}=We();_.useEffect(()=>{e&&(i(!1),a(null))},[e]);const c=async()=>{if(e){i(!0),a(null);try{const u=await n(e),d=L.getState().ideaEntries.find(h=>h.id===u);if(d)try{await r(u,hW(d))}catch(h){l({title:"Idea created, but the refine agent failed to launch",description:Ue(h.message),variant:"error"})}t()}catch(u){a(u.message)}finally{i(!1)}}};return f.jsx(Ta,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsx("p",{className:"m-0 opacity-80",children:e==null?void 0:e.description}),o&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),f.jsx(te,{type:"button",variant:"primary",onClick:c,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},df=({tokens:e})=>f.jsx(f.Fragment,{children:e.map((t,n)=>{if(t.type==="same")return f.jsx("span",{children:t.text},`${t.type}-${n}`);const r=t.type==="added";return f.jsx("span",{className:r?"bg-watercolor-green/[30%] text-watercolor-green-dark no-underline":"bg-watercolor-rose/[30%] text-watercolor-rose-dark line-through",children:t.text},`${t.type}-${n}`)})}),Dv=e=>f.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),SW=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:s})=>{const[i,o]=_.useState(!1),[a,l]=_.useState(!1),c=e.body!==t.body,u=e.phases.map((m,y)=>({phase:m,before:t.phases[y],index:y})).filter(({phase:m,before:y})=>y!==void 0&&(m.text!==y.text||(m.description??"")!==(y.description??""))),d=i||a,h=async()=>{if(!d){o(!0);try{await r()}finally{o(!1)}}},p=async()=>{l(!0);try{await n()}finally{l(!1)}};return f.jsx(Ta,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:d?()=>{}:h,children:f.jsxs("div",{className:"flex flex-col gap-5",children:[f.jsxs("p",{className:"text-sm m-0 opacity-70",children:['The reconcile agent proposed the rewrite below for "',e.title,'". Approve to keep it, or discard to revert to the prior wording.']}),!c&&u.length===0&&f.jsx("p",{className:"text-sm m-0 opacity-60",children:"No wording changed."}),c&&f.jsxs("div",{children:[Dv("Body"),f.jsx("p",{className:"text-base m-0 leading-normal",children:f.jsx(df,{tokens:Nd(t.body,e.body)})})]}),u.length>0&&f.jsxs("div",{children:[Dv("Phases"),f.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:y,index:w})=>f.jsxs("div",{className:"text-sm leading-normal",children:[f.jsx(df,{tokens:Nd(y.text,m.text)}),(m.description||y.description)&&f.jsx("div",{className:"opacity-[0.85] mt-1",children:f.jsx(df,{tokens:Nd(y.description??"",m.description??"")})})]},w))})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{variant:"danger",size:"small",onClick:h,disabled:d,children:"Discard"}),f.jsx(te,{variant:"primary",size:"small",onClick:p,disabled:d,children:"Approve"})]})]})})},CW=({onOpenIdea:e})=>{const t=L(d=>d.archivableIdeas),n=L(d=>d.archiveIdeas),[r,s]=_.useState(null),[i,o]=_.useState(!1),{toast:a}=We(),l=_.useCallback(async d=>{try{await n(d)}catch(h){a({title:"Archive failed",description:h.message,variant:"error"})}},[n,a]),c=_.useCallback(async d=>{s(d.id);try{await l([d.id])}finally{s(null)}},[l]),u=_.useCallback(async()=>{o(!0);try{await l(t.map(d=>d.id))}finally{o(!1)}},[l,t]);return t.length===0?null:f.jsxs("div",{className:"mt-5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[f.jsxs("h2",{className:"text-sm m-0 opacity-60",children:["Ready to archive (",t.length,")"]}),f.jsx(te,{variant:"ghost",size:"small",disabled:i||r!==null,onClick:u,children:i?"Archiving…":"Archive all"})]}),f.jsx("div",{className:"flex flex-col gap-1",children:t.map(d=>f.jsx("div",{className:"rounded-[10px]",children:f.jsx(Te,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("div",{role:e?"button":void 0,tabIndex:e?0:void 0,onClick:e?()=>e(d.title):void 0,onKeyDown:e?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),e(d.title))}:void 0,className:`flex items-center gap-2 flex-1 min-w-0 ${e?"cursor-pointer":""}`,children:[f.jsx(es,{id:d.id}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:d.title})]}),f.jsx(te,{variant:"ghost",size:"small",disabled:r===d.id||i,onClick:()=>c(d),children:r===d.id?"Archiving…":"Archive"})]})})},d.id))})]})},PW="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]";function Fv(e,t){return e.toFixed(t).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function iC(e){const t=Math.round(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60;return n>0?r>0?`${n}h${r}m`:`${n}h`:r>0?s>0?`${r}m${s}s`:`${r}m`:`${s}s`}function di(e){return e>=1e6?`${Fv(e/1e6,1)}M`:e>=1e3?`${Fv(e/1e3,1)}k`:`${Math.round(e)}`}function jW(e,t){var s;const n={runs:0,durationMs:0,inputTokens:0,outputTokens:0,cacheCreationTokens:0,cacheReadTokens:0},r=i=>{n.runs+=1,n.durationMs+=i.durationMs,n.inputTokens+=i.inputTokens,n.outputTokens+=i.outputTokens,n.cacheCreationTokens+=i.cacheCreationTokens,n.cacheReadTokens+=i.cacheReadTokens};for(const i of e)if(!(t&&i.planId!==t))if((s=i.phaseRuns)!=null&&s.length)for(const o of i.phaseRuns)r(o.usage);else i.usage&&r(i.usage);return n}const EW=({onAdd:e,disabled:t})=>{const[n,r]=_.useState(!1),[s,i]=_.useState(""),[o,a]=_.useState(null),[l,c]=_.useState(!1),u=()=>{r(!1),i(""),a(null)},d=async()=>{let h;try{h=rL(s)}catch(p){a(p instanceof Error?p.message:"Could not parse findings");return}c(!0),a(null);try{await e(h),u()}finally{c(!1)}};return f.jsxs(f.Fragment,{children:[f.jsx(Se,{content:"Add code-review findings as phases",children:f.jsx(Ct,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:f.jsx(N4,{size:16})})}),f.jsx(Ta,{open:n,onClose:u,title:"Add code-review findings",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("p",{className:"text-sm m-0 opacity-70",children:["Paste the JSON findings from a ",f.jsx("code",{children:"/code-review"})," run. Each finding becomes a new, unchecked phase on this plan."]}),f.jsx(Nu,{value:s,onChange:h=>i(h.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:l}),o&&f.jsxs(FS,{variant:"warning",children:["Could not add phases — ",o]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",onClick:u,disabled:l,children:"Cancel"}),f.jsx(te,{type:"button",variant:"primary",onClick:d,disabled:l||!s.trim(),children:"Add phases"})]})]})})]})},TW=zA.map(e=>({value:e,label:e})),RW=({open:e,onClose:t,onAdd:n})=>{const[r,s]=_.useState(""),[i,o]=_.useState(""),[a,l]=_.useState("feat"),[c,u]=_.useState(!1),[d,h]=_.useState(null),[p,m]=_.useState(null),[y,w]=_.useState(!1),[g,x]=_.useState(null),[v,b]=_.useState(null),S=L(E=>{var F;return((F=E.plans)==null?void 0:F.entries)??[]}),{patch:k}=Ra(),T=nn(),{toast:P}=We(),R=GS(r,S.map(E=>({id:E.id,title:E.title,body:E.body,tags:E.tags,log:E.log})));_.useEffect(()=>{e&&(s(""),o(""),l("feat"),u(!1),h(null),w(!1),x(null),b(null))},[e]),_.useEffect(()=>{x(null),b(null)},[r,i]);const j=E=>{t(),T({to:"/plans/$planId",params:{planId:encodeURIComponent(E)}})},I=async()=>{const E=`${r.trim()}${i.trim()?`
204
+ ${o.trim()}`:""}`;if(E){g(!0),S(null),v(null);try{const F=k.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));v(await kk(E,F))}catch(F){S(F.message)}finally{g(!1)}}},M=E=>{const F=k.find(V=>V.id===E);F&&j(F.title)},O=async(E,F,V)=>{y(E);const B={date:new Date().toISOString().slice(0,10),text:s.trim()},C=await T(F,{log:[...V??[],B]},{errorTitle:"Extend failed"});y(null),C&&t()},z=async E=>{if(E.preventDefault(),!(!s.trim()||u)){p(null),d(!0);try{await n({title:s.trim(),content:o.trim()||void 0,kind:l?"note":void 0}),t()}catch(F){p(F.message)}finally{d(!1)}}};return f.jsx(Ta,{open:e,onClose:t,title:"New idea",size:"small",children:f.jsxs("form",{onSubmit:z,className:"flex flex-col gap-4",children:[f.jsx(Ea,{label:"Title",value:s,onChange:E=>i(E.target.value),placeholder:"Idea title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:u,autoFocus:!0,required:!0}),R.length>0&&f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),R.map(({candidate:E})=>{const F={id:E.id??null,title:E.title,body:E.body,log:E.log},V=k.filter(A=>A.id!==E.id);return f.jsx(Re,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(es,{id:E.id}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:E.title})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",size:"small",onClick:()=>j(E.title),children:"Open it"}),f.jsx(ne,{type:"button",variant:"ghost",size:"small",disabled:!E.id||!s.trim()||m!==null,onClick:()=>E.id&&O(E.id,E.title,E.log),children:m===E.id?"Extending…":"Extend it instead"}),f.jsx(Au,{idea:F,otherPlans:V})]})]})},E.id??E.title)})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{children:f.jsx(ne,{type:"button",variant:"ghost",size:"small",disabled:!s.trim()||w,onClick:I,children:w?"Checking overlap…":"Check overlap"})}),b&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:b}),x&&f.jsx(Re,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"font-semibold",children:x.verdict==="new"?"Looks genuinely new":x.verdict==="extend"?`Extends ${x.targetId??"an existing idea"}`:`Belongs inside ${x.targetId??"an existing idea"}`}),f.jsx("span",{className:"text-sm opacity-80",children:x.reasoning}),x.targetId&&f.jsx("div",{className:"flex justify-end",children:f.jsx(ne,{type:"button",variant:"ghost",size:"small",onClick:()=>M(x.targetId),children:"Open it"})})]})})]}),f.jsx(Nu,{label:"Description",value:o,onChange:E=>a(E.target.value),placeholder:"Optional details…",disabled:u,rows:4}),f.jsx(V6,{label:"Just a note (no plan needed)",checked:l,onChange:E=>c(E.target.checked),disabled:u}),h&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:h}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),f.jsx(ne,{type:"submit",variant:"primary",disabled:!s.trim()||u,children:"Add"})]})]})})},_W=({suggestion:e,onClose:t})=>{const n=L(u=>u.promoteSuggestion),r=L(u=>u.launchIdeaExtend),[s,i]=_.useState(!1),[o,a]=_.useState(null),{toast:l}=He();_.useEffect(()=>{e&&(i(!1),a(null))},[e]);const c=async()=>{if(e){i(!0),a(null);try{const u=await n(e),d=L.getState().ideaEntries.find(h=>h.id===u);if(d)try{await r(u,hW(d))}catch(h){l({title:"Idea created, but the refine agent failed to launch",description:We(h.message),variant:"error"})}t()}catch(u){a(u.message)}finally{i(!1)}}};return f.jsx(Ta,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsx("p",{className:"m-0 opacity-80",children:e==null?void 0:e.description}),o&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),f.jsx(ne,{type:"button",variant:"primary",onClick:c,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},df=({tokens:e})=>f.jsx(f.Fragment,{children:e.map((t,n)=>{if(t.type==="same")return f.jsx("span",{children:t.text},`${t.type}-${n}`);const r=t.type==="added";return f.jsx("span",{className:r?"bg-watercolor-green/[30%] text-watercolor-green-dark no-underline":"bg-watercolor-rose/[30%] text-watercolor-rose-dark line-through",children:t.text},`${t.type}-${n}`)})}),Dv=e=>f.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),SW=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:s})=>{const[i,o]=_.useState(!1),[a,l]=_.useState(!1),c=e.body!==t.body,u=e.phases.map((m,y)=>({phase:m,before:t.phases[y],index:y})).filter(({phase:m,before:y})=>y!==void 0&&(m.text!==y.text||(m.description??"")!==(y.description??""))),d=i||a,h=async()=>{if(!d){o(!0);try{await r()}finally{o(!1)}}},p=async()=>{l(!0);try{await n()}finally{l(!1)}};return f.jsx(Ta,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:d?()=>{}:h,children:f.jsxs("div",{className:"flex flex-col gap-5",children:[f.jsxs("p",{className:"text-sm m-0 opacity-70",children:['The reconcile agent proposed the rewrite below for "',e.title,'". Approve to keep it, or discard to revert to the prior wording.']}),!c&&u.length===0&&f.jsx("p",{className:"text-sm m-0 opacity-60",children:"No wording changed."}),c&&f.jsxs("div",{children:[Dv("Body"),f.jsx("p",{className:"text-base m-0 leading-normal",children:f.jsx(df,{tokens:Nd(t.body,e.body)})})]}),u.length>0&&f.jsxs("div",{children:[Dv("Phases"),f.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:y,index:w})=>f.jsxs("div",{className:"text-sm leading-normal",children:[f.jsx(df,{tokens:Nd(y.text,m.text)}),(m.description||y.description)&&f.jsx("div",{className:"opacity-[0.85] mt-1",children:f.jsx(df,{tokens:Nd(y.description??"",m.description??"")})})]},w))})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{variant:"danger",size:"small",onClick:h,disabled:d,children:"Discard"}),f.jsx(ne,{variant:"primary",size:"small",onClick:p,disabled:d,children:"Approve"})]})]})})},CW=({onOpenIdea:e})=>{const t=L(d=>d.archivableIdeas),n=L(d=>d.archiveIdeas),[r,s]=_.useState(null),[i,o]=_.useState(!1),{toast:a}=He(),l=_.useCallback(async d=>{try{await n(d)}catch(h){a({title:"Archive failed",description:h.message,variant:"error"})}},[n,a]),c=_.useCallback(async d=>{s(d.id);try{await l([d.id])}finally{s(null)}},[l]),u=_.useCallback(async()=>{o(!0);try{await l(t.map(d=>d.id))}finally{o(!1)}},[l,t]);return t.length===0?null:f.jsxs("div",{className:"mt-5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[f.jsxs("h2",{className:"text-sm m-0 opacity-60",children:["Ready to archive (",t.length,")"]}),f.jsx(ne,{variant:"ghost",size:"small",disabled:i||r!==null,onClick:u,children:i?"Archiving…":"Archive all"})]}),f.jsx("div",{className:"flex flex-col gap-1",children:t.map(d=>f.jsx("div",{className:"rounded-[10px]",children:f.jsx(Re,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("div",{role:e?"button":void 0,tabIndex:e?0:void 0,onClick:e?()=>e(d.title):void 0,onKeyDown:e?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),e(d.title))}:void 0,className:`flex items-center gap-2 flex-1 min-w-0 ${e?"cursor-pointer":""}`,children:[f.jsx(es,{id:d.id}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:d.title})]}),f.jsx(ne,{variant:"ghost",size:"small",disabled:r===d.id||i,onClick:()=>c(d),children:r===d.id?"Archiving…":"Archive"})]})})},d.id))})]})},PW="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]";function Fv(e,t){return e.toFixed(t).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function iC(e){const t=Math.round(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60;return n>0?r>0?`${n}h${r}m`:`${n}h`:r>0?s>0?`${r}m${s}s`:`${r}m`:`${s}s`}function di(e){return e>=1e6?`${Fv(e/1e6,1)}M`:e>=1e3?`${Fv(e/1e3,1)}k`:`${Math.round(e)}`}function jW(e,t){var s;const n={runs:0,durationMs:0,inputTokens:0,outputTokens:0,cacheCreationTokens:0,cacheReadTokens:0},r=i=>{n.runs+=1,n.durationMs+=i.durationMs,n.inputTokens+=i.inputTokens,n.outputTokens+=i.outputTokens,n.cacheCreationTokens+=i.cacheCreationTokens,n.cacheReadTokens+=i.cacheReadTokens};for(const i of e)if(!(t&&i.planId!==t))if((s=i.phaseRuns)!=null&&s.length)for(const o of i.phaseRuns)r(o.usage);else i.usage&&r(i.usage);return n}const EW=({onAdd:e,disabled:t})=>{const[n,r]=_.useState(!1),[s,i]=_.useState(""),[o,a]=_.useState(null),[l,c]=_.useState(!1),u=()=>{r(!1),i(""),a(null)},d=async()=>{let h;try{h=rL(s)}catch(p){a(p instanceof Error?p.message:"Could not parse findings");return}c(!0),a(null);try{await e(h),u()}finally{c(!1)}};return f.jsxs(f.Fragment,{children:[f.jsx(Ce,{content:"Add code-review findings as phases",children:f.jsx(Ct,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:f.jsx(N4,{size:16})})}),f.jsx(Ta,{open:n,onClose:u,title:"Add code-review findings",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("p",{className:"text-sm m-0 opacity-70",children:["Paste the JSON findings from a ",f.jsx("code",{children:"/code-review"})," run. Each finding becomes a new, unchecked phase on this plan."]}),f.jsx(Nu,{value:s,onChange:h=>i(h.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:l}),o&&f.jsxs(FS,{variant:"warning",children:["Could not add phases — ",o]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",onClick:u,disabled:l,children:"Cancel"}),f.jsx(ne,{type:"button",variant:"primary",onClick:d,disabled:l||!s.trim(),children:"Add phases"})]})]})})]})},TW=zA.map(e=>({value:e,label:e})),RW=({open:e,onClose:t,onAdd:n})=>{const[r,s]=_.useState(""),[i,o]=_.useState(""),[a,l]=_.useState("feat"),[c,u]=_.useState(!1),[d,h]=_.useState(null),[p,m]=_.useState(null),[y,w]=_.useState(!1),[g,x]=_.useState(null),[v,b]=_.useState(null),S=L(E=>{var F;return((F=E.plans)==null?void 0:F.entries)??[]}),{patch:k}=Ra(),T=nn(),{toast:P}=He(),R=GS(r,S.map(E=>({id:E.id,title:E.title,body:E.body,tags:E.tags,log:E.log})));_.useEffect(()=>{e&&(s(""),o(""),l("feat"),u(!1),h(null),w(!1),x(null),b(null))},[e]),_.useEffect(()=>{x(null),b(null)},[r,i]);const j=E=>{t(),T({to:"/plans/$planId",params:{planId:encodeURIComponent(E)}})},I=async()=>{const E=`${r.trim()}${i.trim()?`
205
205
 
206
- ${i.trim()}`:""}`;if(E){w(!0),b(null),x(null);try{const F=S.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));x(await kk(E,F))}catch(F){b(F.message)}finally{w(!1)}}},M=E=>{const F=S.find(V=>V.id===E);F?j(F.title):P({title:"Plan not found",description:`No plan with id ${E}`,variant:"error"})},O=async(E,F,V)=>{m(E);const B={date:new Date().toISOString().slice(0,10),text:r.trim()},C=await k(F,{log:[...V??[],B]},{errorTitle:"Extend failed"});m(null),C&&t()},z=async E=>{if(E.preventDefault(),!(!r.trim()||c)){h(null),u(!0);try{await n({title:r.trim(),content:i.trim()||void 0,kind:a}),t()}catch(F){h(F.message)}finally{u(!1)}}};return f.jsx(Ta,{open:e,onClose:t,title:"Quick plan",size:"small",children:f.jsxs("form",{onSubmit:z,className:"flex flex-col gap-4",children:[f.jsx(Ea,{label:"Title",value:r,onChange:E=>s(E.target.value),placeholder:"Backlog item title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:c,autoFocus:!0,required:!0}),R.length>0&&f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),R.map(({candidate:E})=>{const F={id:E.id??null,title:E.title,body:E.body,log:E.log},V=S.filter(A=>A.id!==E.id);return f.jsx(Te,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(es,{id:E.id}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:E.title})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",size:"small",onClick:()=>j(E.title),children:"Open it"}),f.jsx(te,{type:"button",variant:"ghost",size:"small",disabled:!E.id||!r.trim()||p!==null,onClick:()=>E.id&&O(E.id,E.title,E.log),children:p===E.id?"Extending…":"Extend it instead"}),f.jsx(Au,{idea:F,otherPlans:V})]})]})},E.id??E.title)})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{children:f.jsx(te,{type:"button",variant:"ghost",size:"small",disabled:!r.trim()||y,onClick:I,children:y?"Checking overlap…":"Check overlap"})}),v&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:v}),g&&f.jsx(Te,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"font-semibold",children:g.verdict==="new"?"Looks genuinely new":g.verdict==="extend"?`Extends ${g.targetId??"an existing idea"}`:`Belongs inside ${g.targetId??"an existing idea"}`}),f.jsx("span",{className:"text-sm opacity-80",children:g.reasoning}),g.targetId&&f.jsx("div",{className:"flex justify-end",children:f.jsx(te,{type:"button",variant:"ghost",size:"small",onClick:()=>M(g.targetId),children:"Open it"})})]})})]}),f.jsx(LS,{label:"Kind",value:a,onChange:E=>l(E),options:TW,disabled:c}),f.jsx(Nu,{label:"Description",value:i,onChange:E=>o(E.target.value),placeholder:"Optional details…",disabled:c,rows:4}),d&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",onClick:t,disabled:c,children:"Cancel"}),f.jsx(te,{type:"submit",variant:"primary",disabled:!r.trim()||c,children:"Add"})]})]})})},NW=()=>f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M10 6h10M10 12h10M10 18h10"}),f.jsx("path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"})]}),IW=()=>{const e=L(o=>o.loadPlans),t=L(o=>o.gitBranchHygiene),[n,r]=_.useState(!1),s=t==="stale-merged",i=async o=>{await jA(o),await e(),r(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(Se,{content:s?"Switch to main first":void 0,children:f.jsx(Ct,{icon:f.jsx(NW,{}),variant:"ghost",size:"small",label:s?"Switch to main first":"Quick plan",disabled:s,onClick:()=>r(!0)})}),f.jsx(RW,{open:n,onClose:()=>r(!1),onAdd:i})]})},MW=({planId:e,phaseIndex:t,disabled:n})=>{const r=L(u=>u.launchAgent),s=L(Jr),{toast:i}=We(),[o,a]=_.useState(!1),l=async u=>{if(u.stopPropagation(),!!e){a(!0);try{await r(e,t)}catch(d){i({title:"Failed to start agent",description:Ue(d.message),variant:"error"})}finally{a(!1)}}},c=e?s?"Start agent on this phase":"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ct,{icon:f.jsx("span",{className:"text-xs leading-none",children:"▶"}),variant:"ghost",size:"small",label:c,onClick:l,disabled:n||o||!e||!s,className:"transition-opacity text-ink-500"})},AW=({plan:e,disabled:t})=>{const n=L(l=>l.launchPlanAudit),r=L(Jr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,uW(e))}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Se,{content:a,children:f.jsx(te,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})},ag=({idea:e,compact:t})=>{const n=L(h=>h.launchIdeaExtend),r=L(Jr),{state:s,errorMessage:i,run:o}=YS(),{toast:a}=We(),l=e.id,c=()=>{l&&o(async()=>{const h=L.getState().ideaEntries.find(p=>p.id===l);if(!h)throw new Error(`Idea ${l} not found`);try{await n(l,fW(h))}catch(p){throw a({title:"Extension failed",description:Ue(p.message),variant:"error"}),p}})},u=s==="loading"?"Extending…":s==="success"?t?"Sent!":"Extension sent!":s==="error"?"Extension failed":t?"Extend":"Extend with AI",d=s==="error"?i??"Extension failed":l?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return f.jsx(Se,{content:d,children:f.jsx(te,{variant:"ghost",size:"small",onClick:c,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:u})})},LW=({plan:e,disabled:t})=>{const n=L(u=>u.launchFixReview),r=L(Jr),s=L(kL),[i,o]=_.useState(!1),a=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(u){alert(u.message)}finally{o(!1)}}},l=t||i||!e.id||!r||!s,c=e.id?s?r?void 0:"No agent CLI found — set up in Settings":"GitHub CLI needs authentication — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Se,{content:c,children:f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-watercolor-amber-dark",children:"⚑"}),onClick:a,disabled:l,className:`text-xs leading-4 py-2 ${l?"opacity-50":""}`,children:i?"Starting…":"Fix review comments"})})},DW=()=>{const e=L(s=>s.loadIdeas),[t,n]=_.useState(!1),r=async s=>{await bk(s),await e(),n(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(te,{icon:f.jsx(AS,{size:16}),size:"small",onClick:()=>n(!0),children:"New idea"}),f.jsx(sC,{open:t,onClose:()=>n(!1),onAdd:r})]})};async function FW(e){var r;if((r=navigator.clipboard)!=null&&r.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return document.body.removeChild(t),n}const OW=({planTitle:e,planId:t,phaseIndex:n})=>{const[r,s]=_.useState("idle"),i=async o=>{o.stopPropagation();const a=`Start phase ${n+1} of plan "${e}" in papercamp/ideas/${t??"<ID>"}.md`,l=await FW(a);s(l?"copied":"failed"),setTimeout(()=>s("idle"),1500)};return f.jsx(Ct,{icon:r==="copied"?f.jsx(tg,{size:16}):r==="failed"?f.jsx(ja,{size:16}):f.jsx(T4,{size:16}),variant:"ghost",size:"small",label:r==="copied"?"Copied":r==="failed"?"Copy failed — select and copy manually":"Copy phase prompt",onClick:i,className:`transition-opacity ${r==="copied"?"text-state-success":r==="failed"?"text-state-danger":"text-ink-500"}`})},zW=({plan:e,disabled:t})=>{const n=L(l=>l.launchPlanReconcile),r=L(Jr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,dW(e),{body:e.body,phases:e.phases})}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Se,{content:a,children:f.jsx(te,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},$W=()=>{const e=L(s=>s.refreshAll),t=L(s=>s.refreshing),{toast:n}=We(),r=async()=>{if(t)return;const s=await e();s.ok?n({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):n({title:"Couldn't refresh",description:s.error??"The read failed — is the dev server running?",variant:"error"})};return f.jsx(Ct,{icon:f.jsx("span",{className:`inline-flex${t?" animate-pc-spin motion-reduce:animate-none":""}`,children:f.jsx(yU,{size:16})}),label:t?"Refreshing…":"Refresh data",size:"small",variant:"ghost",disabled:t,onClick:r})},BW=({plan:e,disabled:t})=>{const n=L(c=>c.launchRunAll),r=L(Jr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id)}catch(c){alert(c.message)}finally{i(!1)}}},a=t||s||!e.id||!r,l=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Se,{content:l,children:f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-ink-500",children:"▶"}),onClick:o,disabled:a,className:`text-xs leading-4 py-2 ${a?"opacity-50":""}`,children:s?"Starting…":"Run all phases"})})},VW=()=>{const e=L(y=>y.launchSuggestIdeas),t=L(y=>y.launchBatchReconcile),n=L(y=>y.launchPrioritise),r=L(y=>y.ideaEntries),s=L(y=>y.suggestions),i=L(bm),o=L(Jr),{toast:a}=We(),[l,c]=_.useState(null),u=async()=>{c("suggest");try{await e(mW(r,s))}catch(y){a({title:"Failed to launch",description:Ue(y.message),variant:"error"})}finally{c(null)}},d=async()=>{c("reconcile");try{await t()}catch(y){a({title:"Failed to launch",description:Ue(y.message),variant:"error"})}finally{c(null)}},h=async()=>{c("prioritise");try{const y=await n();a({title:y.moved.length>0?"Queue reordered":"Already in order",description:y.why||void 0,variant:"success"})}catch(y){a({title:"Failed to prioritise",description:Ue(y.message),variant:"error"})}finally{c(null)}},p=l!==null||i,m=[{id:"suggest-ideas",label:l==="suggest"?"Starting…":"Suggest ideas",icon:f.jsx(BS,{size:16}),disabled:p||!o,onSelect:u},{id:"reconcile-all",label:l==="reconcile"?"Starting…":"Reconcile all",icon:f.jsx(tg,{size:16}),disabled:p||!o,onSelect:d},{id:"prioritise",label:l==="prioritise"?"Prioritising…":"Prioritise queue",icon:f.jsx(xU,{size:16}),disabled:p||!o,onSelect:h}];return f.jsx(zS,{align:"end",trigger:f.jsx(Ct,{icon:f.jsx(WS,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:m})};function UW(e){const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null}const Lu="font-display-luminari text-sm font-semibold opacity-[0.65]",WW=({rollup:e})=>e.runs===0?null:f.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-[0.55] mb-4 flex-wrap",children:[f.jsx("span",{className:"font-semibold opacity-[0.85]",children:"Run cost"}),f.jsx("span",{"aria-hidden":!0,children:"·"}),f.jsxs("span",{children:[e.runs," ",e.runs===1?"run":"runs"]}),f.jsx("span",{"aria-hidden":!0,children:"·"}),f.jsx("span",{children:iC(e.durationMs)}),f.jsx("span",{"aria-hidden":!0,children:"·"}),f.jsx(Se,{content:`Cache: ${di(e.cacheCreationTokens)} write · ${di(e.cacheReadTokens)} read`,children:f.jsxs("span",{children:[di(e.inputTokens)," in · ",di(e.outputTokens)," out"]})})]}),HW=({plan:e,auditRunning:t,agentBusy:n,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o,onAddReviewPhases:a})=>{const l=L(p=>p.launchRunAll),c=e.fixes??[],u=c.some(p=>!p.done),d=[...e.phases.map((p,m)=>({kind:"phase",item:p,index:m})),...c.map((p,m)=>({kind:"fix",item:p,index:m}))],h=p=>p.kind==="phase"&&!p.item.done&&(r==null?void 0:r.index)===p.index;return f.jsxs("div",{className:"mb-8",style:r?{"--phase-fill":`${r.fraction*100}%`}:void 0,children:[f.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[f.jsx("h3",{className:`${Lu} m-0`,children:"Phases"}),f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t&&f.jsx(Rs,{size:"small",label:"Audit running…"}),(e.status==="review"||e.status==="done")&&f.jsx(AW,{plan:e}),e.status!=="done"&&f.jsx(zW,{plan:e}),f.jsx(EW,{onAdd:a,disabled:s}),e.id&&u&&f.jsx(Se,{content:"Run the open fixes with an agent",children:f.jsx(te,{size:"small",onClick:()=>e.id&&l(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})]}),f.jsx(m5,{data:d,columns:[{key:"checkbox",header:"Status",cell:p=>h(p)?f.jsx(Rs,{size:"small"}):f.jsx(QB,{checked:p.item.done,onChange:()=>p.kind==="phase"?i(p.index):o(p.index),disabled:s}),width:2},{key:"title",header:"Title",cell:p=>f.jsxs("span",{className:`inline-flex items-center gap-2 ${p.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[p.item.text,h(p)&&f.jsxs("span",{className:"text-xs opacity-[0.55]",children:[Math.round(((r==null?void 0:r.fraction)??0)*100),"%"]}),p.kind==="phase"&&p.item.source==="review"&&f.jsx(Ee,{size:"small",fillColor:ir.review.fill,textColor:ir.review.text,children:"review"}),p.kind==="fix"&&f.jsx(Ee,{size:"small",variant:"warning",children:"fix"})]})},{key:"time",header:"Time",align:"end",width:3,cell:p=>p.item.run?f.jsxs("span",{className:"text-xs opacity-[0.55] whitespace-nowrap",children:[iC(p.item.run.durationMs),p.item.run.attempts>1&&f.jsxs("span",{className:"opacity-[0.75]",children:[" ×",p.item.run.attempts]})]}):null},{key:"tokens",header:"Tokens",align:"end",width:6,cell:p=>p.item.run?f.jsxs("span",{className:"text-xs opacity-[0.55] whitespace-nowrap",children:[di(p.item.run.inputTokens)," in ·"," ",di(p.item.run.outputTokens)," out"]}):null},{key:"model",header:"Model",align:"end",width:4,cell:p=>{var m;return(m=p.item.run)!=null&&m.model?f.jsx("span",{className:"text-xs opacity-[0.55] whitespace-nowrap",children:p.item.run.model}):null}},{key:"actions",header:"Actions",align:"end",cell:p=>p.kind!=="phase"||h(p)?null:f.jsx("div",{className:"flex justify-end",children:p.item.done?f.jsx(OW,{planTitle:e.title,planId:e.id,phaseIndex:p.index}):f.jsx(MW,{planId:e.id,phaseIndex:p.index,disabled:n})}),width:7}],expandable:{render:p=>p.item.description||null},showExpandColumn:!1,rowTexture:p=>{if(p.kind==="fix")return"kraft";if(p.kind==="phase"&&p.item.done)return"canvas"},rowClassName:p=>{if(h(p))return"phase-running-row";if(p.kind==="phase"&&p.item.source==="review")return"bg-[rgba(155,122,181,0.08)]"},className:"phase-table-phone"})]})},GW=({plan:e,gitBranch:t,onOwnBranch:n,branching:r,onCreateBranch:s})=>{const i=e.status==="planned"||e.status==="in-progress"||e.status==="review";return!i&&!e.pr?null:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-4",children:[i&&!n&&f.jsx(Te,{size:"small",accent:!0,accentColor:"amber",texture:"kraft",children:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsxs("span",{className:"text-sm",children:["Working branch: ",f.jsx("code",{children:t??"unknown"})," — not this plan's branch."]}),e.id&&f.jsx(Se,{content:`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`,children:f.jsx(te,{size:"small",onClick:s,disabled:r,children:r?"Switching…":"Create branch"})})]})}),i&&n&&f.jsxs("span",{className:"text-sm opacity-[0.45]",children:["Working branch: ",f.jsx("code",{children:t})]}),e.pr&&f.jsx(nC,{pr:e.pr}),e.pr&&f.jsx(kW,{pr:e.pr})]})},KW=({progress:e,color:t})=>f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[f.jsx("div",{className:"flex-1",children:f.jsx(rC,{pct:e.pct,color:t})}),f.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0",children:[Math.round(e.pct),"%"]})]}),QW=({plan:e})=>f.jsx("div",{className:"mb-4",children:f.jsx("div",{className:"opacity-[0.85]",children:e.body&&f.jsx(ZS,{resetKey:e.id??e.title,children:f.jsx(pk,{children:e.body})})})}),qW=({clarifications:e})=>e.length===0?null:f.jsxs("div",{className:"mb-5",children:[f.jsx("h3",{className:`${Lu} mb-3`,children:"Clarifications"}),f.jsx("div",{className:"flex flex-col gap-2 mb-3",children:e.map((t,n)=>f.jsx("div",{className:"text-sm flex items-start justify-between gap-3 opacity-75",children:f.jsxs("span",{children:[f.jsx("span",{className:"font-semibold mr-2",children:t.date}),t.text]})},`clar-${t.date}-${n}`))})]}),YW=({planId:e,released:t})=>{const n=cW(e);return n?f.jsxs("div",{className:"mb-8",children:[f.jsx("h3",{className:`${Lu} mb-3`,children:"History"}),f.jsx(bW,{trail:n,released:t})]}):null},XW=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var v;const[o,a]=_.useState(""),[l,c]=_.useState(null),[u,d]=_.useState(null),h=e.thread??[],{promotingIndex:p,promoteToDurable:m,promoteToIdea:y}=ZU(e);JU(e,!0);const w=async()=>{const b=o.trim();b&&(c(b),a(""),await n(b)||a(S=>S||b),c(null))},g=(b,S)=>{S==="idea"?d(b):m(b,S)},x=async b=>{u!==null&&await y(u,b)&&d(null)};return f.jsxs("div",{className:"mb-8",children:[f.jsx("h3",{className:`${Lu} mb-3`,children:"Feedback"}),f.jsxs(Te,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[f.jsx("div",{className:"flex flex-col gap-3 mb-4",children:h.length>0||l?f.jsxs(f.Fragment,{children:[f.jsx(yW,{messages:h,undo:r,undoing:s,onUndo:i,onPromote:g,promotingIndex:p}),l&&f.jsx("div",{className:"flex flex-col gap-1 items-end",children:f.jsx("div",{className:"max-w-[85%]",children:f.jsx(Te,{size:"small",surface:"paper",texture:"parchment",accent:!0,accentColor:"blue",children:l})})}),t&&f.jsx("div",{className:"flex flex-col gap-1 items-start",children:f.jsx(Te,{size:"small",surface:"paper",texture:"kraft",shade:!0,children:f.jsx(Rs,{size:"small",label:"Agent thinking…"})})})]}):f.jsx("p",{className:"text-sm m-0 text-ink-500",children:"Jot a comment, ask a question, or say what's wrong with this plan."})}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Nu,{value:o,onChange:b=>a(b.target.value),"aria-label":"Feedback message",placeholder:"Write a message…",rows:3}),f.jsx("div",{className:"flex justify-end items-center gap-3",children:f.jsx(te,{size:"small",onClick:w,disabled:t||!o.trim(),children:"Send"})})]})]}),f.jsx(sC,{open:u!==null,onClose:()=>d(null),onAdd:x,initialContent:u!==null?(v=h[u])==null?void 0:v.text:void 0})]})},JW=({plan:e})=>{const t=L(A=>A.plans),n=L(A=>A.gitBranch),r=L(A=>A.loadGitStatus),s=L(A=>A.loadPlans),{toast:i}=We(),{patch:o,updating:a}=Ra(),[l,c]=_.useState(!1),u=L(A=>A.agentStatus),d=L(bm),h=L(A=>A.detailView),p=L(A=>A.taskLog),m=L(A=>A.loadTaskLog),y=ym(e.id,u),w=oW(y,p),g=_.useMemo(()=>jW(p,e.id),[p,e.id]),x=(y==null?void 0:y.taskKind)==="audit",v=AA(e,(w==null?void 0:w.fraction)??0),b=e.phases.length>0,S=h==="feedback",k={id:e.id??null,title:e.title,body:e.body,log:e.log},T=((t==null?void 0:t.entries)??[]).filter(A=>A.id!==e.id),P=e.id!==void 0&&UW(n)===e.id;_.useEffect(()=>{m()},[m]);const R=async()=>{if(e.id){c(!0);try{const A=await pL(e.id);i({title:"Branch ready",description:`Now on ${A}`,variant:"success"}),await r()}catch(A){i({title:"Branch failed",description:Ue(A.message),variant:"error"})}finally{c(!1)}}},j=async A=>{const B=e.phases.map(($,Q)=>Q===A?{...$,done:!$.done}:$);B.every($=>$.done)&&e.status==="in-progress"?await o(e.title,{phases:B,status:"review"}):await o(e.title,{phases:B})},I=async A=>{await o(e.title,{phases:[...e.phases,...A]})},M=async A=>{const B=(e.fixes??[]).map(($,Q)=>Q===A?{...$,done:!$.done}:$);B.every($=>$.done)&&e.status==="in-progress"?await o(e.title,{fixes:B,status:"review"}):await o(e.title,{fixes:B})},{sending:O,send:z,undo:E,undoing:F,undoEdit:V}=aW(e,{reload:s,notify:i});return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-3 flex-wrap",children:[f.jsxs("h2",{className:`${PW} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[f.jsx(es,{id:e.id}),e.title]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:e.updated?`updated ${Ic(e.updated)}`:`created ${Ic(e.created)}`}),f.jsx($W,{})]})]}),S?f.jsx(XW,{plan:e,updating:O,onSend:z,undo:E,undoing:F,onUndo:V}):f.jsxs(f.Fragment,{children:[f.jsx(GW,{plan:e,gitBranch:n,onOwnBranch:P,branching:l,onCreateBranch:R}),v!==null&&f.jsx(KW,{progress:v,color:eC[xm(e,u)]}),f.jsx(QW,{plan:e}),f.jsx(qW,{clarifications:e.clarifications??[]}),f.jsx(WW,{rollup:g}),!b&&f.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[f.jsx(Au,{idea:k,otherPlans:T}),f.jsx(ag,{idea:k})]}),b&&f.jsx(HW,{plan:e,auditRunning:x,agentBusy:d,runningFill:w,updating:a,onTogglePhase:j,onToggleFix:M,onAddReviewPhases:I}),f.jsx(YW,{planId:e.id,released:e.released})]})]})},ZW=()=>{const[e,t]=_.useState(new Set);return _.useEffect(()=>{let n=!1;return vk().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},xo="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",lg=({order:e,done:t,running:n,status:r})=>f.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?f.jsx(Rs,{size:"small",label:"Agent running"}):t?f.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?f.jsx(Ee,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:f.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})}):r==="idea"?f.jsx("span",{"aria-label":"Backlog — not planned yet",className:"inline-flex text-ink-300",children:f.jsx(ng,{size:14})}):null}),ep="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",oC=({plans:e,activePlanTitle:t,onOpen:n,showHeader:r=!0})=>{const s=ep,i=L(o=>o.agentStatus);return f.jsxs("div",{className:"flex flex-col gap-1",children:[r&&f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px]"}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Te,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:s,children:[f.jsx("span",{className:xo,children:"Id"}),f.jsx("span",{className:xo,children:"Title"}),f.jsx("span",{className:`max-lg:hidden ${xo}`,children:"Updated"}),f.jsx("span",{className:xo,children:"Progress"}),f.jsx("span",{className:xo,children:"Status"})]})})})]}),e.map(o=>{var c;const a=Ck(o),l=xm(o,i);return f.jsxs("div",{className:"flex items-center",children:[f.jsx(lg,{order:o.order,done:o.status==="done",status:o.status,running:!!ym(o.id,i)}),f.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(o.title):void 0,onKeyDown:n?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(o.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${o.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:f.jsx(Te,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:s,children:[f.jsx(es,{id:o.id}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:o.title}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:o.updated?Ic(o.updated):Ic(o.created)}),a?f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(rC,{pct:a.pct,color:eC[l]})}),f.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[a.done,"/",a.total]})]}):f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Ee,{size:"small",fillColor:ir[l].fill,textColor:ir[l].text,children:og[l]}),((c=o.pr)==null?void 0:c.state)==="merged"&&f.jsx(Se,{content:`Merged in #${o.pr.number}`,children:f.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:f.jsx(Mu,{size:14})})})]})]})})})]},o.title)})]})},e9=5,t9="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",aC="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",Ov="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",zv=`${t9} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,n9=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],lC="flex items-center gap-2 min-w-0 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit font-semibold",cC="overflow-hidden text-ellipsis whitespace-nowrap",r9=({rows:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const[i,o]=_.useState(new Set),{subjects:a,loading:l,available:c}=KS(),u=ZW(),d=nn(),h=aC,p=L(k=>k.planFilters.sortKey),m=L(k=>k.planFilters.sortDirection),y=L(k=>k.setPlanSortKey),w=L(k=>k.togglePlanSortDirection),g=k=>{k===p?w():y(k)},x=k=>{o(T=>{const P=new Set(T);return P.has(k)?P.delete(k):P.add(k),P})},v=k=>k.type==="plan"?f.jsx(oC,{plans:[k.plan],activePlanTitle:n,onOpen:r,showHeader:!1},k.plan.title):k.type==="note"?f.jsx(s9,{row:k,onOpen:s},k.idea.title):f.jsx(i9,{row:k,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i.has(k.idea.title),onToggleExpanded:()=>x(k.idea.title)},k.idea.title),b=QA(e,m,l||!c?void 0:a),S=b.length>1;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":p==="order"?m==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:zv,"aria-label":"Sort by run order",onClick:()=>g("order"),children:["#",p==="order"&&(m==="asc"?"▲":"▼")]})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Te,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsx("div",{className:h,children:n9.map(({key:k,label:T})=>{const P=k===p;return f.jsx("span",{role:"columnheader",className:k==="updated"?"max-lg:hidden":void 0,"aria-sort":P?m==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:zv,onClick:()=>g(k),children:[T,P&&(m==="asc"?" ▲":" ▼")]})},k)})})})})]}),S?b.map(k=>{const T=k.subject;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx("div",{className:"flex items-baseline gap-2",children:T&&u.has(T)?f.jsx("button",{type:"button",className:`${Ov} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>d({to:"/roadmap",search:{item:T}}),children:T}):f.jsx("div",{className:Ov,children:T??"No subject"})}),k.rows.map(P=>v(P))]},T??"__no-subject__")}):e.map(k=>v(k))]})},s9=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return f.jsxs("div",{className:"flex items-center",children:[f.jsx(lg,{order:n.order,done:r==="done",status:r}),f.jsx("div",{role:t?"button":void 0,tabIndex:t?0:void 0,onClick:t?()=>t(n.title):void 0,onKeyDown:t?s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),t(n.title))}:void 0,className:`${t?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0`,children:f.jsx(Te,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:aC,children:[n.id?f.jsx(es,{id:n.id}):f.jsx("span",{}),f.jsxs("span",{className:`${lC} [cursor:inherit]`,children:[f.jsx(HS,{}),f.jsx("span",{className:cC,children:n.title})]}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsx(Ee,{size:"small",fillColor:Qc[r].fill,textColor:Qc[r].text,children:tC[r]})]})})})]})},i9=({row:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i,onToggleExpanded:o})=>{const a=e.idea,l=e.children,c=l.filter(p=>p.status==="done"),u=l.filter(p=>p.status!=="done"),d=l.length>e9,h=d&&!i?u:l;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx(lg,{order:a.order,done:a.status==="done",status:a.status}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Te,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"grid grid-cols-[76px_minmax(0,1fr)_84px_1fr] gap-2 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",children:[a.id?f.jsx(es,{id:a.id}):f.jsx("span",{}),f.jsxs("button",{type:"button",onClick:()=>s==null?void 0:s(a.title),className:lC,children:[f.jsx(ng,{}),f.jsx("span",{className:cC,children:a.title})]}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[f.jsx("span",{className:`text-sm ${l.length>0?"opacity-60":"opacity-30"}`,children:l.length>0?`${c.length}/${l.length} plans done`:"—"}),f.jsx(ag,{idea:a,compact:!0}),f.jsx(Au,{idea:a,otherPlans:t})]})]})})})]}),l.length>0&&f.jsxs("div",{className:"ml-5 pl-3 border-l-2 border-black/[8%] flex flex-col gap-1",children:[f.jsx(oC,{plans:h,activePlanTitle:n,onOpen:r,showHeader:!1}),d&&f.jsx("button",{type:"button",onClick:o,className:"self-start bg-none bg-transparent border-none py-1 px-0 opacity-60 cursor-pointer underline text-xs [font:inherit]",children:i?"Show less":`+${c.length} done`})]})]})},o9=({plans:e,rows:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const i=_.useRef(null);return _.useEffect(()=>{var a;if(!n)return;const o=(a=i.current)==null?void 0:a.querySelector(".plan-row-highlighted");o==null||o.scrollIntoView({behavior:"smooth",block:"center"})},[n]),f.jsx("div",{ref:i,children:t.length>0?f.jsx(r9,{rows:t,plans:e,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s}):f.jsx("p",{className:"opacity-50 py-6 px-0 text-center",children:"Nothing matches these filters — clear one, or check back once something moves into this status."})})},a9=({idea:e})=>f.jsxs("div",{className:"text-base leading-[1.7] text-ink-900",children:[f.jsxs("h2",{className:"font-display-luminari font-semibold text-[1.75rem] leading-tight mt-0 mr-0 mb-4 ml-0 flex items-center gap-3 flex-wrap",children:[f.jsx(es,{id:e.id??void 0}),e.title,e.status&&f.jsx(Ee,{size:"small",fillColor:Qc[e.status].fill,textColor:Qc[e.status].text,children:tC[e.status]})]}),f.jsx(pk,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),f.jsx("div",{className:"mt-6",children:f.jsx(ag,{idea:e})})]}),ff="__no-subject__",Gs="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300",l9=()=>{const e=L(E=>E.plans),t=rg(),n=L(bm),r=L(E=>E.agentStatus),{patch:s,updating:i}=Ra(),{subjects:o,available:a}=KS(),l=L(E=>E.detailView),c=L(E=>E.setDetailView),u=L(E=>E.archiveIdeas),{toast:d}=We(),h=t?e==null?void 0:e.entries.find(E=>E.title===t):null,[p,m]=_.useState(""),[y,w]=_.useState(!1);if(_.useEffect(()=>{m((h==null?void 0:h.order)!==void 0?String(h==null?void 0:h.order):"")},[h==null?void 0:h.order]),!h)return null;const g=xm(h,r),x=h.status==="in-progress",v=h.status==="review",b=h.status==="dropped",S=h.status==="done",k=h.phases.some(E=>!E.done),T=(h.status==="planned"||x)&&k,P=LA(h),R=!!(h.pr&&(h.pr.state==="open"||h.pr.state==="draft")&&h.pr.unresolvedThreadCount),j=a&&h.subject&&!o.includes(h.subject)?h.subject:void 0,I=E=>s(h.title,E),M=async()=>{if(h.id){w(!0);try{await u([h.id])}catch(E){d({title:"Archive failed",description:E.message,variant:"error"})}finally{w(!1)}}},O=x||v||h.status==="planned",z=async()=>{const E=p.trim(),F=Number(E);if(E===""||!Number.isInteger(F)||F<1){m(h.order!==void 0?String(h.order):"");return}F!==h.order&&await I({order:F})};return f.jsxs("div",{className:"flex flex-col gap-4 -mt-5",children:[f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Show"}),f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(Qn,{size:"small",active:l==="details",onClick:()=>c("details"),className:"text-xs leading-4 py-2",children:"Details"}),f.jsx(Qn,{size:"small",active:l==="feedback",onClick:()=>c("feedback"),className:"text-xs leading-4 py-2",children:"Feedback"})]})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{className:Gs,children:"Status"}),f.jsx(Ee,{size:"small",fillColor:ir[g].fill,textColor:ir[g].text,children:og[g]})]}),f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Subject"}),f.jsx(LS,{size:"small",value:h.subject??ff,onChange:E=>I({subject:E===ff?null:E}),disabled:i||!a,options:[{value:ff,label:"No subject"},...j?[{value:j,label:`${j} (orphan)`}]:[],...!a&&h.subject&&!j?[{value:h.subject,label:h.subject}]:[],...o.map(E=>({value:E,label:E}))]})]}),O&&f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{className:Gs,children:"Order"}),f.jsx(Ea,{type:"number",size:"small","aria-label":"Run order",min:1,value:p,onChange:E=>m(E.target.value),onBlur:z,disabled:i,className:"w-20"})]}),h.tags.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Tags"}),f.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:h.tags.map(E=>f.jsx(Ee,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:E},E))})]}),f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Actions"}),f.jsxs("div",{className:"flex flex-col gap-1",children:[T&&f.jsx(BW,{plan:h,disabled:n||i}),R&&f.jsx(LW,{plan:h,disabled:n||i}),v&&f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:()=>I({status:"done"}),disabled:i,className:`text-xs leading-4 py-2 ${i?"opacity-50":""}`,children:"Approve & close"}),S&&f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:M,disabled:y||!h.id,className:`text-xs leading-4 py-2 ${y||!h.id?"opacity-50":""}`,children:y?"Archiving…":"Archive"}),P&&f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:M,disabled:y||!h.id,className:`text-xs leading-4 py-2 ${y||!h.id?"opacity-50":""}`,children:y?"Marking done…":"Mark done"}),!S&&f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:b?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:b?"↺":"⊘"}),onClick:()=>I({status:b?null:"dropped"}),disabled:i,className:`text-xs leading-4 py-2 ${i?"opacity-50":""}`,children:b?"Reopen plan":"Mark dropped"})]})]})]})},$v=8,c9=["in-progress","review","planned","idea","done","dropped"],Bv="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300 mb-2",u9=()=>{const e=L(b=>b.plans),t=rg(),n=L(b=>b.planFilters),r=L(b=>b.togglePlanStatus),s=L(b=>b.togglePlanTag),i=L(b=>b.setPlanSearch),o=L(b=>b.setSubjectFilter),a=nn(),[l,c]=_.useState(!1);if(!e||t)return null;const{statusCounts:u,tagCounts:d}=Ul(e.entries,n),h=new Set(n.statuses),p=new Set(n.tags),y=[...new Set([...Object.keys(d),...n.tags])].sort((b,S)=>{const k=(d[S]??0)-(d[b]??0);return k!==0?k:b.localeCompare(S)}),w=l?y:y.slice(0,$v),g=y.length-w.length,x="bg-none bg-transparent border-none p-0 cursor-pointer opacity-70 underline text-2xs",v=c9.filter(b=>u[b]>0||h.has(b));return f.jsxs("div",{className:"flex flex-col gap-8 -mt-5",children:[f.jsx(Ea,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:b=>i(b.target.value)}),n.subject!==null&&f.jsxs("div",{className:"flex items-center gap-2","data-testid":"subject-filter-chip",children:[f.jsxs("span",{className:"text-2xs opacity-70",children:["Subject: ",n.subject]}),f.jsx("button",{type:"button",onClick:()=>{o(null),a({to:"/",search:{}})},className:x,children:"Clear"})]}),f.jsxs("div",{children:[f.jsx("div",{className:Bv,children:"Status"}),f.jsx("div",{className:"flex flex-col gap-1",children:v.map(b=>{const S=h.has(b);return f.jsx(Qn,{size:"small",active:S,onClick:()=>r(b),className:"text-xs leading-4 py-2",icon:f.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:ir[b].text}}),action:f.jsx("span",{className:"text-2xs text-ink-500",children:u[b]}),children:og[b]},b)})})]}),f.jsxs("div",{children:[f.jsx("div",{className:Bv,children:"Tags"}),f.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[y.length===0&&f.jsx("span",{className:"opacity-50 text-2xs",children:"No tags"}),w.map(b=>{const S=p.has(b);return f.jsxs(te,{type:"button",variant:"ghost",size:"small",isActive:S,"aria-pressed":S,onClick:()=>s(b),children:[b," ",d[b]??0]},b)}),g>0&&f.jsxs("button",{type:"button",onClick:()=>c(!0),className:x,children:["+",g," more"]}),l&&y.length>$v&&f.jsx("button",{type:"button",onClick:()=>c(!1),className:x,children:"Show less"})]})]})]})},Vv=()=>f.jsxs("div",{className:"flex items-center gap-3 mb-6 flex-wrap",children:[f.jsx("h1",{className:"text-4xl flex-1 font-display-luminari font-semibold text-ink-900 m-0 leading-[1.1]",children:"Plans"}),f.jsx(DW,{}),f.jsx(IW,{}),f.jsx(VW,{})]}),d9=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],f9=()=>f.jsxs("div",{className:"flex flex-col gap-1","aria-hidden":"true",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px]"}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Te,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:ep,children:[f.jsx(cn,{variant:"text",width:28}),f.jsx(cn,{variant:"text",width:44}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(cn,{variant:"text",width:56})}),f.jsx(cn,{variant:"text",width:64}),f.jsx(cn,{variant:"text",width:48})]})})})]}),d9.map(e=>f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:f.jsx(cn,{variant:"text",width:16})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Te,{size:"small",className:"plan-row-card",children:f.jsxs("div",{className:ep,children:[f.jsx(cn,{variant:"rect",width:44,height:18}),f.jsx(cn,{variant:"text",width:e.title}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(cn,{variant:"text",width:52})}),f.jsx(cn,{variant:"rect",width:80,height:8}),f.jsx(cn,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),h9=()=>{const e=L(u=>u.reconcileQueue),t=L(u=>u.removeFromReconcileQueue),n=L(u=>u.plans),{patch:r}=Ra(),{toast:s}=We(),i=_.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(u=>u.id===o.planId))??null:null;if(_.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),_.useEffect(()=>{e.length===0&&(i.current=0)},[e.length]),!o||!a)return null;const l=async()=>{t(o.previewId),i.current+=1,s({title:"Kept the merged version",description:`"${a.title}" keeps the agent's rewrite.`})},c=async()=>{await r(a.title,{body:o.before.body,phases:o.before.phases},{errorTitle:"Discard failed"})&&(t(o.previewId),i.current+=1)};return f.jsx(SW,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},p9=({suggestions:e,onOpen:t,onDismiss:n})=>e.length===0?null:f.jsxs("div",{className:"mt-5",children:[f.jsx("h2",{className:"text-sm mb-2 opacity-60",children:"Suggested from AI"}),f.jsx("div",{className:"flex flex-col gap-1",children:e.map(r=>f.jsx("div",{className:"rounded-[10px]",children:f.jsx(Te,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("button",{type:"button",onClick:()=>t(r),className:"flex-1 min-w-0 flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit",children:[f.jsx(ng,{}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),f.jsx(Ct,{icon:f.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),cg=()=>{const e=L(k=>k.plans),t=L(k=>k.plansError),n=L(k=>k.ideaEntries),r=L(k=>k.suggestions);L(k=>k.loadPlans);const s=L(k=>k.setDetailView),i=L(k=>k.planFilters),o=L(k=>k.setSubjectFilter),a=rg(),l=AU(),c=L(k=>k.dismissSuggestion),u=nn(),{toast:d}=We(),{subject:h}=tm({strict:!1});_.useEffect(()=>{o(h??null)},[h,o]),_.useEffect(()=>{s("details")},[a,l,s]);const p=()=>{u({to:"/"})},m=k=>{u({to:"/plans/$planId",params:{planId:encodeURIComponent(k)}})},y=k=>{u({to:"/ideas/$ideaId",params:{ideaId:encodeURIComponent(k)}})},[w,g]=_.useState(null),x=async k=>{try{await c(k)}catch(T){d({title:"Failed to dismiss suggestion",description:T.message,variant:"error"})}},v=a?e==null?void 0:e.entries.find(k=>k.title===a):null,b=l?n.find(k=>k.title===l):null;if(t)return f.jsxs("div",{children:[f.jsx(YU,{children:"Plans"}),f.jsxs(Te,{size:"small",accent:!0,accentColor:"rose",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Couldn't load plans.md"}),f.jsx("p",{className:"m-0 opacity-75",children:t})]})]});if(!e)return f.jsxs("div",{children:[f.jsx(Vv,{}),f.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),f.jsx(f9,{})]});const{rows:S}=qA(e.entries,n,i);return f.jsxs(f.Fragment,{children:[f.jsx(h9,{}),v?f.jsxs("div",{children:[f.jsx("div",{className:"mb-4",children:f.jsx(Pv,{items:[{id:"plans",label:"Plans",onClick:p},{id:"plan",label:v.title}]})}),f.jsx(JW,{plan:v})]}):b?f.jsxs("div",{children:[f.jsx("div",{className:"mb-4",children:f.jsx(Pv,{items:[{id:"plans",label:"Plans",onClick:p},{id:"idea",label:b.title}]})}),f.jsx(a9,{idea:b})]}):f.jsxs("div",{children:[f.jsx(Vv,{}),e.warnings.length>0&&f.jsxs(Te,{size:"small",accent:!0,accentColor:"amber",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Some entries couldn't be parsed"}),f.jsx("ul",{className:"m-0 pl-5",children:e.warnings.map(k=>f.jsxs("li",{children:[k.title,": ",k.message]},k.title))})]}),e.entries.length===0?f.jsxs("p",{className:"opacity-50",children:["No ideas yet — capture one with ",f.jsx("strong",{children:"New idea"})," above, or click"," ",f.jsx("strong",{children:"Suggest ideas"})," to have an agent propose some."]}):f.jsx(o9,{plans:e.entries,rows:S,activePlanTitle:a,onOpenPlan:m,onOpenIdea:y}),f.jsx(CW,{onOpenIdea:y}),f.jsx(p9,{suggestions:r,onOpen:g,onDismiss:x}),f.jsx(_W,{suggestion:w,onClose:()=>g(null)})]})]})},m9="data-paper-camp-mount";function g9(e){return(e==null?void 0:e.getAttribute(m9))??""}const uC=typeof document>"u"?"":g9(document.getElementById("root")),dC=_.lazy(()=>Fn(()=>import("./index-CYxk5mrY.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsPage}))),y9=_.lazy(()=>Fn(()=>import("./index-CYxk5mrY.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsSidebar}))),fC=_.lazy(()=>Fn(()=>import("./index-CnD1dVCC.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsPage}))),x9=_.lazy(()=>Fn(()=>import("./index-CnD1dVCC.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsSidebar}))),v9=_.lazy(()=>Fn(()=>import("./index-B_yczIPZ.js"),__vite__mapDeps([4,3]),import.meta.url).then(e=>({default:e.TasksPage}))),w9=_.lazy(()=>Fn(()=>import("./index-CjPmPsf0.js"),[],import.meta.url).then(e=>({default:e.RoadmapPage}))),b9=_.lazy(()=>Fn(()=>import("./index-CjPmPsf0.js"),[],import.meta.url).then(e=>({default:e.RoadmapSidebar}))),k9=_.lazy(()=>Fn(()=>import("./index-DLgVuxp-.js"),[],import.meta.url).then(e=>({default:e.DiffPage}))),_9=_.lazy(()=>Fn(()=>import("./index-CASIH0vL.js"),__vite__mapDeps([5,3]),import.meta.url).then(e=>({default:e.StatsPage}))),S9=_.lazy(()=>Fn(()=>import("./index-6xeWffZg.js"),[],import.meta.url).then(e=>({default:e.InboxPage}))),hf=[{id:"plans",label:"Plans",path:"/"},{id:"inbox",label:"Inbox",path:"/inbox"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"tasks",label:"Tasks",path:"/tasks"},{id:"stats",label:"Stats",path:"/stats"},{id:"settings",label:"Settings",path:"/settings"}],Uv=({item:e,count:t})=>f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.label,e.id==="inbox"&&t>0&&f.jsx(Ee,{size:"small",variant:"warning",children:t})]}),Wv=()=>f.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:f.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})}),hC="stack-open";function C9(){try{return localStorage.getItem(hC)==="true"}catch{return!1}}function P9(e){try{localStorage.setItem(hC,String(e))}catch{}}const j9="(min-width: 1440px)";function E9(e){const[t,n]=_.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return _.useEffect(()=>{const r=window.matchMedia(e),s=i=>n(i.matches);return n(r.matches),r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}const T9=()=>{var P;const e=nn(),t=GT({select:R=>R.location.pathname}),n=L(R=>R.loadPlans),r=L(R=>R.loadIdeas),s=L(R=>R.loadSuggestions),i=L(R=>R.loadCapabilities),o=L(R=>R.loadAgentAuthStatus),a=L(R=>R.loadParkedQuestions),l=L(R=>{var j;return((j=R.parkedQuestions)==null?void 0:j.length)??0}),c=L(R=>R.setActiveDocTitle),u=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),d=t==="/docs"||t.startsWith("/docs/"),h=t==="/settings"||t.startsWith("/settings/"),p=t==="/roadmap",m=u?"plans":d?"docs":h?"settings":(P=hf.find(R=>R.path===t))==null?void 0:P.id,y=u||d||h||p,w=u?"plans":d?"docs":h?"settings":"roadmap",[g,x]=_.useState(C9),[v,b]=_.useState(!1),S=Pu(),k=E9(j9),T=_.useRef(!1);return _.useEffect(()=>{n(),r(),s(),i(),o(),a()},[n,r,s,i,o,a]),_.useEffect(()=>{T.current||t!=="/"||(T.current=!0,Promise.all([xk(),yk()]).then(([R,j])=>{if(!(R!=null&&R.setupDismissed)&&j!==null&&!j.every(I=>I.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([wk(),_k()]).then(([I,M])=>{I.entries.length>1||M.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),_.useEffect(()=>{b(!1)},[t]),f.jsxs($8,{position:"bottom-left",children:[f.jsxs("div",{className:"h-screen box-border min-[1440px]:pr-[480px] flex flex-col",children:[f.jsx(OU,{}),f.jsx(qU,{}),f.jsx(LB,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!0,showSidebar:!1,showPage:!1,bleedBottom:!0,headerActions:f.jsxs(f.Fragment,{children:[y&&f.jsx(Ct,{variant:"ghost",size:"small",className:"lg:hidden max-[480px]:hidden",label:"Open sidebar",onClick:()=>b(!0),icon:f.jsx(Wv,{})}),f.jsx(FU,{size:"sm"}),f.jsx("div",{className:"flex-1"}),f.jsx("nav",{"aria-label":"Main navigation",className:"flex items-center gap-1 max-[480px]:hidden",children:hf.map(R=>f.jsx(te,{variant:"ghost",size:"small",isActive:R.id===m,onClick:()=>e({to:R.path}),"aria-current":R.id===m?"page":void 0,children:f.jsx(Uv,{item:R,count:l})},R.id))})]}),children:f.jsx("div",{className:"flex flex-col h-full min-h-0",children:f.jsx("div",{className:"flex flex-1 min-h-0 justify-center items-start box-border overflow-y-auto -mt-8 -ml-8 -mr-8 pt-0 pl-8 pr-8 pb-[var(--pc-content-pad-bottom,32px)]",children:f.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)] gap-6 w-full",children:[y&&f.jsxs(zU,{routeKey:w,mobileOpen:v,onMobileClose:()=>b(!1),children:[u&&f.jsxs(f.Fragment,{children:[f.jsx(u9,{}),f.jsx(l9,{})]}),d&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(y9,{})}),h&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(x9,{})}),p&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(b9,{})})]}),f.jsx("div",{className:`flex flex-col min-w-0 ${k?"flex-[1_1_0%]":"flex-[0_1_800px]"}`,children:f.jsx(Ai.div,{...qS(S),transition:QS(S),className:"flex flex-col flex-1 min-w-0",children:f.jsx(MS,{texture:{texture:"parchment"},outline:!0,className:`min-h-[calc(100vh-160px)] w-full ${k?"max-w-none":""}`,children:f.jsx(_.Suspense,{fallback:null,children:f.jsx(Nb,{})})})},t)})]})})})})]}),f.jsx(TU,{open:g,pinned:k,onToggle:()=>{const R=!g;P9(R),x(R)}}),f.jsxs("nav",{"aria-label":"Main navigation",className:"hidden max-[480px]:flex max-[480px]:fixed max-[480px]:left-0 max-[480px]:right-0 max-[480px]:bottom-0 max-[480px]:z-[250] max-[480px]:items-stretch max-[480px]:justify-around max-[480px]:gap-1 max-[480px]:py-2 max-[480px]:px-2 max-[480px]:[padding-bottom:calc(0.5rem+env(safe-area-inset-bottom))] max-[480px]:bg-[var(--pui-bg-base,#fff)] max-[480px]:border-t max-[480px]:border-black/10 max-[480px]:shadow-[0_-2px_8px_rgba(0,0,0,0.08)]",children:[y&&f.jsx(Ct,{variant:"ghost",size:"small",label:"Open sidebar",onClick:()=>b(!0),icon:f.jsx(Wv,{}),className:"min-h-11"}),hf.map(R=>f.jsx(te,{variant:"ghost",size:"small",isActive:R.id===m,onClick:()=>e({to:R.path}),"aria-current":R.id===m?"page":void 0,className:"min-h-11",children:f.jsx(Uv,{item:R,count:l})},R.id))]})]})},Bt=NT({component:T9}),R9=rn({getParentRoute:()=>Bt,path:"/",component:cg,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0})}),N9=rn({getParentRoute:()=>Bt,path:"/plans/$planId",component:cg}),I9=rn({getParentRoute:()=>Bt,path:"/ideas/$ideaId",component:cg}),M9=rn({getParentRoute:()=>Bt,path:"/docs",component:dC}),A9=rn({getParentRoute:()=>Bt,path:"/docs/$section",component:dC}),L9=rn({getParentRoute:()=>Bt,path:"/settings",component:fC}),D9=rn({getParentRoute:()=>Bt,path:"/settings/$section",component:fC}),F9=rn({getParentRoute:()=>Bt,path:"/roadmap",component:w9,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0})}),O9=rn({getParentRoute:()=>Bt,path:"/diff",component:k9}),z9=rn({getParentRoute:()=>Bt,path:"/inbox",component:S9}),$9=rn({getParentRoute:()=>Bt,path:"/stats",component:_9}),B9=rn({getParentRoute:()=>Bt,path:"/tasks",component:v9,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0})}),V9=Bt.addChildren([R9,N9,I9,M9,A9,L9,D9,B9,F9,O9,$9,z9]),U9=VT({routeTree:V9,basepath:uC||"/"});GM(uC);const pC=document.getElementById("root");if(!pC)throw new Error("#root element not found");rb(pC).render(f.jsx(_.StrictMode,{children:f.jsx(HT,{router:U9})}));export{$U as $,Z9 as A,tm as B,Q9 as C,eH as D,Ta as E,dH as F,Ue as G,tH as H,Y9 as I,te as J,nC as K,og as L,pk as M,q9 as N,nH as O,YU as P,rH as Q,ZW as R,ir as S,sH as T,Ee as U,lH as V,JV as W,OA as X,di as Y,iC as Z,cf as _,nn as a,aW as a0,es as a1,yW as a2,Nu as a3,Rs as a4,uH as b,W9 as c,PW as d,xk as e,X9 as f,Se as g,H9 as h,Qn as i,f as j,We as k,FS as l,KS as m,cH as n,Ea as o,Cv as p,NU as q,_ as r,G9 as s,K9 as t,L as u,LS as v,Te as w,J9 as x,Pv as y,$A as z};
207
- //# sourceMappingURL=main-DR2ma6V-.js.map
206
+ ${i.trim()}`:""}`;if(E){w(!0),b(null),x(null);try{const F=S.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));x(await kk(E,F))}catch(F){b(F.message)}finally{w(!1)}}},M=E=>{const F=S.find(V=>V.id===E);F?j(F.title):P({title:"Plan not found",description:`No plan with id ${E}`,variant:"error"})},O=async(E,F,V)=>{m(E);const B={date:new Date().toISOString().slice(0,10),text:r.trim()},C=await k(F,{log:[...V??[],B]},{errorTitle:"Extend failed"});m(null),C&&t()},z=async E=>{if(E.preventDefault(),!(!r.trim()||c)){h(null),u(!0);try{await n({title:r.trim(),content:i.trim()||void 0,kind:a}),t()}catch(F){h(F.message)}finally{u(!1)}}};return f.jsx(Ta,{open:e,onClose:t,title:"Quick plan",size:"small",children:f.jsxs("form",{onSubmit:z,className:"flex flex-col gap-4",children:[f.jsx(Ea,{label:"Title",value:r,onChange:E=>s(E.target.value),placeholder:"Backlog item title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:c,autoFocus:!0,required:!0}),R.length>0&&f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),R.map(({candidate:E})=>{const F={id:E.id??null,title:E.title,body:E.body,log:E.log},V=S.filter(A=>A.id!==E.id);return f.jsx(Re,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(es,{id:E.id}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:E.title})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",size:"small",onClick:()=>j(E.title),children:"Open it"}),f.jsx(ne,{type:"button",variant:"ghost",size:"small",disabled:!E.id||!r.trim()||p!==null,onClick:()=>E.id&&O(E.id,E.title,E.log),children:p===E.id?"Extending…":"Extend it instead"}),f.jsx(Au,{idea:F,otherPlans:V})]})]})},E.id??E.title)})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{children:f.jsx(ne,{type:"button",variant:"ghost",size:"small",disabled:!r.trim()||y,onClick:I,children:y?"Checking overlap…":"Check overlap"})}),v&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:v}),g&&f.jsx(Re,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"font-semibold",children:g.verdict==="new"?"Looks genuinely new":g.verdict==="extend"?`Extends ${g.targetId??"an existing idea"}`:`Belongs inside ${g.targetId??"an existing idea"}`}),f.jsx("span",{className:"text-sm opacity-80",children:g.reasoning}),g.targetId&&f.jsx("div",{className:"flex justify-end",children:f.jsx(ne,{type:"button",variant:"ghost",size:"small",onClick:()=>M(g.targetId),children:"Open it"})})]})})]}),f.jsx(LS,{label:"Kind",value:a,onChange:E=>l(E),options:TW,disabled:c}),f.jsx(Nu,{label:"Description",value:i,onChange:E=>o(E.target.value),placeholder:"Optional details…",disabled:c,rows:4}),d&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",onClick:t,disabled:c,children:"Cancel"}),f.jsx(ne,{type:"submit",variant:"primary",disabled:!r.trim()||c,children:"Add"})]})]})})},NW=()=>f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M10 6h10M10 12h10M10 18h10"}),f.jsx("path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"})]}),IW=()=>{const e=L(o=>o.loadPlans),t=L(o=>o.gitBranchHygiene),[n,r]=_.useState(!1),s=t==="stale-merged",i=async o=>{await jA(o),await e(),r(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(Ce,{content:s?"Switch to main first":void 0,children:f.jsx(Ct,{icon:f.jsx(NW,{}),variant:"ghost",size:"small",label:s?"Switch to main first":"Quick plan",disabled:s,onClick:()=>r(!0)})}),f.jsx(RW,{open:n,onClose:()=>r(!1),onAdd:i})]})},MW=({planId:e,phaseIndex:t,disabled:n})=>{const r=L(u=>u.launchAgent),s=L(Jr),{toast:i}=He(),[o,a]=_.useState(!1),l=async u=>{if(u.stopPropagation(),!!e){a(!0);try{await r(e,t)}catch(d){i({title:"Failed to start agent",description:We(d.message),variant:"error"})}finally{a(!1)}}},c=e?s?"Start agent on this phase":"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ct,{icon:f.jsx("span",{className:"text-xs leading-none",children:"▶"}),variant:"ghost",size:"small",label:c,onClick:l,disabled:n||o||!e||!s,className:"transition-opacity text-ink-500"})},AW=({plan:e,disabled:t})=>{const n=L(l=>l.launchPlanAudit),r=L(Jr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,uW(e))}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ce,{content:a,children:f.jsx(ne,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})},ag=({idea:e,compact:t})=>{const n=L(h=>h.launchIdeaExtend),r=L(Jr),{state:s,errorMessage:i,run:o}=YS(),{toast:a}=He(),l=e.id,c=()=>{l&&o(async()=>{const h=L.getState().ideaEntries.find(p=>p.id===l);if(!h)throw new Error(`Idea ${l} not found`);try{await n(l,fW(h))}catch(p){throw a({title:"Extension failed",description:We(p.message),variant:"error"}),p}})},u=s==="loading"?"Extending…":s==="success"?t?"Sent!":"Extension sent!":s==="error"?"Extension failed":t?"Extend":"Extend with AI",d=s==="error"?i??"Extension failed":l?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return f.jsx(Ce,{content:d,children:f.jsx(ne,{variant:"ghost",size:"small",onClick:c,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:u})})},LW=({plan:e,disabled:t})=>{const n=L(u=>u.launchFixReview),r=L(Jr),s=L(kL),[i,o]=_.useState(!1),a=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(u){alert(u.message)}finally{o(!1)}}},l=t||i||!e.id||!r||!s,c=e.id?s?r?void 0:"No agent CLI found — set up in Settings":"GitHub CLI needs authentication — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ce,{content:c,children:f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-watercolor-amber-dark",children:"⚑"}),onClick:a,disabled:l,className:`text-xs leading-4 py-2 ${l?"opacity-50":""}`,children:i?"Starting…":"Fix review comments"})})},DW=()=>{const e=L(s=>s.loadIdeas),[t,n]=_.useState(!1),r=async s=>{await bk(s),await e(),n(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(ne,{icon:f.jsx(AS,{size:16}),size:"small",onClick:()=>n(!0),children:"New idea"}),f.jsx(sC,{open:t,onClose:()=>n(!1),onAdd:r})]})};async function FW(e){var r;if((r=navigator.clipboard)!=null&&r.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return document.body.removeChild(t),n}const OW=({planTitle:e,planId:t,phaseIndex:n})=>{const[r,s]=_.useState("idle"),i=async o=>{o.stopPropagation();const a=`Start phase ${n+1} of plan "${e}" in papercamp/ideas/${t??"<ID>"}.md`,l=await FW(a);s(l?"copied":"failed"),setTimeout(()=>s("idle"),1500)};return f.jsx(Ct,{icon:r==="copied"?f.jsx(tg,{size:16}):r==="failed"?f.jsx(ja,{size:16}):f.jsx(T4,{size:16}),variant:"ghost",size:"small",label:r==="copied"?"Copied":r==="failed"?"Copy failed — select and copy manually":"Copy phase prompt",onClick:i,className:`transition-opacity ${r==="copied"?"text-state-success":r==="failed"?"text-state-danger":"text-ink-500"}`})},zW=({plan:e,disabled:t})=>{const n=L(l=>l.launchPlanReconcile),r=L(Jr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,dW(e),{body:e.body,phases:e.phases})}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ce,{content:a,children:f.jsx(ne,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},$W=()=>{const e=L(s=>s.refreshAll),t=L(s=>s.refreshing),{toast:n}=He(),r=async()=>{if(t)return;const s=await e();s.ok?n({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):n({title:"Couldn't refresh",description:s.error??"The read failed — is the dev server running?",variant:"error"})};return f.jsx(Ct,{icon:f.jsx("span",{className:`inline-flex${t?" animate-pc-spin motion-reduce:animate-none":""}`,children:f.jsx(yU,{size:16})}),label:t?"Refreshing…":"Refresh data",size:"small",variant:"ghost",disabled:t,onClick:r})},BW=({plan:e,disabled:t})=>{const n=L(c=>c.launchRunAll),r=L(Jr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id)}catch(c){alert(c.message)}finally{i(!1)}}},a=t||s||!e.id||!r,l=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ce,{content:l,children:f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-ink-500",children:"▶"}),onClick:o,disabled:a,className:`text-xs leading-4 py-2 ${a?"opacity-50":""}`,children:s?"Starting…":"Run all phases"})})},VW=()=>{const e=L(y=>y.launchSuggestIdeas),t=L(y=>y.launchBatchReconcile),n=L(y=>y.launchPrioritise),r=L(y=>y.ideaEntries),s=L(y=>y.suggestions),i=L(bm),o=L(Jr),{toast:a}=He(),[l,c]=_.useState(null),u=async()=>{c("suggest");try{await e(mW(r,s))}catch(y){a({title:"Failed to launch",description:We(y.message),variant:"error"})}finally{c(null)}},d=async()=>{c("reconcile");try{await t()}catch(y){a({title:"Failed to launch",description:We(y.message),variant:"error"})}finally{c(null)}},h=async()=>{c("prioritise");try{const y=await n();a({title:y.moved.length>0?"Queue reordered":"Already in order",description:y.why||void 0,variant:"success"})}catch(y){a({title:"Failed to prioritise",description:We(y.message),variant:"error"})}finally{c(null)}},p=l!==null||i,m=[{id:"suggest-ideas",label:l==="suggest"?"Starting…":"Suggest ideas",icon:f.jsx(BS,{size:16}),disabled:p||!o,onSelect:u},{id:"reconcile-all",label:l==="reconcile"?"Starting…":"Reconcile all",icon:f.jsx(tg,{size:16}),disabled:p||!o,onSelect:d},{id:"prioritise",label:l==="prioritise"?"Prioritising…":"Prioritise queue",icon:f.jsx(xU,{size:16}),disabled:p||!o,onSelect:h}];return f.jsx(zS,{align:"end",trigger:f.jsx(Ct,{icon:f.jsx(WS,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:m})};function UW(e){const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null}const Lu="font-display-luminari text-sm font-semibold opacity-[0.65]",WW=({rollup:e})=>e.runs===0?null:f.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-[0.55] mb-4 flex-wrap",children:[f.jsx("span",{className:"font-semibold opacity-[0.85]",children:"Run cost"}),f.jsx("span",{"aria-hidden":!0,children:"·"}),f.jsxs("span",{children:[e.runs," ",e.runs===1?"run":"runs"]}),f.jsx("span",{"aria-hidden":!0,children:"·"}),f.jsx("span",{children:iC(e.durationMs)}),f.jsx("span",{"aria-hidden":!0,children:"·"}),f.jsx(Ce,{content:`Cache: ${di(e.cacheCreationTokens)} write · ${di(e.cacheReadTokens)} read`,children:f.jsxs("span",{children:[di(e.inputTokens)," in · ",di(e.outputTokens)," out"]})})]}),HW=({plan:e,auditRunning:t,agentBusy:n,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o,onAddReviewPhases:a})=>{const l=L(p=>p.launchRunAll),c=e.fixes??[],u=c.some(p=>!p.done),d=[...e.phases.map((p,m)=>({kind:"phase",item:p,index:m})),...c.map((p,m)=>({kind:"fix",item:p,index:m}))],h=p=>p.kind==="phase"&&!p.item.done&&(r==null?void 0:r.index)===p.index;return f.jsxs("div",{className:"mb-8",style:r?{"--phase-fill":`${r.fraction*100}%`}:void 0,children:[f.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[f.jsx("h3",{className:`${Lu} m-0`,children:"Phases"}),f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t&&f.jsx(Rs,{size:"small",label:"Audit running…"}),(e.status==="review"||e.status==="done")&&f.jsx(AW,{plan:e}),e.status!=="done"&&f.jsx(zW,{plan:e}),f.jsx(EW,{onAdd:a,disabled:s}),e.id&&u&&f.jsx(Ce,{content:"Run the open fixes with an agent",children:f.jsx(ne,{size:"small",onClick:()=>e.id&&l(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})]}),f.jsx(m5,{data:d,columns:[{key:"checkbox",header:"Status",cell:p=>h(p)?f.jsx(Rs,{size:"small"}):f.jsx(QB,{checked:p.item.done,onChange:()=>p.kind==="phase"?i(p.index):o(p.index),disabled:s}),width:2},{key:"title",header:"Title",cell:p=>f.jsxs("span",{className:`inline-flex items-center gap-2 ${p.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[p.item.text,h(p)&&f.jsxs("span",{className:"text-xs opacity-[0.55]",children:[Math.round(((r==null?void 0:r.fraction)??0)*100),"%"]}),p.kind==="phase"&&p.item.source==="review"&&f.jsx(Te,{size:"small",fillColor:ir.review.fill,textColor:ir.review.text,children:"review"}),p.kind==="fix"&&f.jsx(Te,{size:"small",variant:"warning",children:"fix"})]})},{key:"time",header:"Time",align:"end",width:3,cell:p=>p.item.run?f.jsxs("span",{className:"text-xs opacity-[0.55] whitespace-nowrap",children:[iC(p.item.run.durationMs),p.item.run.attempts>1&&f.jsxs("span",{className:"opacity-[0.75]",children:[" ×",p.item.run.attempts]})]}):null},{key:"tokens",header:"Tokens",align:"end",width:6,cell:p=>p.item.run?f.jsxs("span",{className:"text-xs opacity-[0.55] whitespace-nowrap",children:[di(p.item.run.inputTokens)," in ·"," ",di(p.item.run.outputTokens)," out"]}):null},{key:"model",header:"Model",align:"end",width:4,cell:p=>{var m;return(m=p.item.run)!=null&&m.model?f.jsx("span",{className:"text-xs opacity-[0.55] whitespace-nowrap",children:p.item.run.model}):null}},{key:"actions",header:"Actions",align:"end",cell:p=>p.kind!=="phase"||h(p)?null:f.jsx("div",{className:"flex justify-end",children:p.item.done?f.jsx(OW,{planTitle:e.title,planId:e.id,phaseIndex:p.index}):f.jsx(MW,{planId:e.id,phaseIndex:p.index,disabled:n})}),width:7}],expandable:{render:p=>p.item.description||null},showExpandColumn:!1,rowTexture:p=>{if(p.kind==="fix")return"kraft";if(p.kind==="phase"&&p.item.done)return"canvas"},rowClassName:p=>{if(h(p))return"phase-running-row";if(p.kind==="phase"&&p.item.source==="review")return"bg-[rgba(155,122,181,0.08)]"},className:"phase-table-phone"})]})},GW=({plan:e,gitBranch:t,onOwnBranch:n,branching:r,onCreateBranch:s})=>{const i=e.status==="planned"||e.status==="in-progress"||e.status==="review";return!i&&!e.pr?null:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-4",children:[i&&!n&&f.jsx(Re,{size:"small",accent:!0,accentColor:"amber",texture:"kraft",children:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsxs("span",{className:"text-sm",children:["Working branch: ",f.jsx("code",{children:t??"unknown"})," — not this plan's branch."]}),e.id&&f.jsx(Ce,{content:`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`,children:f.jsx(ne,{size:"small",onClick:s,disabled:r,children:r?"Switching…":"Create branch"})})]})}),i&&n&&f.jsxs("span",{className:"text-sm opacity-[0.45]",children:["Working branch: ",f.jsx("code",{children:t})]}),e.pr&&f.jsx(nC,{pr:e.pr}),e.pr&&f.jsx(kW,{pr:e.pr})]})},KW=({progress:e,color:t})=>f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[f.jsx("div",{className:"flex-1",children:f.jsx(rC,{pct:e.pct,color:t})}),f.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0",children:[Math.round(e.pct),"%"]})]}),QW=({plan:e})=>f.jsx("div",{className:"mb-4",children:f.jsx("div",{className:"opacity-[0.85]",children:e.body&&f.jsx(ZS,{resetKey:e.id??e.title,children:f.jsx(pk,{children:e.body})})})}),qW=({clarifications:e})=>e.length===0?null:f.jsxs("div",{className:"mb-5",children:[f.jsx("h3",{className:`${Lu} mb-3`,children:"Clarifications"}),f.jsx("div",{className:"flex flex-col gap-2 mb-3",children:e.map((t,n)=>f.jsx("div",{className:"text-sm flex items-start justify-between gap-3 opacity-75",children:f.jsxs("span",{children:[f.jsx("span",{className:"font-semibold mr-2",children:t.date}),t.text]})},`clar-${t.date}-${n}`))})]}),YW=({planId:e,released:t})=>{const n=cW(e);return n?f.jsxs("div",{className:"mb-8",children:[f.jsx("h3",{className:`${Lu} mb-3`,children:"History"}),f.jsx(bW,{trail:n,released:t})]}):null},XW=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var v;const[o,a]=_.useState(""),[l,c]=_.useState(null),[u,d]=_.useState(null),h=e.thread??[],{promotingIndex:p,promoteToDurable:m,promoteToIdea:y}=ZU(e);JU(e,!0);const w=async()=>{const b=o.trim();b&&(c(b),a(""),await n(b)||a(S=>S||b),c(null))},g=(b,S)=>{S==="idea"?d(b):m(b,S)},x=async b=>{u!==null&&await y(u,b)&&d(null)};return f.jsxs("div",{className:"mb-8",children:[f.jsx("h3",{className:`${Lu} mb-3`,children:"Feedback"}),f.jsxs(Re,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[f.jsx("div",{className:"flex flex-col gap-3 mb-4",children:h.length>0||l?f.jsxs(f.Fragment,{children:[f.jsx(yW,{messages:h,undo:r,undoing:s,onUndo:i,onPromote:g,promotingIndex:p}),l&&f.jsx("div",{className:"flex flex-col gap-1 items-end",children:f.jsx("div",{className:"max-w-[85%]",children:f.jsx(Re,{size:"small",surface:"paper",texture:"parchment",accent:!0,accentColor:"blue",children:l})})}),t&&f.jsx("div",{className:"flex flex-col gap-1 items-start",children:f.jsx(Re,{size:"small",surface:"paper",texture:"kraft",shade:!0,children:f.jsx(Rs,{size:"small",label:"Agent thinking…"})})})]}):f.jsx("p",{className:"text-sm m-0 text-ink-500",children:"Jot a comment, ask a question, or say what's wrong with this plan."})}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Nu,{value:o,onChange:b=>a(b.target.value),"aria-label":"Feedback message",placeholder:"Write a message…",rows:3}),f.jsx("div",{className:"flex justify-end items-center gap-3",children:f.jsx(ne,{size:"small",onClick:w,disabled:t||!o.trim(),children:"Send"})})]})]}),f.jsx(sC,{open:u!==null,onClose:()=>d(null),onAdd:x,initialContent:u!==null?(v=h[u])==null?void 0:v.text:void 0})]})},JW=({plan:e})=>{const t=L(A=>A.plans),n=L(A=>A.gitBranch),r=L(A=>A.loadGitStatus),s=L(A=>A.loadPlans),{toast:i}=He(),{patch:o,updating:a}=Ra(),[l,c]=_.useState(!1),u=L(A=>A.agentStatus),d=L(bm),h=L(A=>A.detailView),p=L(A=>A.taskLog),m=L(A=>A.loadTaskLog),y=ym(e.id,u),w=oW(y,p),g=_.useMemo(()=>jW(p,e.id),[p,e.id]),x=(y==null?void 0:y.taskKind)==="audit",v=AA(e,(w==null?void 0:w.fraction)??0),b=e.phases.length>0,S=h==="feedback",k={id:e.id??null,title:e.title,body:e.body,log:e.log},T=((t==null?void 0:t.entries)??[]).filter(A=>A.id!==e.id),P=e.id!==void 0&&UW(n)===e.id;_.useEffect(()=>{m()},[m]);const R=async()=>{if(e.id){c(!0);try{const A=await pL(e.id);i({title:"Branch ready",description:`Now on ${A}`,variant:"success"}),await r()}catch(A){i({title:"Branch failed",description:We(A.message),variant:"error"})}finally{c(!1)}}},j=async A=>{const B=e.phases.map(($,q)=>q===A?{...$,done:!$.done}:$);B.every($=>$.done)&&e.status==="in-progress"?await o(e.title,{phases:B,status:"review"}):await o(e.title,{phases:B})},I=async A=>{await o(e.title,{phases:[...e.phases,...A]})},M=async A=>{const B=(e.fixes??[]).map(($,q)=>q===A?{...$,done:!$.done}:$);B.every($=>$.done)&&e.status==="in-progress"?await o(e.title,{fixes:B,status:"review"}):await o(e.title,{fixes:B})},{sending:O,send:z,undo:E,undoing:F,undoEdit:V}=aW(e,{reload:s,notify:i});return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-3 flex-wrap",children:[f.jsxs("h2",{className:`${PW} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[f.jsx(es,{id:e.id}),e.title]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:e.updated?`updated ${Ic(e.updated)}`:`created ${Ic(e.created)}`}),f.jsx($W,{})]})]}),S?f.jsx(XW,{plan:e,updating:O,onSend:z,undo:E,undoing:F,onUndo:V}):f.jsxs(f.Fragment,{children:[f.jsx(GW,{plan:e,gitBranch:n,onOwnBranch:P,branching:l,onCreateBranch:R}),v!==null&&f.jsx(KW,{progress:v,color:eC[xm(e,u)]}),f.jsx(QW,{plan:e}),f.jsx(qW,{clarifications:e.clarifications??[]}),f.jsx(WW,{rollup:g}),!b&&f.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[f.jsx(Au,{idea:k,otherPlans:T}),f.jsx(ag,{idea:k})]}),b&&f.jsx(HW,{plan:e,auditRunning:x,agentBusy:d,runningFill:w,updating:a,onTogglePhase:j,onToggleFix:M,onAddReviewPhases:I}),f.jsx(YW,{planId:e.id,released:e.released})]})]})},ZW=()=>{const[e,t]=_.useState(new Set);return _.useEffect(()=>{let n=!1;return vk().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},xo="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",lg=({order:e,done:t,running:n,status:r})=>f.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?f.jsx(Rs,{size:"small",label:"Agent running"}):t?f.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?f.jsx(Te,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:f.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})}):r==="idea"?f.jsx("span",{"aria-label":"Backlog — not planned yet",className:"inline-flex text-ink-300",children:f.jsx(ng,{size:14})}):null}),ep="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",oC=({plans:e,activePlanTitle:t,onOpen:n,showHeader:r=!0})=>{const s=ep,i=L(o=>o.agentStatus);return f.jsxs("div",{className:"flex flex-col gap-1",children:[r&&f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px]"}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Re,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:s,children:[f.jsx("span",{className:xo,children:"Id"}),f.jsx("span",{className:xo,children:"Title"}),f.jsx("span",{className:`max-lg:hidden ${xo}`,children:"Updated"}),f.jsx("span",{className:xo,children:"Progress"}),f.jsx("span",{className:xo,children:"Status"})]})})})]}),e.map(o=>{var c;const a=Ck(o),l=xm(o,i);return f.jsxs("div",{className:"flex items-center",children:[f.jsx(lg,{order:o.order,done:o.status==="done",status:o.status,running:!!ym(o.id,i)}),f.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(o.title):void 0,onKeyDown:n?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(o.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${o.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:f.jsx(Re,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:s,children:[f.jsx(es,{id:o.id}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:o.title}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:o.updated?Ic(o.updated):Ic(o.created)}),a?f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(rC,{pct:a.pct,color:eC[l]})}),f.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[a.done,"/",a.total]})]}):f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Te,{size:"small",fillColor:ir[l].fill,textColor:ir[l].text,children:og[l]}),((c=o.pr)==null?void 0:c.state)==="merged"&&f.jsx(Ce,{content:`Merged in #${o.pr.number}`,children:f.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:f.jsx(Mu,{size:14})})})]})]})})})]},o.title)})]})},e9=5,t9="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",aC="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",Ov="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",zv=`${t9} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,n9=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],lC="flex items-center gap-2 min-w-0 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit font-semibold",cC="overflow-hidden text-ellipsis whitespace-nowrap",r9=({rows:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const[i,o]=_.useState(new Set),{subjects:a,loading:l,available:c}=KS(),u=ZW(),d=nn(),h=aC,p=L(k=>k.planFilters.sortKey),m=L(k=>k.planFilters.sortDirection),y=L(k=>k.setPlanSortKey),w=L(k=>k.togglePlanSortDirection),g=k=>{k===p?w():y(k)},x=k=>{o(T=>{const P=new Set(T);return P.has(k)?P.delete(k):P.add(k),P})},v=k=>k.type==="plan"?f.jsx(oC,{plans:[k.plan],activePlanTitle:n,onOpen:r,showHeader:!1},k.plan.title):k.type==="note"?f.jsx(s9,{row:k,onOpen:s},k.idea.title):f.jsx(i9,{row:k,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i.has(k.idea.title),onToggleExpanded:()=>x(k.idea.title)},k.idea.title),b=QA(e,m,l||!c?void 0:a),S=b.length>1;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":p==="order"?m==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:zv,"aria-label":"Sort by run order",onClick:()=>g("order"),children:["#",p==="order"&&(m==="asc"?"▲":"▼")]})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Re,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsx("div",{className:h,children:n9.map(({key:k,label:T})=>{const P=k===p;return f.jsx("span",{role:"columnheader",className:k==="updated"?"max-lg:hidden":void 0,"aria-sort":P?m==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:zv,onClick:()=>g(k),children:[T,P&&(m==="asc"?" ▲":" ▼")]})},k)})})})})]}),S?b.map(k=>{const T=k.subject;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx("div",{className:"flex items-baseline gap-2",children:T&&u.has(T)?f.jsx("button",{type:"button",className:`${Ov} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>d({to:"/roadmap",search:{item:T}}),children:T}):f.jsx("div",{className:Ov,children:T??"No subject"})}),k.rows.map(P=>v(P))]},T??"__no-subject__")}):e.map(k=>v(k))]})},s9=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return f.jsxs("div",{className:"flex items-center",children:[f.jsx(lg,{order:n.order,done:r==="done",status:r}),f.jsx("div",{role:t?"button":void 0,tabIndex:t?0:void 0,onClick:t?()=>t(n.title):void 0,onKeyDown:t?s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),t(n.title))}:void 0,className:`${t?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0`,children:f.jsx(Re,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:aC,children:[n.id?f.jsx(es,{id:n.id}):f.jsx("span",{}),f.jsxs("span",{className:`${lC} [cursor:inherit]`,children:[f.jsx(HS,{}),f.jsx("span",{className:cC,children:n.title})]}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsx(Te,{size:"small",fillColor:Qc[r].fill,textColor:Qc[r].text,children:tC[r]})]})})})]})},i9=({row:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i,onToggleExpanded:o})=>{const a=e.idea,l=e.children,c=l.filter(p=>p.status==="done"),u=l.filter(p=>p.status!=="done"),d=l.length>e9,h=d&&!i?u:l;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx(lg,{order:a.order,done:a.status==="done",status:a.status}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Re,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"grid grid-cols-[76px_minmax(0,1fr)_84px_1fr] gap-2 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",children:[a.id?f.jsx(es,{id:a.id}):f.jsx("span",{}),f.jsxs("button",{type:"button",onClick:()=>s==null?void 0:s(a.title),className:lC,children:[f.jsx(ng,{}),f.jsx("span",{className:cC,children:a.title})]}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[f.jsx("span",{className:`text-sm ${l.length>0?"opacity-60":"opacity-30"}`,children:l.length>0?`${c.length}/${l.length} plans done`:"—"}),f.jsx(ag,{idea:a,compact:!0}),f.jsx(Au,{idea:a,otherPlans:t})]})]})})})]}),l.length>0&&f.jsxs("div",{className:"ml-5 pl-3 border-l-2 border-black/[8%] flex flex-col gap-1",children:[f.jsx(oC,{plans:h,activePlanTitle:n,onOpen:r,showHeader:!1}),d&&f.jsx("button",{type:"button",onClick:o,className:"self-start bg-none bg-transparent border-none py-1 px-0 opacity-60 cursor-pointer underline text-xs [font:inherit]",children:i?"Show less":`+${c.length} done`})]})]})},o9=({plans:e,rows:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const i=_.useRef(null);return _.useEffect(()=>{var a;if(!n)return;const o=(a=i.current)==null?void 0:a.querySelector(".plan-row-highlighted");o==null||o.scrollIntoView({behavior:"smooth",block:"center"})},[n]),f.jsx("div",{ref:i,children:t.length>0?f.jsx(r9,{rows:t,plans:e,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s}):f.jsx("p",{className:"opacity-50 py-6 px-0 text-center",children:"Nothing matches these filters — clear one, or check back once something moves into this status."})})},a9=({idea:e})=>f.jsxs("div",{className:"text-base leading-[1.7] text-ink-900",children:[f.jsxs("h2",{className:"font-display-luminari font-semibold text-[1.75rem] leading-tight mt-0 mr-0 mb-4 ml-0 flex items-center gap-3 flex-wrap",children:[f.jsx(es,{id:e.id??void 0}),e.title,e.status&&f.jsx(Te,{size:"small",fillColor:Qc[e.status].fill,textColor:Qc[e.status].text,children:tC[e.status]})]}),f.jsx(pk,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),f.jsx("div",{className:"mt-6",children:f.jsx(ag,{idea:e})})]}),ff="__no-subject__",Gs="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300",l9=()=>{const e=L(E=>E.plans),t=rg(),n=L(bm),r=L(E=>E.agentStatus),{patch:s,updating:i}=Ra(),{subjects:o,available:a}=KS(),l=L(E=>E.detailView),c=L(E=>E.setDetailView),u=L(E=>E.archiveIdeas),{toast:d}=He(),h=t?e==null?void 0:e.entries.find(E=>E.title===t):null,[p,m]=_.useState(""),[y,w]=_.useState(!1);if(_.useEffect(()=>{m((h==null?void 0:h.order)!==void 0?String(h==null?void 0:h.order):"")},[h==null?void 0:h.order]),!h)return null;const g=xm(h,r),x=h.status==="in-progress",v=h.status==="review",b=h.status==="dropped",S=h.status==="done",k=h.phases.some(E=>!E.done),T=(h.status==="planned"||x)&&k,P=LA(h),R=!!(h.pr&&(h.pr.state==="open"||h.pr.state==="draft")&&h.pr.unresolvedThreadCount),j=a&&h.subject&&!o.includes(h.subject)?h.subject:void 0,I=E=>s(h.title,E),M=async()=>{if(h.id){w(!0);try{await u([h.id])}catch(E){d({title:"Archive failed",description:E.message,variant:"error"})}finally{w(!1)}}},O=x||v||h.status==="planned",z=async()=>{const E=p.trim(),F=Number(E);if(E===""||!Number.isInteger(F)||F<1){m(h.order!==void 0?String(h.order):"");return}F!==h.order&&await I({order:F})};return f.jsxs("div",{className:"flex flex-col gap-4 -mt-5",children:[f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Show"}),f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(Qn,{size:"small",active:l==="details",onClick:()=>c("details"),className:"text-xs leading-4 py-2",children:"Details"}),f.jsx(Qn,{size:"small",active:l==="feedback",onClick:()=>c("feedback"),className:"text-xs leading-4 py-2",children:"Feedback"})]})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{className:Gs,children:"Status"}),f.jsx(Te,{size:"small",fillColor:ir[g].fill,textColor:ir[g].text,children:og[g]})]}),f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Subject"}),f.jsx(LS,{size:"small",value:h.subject??ff,onChange:E=>I({subject:E===ff?null:E}),disabled:i||!a,options:[{value:ff,label:"No subject"},...j?[{value:j,label:`${j} (orphan)`}]:[],...!a&&h.subject&&!j?[{value:h.subject,label:h.subject}]:[],...o.map(E=>({value:E,label:E}))]})]}),O&&f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{className:Gs,children:"Order"}),f.jsx(Ea,{type:"number",size:"small","aria-label":"Run order",min:1,value:p,onChange:E=>m(E.target.value),onBlur:z,disabled:i,className:"w-20"})]}),h.tags.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Tags"}),f.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:h.tags.map(E=>f.jsx(Te,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:E},E))})]}),f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Actions"}),f.jsxs("div",{className:"flex flex-col gap-1",children:[T&&f.jsx(BW,{plan:h,disabled:n||i}),R&&f.jsx(LW,{plan:h,disabled:n||i}),v&&f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:()=>I({status:"done"}),disabled:i,className:`text-xs leading-4 py-2 ${i?"opacity-50":""}`,children:"Approve & close"}),S&&f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:M,disabled:y||!h.id,className:`text-xs leading-4 py-2 ${y||!h.id?"opacity-50":""}`,children:y?"Archiving…":"Archive"}),P&&f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:M,disabled:y||!h.id,className:`text-xs leading-4 py-2 ${y||!h.id?"opacity-50":""}`,children:y?"Marking done…":"Mark done"}),!S&&f.jsx(Qn,{size:"small",icon:f.jsx("span",{className:b?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:b?"↺":"⊘"}),onClick:()=>I({status:b?null:"dropped"}),disabled:i,className:`text-xs leading-4 py-2 ${i?"opacity-50":""}`,children:b?"Reopen plan":"Mark dropped"})]})]})]})},$v=8,c9=["in-progress","review","planned","idea","done","dropped"],Bv="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300 mb-2",u9=()=>{const e=L(b=>b.plans),t=rg(),n=L(b=>b.planFilters),r=L(b=>b.togglePlanStatus),s=L(b=>b.togglePlanTag),i=L(b=>b.setPlanSearch),o=L(b=>b.setSubjectFilter),a=nn(),[l,c]=_.useState(!1);if(!e||t)return null;const{statusCounts:u,tagCounts:d}=Ul(e.entries,n),h=new Set(n.statuses),p=new Set(n.tags),y=[...new Set([...Object.keys(d),...n.tags])].sort((b,S)=>{const k=(d[S]??0)-(d[b]??0);return k!==0?k:b.localeCompare(S)}),w=l?y:y.slice(0,$v),g=y.length-w.length,x="bg-none bg-transparent border-none p-0 cursor-pointer opacity-70 underline text-2xs",v=c9.filter(b=>u[b]>0||h.has(b));return f.jsxs("div",{className:"flex flex-col gap-8 -mt-5",children:[f.jsx(Ea,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:b=>i(b.target.value)}),n.subject!==null&&f.jsxs("div",{className:"flex items-center gap-2","data-testid":"subject-filter-chip",children:[f.jsxs("span",{className:"text-2xs opacity-70",children:["Subject: ",n.subject]}),f.jsx("button",{type:"button",onClick:()=>{o(null),a({to:"/",search:{}})},className:x,children:"Clear"})]}),f.jsxs("div",{children:[f.jsx("div",{className:Bv,children:"Status"}),f.jsx("div",{className:"flex flex-col gap-1",children:v.map(b=>{const S=h.has(b);return f.jsx(Qn,{size:"small",active:S,onClick:()=>r(b),className:"text-xs leading-4 py-2",icon:f.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:ir[b].text}}),action:f.jsx("span",{className:"text-2xs text-ink-500",children:u[b]}),children:og[b]},b)})})]}),f.jsxs("div",{children:[f.jsx("div",{className:Bv,children:"Tags"}),f.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[y.length===0&&f.jsx("span",{className:"opacity-50 text-2xs",children:"No tags"}),w.map(b=>{const S=p.has(b);return f.jsxs(ne,{type:"button",variant:"ghost",size:"small",isActive:S,"aria-pressed":S,onClick:()=>s(b),children:[b," ",d[b]??0]},b)}),g>0&&f.jsxs("button",{type:"button",onClick:()=>c(!0),className:x,children:["+",g," more"]}),l&&y.length>$v&&f.jsx("button",{type:"button",onClick:()=>c(!1),className:x,children:"Show less"})]})]})]})},Vv=()=>f.jsxs("div",{className:"flex items-center gap-3 mb-6 flex-wrap",children:[f.jsx("h1",{className:"text-4xl flex-1 font-display-luminari font-semibold text-ink-900 m-0 leading-[1.1]",children:"Plans"}),f.jsx(DW,{}),f.jsx(IW,{}),f.jsx(VW,{})]}),d9=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],f9=()=>f.jsxs("div",{className:"flex flex-col gap-1","aria-hidden":"true",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px]"}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Re,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:ep,children:[f.jsx(cn,{variant:"text",width:28}),f.jsx(cn,{variant:"text",width:44}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(cn,{variant:"text",width:56})}),f.jsx(cn,{variant:"text",width:64}),f.jsx(cn,{variant:"text",width:48})]})})})]}),d9.map(e=>f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:f.jsx(cn,{variant:"text",width:16})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Re,{size:"small",className:"plan-row-card",children:f.jsxs("div",{className:ep,children:[f.jsx(cn,{variant:"rect",width:44,height:18}),f.jsx(cn,{variant:"text",width:e.title}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(cn,{variant:"text",width:52})}),f.jsx(cn,{variant:"rect",width:80,height:8}),f.jsx(cn,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),h9=()=>{const e=L(u=>u.reconcileQueue),t=L(u=>u.removeFromReconcileQueue),n=L(u=>u.plans),{patch:r}=Ra(),{toast:s}=He(),i=_.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(u=>u.id===o.planId))??null:null;if(_.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),_.useEffect(()=>{e.length===0&&(i.current=0)},[e.length]),!o||!a)return null;const l=async()=>{t(o.previewId),i.current+=1,s({title:"Kept the merged version",description:`"${a.title}" keeps the agent's rewrite.`})},c=async()=>{await r(a.title,{body:o.before.body,phases:o.before.phases},{errorTitle:"Discard failed"})&&(t(o.previewId),i.current+=1)};return f.jsx(SW,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},p9=({suggestions:e,onOpen:t,onDismiss:n})=>e.length===0?null:f.jsxs("div",{className:"mt-5",children:[f.jsx("h2",{className:"text-sm mb-2 opacity-60",children:"Suggested from AI"}),f.jsx("div",{className:"flex flex-col gap-1",children:e.map(r=>f.jsx("div",{className:"rounded-[10px]",children:f.jsx(Re,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("button",{type:"button",onClick:()=>t(r),className:"flex-1 min-w-0 flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit",children:[f.jsx(ng,{}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),f.jsx(Ct,{icon:f.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),cg=()=>{const e=L(k=>k.plans),t=L(k=>k.plansError),n=L(k=>k.ideaEntries),r=L(k=>k.suggestions);L(k=>k.loadPlans);const s=L(k=>k.setDetailView),i=L(k=>k.planFilters),o=L(k=>k.setSubjectFilter),a=rg(),l=AU(),c=L(k=>k.dismissSuggestion),u=nn(),{toast:d}=He(),{subject:h}=tm({strict:!1});_.useEffect(()=>{o(h??null)},[h,o]),_.useEffect(()=>{s("details")},[a,l,s]);const p=()=>{u({to:"/"})},m=k=>{u({to:"/plans/$planId",params:{planId:encodeURIComponent(k)}})},y=k=>{u({to:"/ideas/$ideaId",params:{ideaId:encodeURIComponent(k)}})},[w,g]=_.useState(null),x=async k=>{try{await c(k)}catch(T){d({title:"Failed to dismiss suggestion",description:T.message,variant:"error"})}},v=a?e==null?void 0:e.entries.find(k=>k.title===a):null,b=l?n.find(k=>k.title===l):null;if(t)return f.jsxs("div",{children:[f.jsx(YU,{children:"Plans"}),f.jsxs(Re,{size:"small",accent:!0,accentColor:"rose",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Couldn't load plans.md"}),f.jsx("p",{className:"m-0 opacity-75",children:t})]})]});if(!e)return f.jsxs("div",{children:[f.jsx(Vv,{}),f.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),f.jsx(f9,{})]});const{rows:S}=qA(e.entries,n,i);return f.jsxs(f.Fragment,{children:[f.jsx(h9,{}),v?f.jsxs("div",{children:[f.jsx("div",{className:"mb-4",children:f.jsx(Pv,{items:[{id:"plans",label:"Plans",onClick:p},{id:"plan",label:v.title}]})}),f.jsx(JW,{plan:v})]}):b?f.jsxs("div",{children:[f.jsx("div",{className:"mb-4",children:f.jsx(Pv,{items:[{id:"plans",label:"Plans",onClick:p},{id:"idea",label:b.title}]})}),f.jsx(a9,{idea:b})]}):f.jsxs("div",{children:[f.jsx(Vv,{}),e.warnings.length>0&&f.jsxs(Re,{size:"small",accent:!0,accentColor:"amber",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Some entries couldn't be parsed"}),f.jsx("ul",{className:"m-0 pl-5",children:e.warnings.map(k=>f.jsxs("li",{children:[k.title,": ",k.message]},k.title))})]}),e.entries.length===0?f.jsxs("p",{className:"opacity-50",children:["No ideas yet — capture one with ",f.jsx("strong",{children:"New idea"})," above, or click"," ",f.jsx("strong",{children:"Suggest ideas"})," to have an agent propose some."]}):f.jsx(o9,{plans:e.entries,rows:S,activePlanTitle:a,onOpenPlan:m,onOpenIdea:y}),f.jsx(CW,{onOpenIdea:y}),f.jsx(p9,{suggestions:r,onOpen:g,onDismiss:x}),f.jsx(_W,{suggestion:w,onClose:()=>g(null)})]})]})},m9="data-paper-camp-mount";function g9(e){return(e==null?void 0:e.getAttribute(m9))??""}const uC=typeof document>"u"?"":g9(document.getElementById("root")),dC=_.lazy(()=>Fn(()=>import("./index-C4T8Gzjs.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsPage}))),y9=_.lazy(()=>Fn(()=>import("./index-C4T8Gzjs.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsSidebar}))),fC=_.lazy(()=>Fn(()=>import("./index-_tpcAf-k.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsPage}))),x9=_.lazy(()=>Fn(()=>import("./index-_tpcAf-k.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsSidebar}))),v9=_.lazy(()=>Fn(()=>import("./index-D0gBw6x1.js"),__vite__mapDeps([4,3]),import.meta.url).then(e=>({default:e.TasksPage}))),w9=_.lazy(()=>Fn(()=>import("./index-BXRfFWnQ.js"),[],import.meta.url).then(e=>({default:e.RoadmapPage}))),b9=_.lazy(()=>Fn(()=>import("./index-BXRfFWnQ.js"),[],import.meta.url).then(e=>({default:e.RoadmapSidebar}))),k9=_.lazy(()=>Fn(()=>import("./index-CSl9MOCi.js"),[],import.meta.url).then(e=>({default:e.DiffPage}))),_9=_.lazy(()=>Fn(()=>import("./index-DJwR0UyW.js"),__vite__mapDeps([5,3]),import.meta.url).then(e=>({default:e.StatsPage}))),S9=_.lazy(()=>Fn(()=>import("./index-BrriNOla.js"),[],import.meta.url).then(e=>({default:e.InboxPage}))),hf=[{id:"plans",label:"Plans",path:"/"},{id:"inbox",label:"Inbox",path:"/inbox"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"tasks",label:"Tasks",path:"/tasks"},{id:"stats",label:"Stats",path:"/stats"},{id:"settings",label:"Settings",path:"/settings"}],Uv=({item:e,count:t})=>f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.label,e.id==="inbox"&&t>0&&f.jsx(Te,{size:"small",variant:"warning",children:t})]}),Wv=()=>f.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:f.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})}),hC="stack-open";function C9(){try{return localStorage.getItem(hC)==="true"}catch{return!1}}function P9(e){try{localStorage.setItem(hC,String(e))}catch{}}const j9="(min-width: 1440px)";function E9(e){const[t,n]=_.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return _.useEffect(()=>{const r=window.matchMedia(e),s=i=>n(i.matches);return n(r.matches),r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}const T9=()=>{var P;const e=nn(),t=GT({select:R=>R.location.pathname}),n=L(R=>R.loadPlans),r=L(R=>R.loadIdeas),s=L(R=>R.loadSuggestions),i=L(R=>R.loadCapabilities),o=L(R=>R.loadAgentAuthStatus),a=L(R=>R.loadParkedQuestions),l=L(R=>{var j;return((j=R.parkedQuestions)==null?void 0:j.length)??0}),c=L(R=>R.setActiveDocTitle),u=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),d=t==="/docs"||t.startsWith("/docs/"),h=t==="/settings"||t.startsWith("/settings/"),p=t==="/roadmap",m=u?"plans":d?"docs":h?"settings":(P=hf.find(R=>R.path===t))==null?void 0:P.id,y=u||d||h||p,w=u?"plans":d?"docs":h?"settings":"roadmap",[g,x]=_.useState(C9),[v,b]=_.useState(!1),S=Pu(),k=E9(j9),T=_.useRef(!1);return _.useEffect(()=>{n(),r(),s(),i(),o(),a()},[n,r,s,i,o,a]),_.useEffect(()=>{T.current||t!=="/"||(T.current=!0,Promise.all([xk(),yk()]).then(([R,j])=>{if(!(R!=null&&R.setupDismissed)&&j!==null&&!j.every(I=>I.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([wk(),_k()]).then(([I,M])=>{I.entries.length>1||M.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),_.useEffect(()=>{b(!1)},[t]),f.jsxs($8,{position:"bottom-left",children:[f.jsxs("div",{className:"h-screen box-border min-[1440px]:pr-[480px] flex flex-col",children:[f.jsx(OU,{}),f.jsx(qU,{}),f.jsx(LB,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!0,showSidebar:!1,showPage:!1,bleedBottom:!0,headerActions:f.jsxs(f.Fragment,{children:[y&&f.jsx(Ct,{variant:"ghost",size:"small",className:"lg:hidden max-[480px]:hidden",label:"Open sidebar",onClick:()=>b(!0),icon:f.jsx(Wv,{})}),f.jsx(FU,{size:"sm"}),f.jsx("div",{className:"flex-1"}),f.jsx("nav",{"aria-label":"Main navigation",className:"flex items-center gap-1 max-[480px]:hidden",children:hf.map(R=>f.jsx(ne,{variant:"ghost",size:"small",isActive:R.id===m,onClick:()=>e({to:R.path}),"aria-current":R.id===m?"page":void 0,children:f.jsx(Uv,{item:R,count:l})},R.id))})]}),children:f.jsx("div",{className:"flex flex-col h-full min-h-0",children:f.jsx("div",{className:"flex flex-1 min-h-0 justify-center items-start box-border overflow-y-auto -mt-8 -ml-8 -mr-8 pt-0 pl-8 pr-8 pb-[var(--pc-content-pad-bottom,32px)]",children:f.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)] gap-6 w-full",children:[y&&f.jsxs(zU,{routeKey:w,mobileOpen:v,onMobileClose:()=>b(!1),children:[u&&f.jsxs(f.Fragment,{children:[f.jsx(u9,{}),f.jsx(l9,{})]}),d&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(y9,{})}),h&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(x9,{})}),p&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(b9,{})})]}),f.jsx("div",{className:`flex flex-col min-w-0 ${k?"flex-[1_1_0%]":"flex-[0_1_800px]"}`,children:f.jsx(Ai.div,{...qS(S),transition:QS(S),className:"flex flex-col flex-1 min-w-0",children:f.jsx(MS,{texture:{texture:"parchment"},outline:!0,className:`min-h-[calc(100vh-160px)] w-full ${k?"max-w-none":""}`,children:f.jsx(_.Suspense,{fallback:null,children:f.jsx(Nb,{})})})},t)})]})})})})]}),f.jsx(TU,{open:g,pinned:k,onToggle:()=>{const R=!g;P9(R),x(R)}}),f.jsxs("nav",{"aria-label":"Main navigation",className:"hidden max-[480px]:flex max-[480px]:fixed max-[480px]:left-0 max-[480px]:right-0 max-[480px]:bottom-0 max-[480px]:z-[250] max-[480px]:items-stretch max-[480px]:justify-around max-[480px]:gap-1 max-[480px]:py-2 max-[480px]:px-2 max-[480px]:[padding-bottom:calc(0.5rem+env(safe-area-inset-bottom))] max-[480px]:bg-[var(--pui-bg-base,#fff)] max-[480px]:border-t max-[480px]:border-black/10 max-[480px]:shadow-[0_-2px_8px_rgba(0,0,0,0.08)]",children:[y&&f.jsx(Ct,{variant:"ghost",size:"small",label:"Open sidebar",onClick:()=>b(!0),icon:f.jsx(Wv,{}),className:"min-h-11"}),hf.map(R=>f.jsx(ne,{variant:"ghost",size:"small",isActive:R.id===m,onClick:()=>e({to:R.path}),"aria-current":R.id===m?"page":void 0,className:"min-h-11",children:f.jsx(Uv,{item:R,count:l})},R.id))]})]})},Bt=NT({component:T9}),R9=rn({getParentRoute:()=>Bt,path:"/",component:cg,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0})}),N9=rn({getParentRoute:()=>Bt,path:"/plans/$planId",component:cg}),I9=rn({getParentRoute:()=>Bt,path:"/ideas/$ideaId",component:cg}),M9=rn({getParentRoute:()=>Bt,path:"/docs",component:dC}),A9=rn({getParentRoute:()=>Bt,path:"/docs/$section",component:dC}),L9=rn({getParentRoute:()=>Bt,path:"/settings",component:fC}),D9=rn({getParentRoute:()=>Bt,path:"/settings/$section",component:fC}),F9=rn({getParentRoute:()=>Bt,path:"/roadmap",component:w9,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0})}),O9=rn({getParentRoute:()=>Bt,path:"/diff",component:k9}),z9=rn({getParentRoute:()=>Bt,path:"/inbox",component:S9}),$9=rn({getParentRoute:()=>Bt,path:"/stats",component:_9}),B9=rn({getParentRoute:()=>Bt,path:"/tasks",component:v9,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0})}),V9=Bt.addChildren([R9,N9,I9,M9,A9,L9,D9,B9,F9,O9,$9,z9]),U9=VT({routeTree:V9,basepath:uC||"/"});GM(uC);const pC=document.getElementById("root");if(!pC)throw new Error("#root element not found");rb(pC).render(f.jsx(_.StrictMode,{children:f.jsx(HT,{router:U9})}));export{cf as $,Z9 as A,$A as B,tm as C,eH as D,Q9 as E,Ta as F,dH as G,We as H,tH as I,ne as J,Y9 as K,nC as L,pk as M,og as N,q9 as O,YU as P,nH as Q,rH as R,ir as S,ZW as T,Te as U,lH as V,sH as W,JV as X,OA as Y,di as Z,iC as _,nn as a,$U as a0,aW as a1,es as a2,yW as a3,Nu as a4,Rs as a5,uH as b,K as c,PW as d,W9 as e,X9 as f,xk as g,Ce as h,Qn as i,f as j,He as k,FS as l,H9 as m,KS as n,Ea as o,Cv as p,cH as q,_ as r,G9 as s,NU as t,L as u,K9 as v,Re as w,LS as x,Pv as y,J9 as z};
207
+ //# sourceMappingURL=main-Zb7gEID9.js.map